From 1b0f8892695905fbc0e3c1c8bc1f0665e422f33a Mon Sep 17 00:00:00 2001 From: Vinothini Dharmaraj <146493756+v-vdharmaraj@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:04:57 -0800 Subject: [PATCH] Merge from Main (#48304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Search] Update Snippets (#47723) * Update container publishing to use 1es templates (#47724) * Sync eng/common directory with azure-sdk-tools for PR 9584 (#47721) * update to version with auto-shutdown present * bump used proxy for .net --------- Co-authored-by: Scott Beddall * [DocumentIntelligence] Fixing broken link (#47725) * Mgmt rest client (#47665) * Azure AI Foundry rebranding (#47720) * Azure AI Foundry rebranding * Update code snippets * Revert changes to Generated files * Fix broken link in README for Azure.AI.Language.Text.Authoring samples (#47737) * [Event Hubs] Add Id to suggested processor logs (#47738) The focus of these changes is to add the "processor position determined" log to the set of suggested ETW Ids to capture for troubleshooting event processor issues. * add RAG sample (#47736) * Compute CloudService 2024-11-04 (#47722) * update swagger ref * generated with 2024-11-04 version * changelog * Add more packages to dependency trimming for .NET 6+ (#47318) * Add more packages to dependency trimming * Update Directory.Build.Common.targets * Update Directory.Build.Common.targets * update * update 2 * test async interfaces only in core * alphabetize * remove core change * Add Microsoft.Bcl.AsyncInterfaces package reference * Update README to include SDK version 1.0.0-beta.2 and supported API versions (#47739) * refactor(playwrighttesting): improve error messaging when reporting returns 403 (#47742) * refactor(playwrighttesting): improve error messaging when reporting returns 403 * chore(): update error message --------- Co-authored-by: Siddharth Singha Roy * Health Data AI Service GA release (#46998) * Regenerated with customization-options typespec * Fixes + pagedDocumentDetails * Revert pagedDocumentDetails * nextLink in DocumentDetails * DocumentDetail * Regenerated with no continuationToken * OperationType * CustomizationOptions and suppression * Change Config to Options * Regenerated after marking ListJobs and ListJobDocuments as internal * Customizations to remove continuationToken * Update tests and samples for new API version * Samples * Updating tests for new API version * Enable local testing * Add sanitizers * Update tests and sanitizers * Rename "body" to "content" * Tests working in all modes * Update commit in tsp-location.yaml * Updated serialization with dotnet build codegen * Version 1.0.0 * GA installation instructions * Use Deidentification prefix naming convention * Update tsp-location.yaml commit * Updates tests and samples with new prefix * Ran dotnet build /t:GenerateCode * Deidentification prefix for CustomizationOptions * Update tsp-location.yaml * Improve samples * Update commit in tsp-location * Update commit again * Update README sample * Regenerated with customization-options typespec * Fixes + pagedDocumentDetails * Revert pagedDocumentDetails * nextLink in DocumentDetails * DocumentDetail * Regenerated with no continuationToken * OperationType * CustomizationOptions and suppression * Change Config to Options * Regenerated after marking ListJobs and ListJobDocuments as internal * Customizations to remove continuationToken * Update tests and samples for new API version * Samples * Updating tests for new API version * Enable local testing * Add sanitizers * Update tests and sanitizers * Rename "body" to "content" * Tests working in all modes * Update commit in tsp-location.yaml * Updated serialization with dotnet build codegen * Version 1.0.0 * GA installation instructions * Use Deidentification prefix naming convention * Update tsp-location.yaml commit * Updates tests and samples with new prefix * Ran dotnet build /t:GenerateCode * Deidentification prefix for CustomizationOptions * Update tsp-location.yaml * Improve samples * Update commit in tsp-location * Update commit again * Update README sample * Export API * Switch back to ResourceList * Update commit hash * New tests with overwrite * Use public setter for overwrite * Regenerated after removing PartialFailed * Rm DeidentificationJobStatus from tests * Regenerated with merged typespec * Update changelog.md * Updating generated code * Update changelog --------- Co-authored-by: Alexa Thomases * [Storage] [DataMovement] Update README and minor sample updates Part 1 (#47727) * Update readme/samples * Removed base samples, rely on blob and share samples * Update blob readme * Fix sample snippet references to use blobs; added extension samples to base blob README * Mispellings * Fix links * Fix links * [Storage][DataMovement] Rename `DataTransfer*` to `Transfer*` (#47754) * [SignalR functions bindings] Self-implemented MessagePack hub protocol (#47649) As `Microsoft.AspNetCore.SignalR.Protocols.MessagePack` 1.x relies on an unsecure `MessagePack` version 1.x, and we cannot update `Microsoft.AspNetCore.SignalR.Protocols.MessagePack` to 2.x as we have to support .NET Standard 2.0 framework, we implement the required functionalities of `Microsoft.AspNetCore.SignalR.Protocols.MessagePack` with `MessagePack` 2.0 * Copied `MessagePackHubProtocol` files from https://github.com/dotnet/aspnetcore/blob/0825def633c99d9fdd74e47e69bcde3935a5fe74/ * Self-implemented MessagePack Hub Protocol * Fix security code alert * Cleanup dependencies This pull request includes several updates and improvements to the `Microsoft.Azure.WebJobs.Extensions.SignalRService` package, including dependency updates, breaking changes, and new internal implementations for MessagePack protocol support. ### Dependency updates: * Updated `MessagePack` to version 2.5.192 and `Microsoft.Azure.SignalR` packages to version 1.29.0 in `eng/Packages.Data.props` and `CHANGELOG.md` files. [[1]](diffhunk://#diff-93a28d9569550c68624a8ad2209a6fae1d4f88237e4b5414eed2ecac4ef8c98fL212-R215) [[2]](diffhunk://#diff-4d5b0364bdfdd9ef92d9390778dc219802aaa0928538cb2cd57b68dbe0c29221L3-R15) ### Breaking changes: * Removed .NET 6.0 support from `Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj`. [[1]](diffhunk://#diff-4d5b0364bdfdd9ef92d9390778dc219802aaa0928538cb2cd57b68dbe0c29221L3-R15) [[2]](diffhunk://#diff-d7d1fc92bb60f4162589c9d75a13093a5c1388addb9ed263f3b8269eccd623deL1-R6) ### New internal implementations for MessagePack protocol: * Added `BinaryMessageFormatter`, `DefaultMessagePackHubProtocolWorker`, `MessagePackHubProtocol`, and `MessagePackHubProtocolWorker` classes to support MessagePack serialization and deserialization. [[1]](diffhunk://#diff-d078a537b71b42d35b0edfe9d0b29af9a4015b69a4f34c0a249eca42ee30c93fR1-R56) [[2]](diffhunk://#diff-a76e5671b348949cd69c7c0d48230ba174198702ca45b5b7e5368a8cc8cbd9e2R1-R41) [[3]](diffhunk://#diff-72c85cc1f4ff9895e501b28007e8369acfd4881c70893ee96f4a97f0dbd20debR1-R97) [[4]](diffhunk://#diff-666c7b6452ef625804593260147713eba1eb6ec088285711dfc90b6bc202b481R1-R207) ### Code improvements: * Added `JTokenWrapperMessagePackFormatter` to `JTokenWrapper` class for MessagePack serialization support. [[1]](diffhunk://#diff-3b3afd72fe7b3ec3ff0c24b0f3d8641ba5620774ad29921f462595747e91e058L18-R26) [[2]](diffhunk://#diff-3b3afd72fe7b3ec3ff0c24b0f3d8641ba5620774ad29921f462595747e91e058R49-R62) ### Test updates: * Updated test cases to use `MicrosoftEntraAccessKey` instead of `AadAccessKey` and added validation for issuer and audience in `DefaultSecurityTokenValidatorTests`. [[1]](diffhunk://#diff-703e2ebb42f2b10519f5f7f40dc765fba826f126042a9d5833ca6a68b4e1d32eL44-R47) [[2]](diffhunk://#diff-703e2ebb42f2b10519f5f7f40dc765fba826f126042a9d5833ca6a68b4e1d32eL68-R71) [[3]](diffhunk://#diff-87b72117be06a7d56bfa5afc7195979729da5ee25e66a63d4b86f7e3c6e27eb6L50-R55)
Details
* [FormRecognizer] Ignoring tests that are hanging (#47755) * Fix the issue where IaasComputeVmProtectedItem cannot handle an empty resourceId (#47626) * fix * Update CHANGELOG.md * Update Generator Version 3.0.0-beta.20250108.1 (#47763) * feat(playwrighttesting): showing using warning message if access token will expire within 7 days. (#47748) * feat(playwrighttesting): showing using warning message if access token will expire within 7 days. * updated and added test * update --------- Co-authored-by: guptakashish * Update CODEOWNERS (#47553) * [CODEOWNERS] Remove legacy service (#47752) The focus of these changes is to remove a block tied to a legacy label. * [Storage][DataMovement] Update checkpoint schema versions for GA (#47741) * Add launchsettings file for easy debugging (#47771) * Add launchsettings file for easy debugging * Fix name * [Storage][DataMovement] Remove the sync `WaitForCompletion` for now (#47774) * Prep for release and add App Compat switch for the recent breaking change (#47751) * Increment package version after release of Azure.ResourceManager.Network (#47766) * Update Generator Version 3.0.0-beta.20250109.1 (#47765) * Add detection for empty string in the return value of createdByPrincipalTenantId (#47642) * update * Update BillingRoleAssignmentProperties.cs * Update CHANGELOG.md * update * Generating confidentialledger SDK for API spec version 2024-01-26-pre… (#47340) * Generating confidentialledger SDK for API spec version 2024-01-26-preview * API adds the ability to list users. * Fix typo in CertificatePolicy.KeySize documentation (#47794) * Fix typo in documentation * Update CHANGELOG.md * [Storage] [DataMovement] [Archboard feedback] Renamed *CheckpointData to *CheckpointDetails (#47776) * Renamed *CheckpointData to *CheckpointDetails * Export API * Updated changelog * [CODEOWNERS] Remove invalid owner (#47820) The focus of these changes is to remove an invalid owner causing a linter failure. * Permissions docs (#47793) * readmes * docstring * remove autoadded import * Increment package version after release of Azure.Data.Tables (#47831) * datamovement migration guide skeleton (#47818) * migration guide skeleton * fix some copy/paste * make TODOs CI-compatible * Prepare Identity for release with bugfix (#47753) * [Storage][DataMovement] More GA API feedback (renames/refactors) (#47796) * remove erroneous package inclusion during package-properties evaluation (#47830) Co-authored-by: Scott Beddall * Remove extra / when building the pipeline for import certificate (#47795) * remove extra / when building the pipeline * Update CHANGELOG.md * Update test recordings * Update sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md Co-authored-by: Christopher Scott --------- Co-authored-by: Christopher Scott * Update AutoRest C# version to 3.0.0-beta.20250113.1 (#47824) * Update Generator Version 3.0.0-beta.20250113.1 * Update SDK codes pu_sp_5 * Implement resource detection and generate ReourceData (#47730) * NetworkCloud 2024-07-01 API - Update generated SDK and sample tests (#47159) * Update CHANGELOG.md (#47839) * Public Preview SDK update for Api Version 2024-12-18-preview (#47813) * Api based on new 12-18-preview spec * Adds the tests * Modifies the assets.json * Removes unused samples * modifies Changelog file with new API version * update --------- Co-authored-by: Arthur Ma * Increment package version after release of Azure.Identity (#47833) * [CODEOWNERS] Adding owners for AI Projects (#47845) * [CODEOWNERS] Adding owners for AI Projects The focus of these changes is to add owners for the AI Projects library and refocus the root /sdk/ai path such that it alerts both sub-packages for changes. * Update .github/CODEOWNERS * Removing invalid owner * [CODEOWNERS] Remove invalid owner (#47846) The focus of these changes is to remove an owner who is being flagged as no longer valid by the linter. * Generating dotnet SDK for the API version 2024-08-22 (#47815) * Generating dotnet SDK for the API version 2024-08-22 * Updating API version * Fixing autorest.md file * Disable sparse-checkout for pr repos (#47851) * Sync eng/common directory with azure-sdk-tools for PR 9635 (#47850) * ensure that packages that come back from AdditionalValidationPackages are NOT counted as 'includedForValidation: true' if they also exist in the original 'these packages changed' set Co-authored-by: Ben Broderick Phillips --------- Co-authored-by: Scott Beddall Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com> Co-authored-by: Ben Broderick Phillips * [Storage][DataMovement] Make extension methods follow LRO pattern (#47832) * [Cloud Machine] Fix code to generate correct Bicep for Storage and OpenAI (#47853) [Cloud Machine] Fix code to generate correct Bicep for storage and OpenAI * Fix the issie with inability to deserialize RunStep when files earch is used. (#47858) * Sync eng/common directory with azure-sdk-tools for PR 9529 (#47555) * Use -Mail for test resources local user lookup to support TME * Auto-select TME subscription based on user context --------- Co-authored-by: Ben Broderick Phillips * Use common OIDC token env vars for identity live tests (#47869) * Sync eng/common directory with azure-sdk-tools for PR 9649 (#47867) * Filter out Excludes for PR Pipelines * Updates for feedback --------- Co-authored-by: James Suplizio * [Storage][DataMovement] Modify file-share client extensions to match LRO pattern (#47855) * Queue Listener fixes: Drain Mode and Message Deletion (#47791) * Update drainMode logic * Drain mode and shutdown cancellation * Add tests * Fix tests * Fix spacing * Update comment, add changes to changelog * Updates to tests * Update tests, add TesteQueueProcessor * Adding test constructor * Uncomment * revert constructor * Refactor tests * Revert eng * Update change log * Update change log * Fix changelog * Update AutoRest C# version to 3.0.0-beta.20250116.1 (#47878) * Update Generator Version 3.0.0-beta.20250116.1 * Update SDK codes co_da_1 * docs(): CHANGELOG for 1.0.0-beta.4 release (#47880) Co-authored-by: Siddharth Singha Roy * Increment version for playwrighttesting releases (#47881) * Increment package version after release of Azure.Developer.MicrosoftPlaywrightTesting.TestLogger * Increment package version after release of Azure.Developer.MicrosoftPlaywrightTesting.NUnit * Remove sovereign cloud testing references (#47873) * Sync eng/common directory with azure-sdk-tools for PR 9577 (#47875) * Add common SDK generation pipeline * Update Yaml Configuration * Update SDK generation Yaml config * Add spec-gen-sdk pipeline configuration * Remove spec-gen-sdk.yml and add archetype-spec-gen-sdk.yml * Allow pipelline override of repo organisation * Remove SkipPullRequestCreation from pipeline condition --------- Co-authored-by: Chidozie Ononiwu * [Service Bus] January Release Prep (#47884) The focus of these changes is to prepare the Service Bus library for its January release. * Remove sovereign cloud testing support (#47883) Co-authored-by: Ben Broderick Phillips * Removing the default audio format media streaming (#47841) * Media streaming audio format default Pcm24kMono changed to null * updating the audio format changes and reverting the export api script changes * updating the script end line space * removing the recorded files * updating the records for the media streaming * re recording live test --------- Co-authored-by: Vinothini Dharmaraj * Sync eng/common directory with azure-sdk-tools for PR 9601 (#47856) * updates to dynamic matrix generation. moves indirectly included packages to sparse usage. adds additional parameters to GeneratePRMatrix that enable further filtering of the matrix generated for the indirect packages --------- Co-authored-by: Scott Beddall Co-authored-by: Wes Haggard * Increment package version after release of Azure.Messaging.ServiceBus (#47891) * Fix the streaming API used for tool calls. (#47834) * First draft of changes * Fixes * Add readmi, example and fix the code * Move changes to the custom code * Fix generated code * Fix api * Fix comments * Fix * Fix * Remove inernal method * Remove unnecessary changes * Fix * Fix * Fix * Update API * Fix qualifier * Fix * Add asserts and comments * Fix * Fix broken link (#47835) Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Add missing locations to AzureLocation struct (#47862) * Add missing locations to AzureLocation struct * Update Update-Mgmt-CI.ps1 (#47879) * update computeschedule changelog file (#47885) * Increment package version after release of Azure.Developer.LoadTesting (#47902) * Increment package version after release of Azure.ResourceManager.Quota (#47901) * Skip empty client (#47859) * [Do not merge before 20th of January 2025] Kusto C# SDK For Managment- 2024-04-13 (#47564) * Move location of doc tools (#47906) * Sync eng/common directory with azure-sdk-tools for PR 9652 (#47908) * Update github.io docs to use static website instead of blobs directly * Update eng/common/scripts/copy-docs-to-blobstorage.ps1 Co-authored-by: Ben Broderick Phillips * Switch from AzurePowerShell to AzureCLI task * Add scriptLocation to docindex.yml * Update Generate-DocIndex.ps1 * Fix indentation in docindex.yml script block --------- Co-authored-by: Wes Haggard Co-authored-by: Wes Haggard Co-authored-by: Ben Broderick Phillips * Prepare for release (#47909) * Improve Azure Identity credential env var docs (#47889) * Improve DAC env var docs * Edit pass * Revert changes to EBN properties * Update DAC options XML docs * Improve XML docs for options classes * Update sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredentialOptions.cs Co-authored-by: Christopher Scott --------- Co-authored-by: Christopher Scott * [Storage][DataMovement] Add tests for TransferProgressTracker as well as minor changes (#47894) * [Storage] [Datamovement] Replacing DataTransferProperty with isPropertySet (#47868) * WIP - removed DataTransferProperty from checkpointer * Removed DataTransferProperty from API options and implemented isPropertySet * Export API * Update changelog * Update Snippets and remove wrong api generate * PR comments * Update to default comments for preserve properties * Add Subscription property to AzureCliCredentialOptions (#47817) * Update to reportgenerator@5 (#47728) * handle only deleted files in a - pullrequest build (#47893) Co-authored-by: Scott Beddall * Increment package version after release of Azure.Messaging.EventGrid (#47921) * remove scaffolding for sdks from swagger (#47688) * remove scaffolding for sdks from swagger * add more detail message * update dockerfile to install net80 (#47872) * Increment package version after release of Azure.ResourceManager.Kusto (#47926) * Fix the issue preventing addition of a single file to Vector Store (#47895) * Fix the issue preventing addition of a single azure BLOB URI to the Vector store * Fix chanelog * Fix * Drive traffic to credential reuse guidance (#47931) * Drive traffic to credential reuse guidance * Update DeviceCodeCredential XML docs * Trim trailing whitespace * Add myself to codeowners (#47918) * Handle non-IMDS local null content response as CredentialUnavailableException (#47866) * copy (#47890) * Sync eng/common directory with azure-sdk-tools for PR 9668 (#47932) * Support incrementing semver prereleases with 'zero' versions * Make tests more explicit --------- Co-authored-by: Patrick Hallisey * Renamed `BlobStorageResourceContainerOptions.BlobDirectoryPrefix` to `BlobPrefix` (#47938) * Sync eng/common directory with azure-sdk-tools for PR 9656 (#47940) * Added label handle sdk-gen pipeline template Added common script to delete label from a PR * Update eng/common/scripts/Invoke-GitHubAPI.ps1 Co-authored-by: Ben Broderick Phillips --------- Co-authored-by: ray chen Co-authored-by: Ben Broderick Phillips * change the function name (#47943) * change the name * check the override package name is null * [Cdn] optimization : directive to rename-mapping (#47947) * staged * Update autorest.md * Increment package version after release of Azure.AI.Projects (#47935) * [Storage] [DataMovement] Renamed ResumeProvider to ProviderForResuming; Made FromClient methods static (#47886) * Renamed ResumeProvider to ProviderForResuming; Made ResourceProvider.FromClient static * Removed public empty constructor LocalFilesStorageResourceProvider * Cleanup * Update tests; Export API; Snippets * Remove unnecessary static members container extensions * Removed InternalProviderId, added LocalFilesStorageResourceProvider to resume providers on default * Forgot to commit the remove of InternalProviderId * Increment version for provisioning releases (#47951) * Increment package version after release of Azure.Provisioning * Increment package version after release of Azure.Provisioning.AppConfiguration * Increment package version after release of Azure.Provisioning.CognitiveServices * Increment package version after release of Azure.Provisioning.Search * Increment package version after release of Azure.Provisioning.WebPubSub * Increment package version after release of Azure.Provisioning.Sql * Increment package version after release of Azure.Provisioning.EventHubs * Increment package version after release of Azure.Provisioning.ServiceBus * Increment package version after release of Azure.Provisioning.Storage * Increment package version after release of Azure.Provisioning.SignalR * Increment package version after release of Azure.Provisioning.KeyVault * Increment package version after release of Azure.Provisioning.Redis * Increment package version after release of Azure.Provisioning.PostgreSql * Increment package version after release of Azure.Provisioning.CosmosDB --------- Co-authored-by: azure-sdk * [Search] Renaming AIStudioModelCatalogName to AIFoundryModelCatalogName (#47959) * [CODEOWNERS] Remove invalid user (#47953) The focus of these changes is to remove a user flagged by the linter as invalid. * support spec PR trigger (#47963) Co-authored-by: ray chen * IoTOperations C# SDK (#47398) * [DeviceRegistry] Generated SDK for Microsoft.DeviceRegistry API version 2024-09-01-preview (#47304) * Update the Appconfiguration management plane sdk API Version to 2024-05-01 (#47762) * update commit to main branch (#47969) * Remove Custom ModelFactory and Regen (#47910) * Increment package version after release of Azure.ResourceManager.IotOperations (#47970) * Increment package version after release of Azure.ResourceManager.DeviceRegistry (#47971) * Increment package version after release of Azure.ResourceManager.AppConfiguration (#47975) * Increment package version after release of Azure.ResourceManager.ComputeSchedule (#47974) * Sparse checkout 1espt auto-baselining file by default (#47966) Co-authored-by: Ben Broderick Phillips * Azure cadl ranch (#47936) * Initial alignment to support cadl ranch scripts * generate stubbed cadl ranch specs * autogen launch settings * add cadl ranch test project * regen with comments * add test cadl ranch ability * regen stubs in azure format * remove problematic specs * remove comments from stubs * pr fb * pr feedback * regen with scaffolding changes * pr feedback * use process tracker from testframework * update sparse checkout * pr fb * Sync eng/common directory with azure-sdk-tools for PR 9687 (#47954) * Migrate stress storage cluster * Add tenant to stress deploy login --------- Co-authored-by: Ben Broderick Phillips * [Storage] [DataMovement] Re-enable flakey pause/resume E2E tests (#47812) * change tests to LiveOnly * use OAuth for blobProvider + add more delay for pause * Do not fail test if transfer Completes before Pause is issued in ResumeTransferAsync_Directory_Large * merged main * disable ResumeTransferAsync_Directory_Large * extend cancellation time limit * add tiny delay between start transfer and pause * decreased delay * accounted for if transfer completes before pause + lowered asserts * small * adjust cancel time * added AssertContainerCompleted * small complete assert * Added retry * More chunks = hopefully slower transfer * reduced delay * pause hang fix * revert * Resolved bug where resumed single resource transfer can be enumerated * minor test changes * do not allow single resource transfers to be enumerated * revert * merge conflict resolution * temp disable ResumeTransferAsync_Options * Fix for jobPlanFile length bug * lowered the cancellation time to 150ms * Revert "Generating dotnet SDK for the API version 2024-08-22 (#47815)" (#47982) This reverts commit c5c7612d6fca1368d665d6e45f39360a0ca622ef. * [ConfidentialLedger] Update changelog for 1.4.1-beta (#47988) * Revert "Generating dotnet SDK for the API version 2024-08-22 (#47815)" This reverts commit c5c7612d6fca1368d665d6e45f39360a0ca622ef. * Update the changelog * Added interrupt hold audio flag for play media. (#47715) * Added interruprt hold audio flag for play media. * issue resolved. * recording the test * exporting newly added field * updating the auto rest * re recording the test records * re recording tests * re recording tests * re-recording the test * re recording transcription test --------- Co-authored-by: Vinothini Dharmaraj * Increment package version after release of Azure.Security.ConfidentialLedger (#47990) * [Storage][DataMovement] Refactor resource provider credential callbacks (#47984) * `AzurePowerShellCredential` no longer relies on APIs that are not available in Constrained Language Mode (#47989) * Sync eng/common directory with azure-sdk-tools for PR 9699 (#47992) * allow the sparse matrix to generate fully based on new parameter to generate-job-matrix --------- Co-authored-by: Scott Beddall * Spector coverage publish (#48000) * update new proj scaffolding * rename cadl ranch to spector * fixes after rename * pr fb * update format * fix spacing * pr fb * fix spacing * [Storage] [DataMovement] Put EditorBrowsable(Never) for not using interfaces (#47939) * Added EditorBrowsable(Never) for not using interfaces * Remove EB(never) from APIs that require it * Add fallback user id lookup for test resource deployment (#48001) Co-authored-by: Ben Broderick Phillips * [Core] Update change log (#47983) The focus of these changes is to acknowledge our community contribution for the current version and add attribution of the changes. * removing the streaming data parser (#48004) * [Storage] [DataMovement] [Docs] Known Limitations (#47999) * Initial commit * feedback * small wording change * Added call connection Id for recording and live and unit test code. (#47646) * Added call connection Id for recording and live and unit test code. * Added start recording failed event. * Updating the PR with minor changes * updating the api changes * fixing the live test * updating the live test * fixing the media recording failed * reverting playback mode set * pushing the test records for recording --------- Co-authored-by: Vinothini Dharmaraj * Minor NFS over REST bug fix (#48014) * Add CI/CD to .NET project (#47964) * Add tests * Record unit tests * Add mock credential to avoid authentication issues in the playback * Add licenseheader * Sync eng/common directory with azure-sdk-tools for PR 9724 (#48019) * Use 1es template * Move to stage template folder --------- Co-authored-by: ray chen * Sync eng/common directory with azure-sdk-tools for PR 9732 (#48016) * update emitter template * hide step if public pr * update conditions after testing --------- Co-authored-by: m-nash <64171366+m-nash@users.noreply.github.com> * add az.namespace to Azure AI Inference spans (#48022) * [Storage] Update Storage Package Versions Packages.Data.props (#48021) * Update Storage Package Versions Packages.Data.props * Update test versions for storage packages * Update XML doc on ServiceBusReceivedMessage (#48023) * Update CI to publish spector results (#48006) * temp ci changes to test * add warning when test file didn't exist * invoke coverage script * change mode * replace one more name * hide step in pr * toggle coverage * fix condition * test no spector name condition * add spector name back to ci * update owner of the typespec scripts * fix label * DataMovement migration guide samples (#47934) * migration samples: upload file and directory * migration samples: download file and directory * copy * Migration samples TOC * more samples * rephrasing * pause/resume * files provider now static * fix share file sample * add note about static provider * links * update triggers for azure plugin (#48027) * Generate missing .net 8.0 api for WebJobs Extensions Storage (#48030) * Data Movement Migration: `Azure.Storage.DataMovement.Samples.Tests` (#48028) * datamovement.samples.tests first sample test written * upload directory * download blob * download directory * blob2blob * blob2file * provider API changes from rebase * updatesnippets * [Storage][DataMovement] Fix preserving FileChangedOn during transfers (#48009) * [Event Hubs] Fixed producer semaphore release (#47965) * [Event Hubs] Fixed producer semaphore release The focus of these changes is to fox an obscure edge case in the `EventHubBufferedProducer` client where an obscure race condition when flushing/enqueuing events concurrently with disposing the producer could cause a semaphore to be released inappropriately. This error superseded the `TaskCanceledException` that should have been surfaced. Also moved to volatile reads for the total buffer count when making state-related decisions, to ensure that the most recent value is used. * [System.ClientModel] Add Logging (#45472) * initial draft * WIP test stubs pt 1 * WIP test stubs 2 * tweaks * changes * p1 of adding Event Source * tests p1 * test updates * Tests2 * updates * API * try slimming methods and adding retry policy log * test * refactory + add abstraction * add tests and update api * more tests * fix functional tests * static -> instance * updates * tweaks * tweaks * fix * little refactorings * tweaks * tweaks * WIP feedback * reformat * WIP more feedback * WIP * WIP - updates * Export API * API * API tweaks * comment * changes 1 * changes 2 * changes * fixes * more updates * some tests * WIP - experiment * wip * wip fixes * event source / logger tests green * API * fb * implement request ID * adding tests, some fb * more FB * more fb + more tests * WIP * tweaks to logging stream * tests green * test updates * more test updates * Update sdk/core/System.ClientModel/src/Options/ClientLoggingOptions.cs Co-authored-by: Jesse Squire * fb 1 * fb 2 * fixes * initial samples * api fix and logging.md * tests * Apply suggestions from code review Co-authored-by: Christopher Scott * feedback 1 * more fb * more feedback * test fix * prefer activity.current for request id * last clean up tweaks --------- Co-authored-by: Jesse Squire Co-authored-by: Christopher Scott * Increment package version after release of Azure.ResourceManager.NetworkCloud (#48080) * 2024-11-15-preview and 2024-11-01 updates for Conversations Runtime (#47814) * Updated the dotnet sdk based on the new commit * - adjust test examples based on the new generated sdk * updated samples and snippets * updated code based on new commit id * modified the ChangeLog * remove breaking changes and Bugs Fixed sections * update sdk based on the latest commit id * updated class name based on new commit id * updated the snippets * add one more version 2024-11-01 in TestBase and add test for ConversationPiiWithCharacterMask * -adjust the version to 2024-11-01 in the test * Modified the assertion in conversation pii test with MaskPolicyType * add async test for ConversationPii_WithCharacterMaskPolicy * add sync and async test for ConversationPii_WithEntityMaskPolicy * add sync and async test for ConversationPii_WithNoMaskPolicy * revert ConversationsClientLiveTests * modify new test data for previous tests * revert previous tests to main version. * testing * test for authentication * - update the assets.json * update recording for some old version apis * update assets.json * Succesfully run all the local tests and update the assets.json * adding new tests to clientLiveTests and update assets.json * remove the duplicate snippets * update some remaining test recordings to 2024-11-15-preview * udpate the new test for MaskWithEntity * Update the snippets for new feature tests * update the snippets for the general README file. * updated the change log * Update RAGMachine.csproj (#47952) * Add "None" as a supported value for authentication type of a connection (#48071) * Add "None" as a supported value for authentication type of a connection * Update API * Fix gow we get the default connection * Cloud Machine and Azure AI Project integration (#47933) Cloud Machine and Azure AI Project integration * Update query count to fix automation (#48086) Co-authored-by: Wes Haggard * Add entry to changelog (#48087) * Sync eng/common directory with azure-sdk-tools for PR 9698 (#48091) * Fix pipeline generation for private repos * Update eng/common/pipelines/templates/steps/sparse-checkout.yml --------- Co-authored-by: Wes Haggard * Update common tool to support go (#48094) Co-authored-by: Chidozie Ononiwu * Pass non sparse parameters through to PR job matrix generator (#48081) Co-authored-by: Ben Broderick Phillips * [Storage] [DataMovement] Fixed File Attributes with ReadOnly does not transfer / copy correctly bug (#48096) * Initial commit * initial commit * reverted spaces * Removed _destinationPermissionKey * Added changelog + addressed if property is null * Sync eng/common directory with azure-sdk-tools for PR 9745 (#48098) * Pass arm template parameter for TME context * Use supportsSafeSecretStandard parameter instead --------- Co-authored-by: Ben Broderick Phillips * `net - pullrequest` (#47957) * combined ci and ci.tests.yml changes to enable net - pullrequest * update analyze phase to iterate across the changed packages for that is being tested * [Cloud Machine] Merge AIFoundryClient logic into CloudMachineClient and introduce AIFoundryFeature (#48100) [Cloud Machine] Merge AIFoundryClient logic into CloudMachineClient and introduce AIFoundryFeature * Removed references to deprecated service, Azure Spatial Anchors (#48039) * Increment package version after release of Azure.AI.Language.Conversations (#48099) * Prepare Core / SCM release (#48111) * Remove impression pixels from Markdown files (#48113) * AGC-2025.01.01 (#47993) * AGC-2025.01.01 * rename and changelog * fix ci * fix ci * fix change log * rename * Update sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md --------- Co-authored-by: Dapeng Zhang * [Storage] [DataMovement] Renamed TransferOptions.CreationPreference to CreateMode (#48119) * [Storage] [DataMovement] Renamed TransferOptions.CreationPreference to CreateMode * Ran Update-Snippets.ps1 * Flip supportsSafeSecretStandard boolean condition (#48118) Co-authored-by: Ben Broderick Phillips * change log for release (#48124) * Prepare release of data protection backup (#48127) * change the name and type of the property * change the way of fixing the issue * prepare release * fix the release date (#48129) * Add rust to prepare-pipelines and create-package-workitem yaml (#48134) Co-authored-by: Patrick Hallisey * Increment package version after release of Azure.ResourceManager.ServiceNetworking (#48132) * Update AutoRest C# version to 3.0.0-beta.20250205.1 (#48136) * Update Generator Version 3.0.0-beta.20250205.1 * Update SDK codes pu_sp_5 * Update SDK codes co_da_1 * Update SDK codes ad_co_0 * regen --------- Co-authored-by: Arcturus Zhang * [Extensions] Prepare Microsoft.Extension.Azure for release (#48133) * Update version to 1.10.0 * Update changelog * [Cloud Machine] Rename CloudMachineInfrastructure and CloudMachineClient (#48130) * Increment version for core releases (#48146) * Add the C# function deployment to the readme. (#48121) * The draft of changes * Recird the tests and add fuction deployment instructions. * Remove unrelated changes * Remove non needed line * Print clickable link to terminal (#48144) Co-authored-by: Heath Stewart * Increment package version after release of Microsoft.Extensions.Azure (#48148) * Add AdditionalMatrixConfigs the CIMatrixConfigs (#48147) Co-authored-by: James Suplizio * Update Microsoft.Extensions.Azure dependency version (#48155) * Generate ArmOperation for LRO in Azure plugin (#48108) * Sync eng/common directory with azure-sdk-tools for PR 9793 (#48157) * Update pipeline generate Includes fix https://github.com/Azure/azure-sdk-tools/pull/9784 * Update eng/common/pipelines/templates/steps/install-pipeline-generation.yml --------- Co-authored-by: Wes Haggard * Update AutoRest C# version to 3.0.0-beta.20250206.1 (#48162) * Update Generator Version 3.0.0-beta.20250206.1 * Update SDK codes co_da_1 * [Extensions] [ContainerRegistry] Prepare release for Extension packages and Container Registry (#48159) * Prepare release for Azure.Extensions.AspNetCore.Configuration.Secrets * Prepare Azure.Extensions.AspNetCore.DataProtection.Blobs for release * Prepare Azure.Extensions.AspNetCore.DataProtection.Keys for release * Prepare Azure.Containers.ContainerRegistry for release * [Service Bus] Fix error parsing logic (#48156) * [Service Bus] Fix error parsing logic The focus of these changes is to fix the logic for parsing error codes from the Service Bus administration service. The implementation assumes that all error responses will have a content body, which is not always the case. For example, an HTTP 401 is returned without a body. In this scenario, the error detail parsing faults and surfaces an exception, obscuring the original 401 status code. * Adding changelog * Update sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusRequestFailedDetailsParser.cs Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --------- Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> * `net - pullrequest` bugfixes (#48122) * fix broken reference to install_azurite * disable snippet generation in net - pullrequest until per-yml parameters are supported * fix issue with dependent packages not being generated properly * [SignalR] Fixed transitive version conflict (#48181) The focus of these changes is to fix a transitive version conflict in the SignalR extension, arising from the legacy `Microsoft.Azure.Functions.Extensions` package and its dependency on an old version of `Microsoft.Extensions.DependencyInjection" which conflicts with the 8.x package line. This was added as a local override, as SignalR is the only Functions extension package in the repository which uses the legacy package. * Increment version for extensions releases (#48182) * Increment package version after release of Azure.Extensions.AspNetCore.Configuration.Secrets * Increment package version after release of Azure.Extensions.AspNetCore.DataProtection.Blobs * Increment package version after release of Azure.Extensions.AspNetCore.DataProtection.Keys * Sync eng/common directory with azure-sdk-tools for PR 9799 (#48185) * resolve issue with matrix collation when multiple matrix configs are being resolved --------- Co-authored-by: Scott Beddall * Azure OpenAI: 2.2.0-beta.1 (2025-01-01-preview feature support) (#48184) * (squash) 2.2.0-beta.1 release prep * descope incidental deprecated Assistants library changes * update-snippets/export-api * Increment package version after release of Azure.ResourceManager.DataProtectionBackup (#48160) * [Event Hubs] Handle bad offset at GeoDR failover (#48101) * [Event Hubs] Handle bad offset at GeoDR failover The focus of these changes is to handle the corner case exception that can occur when a GeoDR namespace fails over and an existing checkpoint exists with the legacy format that is now invalid. This is a rare occurrence, but it would cause the processor to be unable to recover without manual deletion of the checkpoint blobs. This change introduces error handling that detects the scenario based on a new service error code and automatically resets the checkpoint, falling back to the configured default position. * number insight ga (#47195) * Add number lookup GA * Update CHANGELOG with new features and fixes * Update default API version in changelog * remove preview version number * Update comments * update docs * regenerate comments * hide preview version * fix doc comment policy issue * Fix code check * delete unrelated files * STG 97 beta and WebJobs release commit (#48090) * [Storage] [DataMovement] Getting Started Guide Updates / Advanced samples (#48125) * WIP * More updates to samples / getting started * Updated links, next steps, and adding creation mode samples * Fixed links * Fix links again * Fixed link part 4 * PR comments * [Storage] Add Azure.Storage.DataMovement to eng/Packages.Data.props (#48177) * Add Azure.Storage.DataMovement to eng/Packages.Data.props * PR comment Co-authored-by: Jesse Squire --------- Co-authored-by: Jesse Squire * [Service Bus] Adding resiliance to drain for session receivers (#48149) * Adding resiliance to drain for session receivers * Add missing throw statement in catch block * PR Review changes * PR fixes * Changelog update * Further pullrequest adjustments (#48186) * fix up the exclusions * [CODEOWNERS] Fix linter issues (#48203) The focus of these changes is to remove invalid owners being flagged by linter runs. * [Storage] [DataMovement] Preparing for DataMovement release; Added GenerateApiListing tag (#48154) * Preparing for DataMovement release; Added GenerateApiListing tag * WIP - change project ref to datamovement base to package ref * Revert package to project for base DMLib reference * Update README to remove prerelease status * Remove prelease off of Azure.Storage.DataMovement.Files.Shares README * Add support for more message types (Interactive, Reaction, Sticker) (#47349) * Generate for latest Typespec API - more message types Add interactive messages, stickers, reactions * generate with latest TypeSpec API, and move WhatsApp specific models to models.channels namespace * regenerate with latest typespec - update version * add tests, add change log * re-run recordings * fix "Generated code is not up to date." * re-run recordings * Some more interactive messages tests and new recordings * add ReactionMessage test and re-record * Update tsp-location.yaml with latest commit in main branch * regenerate tspCodeModel * Prepare for release * Increment package version after release of Azure.Containers.ContainerRegistry (#48206) * [ContainerRegistry] Generate .NET SDK for version 2024-11-01 (#47561) * [Service Bus] Release Prep: Feb, 2025 (#48210) * [Service Bus] Release Prep: Feb, 2025 The focus of these changes is to prepare the Service Bus package for the February 2025 release. * Increment package version after release of Azure.ResourceManager.ContainerRegistry (#48214) * use squashed commit Id from specs repo (#48222) * Release prep (#48223) * Increment version for storage releases (#48226) * Increment package version after release of Azure.Identity (#48230) * [Storage] [DataMovement] [Tests] Abstract Pause/Resume E2E tests and implement for Share File & Blobs (#48205) * Initial commit * initial commit * refactored CreateDestinationStorageResourceItem and reduced abstract methods * removed space * added blobClient check * Increment version for storage releases (#48231) * Sync eng/common directory with azure-sdk-tools for PR 9803 (#48232) * update Get-ObjectKey to coalesce boolean-like values to their true boolean value * update Get-ObjectKey to call Get-ObjectKey on each item of an array or pscustom object - versus utilizing their values directly --------- Co-authored-by: Scott Beddall * [Event Hubs] Set GeoDR on management link (#48204) The focus of these changes is to set the desired capability for GeoDR on the management link, so that requests for Event Hub and partition metadata can take it into account for offset formatting. Also included are tweaks to the tests for `EventPosition.Latest` to reduce flakininess due to timing issues during nightly runs. * [Event Hubs] Release Prep: Feb, 2025 (#48208) * [Event Hubs] Release Prep: Feb, 2025 The focus of these changes is to prepare the Event Hubs core package for the February 2025 release. * Removing changelog section without content * Update Data Movement Blobs package install command (#48220) * Parameterize test-pipeline version separator (#48235) Co-authored-by: Patrick Hallisey * [Event Hubs] Processor Release Prep: Feb, 2025 (#48209) The focus of these changes is to prepare the Event Hubs processor package for the February 2025 release. * Support Linux environment (#48238) Co-authored-by: Chidozie Ononiwu * Increment package version after release of Azure.Communication.Messages (#48239) * Increment package version after release of Azure.Messaging.EventHubs (#48237) * Increment package version after release of Azure.Messaging.ServiceBus (#48236) * Increment package version after release of Azure.Communication.PhoneNumbers (#48228) * Increment package version after release of Azure.Messaging.EventHubs.Processor (#48242) * prepare release (#48215) * Fix for #36714: Tags related test cases (#47731) * Update assets.json * update * update2 * Update ManagedDiskOperationsTests.cs * fix the version number (#48252) * Increment package version after release of Azure.ResourceManager.DataProtectionBackup (#48257) * Update etag reset logic in the checkpoint store (#48244) * Update Azure.ResourceManager.Resources API version to latest (#48013) * Update Azure.ResourceManager.Resources API version to latest * Run Export-API.ps1 script * Change name of incorrectly named example * Sync eng/common directory with azure-sdk-tools for PR 9807 (#48267) * replace PkgProps CIMatrixConfigs property in favor of a more generalized CIParameters property. Original CIMatrixConfigs will exist as an item of same key within CIParameters. * update Create-PRJobMatrix to honor new CIMatrixConfigs property location --------- Co-authored-by: Scott Beddall * Update Maps Weather samples (#48253) * [Storage] Fix NullReferenceException when parsing error response (#48268) * Sync eng/common directory with azure-sdk-tools for PR 9821 (#48266) * Change AddDevVersion as boolean in save package properties script * Update to latest MGC and set namespace of model and enum for Azure (#48197) * [Storage] Update documentation for `overwrite` parameter of `OpenWrite` (#48276) * Sync eng/common directory with azure-sdk-tools for PR 9823 (#48277) * handle defaults for changedfiles, deletedfiles, and changedServices --------- Co-authored-by: Scott Beddall * [Azure.AI.Inference] Beta 3 (#48288) * Feature updates for beta 3 ### Features Added - Added new `ImageEmbeddingsClient`, to provide support for generating embeddings with model input. See sample for more information. - Added support for Chat Completions with audio input, for supported models. - Added support for Chat Completions with structured output. - Added support for providing a "Developer" message to models which support it. ### Breaking Changes - `ChatCompletionsResponseFormatJSON` has been renamed to `ChatCompletionsResponseFormatJsonObject`. ### Bugs Fixed - Fixed an issue where `usage` wasn't being properly included in chat responses. --------- Signed-off-by: trangevi * [Key Vault] Add warnings on RSA1_5 and RSA_OAEP encryption algorithms (#48005) * Add warnings on RSA1_5 and RSA_OAEP algorithms * Replace REST constants with C# names * missing '/' in XML see tag * Chaning missing REST name to property name * Update samples to use RsaOaep256 * Update code snippets * Add Obsolete attribute * Update API * Revert "Update API" This reverts commit ae38e8071549d7ac44ce784f196f01148cea4b1e. * Revert "Add Obsolete attribute" This reverts commit 88e2a7ca86c187bdcb0ab8ef5209dec87169f2cc. * initial commit (#48285) * Further Tuning to `net - pullrequest` (#48269) * we need to support track1 exclusions separately from override file exclusions * the 'get additional validation packages for pr' is resolving deleted files and excluding any paths under exclude paths now * tune the language-settings to properly handle shared packages that have been changed Co-authored-by: Patrick Hallisey * [Event Hubs] Updates to reflect the v5.11.6 hotfix (#48274) * [Event Hubs] Updates to reflect the v5.11.6 hotfix The focus of these changes is to update assets to reflect the 5.11.6 hotfix. Included are updates to the change logs and bumps for central package versions. * [Storage] [BUG] Fixed ContentRange is null in BlobDownloadDetails when calling DownloadStreamingAsync with HttpRange "0-" (#48272) * Initial commit * initial commit * initial commit * Exported Api * changed _isRangeSet to internal * undo export api * fixed SetupDownload * re-recorded old tests * re-record pt2 * re-recorded pt 3 * re-record pt4 * typo * reverting call automation changes * updating the tests --------- Signed-off-by: trangevi Co-authored-by: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Scott Beddall Co-authored-by: Caio Saldanha Co-authored-by: Wei Hu Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com> Co-authored-by: Quentin Robinson <32183739+quentinRobinson@users.noreply.github.com> Co-authored-by: Jesse Squire Co-authored-by: Christopher Scott Co-authored-by: Theodore Chang Co-authored-by: Madalyn Redding Heaps <66138537+m-redding@users.noreply.github.com> Co-authored-by: Siddharth Singha Roy Co-authored-by: Siddharth Singha Roy Co-authored-by: alexathomases <55257302+alexathomases@users.noreply.github.com> Co-authored-by: Alexa Thomases Co-authored-by: Amanda Nguyen <48961492+amnguye@users.noreply.github.com> Co-authored-by: Jacob Lauzon <96087589+jalauzon-msft@users.noreply.github.com> Co-authored-by: yzt Co-authored-by: mcgallan <88413158+mcgallan@users.noreply.github.com> Co-authored-by: Kashish Gupta <90824921+kashish2508@users.noreply.github.com> Co-authored-by: guptakashish Co-authored-by: ChrisRibe Co-authored-by: Jesse Squire Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Co-authored-by: taicchoumsft <61705609+taicchoumsft@users.noreply.github.com> Co-authored-by: Jonathan Cárdenas Co-authored-by: Jocelyn <41338290+jaschrep-msft@users.noreply.github.com> Co-authored-by: Christopher Scott Co-authored-by: Anna Pankiewicz Co-authored-by: Venkat Ragavan <50309787+venkatr21@users.noreply.github.com> Co-authored-by: tejasm-microsoft <137446850+tejasm-microsoft@users.noreply.github.com> Co-authored-by: Arthur Ma Co-authored-by: amruthashree18 <110563260+amruthashree18@users.noreply.github.com> Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com> Co-authored-by: Ben Broderick Phillips Co-authored-by: nick863 <30440255+nick863@users.noreply.github.com> Co-authored-by: Ben Broderick Phillips Co-authored-by: James Suplizio Co-authored-by: Zachary Halzel Co-authored-by: Chidozie Ononiwu Co-authored-by: v-pivamshi <155710746+v-pivamshi@users.noreply.github.com> Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> Co-authored-by: Jero Bado <10357742+jerobado@users.noreply.github.com> Co-authored-by: Wenming Liu Co-authored-by: Nneka Okeke <149507727+NneOkeke@users.noreply.github.com> Co-authored-by: guyhirPublic Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Crystal YU Co-authored-by: ray chen Co-authored-by: azure-sdk Co-authored-by: hmmorales <100385146+hmmorales@users.noreply.github.com> Co-authored-by: Davide Montanari Co-authored-by: Heng Liu Co-authored-by: m-nash <64171366+m-nash@users.noreply.github.com> Co-authored-by: Nick Liu Co-authored-by: Sean McCullough <44180881+seanmcc-msft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Daniel Marbach Co-authored-by: amber-ccc Co-authored-by: pamistel <75835644+pamistel@users.noreply.github.com> Co-authored-by: cdxu-147 Co-authored-by: Dapeng Zhang Co-authored-by: Dapeng Zhang Co-authored-by: Heath Stewart Co-authored-by: Travis Wilson <35748617+trrwilson@users.noreply.github.com> Co-authored-by: guoqing2023 <124081795+guoqing2023@users.noreply.github.com> Co-authored-by: Juan Ospina <70209456+jeo02@users.noreply.github.com> Co-authored-by: glorialimicrosoft <67171398+glorialimicrosoft@users.noreply.github.com> Co-authored-by: trisavo-msft <141691062+trisavo-msft@users.noreply.github.com> Co-authored-by: Jonny Eskew Co-authored-by: Charlie Chen Co-authored-by: Travis Angevine --- .github/CODEOWNERS | 19 +- .vscode/cspell.json | 9 + README.md | 8 +- doc/README.md | 2 - .../2.0.46/Sdk/Sdk.targets | 2 +- .../Readme.md | 2 - eng/Packages.Data.props | 47 +- .../TestResources/New-TestResources.ps1 | 18 +- .../TestResources/TestResources-Helpers.ps1 | 2 +- .../templates/archetype-typespec-emitter.yml | 11 + .../templates/jobs/generate-job-matrix.yml | 6 +- .../templates/jobs/prepare-pipelines.yml | 24 +- .../stages/archetype-spec-gen-sdk.yml | 256 + .../steps/install-pipeline-generation.yml | 2 +- .../steps/save-package-properties.yml | 2 +- .../steps/set-test-pipeline-version.yml | 2 + .../templates/steps/sparse-checkout.yml | 21 +- .../templates/steps/validate-all-packages.yml | 2 +- eng/common/scripts/Detect-Api-Changes.ps1 | 22 +- eng/common/scripts/Generate-PR-Diff.ps1 | 12 + .../Helpers/DevOps-WorkItem-Helpers.ps1 | 2 +- .../scripts/Helpers/PSModule-Helpers.ps1 | 6 +- .../scripts/Helpers/Package-Helpers.ps1 | 40 +- eng/common/scripts/Invoke-GitHubAPI.ps1 | 33 + eng/common/scripts/Package-Properties.ps1 | 64 +- eng/common/scripts/Remove-IssueLabel.ps1 | 32 + eng/common/scripts/SemVer.ps1 | 107 +- eng/common/scripts/SetTestPipelineVersion.ps1 | 20 +- .../scripts/job-matrix/Create-PrJobMatrix.ps1 | 26 +- .../job-matrix/job-matrix-functions.ps1 | 8 +- .../stress-testing/deploy-stress-tests.ps1 | 1 + .../stress-test-deployment-lib.ps1 | 15 +- .../UbuntuNetCoreKeyring/Dockerfile | 14 +- eng/emitter-package-lock.json | 53 +- eng/emitter-package.json | 4 +- eng/packages/http-client-csharp/ci.yml | 13 +- .../http-client-csharp/emitter/src/emitter.ts | 2 +- .../eng/scripts/Generate.ps1 | 212 + .../eng/scripts/Generation.psm1 | 180 + .../src/Azure.Generator.StubLibrary.csproj | 26 + .../src/AzureStubPlugin.cs | 32 + .../src/AzureStubVisitor.cs | 132 + .../generator/Azure.Generator.sln | 24 +- .../src/Azure.Generator.csproj | 69 +- .../Azure.Generator/src/AzureClientPlugin.cs | 8 +- .../Azure.Generator/src/AzureOutputLibrary.cs | 19 +- .../Azure.Generator/src/AzureTypeFactory.cs | 24 +- .../InputClientTransformer.cs | 4 +- .../src/Mgmt/Models/OperationSet.cs | 4 +- .../Azure.Generator/src/NamespaceVisitor.cs | 63 + .../src/Primitives/KnownAzureTypes.cs | 14 +- .../Primitives/NewAzureProjectScaffolding.cs | 168 + .../src/Properties/launchSettings.json | 142 +- .../AzureClientResponseProvider.cs | 10 +- .../Abstraction/AzureResponseProvider.cs | 8 +- .../Abstraction/HttpMessageProvider.cs | 9 +- .../Abstraction/HttpPipelineProvider.cs | 14 +- .../Abstraction/HttpRequestOptionsProvider.cs | 8 +- .../Abstraction/HttpRequestProvider.cs | 8 +- .../Abstraction/RequestContentProvider.cs | 12 +- .../StatusCodeClassifierProvider.cs | 8 +- .../MgmtLongRunningOperationProvider.cs | 234 + .../RequestContextExtensionsDefinition.cs | 11 +- .../src/Providers/ResourceDataProvider.cs | 4 +- .../ResourceDataSerializationProvider.cs | 6 +- .../Azure.Generator/src/RestClientVisitor.cs | 50 + .../Utilities/ConstructorProviderHelper.cs | 24 + .../src/Utilities/InputExtensions.cs | 2 +- .../src/Utilities/OperationExtensions.cs | 2 +- .../src/Utilities/ResourceDetection.cs | 8 +- .../test/Azure.Generator.Tests.csproj | 51 +- .../test/AzureTypeFactoryTests.cs | 9 +- .../Azure.Generator/test/Common/Helpers.cs | 1 - .../test/Common/InputFactory.cs | 22 +- .../AzureClientResponseProviderTests.cs | 4 +- .../test/Providers/ClientProviderTests.cs | 19 +- .../MgmtLongRunningOperationProviderTests.cs | 44 + .../Providers/ResourceDataProviderTests.cs | 11 +- ...yConstructor(WithDefault,False,False,0).cs | 4 +- ...ryConstructor(WithDefault,False,True,0).cs | 6 +- ...ryConstructor(WithDefault,True,False,0).cs | 6 +- ...aryConstructor(WithDefault,True,True,0).cs | 6 +- ...aryConstructor(WithDefault,True,True,1).cs | 6 +- ...Constructor(WithRequired,False,False,0).cs | 4 +- ...yConstructor(WithRequired,False,True,0).cs | 6 +- ...yConstructor(WithRequired,True,False,0).cs | 6 +- ...ryConstructor(WithRequired,True,True,0).cs | 6 +- ...ryConstructor(WithRequired,True,True,1).cs | 6 +- ...erify_Generic_MgmtLROProviderGeneration.cs | 106 + ...fy_NonGeneric_MgmtLROProviderGeneration.cs | 100 + .../test/TestHelpers/Configuration.json | 1 - .../test/TestHelpers/MockHelpers.cs | 19 +- .../generator/Directory.Build.props | 8 +- .../TestProjects/Directory.Build.props | 9 + .../TestProjects.Local.Tests.csproj | 32 + .../Local/Basic-TypeSpec/Basic-TypeSpec.tsp | 26 +- .../Local/Basic-TypeSpec/BasicTypeSpec.sln | 60 +- .../Local/Basic-TypeSpec/Configuration.json | 3 +- .../Basic-TypeSpec/src/BasicTypeSpec.csproj | 13 +- .../src/Generated/BasicTypeSpecClient.cs | 76 +- .../Generated/BasicTypeSpecClientOptions.cs | 1 + .../Generated/BasicTypeSpecModelFactory.cs | 16 +- .../Internal/ChangeTrackingDictionary.cs | 8 + .../Generated/Internal/ChangeTrackingList.cs | 4 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/Internal/ErrorResult.cs | 1 + .../Internal/Utf8JsonBinaryContent.cs | 1 + ...zation.cs => FriendModel.Serialization.cs} | 56 +- .../Models/{Friend.cs => FriendModel.cs} | 6 +- .../Models/RoundTripModel.Serialization.cs | 4 +- .../src/Generated/Models/RoundTripModel.cs | 6 +- ...ization.cs => ThingModel.Serialization.cs} | 80 +- .../Models/{Thing.cs => ThingModel.cs} | 24 +- ...odelOptionalLiteralFloat.Serialization.cs} | 2 +- ...t.cs => ThingModelOptionalLiteralFloat.cs} | 26 +- ...gModelOptionalLiteralInt.Serialization.cs} | 2 +- ...Int.cs => ThingModelOptionalLiteralInt.cs} | 26 +- ....cs => ThingModelOptionalLiteralString.cs} | 26 +- ...odelRequiredLiteralFloat.Serialization.cs} | 2 +- ...t.cs => ThingModelRequiredLiteralFloat.cs} | 26 +- ...gModelRequiredLiteralInt.Serialization.cs} | 2 +- ...Int.cs => ThingModelRequiredLiteralInt.cs} | 26 +- ....cs => ThingModelRequiredLiteralString.cs} | 26 +- .../Local/Basic-TypeSpec/tspCodeModel.json | 981 ++- .../TestProjects/Local/Directory.Build.props | 10 + .../Local/Mgmt-TypeSpec/Configuration.json | 3 +- .../Local/Mgmt-TypeSpec/MgmtTypeSpec.sln | 60 +- .../Internal/ChangeTrackingDictionary.cs | 8 + .../Generated/Internal/ChangeTrackingList.cs | 4 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/Internal/ErrorResult.cs | 1 + .../Internal/Utf8JsonBinaryContent.cs | 1 + .../MgmtTypeSpecArmOperation.cs | 100 + .../MgmtTypeSpecArmOperationOfT.cs | 106 + .../RestOperations/FoosRestOperations.cs | 1 + .../PrivateLinksRestOperations.cs | 1 + .../Mgmt-TypeSpec/src/MgmtTypeSpec.csproj | 37 +- .../Local/Mgmt-TypeSpec/tspCodeModel.json | 1376 ++-- .../Http/Authentication/ApiKey/ApiKeyTests.cs | 28 + .../Infrastructure/AssemblyCleanFixture.cs | 17 + .../BuildPropertiesAttribute.cs | 20 + .../Infrastructure/SpectorServer.cs | 50 + .../Infrastructure/SpectorServerSession.cs | 26 + .../Infrastructure/SpectorTestAttribute.cs | 100 + .../Infrastructure/TestServerBase.cs | 107 + .../Infrastructure/TestServerSessionBase.cs | 78 + .../Spector.Tests/SpectorTestBase.cs | 36 + .../TestProjects.Spector.Tests.csproj | 36 + .../Spector/Directory.Build.props | 12 + .../api-key/Authentication.ApiKey.sln | 24 + .../authentication/api-key/Configuration.json | 5 + .../api-key/src/Authentication.ApiKey.csproj | 19 + .../api-key/src/Generated/ApiKeyClient.cs | 42 + .../src/Generated/ApiKeyClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../authentication/api-key/tspCodeModel.json | 184 + .../custom/Authentication.Http.Custom.sln | 24 + .../http/custom/Configuration.json | 5 + .../src/Authentication.Http.Custom.csproj | 19 + .../http/custom/src/Generated/CustomClient.cs | 42 + .../src/Generated/CustomClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../http/custom/tspCodeModel.json | 185 + .../oauth2/Authentication.OAuth2.sln | 24 + .../authentication/oauth2/Configuration.json | 5 + .../oauth2/src/Authentication.OAuth2.csproj | 14 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../oauth2/src/Generated/OAuth2Client.cs | 43 + .../src/Generated/OAuth2ClientOptions.cs | 15 + .../authentication/oauth2/tspCodeModel.json | 185 + .../union/Authentication.Union.sln | 24 + .../authentication/union/Configuration.json | 5 + .../union/src/Authentication.Union.csproj | 19 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../union/src/Generated/UnionClient.cs | 47 + .../union/src/Generated/UnionClientOptions.cs | 15 + .../authentication/union/tspCodeModel.json | 124 + .../default/Client.Structure.Service.sln | 24 + .../structure/default/Configuration.json | 5 + .../src/Client.Structure.Service.csproj | 14 + .../structure/default/src/Generated/Bar.cs | 37 + .../structure/default/src/Generated/Baz.cs | 20 + .../structure/default/src/Generated/BazFoo.cs | 29 + .../structure/default/src/Generated/Foo.cs | 37 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/Models/ClientType.cs | 23 + .../structure/default/src/Generated/Qux.cs | 31 + .../structure/default/src/Generated/QuxBar.cs | 29 + .../default/src/Generated/ServiceClient.cs | 51 + .../src/Generated/ServiceClientOptions.cs | 15 + .../structure/default/tspCodeModel.json | 728 ++ .../http/encode/numeric/Configuration.json | 5 + .../http/encode/numeric/Encode.Numeric.sln | 24 + .../encode/numeric/src/Encode.Numeric.csproj | 14 + .../Generated/EncodeNumericModelFactory.cs | 18 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../SafeintAsStringProperty.Serialization.cs | 41 + .../Models/SafeintAsStringProperty.cs | 20 + .../Uint32AsStringProperty.Serialization.cs | 41 + .../Models/Uint32AsStringProperty.cs | 20 + .../Uint8AsStringProperty.Serialization.cs | 41 + .../Generated/Models/Uint8AsStringProperty.cs | 20 + .../numeric/src/Generated/NumericClient.cs | 23 + .../src/Generated/NumericClientOptions.cs | 15 + .../encode/numeric/src/Generated/Property.cs | 47 + .../http/encode/numeric/tspCodeModel.json | 540 ++ .../http/parameters/basic/Configuration.json | 5 + .../parameters/basic/Parameters.Basic.sln | 24 + .../basic/src/Generated/BasicClient.cs | 25 + .../basic/src/Generated/BasicClientOptions.cs | 15 + .../basic/src/Generated/ExplicitBody.cs | 31 + .../basic/src/Generated/ImplicitBody.cs | 30 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Generated/Models/User.Serialization.cs | 41 + .../basic/src/Generated/Models/User.cs | 16 + .../Generated/ParametersBasicModelFactory.cs | 15 + .../basic/src/Parameters.Basic.csproj | 14 + .../http/parameters/basic/tspCodeModel.json | 371 + .../body-optionality/Configuration.json | 5 + .../Parameters.BodyOptionality.sln | 24 + .../src/Generated/BodyOptionalityClient.cs | 44 + .../Generated/BodyOptionalityClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/BodyModel.Serialization.cs | 41 + .../src/Generated/Models/BodyModel.cs | 16 + .../src/Generated/OptionalExplicit.cs | 39 + .../ParametersBodyOptionalityModelFactory.cs | 14 + .../src/Parameters.BodyOptionality.csproj | 14 + .../body-optionality/tspCodeModel.json | 441 ++ .../http/parameters/spread/Configuration.json | 5 + .../parameters/spread/Parameters.Spread.sln | 24 + .../parameters/spread/src/Generated/Alias.cs | 63 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../parameters/spread/src/Generated/Model.cs | 63 + .../Models/BodyParameter.Serialization.cs | 41 + .../src/Generated/Models/BodyParameter.cs | 16 + .../Generated/ParametersSpreadModelFactory.cs | 17 + .../spread/src/Generated/SpreadClient.cs | 25 + .../src/Generated/SpreadClientOptions.cs | 15 + .../spread/src/Parameters.Spread.csproj | 14 + .../http/parameters/spread/tspCodeModel.json | 1535 ++++ .../content-negotiation/Configuration.json | 5 + .../Payload.ContentNegotiation.sln | 24 + .../src/Generated/ContentNegotiationClient.cs | 25 + .../ContentNegotiationClientOptions.cs | 15 + .../src/Generated/DifferentBody.cs | 39 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/PngImageAsJson.Serialization.cs | 41 + .../src/Generated/Models/PngImageAsJson.cs | 16 + .../PayloadContentNegotiationModelFactory.cs | 16 + .../src/Generated/SameBody.cs | 38 + .../src/Payload.ContentNegotiation.csproj | 14 + .../content-negotiation/tspCodeModel.json | 514 ++ .../json-merge-patch/Configuration.json | 5 + .../Payload.JsonMergePatch.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/JsonMergePatchClient.cs | 42 + .../Generated/JsonMergePatchClientOptions.cs | 15 + .../Models/InnerModel.Serialization.cs | 41 + .../src/Generated/Models/InnerModel.cs | 26 + .../Models/Resource.Serialization.cs | 41 + .../src/Generated/Models/Resource.cs | 52 + .../PayloadJsonMergePatchModelFactory.cs | 18 + .../src/Payload.JsonMergePatch.csproj | 14 + .../json-merge-patch/tspCodeModel.json | 889 +++ .../payload/media-type/Configuration.json | 5 + .../payload/media-type/Payload.MediaType.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/MediaTypeClient.cs | 23 + .../src/Generated/MediaTypeClientOptions.cs | 15 + .../media-type/src/Generated/StringBody.cs | 54 + .../media-type/src/Payload.MediaType.csproj | 14 + .../http/payload/media-type/tspCodeModel.json | 424 ++ .../encoded-name/json/Configuration.json | 5 + .../json/Serialization.EncodedName.Json.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../json/src/Generated/JsonClient.cs | 23 + .../json/src/Generated/JsonClientOptions.cs | 15 + .../JsonEncodedNameModel.Serialization.cs | 41 + .../Generated/Models/JsonEncodedNameModel.cs | 20 + .../json/src/Generated/Property.cs | 39 + ...erializationEncodedNameJsonModelFactory.cs | 14 + .../src/Serialization.EncodedName.Json.csproj | 14 + .../encoded-name/json/tspCodeModel.json | 274 + .../endpoint/not-defined/Configuration.json | 5 + .../Server.Endpoint.NotDefined.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/NotDefinedClient.cs | 34 + .../src/Generated/NotDefinedClientOptions.cs | 15 + .../src/Server.Endpoint.NotDefined.csproj | 14 + .../endpoint/not-defined/tspCodeModel.json | 71 + .../server/path/single/Configuration.json | 5 + .../server/path/single/Server.Path.Single.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../path/single/src/Generated/SingleClient.cs | 34 + .../src/Generated/SingleClientOptions.cs | 15 + .../path/single/src/Server.Path.Single.csproj | 14 + .../http/server/path/single/tspCodeModel.json | 71 + .../versions/not-versioned/Configuration.json | 5 + .../Server.Versions.NotVersioned.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/NotVersionedClient.cs | 50 + .../Generated/NotVersionedClientOptions.cs | 15 + .../src/Server.Versions.NotVersioned.csproj | 14 + .../versions/not-versioned/tspCodeModel.json | 169 + .../conditional-request/Configuration.json | 5 + .../SpecialHeaders.ConditionalRequest.sln | 24 + .../src/Generated/ConditionalRequestClient.cs | 56 + .../ConditionalRequestClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../SpecialHeaders.ConditionalRequest.csproj | 14 + .../conditional-request/tspCodeModel.json | 274 + .../repeatability/Configuration.json | 5 + .../SpecialHeaders.Repeatability.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/RepeatabilityClient.cs | 32 + .../Generated/RepeatabilityClientOptions.cs | 15 + .../src/SpecialHeaders.Repeatability.csproj | 14 + .../repeatability/tspCodeModel.json | 198 + .../http/special-words/Configuration.json | 5 + .../http/special-words/SpecialWords.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/ModelProperties.cs | 31 + .../special-words/src/Generated/Models.cs | 287 + .../src/Generated/Models/And.Serialization.cs | 41 + .../special-words/src/Generated/Models/And.cs | 16 + .../src/Generated/Models/As.Serialization.cs | 41 + .../special-words/src/Generated/Models/As.cs | 16 + .../Generated/Models/Assert.Serialization.cs | 41 + .../src/Generated/Models/Assert.cs | 16 + .../Generated/Models/Async.Serialization.cs | 41 + .../src/Generated/Models/Async.cs | 16 + .../Generated/Models/Await.Serialization.cs | 41 + .../src/Generated/Models/Await.cs | 16 + .../Generated/Models/Break.Serialization.cs | 41 + .../src/Generated/Models/Break.cs | 16 + .../Generated/Models/Class.Serialization.cs | 41 + .../src/Generated/Models/Class.cs | 16 + .../Models/Constructor.Serialization.cs | 41 + .../src/Generated/Models/Constructor.cs | 16 + .../Models/Continue.Serialization.cs | 41 + .../src/Generated/Models/Continue.cs | 16 + .../src/Generated/Models/Def.Serialization.cs | 41 + .../special-words/src/Generated/Models/Def.cs | 16 + .../src/Generated/Models/Del.Serialization.cs | 41 + .../special-words/src/Generated/Models/Del.cs | 16 + .../Generated/Models/Elif.Serialization.cs | 41 + .../src/Generated/Models/Elif.cs | 16 + .../Generated/Models/Else.Serialization.cs | 41 + .../src/Generated/Models/Else.cs | 16 + .../Generated/Models/Except.Serialization.cs | 41 + .../src/Generated/Models/Except.cs | 16 + .../Generated/Models/Exec.Serialization.cs | 41 + .../src/Generated/Models/Exec.cs | 16 + .../Generated/Models/Finally.Serialization.cs | 41 + .../src/Generated/Models/Finally.cs | 16 + .../src/Generated/Models/For.Serialization.cs | 41 + .../special-words/src/Generated/Models/For.cs | 16 + .../Generated/Models/From.Serialization.cs | 41 + .../src/Generated/Models/From.cs | 16 + .../Generated/Models/Global.Serialization.cs | 41 + .../src/Generated/Models/Global.cs | 16 + .../src/Generated/Models/If.Serialization.cs | 41 + .../special-words/src/Generated/Models/If.cs | 16 + .../Generated/Models/Import.Serialization.cs | 41 + .../src/Generated/Models/Import.cs | 16 + .../src/Generated/Models/In.Serialization.cs | 41 + .../special-words/src/Generated/Models/In.cs | 16 + .../src/Generated/Models/Is.Serialization.cs | 41 + .../special-words/src/Generated/Models/Is.cs | 16 + .../Generated/Models/Lambda.Serialization.cs | 41 + .../src/Generated/Models/Lambda.cs | 16 + .../src/Generated/Models/Not.Serialization.cs | 41 + .../special-words/src/Generated/Models/Not.cs | 16 + .../src/Generated/Models/Or.Serialization.cs | 41 + .../special-words/src/Generated/Models/Or.cs | 16 + .../Generated/Models/Pass.Serialization.cs | 41 + .../src/Generated/Models/Pass.cs | 16 + .../Generated/Models/Raise.Serialization.cs | 41 + .../src/Generated/Models/Raise.cs | 16 + .../Generated/Models/Return.Serialization.cs | 41 + .../src/Generated/Models/Return.cs | 16 + .../Models/SameAsModel.Serialization.cs | 41 + .../src/Generated/Models/SameAsModel.cs | 16 + .../src/Generated/Models/Try.Serialization.cs | 41 + .../special-words/src/Generated/Models/Try.cs | 16 + .../Generated/Models/While.Serialization.cs | 41 + .../src/Generated/Models/While.cs | 16 + .../Generated/Models/With.Serialization.cs | 41 + .../src/Generated/Models/With.cs | 16 + .../Generated/Models/Yield.Serialization.cs | 41 + .../src/Generated/Models/Yield.cs | 16 + .../special-words/src/Generated/Operations.cs | 285 + .../special-words/src/Generated/Parameters.cs | 293 + .../src/Generated/SpecialWordsClient.cs | 29 + .../Generated/SpecialWordsClientOptions.cs | 15 + .../src/Generated/SpecialWordsModelFactory.cs | 80 + .../special-words/src/SpecialWords.csproj | 14 + .../http/special-words/tspCodeModel.json | 6637 +++++++++++++++++ .../http/type/enum/fixed/Configuration.json | 5 + .../http/type/enum/fixed/Type.Enum.Fixed.sln | 24 + .../enum/fixed/src/Generated/FixedClient.cs | 23 + .../fixed/src/Generated/FixedClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/Models/DaysOfWeekEnum.cs | 27 + .../type/enum/fixed/src/Generated/String.cs | 47 + .../enum/fixed/src/Type.Enum.Fixed.csproj | 19 + .../http/type/enum/fixed/tspCodeModel.json | 463 ++ .../http/type/model/empty/Configuration.json | 5 + .../type/model/empty/Type.Model.Empty.sln | 24 + .../model/empty/src/Generated/EmptyClient.cs | 50 + .../empty/src/Generated/EmptyClientOptions.cs | 15 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/EmptyInput.Serialization.cs | 41 + .../empty/src/Generated/Models/EmptyInput.cs | 14 + .../Models/EmptyInputOutput.Serialization.cs | 41 + .../src/Generated/Models/EmptyInputOutput.cs | 14 + .../Models/EmptyOutput.Serialization.cs | 41 + .../empty/src/Generated/Models/EmptyOutput.cs | 13 + .../Generated/TypeModelEmptyModelFactory.cs | 18 + .../model/empty/src/Type.Model.Empty.csproj | 19 + .../http/type/model/empty/tspCodeModel.json | 334 + .../nested-discriminator/Configuration.json | 5 + ....Model.Inheritance.NestedDiscriminator.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Generated/Models/Fish.Serialization.cs | 42 + .../src/Generated/Models/Fish.cs | 31 + .../Models/GoblinShark.Serialization.cs | 41 + .../src/Generated/Models/GoblinShark.cs | 19 + .../Generated/Models/Salmon.Serialization.cs | 41 + .../src/Generated/Models/Salmon.cs | 29 + .../Models/SawShark.Serialization.cs | 41 + .../src/Generated/Models/SawShark.cs | 19 + .../Generated/Models/Shark.Serialization.cs | 41 + .../src/Generated/Models/Shark.cs | 25 + .../Models/UnknownFish.Serialization.cs | 34 + .../src/Generated/Models/UnknownFish.cs | 17 + .../Models/UnknownShark.Serialization.cs | 34 + .../src/Generated/Models/UnknownShark.cs | 17 + .../Generated/NestedDiscriminatorClient.cs | 74 + .../NestedDiscriminatorClientOptions.cs | 15 + ...eritanceNestedDiscriminatorModelFactory.cs | 24 + ...del.Inheritance.NestedDiscriminator.csproj | 19 + .../nested-discriminator/tspCodeModel.json | 843 +++ .../not-discriminated/Configuration.json | 5 + ...ype.Model.Inheritance.NotDiscriminated.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../src/Generated/Models/Cat.Serialization.cs | 41 + .../src/Generated/Models/Cat.cs | 25 + .../src/Generated/Models/Pet.Serialization.cs | 41 + .../src/Generated/Models/Pet.cs | 25 + .../Generated/Models/Siamese.Serialization.cs | 41 + .../src/Generated/Models/Siamese.cs | 25 + .../src/Generated/NotDiscriminatedClient.cs | 50 + .../NotDiscriminatedClientOptions.cs | 15 + ...InheritanceNotDiscriminatedModelFactory.cs | 18 + ....Model.Inheritance.NotDiscriminated.csproj | 19 + .../not-discriminated/tspCodeModel.json | 421 ++ .../inheritance/recursive/Configuration.json | 5 + .../Type.Model.Inheritance.Recursive.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Generated/Models/Element.Serialization.cs | 41 + .../recursive/src/Generated/Models/Element.cs | 21 + .../Models/Extension.Serialization.cs | 41 + .../src/Generated/Models/Extension.cs | 25 + .../src/Generated/RecursiveClient.cs | 42 + .../src/Generated/RecursiveClientOptions.cs | 15 + ...peModelInheritanceRecursiveModelFactory.cs | 18 + .../Type.Model.Inheritance.Recursive.csproj | 19 + .../inheritance/recursive/tspCodeModel.json | 274 + .../single-discriminator/Configuration.json | 5 + ....Model.Inheritance.SingleDiscriminator.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Generated/Models/Bird.Serialization.cs | 42 + .../src/Generated/Models/Bird.cs | 31 + .../Models/Dinosaur.Serialization.cs | 42 + .../src/Generated/Models/Dinosaur.cs | 27 + .../Generated/Models/Eagle.Serialization.cs | 41 + .../src/Generated/Models/Eagle.cs | 29 + .../Generated/Models/Goose.Serialization.cs | 41 + .../src/Generated/Models/Goose.cs | 19 + .../Generated/Models/SeaGull.Serialization.cs | 41 + .../src/Generated/Models/SeaGull.cs | 19 + .../Generated/Models/Sparrow.Serialization.cs | 41 + .../src/Generated/Models/Sparrow.cs | 19 + .../Generated/Models/TRex.Serialization.cs | 41 + .../src/Generated/Models/TRex.cs | 19 + .../Models/UnknownBird.Serialization.cs | 34 + .../src/Generated/Models/UnknownBird.cs | 17 + .../Models/UnknownDinosaur.Serialization.cs | 34 + .../src/Generated/Models/UnknownDinosaur.cs | 17 + .../Generated/SingleDiscriminatorClient.cs | 82 + .../SingleDiscriminatorClientOptions.cs | 15 + ...eritanceSingleDiscriminatorModelFactory.cs | 28 + ...del.Inheritance.SingleDiscriminator.csproj | 19 + .../single-discriminator/tspCodeModel.json | 993 +++ .../http/type/model/usage/Configuration.json | 5 + .../type/model/usage/Type.Model.Usage.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/InputOutputRecord.Serialization.cs | 41 + .../src/Generated/Models/InputOutputRecord.cs | 20 + .../Models/InputRecord.Serialization.cs | 41 + .../usage/src/Generated/Models/InputRecord.cs | 16 + .../Models/OutputRecord.Serialization.cs | 41 + .../src/Generated/Models/OutputRecord.cs | 14 + .../Generated/TypeModelUsageModelFactory.cs | 18 + .../model/usage/src/Generated/UsageClient.cs | 50 + .../usage/src/Generated/UsageClientOptions.cs | 15 + .../model/usage/src/Type.Model.Usage.csproj | 19 + .../http/type/model/usage/tspCodeModel.json | 415 ++ .../type/model/visibility/Configuration.json | 5 + .../visibility/Type.Model.Visibility.sln | 24 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/ReadOnlyModel.Serialization.cs | 41 + .../src/Generated/Models/ReadOnlyModel.cs | 20 + .../Models/VisibilityModel.Serialization.cs | 41 + .../src/Generated/Models/VisibilityModel.cs | 34 + .../TypeModelVisibilityModelFactory.cs | 18 + .../src/Generated/VisibilityClient.cs | 78 + .../src/Generated/VisibilityClientOptions.cs | 15 + .../src/Type.Model.Visibility.csproj | 19 + .../type/model/visibility/tspCodeModel.json | 904 +++ .../type/property/nullable/Configuration.json | 5 + .../nullable/Type.Property.Nullable.sln | 24 + .../property/nullable/src/Generated/Bytes.cs | 47 + .../nullable/src/Generated/CollectionsByte.cs | 47 + .../src/Generated/CollectionsModel.cs | 47 + .../src/Generated/CollectionsString.cs | 47 + .../nullable/src/Generated/Datetime.cs | 47 + .../nullable/src/Generated/Duration.cs | 47 + .../Internal/CodeGenMemberAttribute.cs | 19 + .../Internal/CodeGenSerializationAttribute.cs | 45 + .../Internal/CodeGenSuppressAttribute.cs | 27 + .../Internal/CodeGenTypeAttribute.cs | 23 + .../Models/BytesProperty.Serialization.cs | 41 + .../src/Generated/Models/BytesProperty.cs | 28 + .../CollectionsByteProperty.Serialization.cs | 41 + .../Models/CollectionsByteProperty.cs | 29 + .../CollectionsModelProperty.Serialization.cs | 41 + .../Models/CollectionsModelProperty.cs | 28 + ...CollectionsStringProperty.Serialization.cs | 41 + .../Models/CollectionsStringProperty.cs | 28 + .../Models/DatetimeProperty.Serialization.cs | 41 + .../src/Generated/Models/DatetimeProperty.cs | 28 + .../Models/DurationProperty.Serialization.cs | 41 + .../src/Generated/Models/DurationProperty.cs | 28 + .../Models/InnerModel.Serialization.cs | 41 + .../src/Generated/Models/InnerModel.cs | 20 + .../Models/StringProperty.Serialization.cs | 41 + .../src/Generated/Models/StringProperty.cs | 26 + .../nullable/src/Generated/NullableClient.cs | 35 + .../src/Generated/NullableClientOptions.cs | 15 + .../property/nullable/src/Generated/String.cs | 47 + .../TypePropertyNullableModelFactory.cs | 31 + .../src/Type.Property.Nullable.csproj | 19 + .../type/property/nullable/tspCodeModel.json | 2886 +++++++ .../http-client-csharp/package-lock.json | 3339 ++++++++- eng/packages/http-client-csharp/package.json | 32 +- eng/pipelines/templates/jobs/ci.tests.yml | 64 +- eng/pipelines/templates/jobs/ci.yml | 282 +- .../templates/stages/platform-matrix.json | 3 +- .../templates/steps/archetype-sdk-docs.yml | 55 + .../templates/steps/dependency.tests.yml | 1 + .../templates/steps/set-artifact-packages.yml | 51 + eng/pipelines/templates/variables/globals.yml | 2 + eng/scripts/Install-Azurite.ps1 | 23 + eng/scripts/Language-Settings.ps1 | 195 + .../Save-Package-Namespaces-Property.ps1 | 4 +- .../automation/GenerateAndBuildLib.ps1 | 166 +- ...ke-AutorestDataPlaneGenerateSDKPackage.ps1 | 2 +- eng/scripts/ci.yml | 6 + .../set-artifact-packages.ps1 | 41 + eng/scripts/typespec/Generate-Code.ps1 | 1 + eng/scripts/typespec/Get-Spector-Coverage.ps1 | 99 + eng/scripts/typespec/Spector-Helper.psm1 | 45 + eng/scripts/typespec/Test-Emitter.ps1 | 31 +- eng/scripts/typespec/Test-Spector.ps1 | 110 + eng/service.proj | 80 +- samples/iothub-connect-to-eventhubs/README.md | 2 - .../README.md | 2 - sdk/ai/Azure.AI.Inference/CHANGELOG.md | 9 +- sdk/ai/Azure.AI.Inference/README.md | 4 +- .../api/Azure.AI.Inference.net8.0.cs | 147 +- .../api/Azure.AI.Inference.netstandard2.0.cs | 147 +- sdk/ai/Azure.AI.Inference/assets.json | 2 +- .../samples/Sample10_EmbeddingsWithAoai.md | 2 +- .../samples/Sample11_ImageEmbeddings.md | 80 + .../Sample12_ChatCompletionsWithAudio.md | 68 + ...13_ChatCompletionsWithStructuredOutputs.md | 148 + .../samples/Sample1_ChatCompletions.md | 2 +- .../Sample2_ChatCompletionsWithAoai.md | 2 +- .../Sample3_ChatCompletionsStreaming.md | 2 +- .../Sample4_ChatCompletionsWithHistory.md | 2 +- .../Sample5_ChatCompletionsWithImages.md | 2 +- ...ChatCompletionsWithAdditionalProperties.md | 2 +- .../Sample7_ChatCompletionsWithTools.md | 2 +- .../samples/Sample9_Embeddings.md | 2 +- .../src/Customized/ChatCompletionsClient.cs | 6 +- .../ChatCompletionsResponseFormat.cs | 100 + ...atMessageAudioContentItem.Serialization.cs | 53 + .../Customized/ChatMessageAudioContentItem.cs | 40 + .../src/Customized/ChatMessageInputAudio.cs | 20 + .../src/Customized/ChatRequestToolMessage.cs | 19 + .../src/Customized/EmbeddingsClient.cs | 7 +- .../src/Customized/FunctionDefinition.cs | 35 + .../src/Customized/ImageEmbeddingInput.cs | 27 + .../src/Customized/ImageEmbeddingsClient.cs | 207 + .../StreamingChatCompletionsUpdate.cs | 29 + .../AIInferenceClientBuilderExtensions.cs | 29 +- .../src/Generated/AIInferenceModelFactory.cs | 46 +- .../src/Generated/AudioContentFormat.cs | 51 + .../ChatCompletions.Serialization.cs | 18 +- .../src/Generated/ChatCompletions.cs | 16 +- .../src/Generated/ChatCompletionsClient.cs | 1 + ...nsNamedToolChoiceFunction.Serialization.cs | 96 +- .../src/Generated/ChatCompletionsOptions.cs | 28 +- ...CompletionsResponseFormat.Serialization.cs | 3 +- .../ChatCompletionsResponseFormat.cs | 2 +- ...ResponseFormatJsonObject.Serialization.cs} | 42 +- ...hatCompletionsResponseFormatJsonObject.cs} | 10 +- ...sResponseFormatJsonSchema.Serialization.cs | 134 + ...ChatCompletionsResponseFormatJsonSchema.cs | 47 + ...ormatJsonSchemaDefinition.Serialization.cs | 206 + ...tionsResponseFormatJsonSchemaDefinition.cs | 142 + ...ssageAudioDataContentItem.Serialization.cs | 134 + .../ChatMessageAudioDataContentItem.cs | 44 + ...essageAudioUrlContentItem.Serialization.cs | 134 + .../ChatMessageAudioUrlContentItem.cs | 44 + .../ChatMessageContentItem.Serialization.cs | 2 + .../ChatMessageInputAudio.Serialization.cs | 150 + .../src/Generated/ChatMessageInputAudio.cs | 81 + .../ChatMessageInputAudioUrl.Serialization.cs | 142 + .../src/Generated/ChatMessageInputAudioUrl.cs | 75 + ...atRequestAssistantMessage.Serialization.cs | 16 +- ...atRequestDeveloperMessage.Serialization.cs | 134 + .../Generated/ChatRequestDeveloperMessage.cs | 47 + .../ChatRequestMessage.Serialization.cs | 1 + .../src/Generated/ChatRequestMessage.cs | 2 +- .../ChatRequestToolMessage.Serialization.cs | 11 +- .../src/Generated/ChatRequestToolMessage.cs | 6 +- .../src/Generated/ChatRole.cs | 3 + .../CompleteRequest.Serialization.cs | 259 +- .../src/Generated/CompleteRequest.cs | 256 +- .../src/Generated/Docs/EmbeddingsClient.xml | 116 - .../Generated/Docs/ImageEmbeddingsClient.xml | 101 + .../Generated/EmbedRequest.Serialization.cs | 106 +- .../src/Generated/EmbedRequest.cs | 101 +- .../Generated/EmbedRequest1.Serialization.cs | 208 + .../src/Generated/EmbedRequest1.cs | 123 + .../src/Generated/EmbeddingsClient.cs | 1 + .../src/Generated/ExtraParameters.cs | 2 +- .../src/Generated/FunctionDefinition.cs | 31 - .../ImageEmbeddingInput.Serialization.cs | 153 + .../src/Generated/ImageEmbeddingInput.cs | 85 + .../src/Generated/ImageEmbeddingsClient.cs | 230 + .../ImageEmbeddingsOptions.Serialization.cs | 208 + .../src/Generated/ImageEmbeddingsOptions.cs | 123 + .../src/Generated/ModelType.cs | 16 +- ...mingChatCompletionsUpdate.Serialization.cs | 25 +- .../StreamingChatCompletionsUpdate.cs | 17 +- ...letionsNamedToolSelection.Serialization.cs | 135 + ...nChatCompletionsToolCall.Serialization.cs} | 60 +- .../src/Telemetry/OpenTelemetryConstants.cs | 4 + .../src/Telemetry/OpenTelemetryScope.cs | 1 + .../tests/ChatCompletionsClientTest.cs | 330 +- .../tests/Data/hello_how_are_you.mp3 | Bin 0 -> 91951 bytes .../Samples/Samples_EmbeddingsClient.cs | 129 - .../Samples/Samples_ImageEmbeddingsClient.cs | 126 + .../tests/ImageEmbeddingClientTests.cs | 106 + .../tests/InferenceClientTestEnvironment.cs | 7 +- .../tests/Samples/Sample11_ImageEmbeddings.cs | 158 + .../Sample12_ChatCompletionsWithAudioInput.cs | 137 + ...e13_ChatCompletionsWithStructuredOutput.cs | 154 + .../Sample5_ChatCompletionsWithImages.cs | 6 +- .../tests/StreamingRecordingResponseTest.cs | 4 +- .../Utilities/ValidatingActivityListener.cs | 1 + sdk/ai/Azure.AI.Inference/tsp-location.yaml | 2 +- sdk/ai/Azure.AI.Projects/CHANGELOG.md | 12 +- sdk/ai/Azure.AI.Projects/README.md | 105 +- .../api/Azure.AI.Projects.net8.0.cs | 18 +- .../api/Azure.AI.Projects.netstandard2.0.cs | 18 +- sdk/ai/Azure.AI.Projects/assets.json | 4 +- .../src/Azure.AI.Projects.csproj | 2 +- .../Custom/Connection/ConnectionsClient.cs | 13 +- .../src/Generated/AIProjectsModelFactory.cs | 11 +- .../src/Generated/AgentsClient.cs | 16 +- ...tionInsightsConfiguration.Serialization.cs | 7 +- .../ApplicationInsightsConfiguration.cs | 7 +- .../AuthenticationType.Serialization.cs | 2 + .../src/Generated/AuthenticationType.cs | 4 +- .../ConnectionProperties.Serialization.cs | 1 + .../src/Generated/ConnectionProperties.cs | 2 +- .../src/Generated/ConnectionResponse.cs | 6 +- ...ateVectorStoreFileRequest.Serialization.cs | 24 +- .../Generated/CreateVectorStoreFileRequest.cs | 9 +- ...onnectionPropertiesNoAuth.Serialization.cs | 138 + .../InternalConnectionPropertiesNoAuth.cs | 41 + ...eltaMessageCreationObject.Serialization.cs | 10 + ...eltaCodeInterpreterOutput.Serialization.cs | 111 +- .../tests/AgentClientTests.cs | 1308 ++++ .../tests/ConnectionsClientTests.cs | 73 + .../tests/Utilities/MockTokenCredential.cs | 23 + sdk/ai/Azure.AI.Projects/tsp-location.yaml | 2 +- .../Azure.Data.AppConfiguration/README.md | 2 - .../CHANGELOG.md | 18 +- ...ResourceManager.AppConfiguration.net8.0.cs | 159 +- ...Manager.AppConfiguration.netstandard2.0.cs | 159 +- .../assets.json | 2 +- ...mple_AppConfigurationKeyValueCollection.cs | 8 +- ...Sample_AppConfigurationKeyValueResource.cs | 6 +- ...tionPrivateEndpointConnectionCollection.cs | 10 +- ...rationPrivateEndpointConnectionResource.cs | 6 +- ...ple_AppConfigurationPrivateLinkResource.cs | 2 +- ...figurationPrivateLinkResourceCollection.cs | 8 +- ...ample_AppConfigurationReplicaCollection.cs | 10 +- .../Sample_AppConfigurationReplicaResource.cs | 6 +- ...mple_AppConfigurationSnapshotCollection.cs | 124 + ...Sample_AppConfigurationSnapshotResource.cs | 49 + .../Sample_AppConfigurationStoreCollection.cs | 56 +- .../Sample_AppConfigurationStoreResource.cs | 14 +- ..._DeletedAppConfigurationStoreCollection.cs | 8 +- ...le_DeletedAppConfigurationStoreResource.cs | 4 +- .../Samples/Sample_SnapshotCollection.cs | 174 + .../Samples/Sample_SnapshotResource.cs | 49 + .../Sample_SubscriptionResourceExtensions.cs | 6 +- ...re.ResourceManager.AppConfiguration.csproj | 4 +- .../AppConfigurationSnapshotResource.cs | 28 + .../AppConfigurationKeyValueCollection.cs | 16 +- .../AppConfigurationKeyValueResource.cs | 24 +- ...tionPrivateEndpointConnectionCollection.cs | 20 +- ...rationPrivateEndpointConnectionResource.cs | 12 +- .../AppConfigurationPrivateLinkResource.cs | 4 +- ...figurationPrivateLinkResourceCollection.cs | 16 +- .../AppConfigurationReplicaCollection.cs | 20 +- .../AppConfigurationReplicaResource.cs | 12 +- .../AppConfigurationSnapshotCollection.cs | 415 ++ ...ConfigurationSnapshotData.Serialization.cs | 647 ++ .../Generated/AppConfigurationSnapshotData.cs | 133 + ...igurationSnapshotResource.Serialization.cs | 26 + .../AppConfigurationSnapshotResource.cs | 172 + .../AppConfigurationStoreCollection.cs | 20 +- ...AppConfigurationStoreData.Serialization.cs | 31 + .../Generated/AppConfigurationStoreData.cs | 7 +- .../AppConfigurationStoreResource.cs | 117 +- .../ArmAppConfigurationModelFactory.cs | 74 +- .../DeletedAppConfigurationStoreCollection.cs | 16 +- .../DeletedAppConfigurationStoreResource.cs | 8 +- .../Extensions/AppConfigurationExtensions.cs | 35 +- .../MockableAppConfigurationArmClient.cs | 12 + ...leAppConfigurationResourceGroupResource.cs | 4 +- ...bleAppConfigurationSubscriptionResource.cs | 12 +- ...AppConfigurationSnapshotOperationSource.cs | 38 + ...nDataPlaneProxyProperties.Serialization.cs | 196 + ...ppConfigurationDataPlaneProxyProperties.cs | 71 + .../Models/AppConfigurationSnapshotStatus.cs | 57 + ...ppConfigurationStorePatch.Serialization.cs | 16 + .../Models/AppConfigurationStorePatch.cs | 7 +- .../DataPlaneProxyAuthenticationMode.cs | 51 + .../DataPlaneProxyPrivateLinkDelegation.cs | 51 + .../Models/SnapshotCompositionType.cs | 51 + .../SnapshotKeyValueFilter.Serialization.cs | 201 + .../Models/SnapshotKeyValueFilter.cs | 81 + ...ppConfigurationManagementRestOperations.cs | 2 +- .../ConfigurationStoresRestOperations.cs | 2 +- .../RestOperations/KeyValuesRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../RestOperations/ReplicasRestOperations.cs | 2 +- .../RestOperations/SnapshotsRestOperations.cs | 242 + .../src/autorest.md | 32 +- .../ConfigurationStoreCollectionTests.cs | 28 + .../tests/Tests/SnapshotCollectionTests.cs | 123 + .../tests/Tests/SnapshotOperationTests.cs | 76 + .../Azure.Security.Attestation/README.md | 2 - .../src/Generated/Docs/BatchClient.xml | 2856 +------ .../Generated/Samples/Samples_BatchClient.cs | 2854 +------ .../README.md | 13 +- sdk/batch/Microsoft.Azure.Batch/README.md | 4 +- .../Azure.ResourceManager.Cdn/src/autorest.md | 127 +- .../api/Azure.CloudMachine.OpenAI.net8.0.cs | 6 +- ...zure.CloudMachine.OpenAI.netstandard2.0.cs | 6 +- .../src/AzureOpenAIExtensions.cs | 26 +- .../src/OpenAIFeature.cs | 4 +- .../src/OpenAIModelFeature.cs | 4 +- .../tests/CloudMachineTests_rag.cs | 2 +- .../src/CloudMachineExtensions.cs | 2 +- .../api/Azure.CloudMachine.net8.0.cs | 49 +- .../api/Azure.CloudMachine.netstandard2.0.cs | 49 +- .../samples/RAGMachine/Program.cs | 4 +- .../samples/RAGMachine/RAGMachine.csproj | 4 +- .../src/AIFoundary/AIFoundryClient.cs | 255 + .../AIFoundary/AzureAIProjectsExensions.cs | 147 + .../src/Azure.CloudMachine.csproj | 3 + .../src/CoreServices/MessagingServices.cs | 6 +- .../src/CoreServices/StorageServices.cs | 8 +- .../src/GlobalSuppressions.cs | 7 + .../Azure.CloudMachine/src/ProjectClient.cs | 155 + .../tests/AIFoundryTests.cs | 169 + .../tests/Azure.CloudMachine.Tests.csproj | 2 + .../tests/CloudMachineTestEnvironment.cs | 10 + .../tests/ConnectionTests.cs | 18 +- .../Azure.Provisioning.CloudMachine.net8.0.cs | 39 +- ...rovisioning.CloudMachine.netstandard2.0.cs | 39 +- .../src/CloudMachineClientExtensions.cs | 12 +- .../CloudMachineFeature.cs | 4 +- .../FeatureCollection.cs | 2 +- .../ProjectInfrastructure.cs | 165 + .../FeaturesBuiltIn/AIFoundryConnections.cs | 131 + .../src/FeaturesBuiltIn/AIFoundryFeature.cs | 76 + .../EventGridSystemTopicFeature.cs | 2 +- .../src/FeaturesBuiltIn/NoOpResource.cs | 18 + .../ServiceBusNamespaceFeature.cs | 2 +- .../ServiceBusSubscriptionFeature.cs | 2 +- .../FeaturesBuiltIn/ServiceBusTopicFeature.cs | 2 +- .../FeaturesBuiltIn/StorageAccountFeature.cs | 6 +- .../SystemTopicEventSubscriptionFeature.cs | 2 +- .../FeaturesExtensions/AppServiceFeature.cs | 2 +- .../src/FeaturesExtensions/KeyVaultFeature.cs | 2 +- .../src/GlobalSuppressions.cs | 6 +- .../src/Tooling/Azd.cs | 10 +- .../src/Tooling/CloudMachineCommands.cs | 4 +- .../tests/CommandsTests.cs | 6 +- .../tests/ProvisioningTests.cs | 6 +- sdk/cloudmachine/README.md | 26 +- .../README.md | 1 - .../CHANGELOG.md | 16 +- .../Azure.AI.Language.Conversations/README.md | 219 + .../Azure.AI.Language.Conversations.net8.0.cs | 62 +- ...I.Language.Conversations.netstandard2.0.cs | 62 +- .../assets.json | 2 +- ...ion_ConversationPiiWithEntityMaskPolicy.md | 103 + ...rsation_ConversationPiiWithNoMaskPolicy.md | 98 + ..._ConversationPiiWithCharacterMaskPolicy.md | 102 + .../Azure.AI.Language.Conversations.csproj | 2 +- .../Generated/ConversationsClientOptions.cs | 11 +- .../Generated/ConversationsModelFactory.cs | 338 +- .../Docs/ConversationAnalysisClient.xml | 1172 ++- .../BaseRedactionPolicy.Serialization.cs | 135 + .../Generated/Models/BaseRedactionPolicy.cs | 69 + .../CharacterMaskPolicyType.Serialization.cs | 141 + .../Models/CharacterMaskPolicyType.cs | 34 + ...versationPiiActionContent.Serialization.cs | 16 + .../Models/ConversationPiiActionContent.cs | 14 +- .../Models/ConversationPiiCategories.cs | 15 +- .../ConversationPiiCategoryExclusions.cs | 12 +- ...ummarizationActionContent.Serialization.cs | 12 + .../ConversationSummarizationActionContent.cs | 6 +- .../EntityMaskTypePolicyType.Serialization.cs | 126 + .../Models/EntityMaskTypePolicyType.cs | 29 + .../Models/NamedEntity.Serialization.cs | 44 + .../src/Generated/Models/NamedEntity.cs | 14 +- .../Models/NoMaskPolicyType.Serialization.cs | 126 + .../src/Generated/Models/NoMaskPolicyType.cs | 29 + .../Generated/Models/RedactionPolicyKind.cs | 54 + .../src/Generated/Models/RegexKey.cs | 4 +- ...nknownBaseRedactionPolicy.Serialization.cs | 126 + .../Models/UnknownBaseRedactionPolicy.cs | 28 + .../tests/ConversationsClientLiveTests.cs | 243 + .../Samples_ConversationAnalysisClient.cs | 1156 ++- .../ConversationAnalysisTestBase.cs | 2 + ..._ConversationPiiWithCharacterMaskPolicy.cs | 178 + ...ion_ConversationPiiWithEntityMaskPolicy.cs | 183 + ...rsation_ConversationPiiWithNoMaskPolicy.cs | 176 + .../tsp-location.yaml | 2 +- .../README.md | 2 - .../README.md | 1 - ...cognitionEvaluationResult.Serialization.cs | 82 - .../Azure.AI.Language.Text/README.md | 1 - ...namicClassificationResult.Serialization.cs | 143 + .../Language.TextAnalytics/src/README.md | 3 - .../CallAutomationClientAutomatedLiveTests.cs | 24 +- .../CallConnectionAutomatedLiveTests.cs | 12 +- .../CallDialogAutomatedLiveTests.cs | 10 +- .../CallMedias/CallMediaAutomatedLiveTests.cs | 30 +- .../CallRecordingAutomatedLiveTests.cs | 18 +- .../CallRecordings/CallRecordingTests.cs | 4 +- .../tests/EventCatcher/EventRecordPlayer.cs | 11 +- .../Events/CallAutomationEventParserTests.cs | 59 +- ...lAutomationClientAutomatedLiveTestsBase.cs | 22 +- .../CallAutomationClientLiveTestsBase.cs | 28 +- .../CallAutomationEventProcessorTestBase.cs | 17 +- .../MuteParticipantTest.json | 126 +- .../MuteParticipantTestAsync.json | 126 +- .../AnswerCallAndTranscriptionTest.json | 184 + .../AnswerCallAndTranscriptionTestAsync.json | 184 + ...thCombinationOfTextAndFileSourcesTest.json | 124 + ...binationOfTextAndFileSourcesTestAsync.json | 124 + ...hInvalidFileSourceWithValidSourceTest.json | 124 + ...lidFileSourceWithValidSourceTestAsync.json | 124 + ...ceRecognizeWithInvalidFileSourcesTest.json | 124 + ...ognizeWithInvalidFileSourcesTestAsync.json | 124 + ...eRecognizeWithMultipleFileSourcesTest.json | 124 + ...gnizeWithMultipleFileSourcesTestAsync.json | 124 + ...eRecognizeWithMultipleTextSourcesTest.json | 124 + ...gnizeWithMultipleTextSourcesTestAsync.json | 124 + .../CreateCallAndTranscriptionTest.json | 184 + .../CreateCallAndTranscriptionTestAsync.json | 184 + ...thCombinationOfTextAndFileSourcesTest.json | 124 + ...binationOfTextAndFileSourcesTestAsync.json | 124 + ...hInvalidFileSourceWithValidSourceTest.json | 124 + ...lidFileSourceWithValidSourceTestAsync.json | 124 + ...mfRecognizeWithInvalidFileSourcesTest.json | 124 + ...ognizeWithInvalidFileSourcesTestAsync.json | 124 + ...fRecognizeWithMultipleFileSourcesTest.json | 124 + ...gnizeWithMultipleFileSourcesTestAsync.json | 124 + ...fRecognizeWithMultipleTextSourcesTest.json | 124 + ...gnizeWithMultipleTextSourcesTestAsync.json | 124 + .../InterruptAudioAndAnnounceAsyncTest.json | 259 + ...terruptAudioAndAnnounceAsyncTestAsync.json | 259 + ...terruptHoldAudioForPlayMediaAsyncTest.json | 244 + ...ptHoldAudioForPlayMediaAsyncTestAsync.json | 244 + ...extAndFileSourcesWithPlayMediaAllTest.json | 139 + ...dFileSourcesWithPlayMediaAllTestAsync.json | 139 + ...edTextAndFileSourcesWithPlayMediaTest.json | 199 + ...tAndFileSourcesWithPlayMediaTestAsync.json | 199 + ...InvalidFileSourceWithPlayMediaAllTest.json | 139 + ...idFileSourceWithPlayMediaAllTestAsync.json | 139 + ...idAndValidFileSourceWithPlayMediaTest.json | 199 + ...ValidFileSourceWithPlayMediaTestAsync.json | 199 + ...InvalidFileSourceWithPlayMediaAllTest.json | 124 + ...idFileSourceWithPlayMediaAllTestAsync.json | 124 + ...layInvalidFileSourceWithPlayMediaTest.json | 184 + ...validFileSourceWithPlayMediaTestAsync.json | 184 + ...tipleFilesSourcesWithPlayMediaAllTest.json | 139 + ...FilesSourcesWithPlayMediaAllTestAsync.json | 139 + ...MultipleFilesSourcesWithPlayMediaTest.json | 199 + ...pleFilesSourcesWithPlayMediaTestAsync.json | 199 + ...ltipleTextSourcesWithPlayMediaAllTest.json | 139 + ...eTextSourcesWithPlayMediaAllTestAsync.json | 139 + ...yMultipleTextSourcesWithPlayMediaTest.json | 199 + ...ipleTextSourcesWithPlayMediaTestAsync.json | 199 + ...thCombinationOfTextAndFileSourcesTest.json | 124 + ...binationOfTextAndFileSourcesTestAsync.json | 124 + ...hInvalidFileSourceWithValidSourceTest.json | 124 + ...lidFileSourceWithValidSourceTestAsync.json | 124 + ...mfRecognizeWithInvalidFileSourcesTest.json | 124 + ...ognizeWithInvalidFileSourcesTestAsync.json | 124 + ...fRecognizeWithMultipleFileSourcesTest.json | 124 + ...gnizeWithMultipleFileSourcesTestAsync.json | 124 + ...fRecognizeWithMultipleTextSourcesTest.json | 124 + ...gnizeWithMultipleTextSourcesTestAsync.json | 124 + ...thCombinationOfTextAndFileSourcesTest.json | 124 + ...binationOfTextAndFileSourcesTestAsync.json | 124 + ...hInvalidFileSourceWithValidSourceTest.json | 124 + ...lidFileSourceWithValidSourceTestAsync.json | 124 + ...chRecognizeWithInvalidFileSourcesTest.json | 124 + ...ognizeWithInvalidFileSourcesTestAsync.json | 124 + ...hRecognizeWithMultipleFileSourcesTest.json | 124 + ...gnizeWithMultipleFileSourcesTestAsync.json | 124 + ...hRecognizeWithMultipleTextSourcesTest.json | 124 + ...gnizeWithMultipleTextSourcesTestAsync.json | 124 + ...ontinuousDtmfDetectionAndSendDtmfTest.json | 276 +- ...uousDtmfDetectionAndSendDtmfTestAsync.json | 276 +- .../CreateACSCallAndUnmixedAudioTest.json | 94 + ...CreateACSCallAndUnmixedAudioTestAsync.json | 94 + ...CreateACSCallUnmixedAudioAffinityTest.json | 94 + ...eACSCallUnmixedAudioAffinityTestAsync.json | 94 + .../RecordingOperationsTest.json | 154 + .../RecordingOperationsTestAsync.json | 154 + ...tartRecordingWithCallConnectionIdTest.json | 184 + ...ecordingWithCallConnectionIdTestAsync.json | 199 + .../Azure.Communication.Messages/CHANGELOG.md | 10 +- .../Configuration.json | 4 +- .../Azure.Communication.Messages.net8.0.cs | 233 +- ...e.Communication.Messages.netstandard2.0.cs | 233 +- .../Azure.Communication.Messages/assets.json | 4 +- .../src/Azure.Communication.Messages.csproj | 2 +- .../Generated/ActionBindings.Serialization.cs | 136 + .../src/Generated/ActionBindings.cs | 70 + .../Generated/ActionGroup.Serialization.cs | 160 + .../src/Generated/ActionGroup.cs | 83 + .../ActionGroupContent.Serialization.cs | 152 + .../src/Generated/ActionGroupContent.cs | 52 + .../ActionGroupItem.Serialization.cs | 158 + .../src/Generated/ActionGroupItem.cs | 89 + .../Generated/ButtonContent.Serialization.cs | 241 + .../src/Generated/ButtonContent.cs | 82 + .../ButtonSetContent.Serialization.cs | 144 + .../src/Generated/ButtonSetContent.cs | 45 + .../src/Generated/CommunicationMessageKind.cs | 9 + .../CommunicationMessagesClientOptions.cs | 5 +- .../CommunicationMessagesModelFactory.cs | 138 + .../DocumentMessageContent.Serialization.cs | 134 + .../src/Generated/DocumentMessageContent.cs | 44 + .../ImageMessageContent.Serialization.cs | 134 + .../src/Generated/ImageMessageContent.cs | 44 + .../InteractiveMessage.Serialization.cs | 180 + .../src/Generated/InteractiveMessage.cs | 111 + ...activeNotificationContent.Serialization.cs | 151 + .../InteractiveNotificationContent.cs | 49 + .../Generated/LinkContent.Serialization.cs | 142 + .../src/Generated/LinkContent.cs | 51 + .../src/Generated/MessageActionBindingKind.cs | 54 + .../Generated/MessageContent.Serialization.cs | 139 + .../src/Generated/MessageContent.cs | 69 + .../src/Generated/MessageContentKind.cs | 66 + .../src/Generated/NotificationContent.cs | 2 +- ...actionNotificationContent.Serialization.cs | 165 + .../Generated/ReactionNotificationContent.cs | 56 + ...tickerNotificationContent.Serialization.cs | 151 + .../Generated/StickerNotificationContent.cs | 49 + .../TextMessageContent.Serialization.cs | 134 + .../src/Generated/TextMessageContent.cs | 44 + .../UnknownActionBindings.Serialization.cs | 126 + .../src/Generated/UnknownActionBindings.cs | 28 + .../UnknownMessageContent.Serialization.cs | 126 + .../src/Generated/UnknownMessageContent.cs | 28 + .../VideoMessageContent.Serialization.cs | 134 + .../src/Generated/VideoMessageContent.cs | 44 + ...tsAppButtonActionBindings.Serialization.cs | 134 + .../Generated/WhatsAppButtonActionBindings.cs | 44 + ...hatsAppListActionBindings.Serialization.cs | 134 + .../Generated/WhatsAppListActionBindings.cs | 44 + ...WhatsAppUrlActionBindings.Serialization.cs | 134 + .../Generated/WhatsAppUrlActionBindings.cs | 44 + .../src/Models/Channels/WhatsAppModels.cs | 9 + .../NotificationMessagesClientLiveTests.cs | 251 + .../tsp-location.yaml | 2 +- .../tspCodeModel.json | 3448 +++++++-- .../CHANGELOG.md | 12 +- ...Azure.Communication.PhoneNumbers.net8.0.cs | 5 +- ...mmunication.PhoneNumbers.netstandard2.0.cs | 5 +- .../assets.json | 2 +- .../Azure.Communication.PhoneNumbers.csproj | 4 +- .../Generated/InternalPhoneNumbersClient.cs | 2 +- .../InternalPhoneNumbersRestClient.cs | 2 +- .../src/Generated/Models/OperatorDetails.cs | 17 +- .../src/Generated/PhoneNumbersModelFactory.cs | 4 +- .../src/PhoneNumbersClientOptions.cs | 10 +- .../src/autorest.md | 4 +- .../README.md | 2 - .../src/Models/SmsRecipient.cs | 12 + ...re.ResourceManager.Communication.net8.0.cs | 3 +- ...rceManager.Communication.netstandard2.0.cs | 3 +- .../Customize/ArmCommunicationModelFactory.cs | 40 - .../Generated/ArmCommunicationModelFactory.cs | 21 + .../Azure.ResourceManager.Compute/assets.json | 2 +- .../src/Customize/ArmComputeModelFactory.cs | 40 - .../src/Generated/ArmComputeModelFactory.cs | 60 + .../AvailabilitySetOperationsTests.cs | 1 - .../DedicatedHostGroupOperationsTests.cs | 1 - .../Scenario/DedicatedHostOperationsTests.cs | 1 - .../Scenario/DiskAccessOperationsTests.cs | 1 - .../Scenario/GalleryImageOperationsTests.cs | 1 - .../tests/Scenario/GalleryOperationsTests.cs | 1 - .../Scenario/ManagedDiskOperationsTests.cs | 1 - .../CHANGELOG.md | 10 + ...ure.ResourceManager.ComputeSchedule.csproj | 4 +- .../tsp-location.yaml | 2 +- .../Azure.Security.CodeTransparency/README.md | 2 - .../CHANGELOG.md | 7 +- .../README.md | 2 - ...zure.Security.ConfidentialLedger.net8.0.cs | 26 - ...urity.ConfidentialLedger.netstandard2.0.cs | 26 - .../Azure.Security.ConfidentialLedger.csproj | 2 +- .../src/Generated/ConfidentialLedgerClient.cs | 1059 --- .../Docs/ConfidentialLedgerClient.xml | 932 --- .../src/autorest.md | 15 +- .../Samples_ConfidentialLedgerClient.cs | 1010 --- .../CHANGELOG.md | 8 +- .../README.md | 2 - .../README.md | 2 - .../Azure.Containers.ContainerRegistry.csproj | 4 +- .../CHANGELOG.md | 9 +- ...esourceManager.ContainerRegistry.net8.0.cs | 1108 ++- ...anager.ContainerRegistry.netstandard2.0.cs | 1108 ++- .../Sample_ConnectedRegistryCollection.cs | 213 + .../Sample_ConnectedRegistryResource.cs | 158 + ...mple_ContainerRegistryArchiveCollection.cs | 211 + ...Sample_ContainerRegistryArchiveResource.cs | 115 + ...ntainerRegistryArchiveVersionCollection.cs | 205 + ...ContainerRegistryArchiveVersionResource.cs | 114 + ...le_ContainerRegistryCacheRuleCollection.cs | 201 + ...mple_ContainerRegistryCacheRuleResource.cs | 113 + .../Sample_ContainerRegistryCollection.cs | 54 +- ...ontainerRegistryCredentialSetCollection.cs | 208 + ..._ContainerRegistryCredentialSetResource.cs | 118 + ...ntainerRegistryExportPipelineCollection.cs | 208 + ...ContainerRegistryExportPipelineResource.cs | 121 + ...ntainerRegistryImportPipelineCollection.cs | 214 + ...ContainerRegistryImportPipelineResource.cs | 127 + ..._ContainerRegistryPipelineRunCollection.cs | 258 + ...le_ContainerRegistryPipelineRunResource.cs | 168 + ...stryPrivateEndpointConnectionCollection.cs | 10 +- ...gistryPrivateEndpointConnectionResource.cs | 6 +- ...le_ContainerRegistryPrivateLinkResource.cs | 2 +- ...erRegistryPrivateLinkResourceCollection.cs | 8 +- ..._ContainerRegistryReplicationCollection.cs | 12 +- ...le_ContainerRegistryReplicationResource.cs | 6 +- .../Sample_ContainerRegistryResource.cs | 20 +- ...Sample_ContainerRegistryTokenCollection.cs | 10 +- .../Sample_ContainerRegistryTokenResource.cs | 6 +- ...mple_ContainerRegistryWebhookCollection.cs | 10 +- ...Sample_ContainerRegistryWebhookResource.cs | 12 +- .../Samples/Sample_ScopeMapCollection.cs | 10 +- .../Samples/Sample_ScopeMapResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 18 +- ...e.ResourceManager.ContainerRegistry.csproj | 2 +- .../ArmContainerRegistryModelFactory.cs | 431 +- .../Generated/ConnectedRegistryCollection.cs | 495 ++ .../ConnectedRegistryData.Serialization.cs | 726 ++ .../src/Generated/ConnectedRegistryData.cs | 145 + ...ConnectedRegistryResource.Serialization.cs | 26 + .../Generated/ConnectedRegistryResource.cs | 432 ++ .../ContainerRegistryArchiveCollection.cs | 498 ++ ...tainerRegistryArchiveData.Serialization.cs | 395 + .../Generated/ContainerRegistryArchiveData.cs | 96 + ...erRegistryArchiveResource.Serialization.cs | 26 + .../ContainerRegistryArchiveResource.cs | 410 + ...ntainerRegistryArchiveVersionCollection.cs | 489 ++ ...egistryArchiveVersionData.Serialization.cs | 294 + .../ContainerRegistryArchiveVersionData.cs | 81 + ...tryArchiveVersionResource.Serialization.cs | 26 + ...ContainerRegistryArchiveVersionResource.cs | 341 + .../ContainerRegistryCacheRuleCollection.cs | 493 ++ ...inerRegistryCacheRuleData.Serialization.cs | 392 + .../ContainerRegistryCacheRuleData.cs | 102 + ...RegistryCacheRuleResource.Serialization.cs | 26 + .../ContainerRegistryCacheRuleResource.cs | 348 + .../Generated/ContainerRegistryCollection.cs | 20 +- ...ontainerRegistryCredentialSetCollection.cs | 493 ++ ...RegistryCredentialSetData.Serialization.cs | 407 + .../ContainerRegistryCredentialSetData.cs | 103 + ...stryCredentialSetResource.Serialization.cs | 26 + .../ContainerRegistryCredentialSetResource.cs | 348 + .../ContainerRegistryData.Serialization.cs | 94 + .../src/Generated/ContainerRegistryData.cs | 17 +- ...ntainerRegistryExportPipelineCollection.cs | 493 ++ ...egistryExportPipelineData.Serialization.cs | 402 + .../ContainerRegistryExportPipelineData.cs | 97 + ...tryExportPipelineResource.Serialization.cs | 26 + ...ContainerRegistryExportPipelineResource.cs | 598 ++ ...ntainerRegistryImportPipelineCollection.cs | 493 ++ ...egistryImportPipelineData.Serialization.cs | 440 ++ .../ContainerRegistryImportPipelineData.cs | 121 + ...tryImportPipelineResource.Serialization.cs | 26 + ...ContainerRegistryImportPipelineResource.cs | 347 + .../ContainerRegistryPipelineRunCollection.cs | 493 ++ ...erRegistryPipelineRunData.Serialization.cs | 356 + .../ContainerRegistryPipelineRunData.cs | 91 + ...gistryPipelineRunResource.Serialization.cs | 26 + .../ContainerRegistryPipelineRunResource.cs | 347 + ...stryPrivateEndpointConnectionCollection.cs | 20 +- ...gistryPrivateEndpointConnectionResource.cs | 12 +- .../ContainerRegistryPrivateLinkResource.cs | 4 +- ...erRegistryPrivateLinkResourceCollection.cs | 16 +- .../ContainerRegistryReplicationCollection.cs | 20 +- .../ContainerRegistryReplicationResource.cs | 24 +- .../Generated/ContainerRegistryResource.cs | 556 +- .../ContainerRegistryTokenCollection.cs | 20 +- .../ContainerRegistryTokenResource.cs | 12 +- .../ContainerRegistryWebhookCollection.cs | 20 +- .../ContainerRegistryWebhookResource.cs | 36 +- .../Extensions/ContainerRegistryExtensions.cs | 164 +- .../MockableContainerRegistryArmClient.cs | 96 + ...eContainerRegistryResourceGroupResource.cs | 4 +- ...leContainerRegistrySubscriptionResource.cs | 8 +- .../ConnectedRegistryOperationSource.cs | 38 + ...ContainerRegistryArchiveOperationSource.cs | 38 + ...erRegistryArchiveVersionOperationSource.cs | 38 + ...ntainerRegistryCacheRuleOperationSource.cs | 38 + ...nerRegistryCredentialSetOperationSource.cs | 38 + ...erRegistryExportPipelineOperationSource.cs | 38 + ...erRegistryImportPipelineOperationSource.cs | 38 + ...ainerRegistryPipelineRunOperationSource.cs | 38 + .../AadAuthenticationAsArmPolicyStatus.cs | 51 + .../Models/ArchiveListResult.Serialization.cs | 302 + .../src/Generated/Models/ArchiveListResult.cs | 70 + ...vePackageSourceProperties.Serialization.cs | 326 + .../Models/ArchivePackageSourceProperties.cs | 71 + .../Models/ArchivePackageSourceType.cs | 48 + .../ArchiveVersionListResult.Serialization.cs | 219 + .../Models/ArchiveVersionListResult.cs | 70 + .../AutoGeneratedDomainNameLabelScope.cs | 60 + ...AuthenticationAsArmPolicy.Serialization.cs | 166 + .../AzureADAuthenticationAsArmPolicy.cs | 66 + .../CacheRulesListResult.Serialization.cs | 219 + .../Generated/Models/CacheRulesListResult.cs | 70 + ...nnectedRegistryActivation.Serialization.cs | 166 + .../Models/ConnectedRegistryActivation.cs | 66 + .../ConnectedRegistryActivationStatus.cs | 51 + .../Models/ConnectedRegistryAuditLogStatus.cs | 51 + .../ConnectedRegistryConnectionState.cs | 57 + ...nnectedRegistryListResult.Serialization.cs | 219 + .../Models/ConnectedRegistryListResult.cs | 70 + .../Models/ConnectedRegistryLogLevel.cs | 60 + .../ConnectedRegistryLogging.Serialization.cs | 196 + .../Models/ConnectedRegistryLogging.cs | 71 + ...nectedRegistryLoginServer.Serialization.cs | 200 + .../Models/ConnectedRegistryLoginServer.cs | 71 + .../Generated/Models/ConnectedRegistryMode.cs | 57 + .../ConnectedRegistryParent.Serialization.cs | 189 + .../Models/ConnectedRegistryParent.cs | 82 + .../ConnectedRegistryPatch.Serialization.cs | 246 + .../Models/ConnectedRegistryPatch.cs | 89 + ...egistryPipelineRunContent.Serialization.cs | 328 + .../ConnectedRegistryPipelineRunContent.cs | 98 + ...ectedRegistryStatusDetail.Serialization.cs | 305 + .../Models/ConnectedRegistryStatusDetail.cs | 86 + ...tedRegistrySyncProperties.Serialization.cs | 317 + .../Models/ConnectedRegistrySyncProperties.cs | 104 + ...istrySyncUpdateProperties.Serialization.cs | 159 + .../ConnectedRegistrySyncUpdateProperties.cs | 76 + ...inerRegistryArchivePatch.Serialization.cs} | 69 +- .../Models/ContainerRegistryArchivePatch.cs | 66 + ...nerRegistryAuthCredential.Serialization.cs | 264 + .../Models/ContainerRegistryAuthCredential.cs | 81 + ...nerRegistryCacheRulePatch.Serialization.cs | 148 + .../Models/ContainerRegistryCacheRulePatch.cs | 67 + .../ContainerRegistryCertificateType.cs | 48 + ...rRegistryCredentialHealth.Serialization.cs | 234 + .../ContainerRegistryCredentialHealth.cs | 76 + ...ContainerRegistryCredentialHealthStatus.cs | 51 + .../Models/ContainerRegistryCredentialName.cs | 48 + ...egistryCredentialSetPatch.Serialization.cs | 174 + .../ContainerRegistryCredentialSetPatch.cs | 79 + .../Models/ContainerRegistryMetadataSearch.cs | 51 + ...ryNameAvailabilityContent.Serialization.cs | 28 +- ...ontainerRegistryNameAvailabilityContent.cs | 12 +- ...gistryNameAvailableResult.Serialization.cs | 36 +- .../ContainerRegistryNameAvailableResult.cs | 7 +- .../ContainerRegistryPatch.Serialization.cs | 32 + .../Models/ContainerRegistryPatch.cs | 12 +- .../Models/ContainerRegistryPipelineOption.cs | 57 + ...pelineRunSourceProperties.Serialization.cs | 200 + ...inerRegistryPipelineRunSourceProperties.cs | 71 + .../ContainerRegistryPipelineRunSourceType.cs | 48 + ...pelineRunTargetProperties.Serialization.cs | 200 + ...inerRegistryPipelineRunTargetProperties.cs | 71 + .../ContainerRegistryPipelineRunTargetType.cs | 48 + .../ContainerRegistryPipelineSourceType.cs | 48 + ...ContainerRegistryPolicies.Serialization.cs | 72 +- .../Models/ContainerRegistryPolicies.cs | 25 +- ...rRegistrySoftDeletePolicy.Serialization.cs | 227 + .../ContainerRegistrySoftDeletePolicy.cs | 76 + ...yTlsCertificateProperties.Serialization.cs | 200 + ...ntainerRegistryTlsCertificateProperties.cs | 71 + ...inerRegistryTlsProperties.Serialization.cs | 319 + .../Models/ContainerRegistryTlsProperties.cs | 71 + .../Models/ContainerRegistryTlsStatus.cs | 51 + .../CredentialSetListResult.Serialization.cs | 219 + .../Models/CredentialSetListResult.cs | 70 + .../ExportPipelineListResult.Serialization.cs | 219 + .../Models/ExportPipelineListResult.cs | 70 + ...tPipelineTargetProperties.Serialization.cs | 223 + .../Models/ExportPipelineTargetProperties.cs | 94 + ...rbageCollectionProperties.Serialization.cs | 201 + .../Models/GarbageCollectionProperties.cs | 71 + .../ImportPipelineListResult.Serialization.cs | 219 + .../Models/ImportPipelineListResult.cs | 70 + ...tPipelineSourceProperties.Serialization.cs | 219 + .../Models/ImportPipelineSourceProperties.cs | 94 + .../Models/PipelineProgress.Serialization.cs | 170 + .../src/Generated/Models/PipelineProgress.cs | 66 + .../PipelineRunListResult.Serialization.cs | 219 + .../Generated/Models/PipelineRunListResult.cs | 70 + .../Models/PipelineRunResult.Serialization.cs | 501 ++ .../src/Generated/Models/PipelineRunResult.cs | 124 + ...neSourceTriggerDescriptor.Serialization.cs | 167 + .../Models/PipelineSourceTriggerDescriptor.cs | 66 + ...neSourceTriggerProperties.Serialization.cs | 156 + .../Models/PipelineSourceTriggerProperties.cs | 73 + ...PipelineTriggerDescriptor.Serialization.cs | 169 + .../Models/PipelineTriggerDescriptor.cs | 71 + ...PipelineTriggerProperties.Serialization.cs | 169 + .../Models/PipelineTriggerProperties.cs | 75 + .../ArchiveVersionsRestOperations.cs | 577 ++ .../RestOperations/ArchivesRestOperations.cs | 665 ++ .../CacheRulesRestOperations.cs | 613 ++ .../ConnectedRegistriesRestOperations.cs | 721 ++ .../CredentialSetsRestOperations.cs | 1098 +++ .../ExportPipelinesRestOperations.cs | 515 ++ .../ImportPipelinesRestOperations.cs | 515 ++ .../PipelineRunsRestOperations.cs | 515 ++ ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../RegistriesRestOperations.cs | 2 +- .../ReplicationsRestOperations.cs | 2 +- .../RestOperations/ScopeMapsRestOperations.cs | 2 +- .../RestOperations/TokensRestOperations.cs | 2 +- .../RestOperations/WebhooksRestOperations.cs | 2 +- .../src/Generated/ScopeMapCollection.cs | 20 +- .../src/Generated/ScopeMapResource.cs | 12 +- .../src/autorest.md | 129 +- .../Azure.AI.ContentSafety/README.md | 2 - .../README.md | 12 +- sdk/core/Azure.Core/CHANGELOG.md | 20 +- sdk/core/Azure.Core/README.md | 2 - sdk/core/Azure.Core/src/Azure.Core.csproj | 4 +- sdk/core/Azure.Core/src/DiagnosticsOptions.cs | 2 + .../README.md | 2 - .../README.md | 2 - .../Microsoft.Azure.Core.Spatial/README.md | 2 - sdk/core/System.ClientModel/CHANGELOG.md | 6 +- sdk/core/System.ClientModel/README.md | 2 - .../api/System.ClientModel.net6.0.cs | 25 + .../api/System.ClientModel.net8.0.cs | 25 + .../api/System.ClientModel.netstandard2.0.cs | 25 + .../System.ClientModel/samples/Logging.md | 158 + .../src/Internal/ChangeTrackingStringList.cs | 114 + .../src/Internal/ContentTypeUtilities.cs | 54 + .../Logging/ClientModelEventSource.cs | 285 + .../src/Internal/Logging/LoggingEventIds.cs | 24 + .../Logging/PipelineMessageHeadersLogValue.cs | 109 + .../Internal/Logging/PipelineMessageLogger.cs | 241 + .../Logging/PipelineMessageSanitizer.cs | 206 + .../Internal/Logging/PipelineRetryLogger.cs | 32 + .../Logging/PipelineTransportLogger.cs | 56 + .../src/Message/PipelineRequest.cs | 7 + .../src/Options/ClientLoggingOptions.cs | 281 + .../src/Options/ClientPipelineOptions.cs | 77 +- .../ClientPipeline.RequestOptionsProcessor.cs | 4 +- .../src/Pipeline/ClientPipeline.cs | 28 +- .../src/Pipeline/ClientRetryPolicy.cs | 26 +- .../Pipeline/HttpClientPipelineTransport.cs | 18 +- .../src/Pipeline/MessageLoggingPolicy.cs | 372 + .../src/Pipeline/PipelineTransport.cs | 58 +- .../src/System.ClientModel.csproj | 6 +- .../Options/ClientLoggingOptionsTests.cs | 115 + .../Options/ClientPipelineOptionsTests.cs | 14 + .../Pipeline/ClientPipelineFunctionalTests.cs | 289 +- .../tests/Pipeline/ClientPipelineTests.cs | 12 +- .../tests/Pipeline/ClientRetryPolicyTests.cs | 49 +- .../Pipeline/MessageLoggingPolicyTests.cs | 644 ++ .../PipelineTransportFunctionalTests.cs | 12 +- .../tests/Samples/LoggingSamples.cs | 185 + .../tests/System.ClientModel.Tests.csproj | 2 + .../TestFramework/Logging/LoggerEvent.cs | 36 + .../Logging/TestClientEventListener.cs | 172 + .../tests/TestFramework/Logging/TestLogger.cs | 89 + .../Logging/TestLoggingFactory.cs | 42 + .../Mocks/MockPipelineRequest.cs | 1 + .../Mocks/MockPipelineResponse.cs | 6 +- .../Mocks/MockPipelineTransport.cs | 146 +- .../TestFramework/Mocks/MockRequestHeaders.cs | 14 +- .../Mocks/MockResponseHeaders.cs | 7 +- .../Mocks/ObservableTransport.cs | 28 +- .../Internal/ChangeTrackingStringListTests.cs | 161 + .../ClientLoggingOptionsTestsInternal.cs | 123 + .../Internal/ContentTypeUtilitiesTests.cs | 36 + .../PipelineMessageHeadersLogValueTests.cs | 48 + .../Logging/PipelineMessageLoggerTests.cs | 1075 +++ .../Logging/PipelineMessageSanitizerTests.cs | 54 + .../Logging/PipelineRetryLoggerTests.cs | 156 + .../Logging/PipelineTransportLoggerTests.cs | 221 + .../CHANGELOG.md | 20 +- ...urceManager.DataProtectionBackup.net8.0.cs | 25 +- ...ger.DataProtectionBackup.netstandard2.0.cs | 25 +- ...esourceManager.DataProtectionBackup.csproj | 4 +- .../ArmDataProtectionBackupModelFactory.cs | 176 - .../Models/DataProtectionIdentityDetails.cs | 11 +- .../ArmDataProtectionBackupModelFactory.cs | 177 + ...ProtectionIdentityDetails.Serialization.cs | 12 +- .../Models/DataProtectionIdentityDetails.cs | 9 +- .../src/autorest.md | 2 +- .../ArmDesktopVirtualizationModelFactory.cs | 140 - .../ArmDesktopVirtualizationModelFactory.cs | 132 + .../Azure.Developer.DevCenter/README.md | 8 +- .../CHANGELOG.md | 16 +- .../README.md | 4 +- ...e.ResourceManager.DeviceRegistry.net8.0.cs | 1091 ++- ...ceManager.DeviceRegistry.netstandard2.0.cs | 1091 ++- .../assets.json | 2 +- .../Sample_DeviceRegistryAssetCollection.cs | 362 +- ...eRegistryAssetEndpointProfileCollection.cs | 185 +- ...iceRegistryAssetEndpointProfileResource.cs | 53 +- .../Sample_DeviceRegistryAssetResource.cs | 31 +- ...eviceRegistryBillingContainerCollection.cs | 153 + ..._DeviceRegistryBillingContainerResource.cs | 47 + ...DeviceRegistryDiscoveredAssetCollection.cs | 242 + ...iscoveredAssetEndpointProfileCollection.cs | 204 + ...yDiscoveredAssetEndpointProfileResource.cs | 118 + ...e_DeviceRegistryDiscoveredAssetResource.cs | 117 + .../Sample_DeviceRegistrySchemaCollection.cs | 208 + ..._DeviceRegistrySchemaRegistryCollection.cs | 203 + ...le_DeviceRegistrySchemaRegistryResource.cs | 115 + .../Sample_DeviceRegistrySchemaResource.cs | 121 + ...e_DeviceRegistrySchemaVersionCollection.cs | 208 + ...ple_DeviceRegistrySchemaVersionResource.cs | 119 + .../Sample_SubscriptionResourceExtensions.cs | 109 +- ...zure.ResourceManager.DeviceRegistry.csproj | 2 +- .../src/Custom/Data/OperationStatusResult.cs | 15 + .../Extensions/DeviceRegistryExtensions.cs | 22 + ...kableDeviceRegistrySubscriptionResource.cs | 22 + .../ArmDeviceRegistryModelFactory.cs | 421 +- .../DeviceRegistryAssetCollection.cs | 40 +- .../DeviceRegistryAssetData.Serialization.cs | 397 +- .../src/Generated/DeviceRegistryAssetData.cs | 130 +- ...eRegistryAssetEndpointProfileCollection.cs | 40 +- ...yAssetEndpointProfileData.Serialization.cs | 119 +- .../DeviceRegistryAssetEndpointProfileData.cs | 37 +- ...iceRegistryAssetEndpointProfileResource.cs | 48 +- .../Generated/DeviceRegistryAssetResource.cs | 48 +- ...eviceRegistryBillingContainerCollection.cs | 396 + ...istryBillingContainerData.Serialization.cs | 171 + .../DeviceRegistryBillingContainerData.cs | 85 + ...yBillingContainerResource.Serialization.cs | 26 + .../DeviceRegistryBillingContainerResource.cs | 170 + ...DeviceRegistryDiscoveredAssetCollection.cs | 494 ++ ...gistryDiscoveredAssetData.Serialization.cs | 187 + .../DeviceRegistryDiscoveredAssetData.cs | 92 + ...iscoveredAssetEndpointProfileCollection.cs | 494 ++ ...dAssetEndpointProfileData.Serialization.cs | 187 + ...istryDiscoveredAssetEndpointProfileData.cs | 92 + ...etEndpointProfileResource.Serialization.cs | 26 + ...yDiscoveredAssetEndpointProfileResource.cs | 707 ++ ...ryDiscoveredAssetResource.Serialization.cs | 26 + .../DeviceRegistryDiscoveredAssetResource.cs | 707 ++ .../DeviceRegistrySchemaCollection.cs | 497 ++ .../DeviceRegistrySchemaData.Serialization.cs | 155 + .../src/Generated/DeviceRegistrySchemaData.cs | 75 + .../DeviceRegistrySchemaRegistryCollection.cs | 494 ++ ...egistrySchemaRegistryData.Serialization.cs | 194 + .../DeviceRegistrySchemaRegistryData.cs | 87 + ...trySchemaRegistryResource.Serialization.cs | 26 + .../DeviceRegistrySchemaRegistryResource.cs | 776 ++ ...iceRegistrySchemaResource.Serialization.cs | 26 + .../Generated/DeviceRegistrySchemaResource.cs | 424 ++ .../DeviceRegistrySchemaVersionCollection.cs | 497 ++ ...RegistrySchemaVersionData.Serialization.cs | 155 + .../DeviceRegistrySchemaVersionData.cs | 75 + ...strySchemaVersionResource.Serialization.cs | 26 + .../DeviceRegistrySchemaVersionResource.cs | 356 + .../Extensions/DeviceRegistryExtensions.cs | 916 ++- .../MockableDeviceRegistryArmClient.cs | 84 +- ...ableDeviceRegistryResourceGroupResource.cs | 263 +- ...kableDeviceRegistrySubscriptionResource.cs | 319 +- ...eredAssetEndpointProfileOperationSource.cs | 38 + ...eRegistryDiscoveredAssetOperationSource.cs | 38 + ...ceRegistrySchemaRegistryOperationSource.cs | 38 + ...EndpointProfileListResult.Serialization.cs | 2 +- ...setEndpointProfileStatus.Serialization.cs} | 61 +- ...tatus.cs => AssetEndpointProfileStatus.cs} | 20 +- ...ndpointProfileStatusError.Serialization.cs | 234 + .../Models/AssetEndpointProfileStatusError.cs | 69 + ...ntProfileUpdateProperties.Serialization.cs | 170 + .../AssetEndpointProfileUpdateProperties.cs | 77 + .../Models/AssetListResult.Serialization.cs | 2 +- .../Models/AssetProperties.Serialization.cs | 508 ++ .../src/Generated/Models/AssetProperties.cs | 200 + .../AssetUpdateProperties.Serialization.cs | 401 + .../Generated/Models/AssetUpdateProperties.cs | 161 + .../Generated/Models/AuthenticationMethod.cs | 54 + ...illingContainerListResult.Serialization.cs | 151 + .../Models/BillingContainerListResult.cs | 80 + ...illingContainerProperties.Serialization.cs | 133 + ...pdate.cs => BillingContainerProperties.cs} | 20 +- .../Models/DataPointObservabilityMode.cs | 60 + .../Models/DataPointsObservabilityMode.cs | 60 - ...AssetEndpointProfilePatch.Serialization.cs | 74 +- ...DeviceRegistryAssetEndpointProfilePatch.cs | 33 +- ...EndpointProfileProperties.Serialization.cs | 221 + ...eRegistryAssetEndpointProfileProperties.cs | 112 + .../DeviceRegistryAssetPatch.Serialization.cs | 292 +- .../Models/DeviceRegistryAssetPatch.cs | 106 +- ...DeviceRegistryAssetStatus.Serialization.cs | 208 + .../Models/DeviceRegistryAssetStatus.cs | 80 + ...egistryAssetStatusDataset.Serialization.cs | 144 + .../DeviceRegistryAssetStatusDataset.cs | 76 + ...RegistryAssetStatusError.Serialization.cs} | 42 +- ...r.cs => DeviceRegistryAssetStatusError.cs} | 10 +- ...eRegistryAssetStatusEvent.Serialization.cs | 144 + .../Models/DeviceRegistryAssetStatusEvent.cs | 76 + ...ceRegistryAuthentication.Serialization.cs} | 56 +- ...ion.cs => DeviceRegistryAuthentication.cs} | 38 +- .../DeviceRegistryDataPoint.Serialization.cs | 137 + .../Models/DeviceRegistryDataPoint.cs | 45 + ...iceRegistryDataPointBase.Serialization.cs} | 69 +- .../Models/DeviceRegistryDataPointBase.cs | 86 + .../DeviceRegistryDataset.Serialization.cs | 177 + .../Generated/Models/DeviceRegistryDataset.cs | 88 + ...AssetEndpointProfilePatch.Serialization.cs | 159 + ...tryDiscoveredAssetEndpointProfilePatch.cs} | 26 +- ...istryDiscoveredAssetPatch.Serialization.cs | 159 + .../DeviceRegistryDiscoveredAssetPatch.cs | 70 + ...DiscoveredAssetProperties.Serialization.cs | 358 + ...DeviceRegistryDiscoveredAssetProperties.cs | 146 + .../DeviceRegistryEvent.Serialization.cs | 153 + .../Generated/Models/DeviceRegistryEvent.cs | 46 + .../DeviceRegistryEventBase.Serialization.cs | 160 + .../Models/DeviceRegistryEventBase.cs | 90 + .../Models/DeviceRegistryProvisioningState.cs | 3 + .../Models/DeviceRegistrySchemaFormat.cs | 51 + ...eRegistrySchemaProperties.Serialization.cs | 216 + .../Models/DeviceRegistrySchemaProperties.cs | 99 + ...gistrySchemaRegistryPatch.Serialization.cs | 175 + .../DeviceRegistrySchemaRegistryPatch.cs | 75 + ...ySchemaRegistryProperties.Serialization.cs | 189 + .../DeviceRegistrySchemaRegistryProperties.cs | 98 + .../Models/DeviceRegistrySchemaType.cs | 48 + ...rySchemaVersionProperties.Serialization.cs | 180 + .../DeviceRegistrySchemaVersionProperties.cs | 91 + .../DeviceRegistryTopic.Serialization.cs | 141 + .../Generated/Models/DeviceRegistryTopic.cs | 79 + .../Models/DeviceRegistryTopicRetainType.cs | 51 + ...ernamePasswordCredentials.Serialization.cs | 134 + ...iceRegistryUsernamePasswordCredentials.cs} | 44 +- ...ceRegistryX509Credentials.Serialization.cs | 126 + .../Models/DeviceRegistryX509Credentials.cs | 75 + ...EndpointProfileListResult.Serialization.cs | 151 + ...iscoveredAssetEndpointProfileListResult.cs | 80 + ...EndpointProfileProperties.Serialization.cs | 209 + ...iscoveredAssetEndpointProfileProperties.cs | 108 + ...ntProfileUpdateProperties.Serialization.cs | 213 + ...redAssetEndpointProfileUpdateProperties.cs | 86 + ...DiscoveredAssetListResult.Serialization.cs | 151 + ...ficate.cs => DiscoveredAssetListResult.cs} | 43 +- ...eredAssetUpdateProperties.Serialization.cs | 343 + .../Models/DiscoveredAssetUpdateProperties.cs | 123 + ...s => DiscoveredDataPoint.Serialization.cs} | 82 +- .../{DataPoint.cs => DiscoveredDataPoint.cs} | 35 +- .../Models/DiscoveredDataset.Serialization.cs | 177 + .../src/Generated/Models/DiscoveredDataset.cs | 88 + ...on.cs => DiscoveredEvent.Serialization.cs} | 87 +- .../{AssetEvent.cs => DiscoveredEvent.cs} | 39 +- .../Models/EventObservabilityMode.cs | 51 + .../Models/EventsObservabilityMode.cs | 51 - .../MessageSchemaReference.Serialization.cs | 151 + .../Models/MessageSchemaReference.cs | 84 + .../Models/SchemaListResult.Serialization.cs | 151 + .../src/Generated/Models/SchemaListResult.cs | 80 + .../SchemaRegistryListResult.Serialization.cs | 151 + .../Models/SchemaRegistryListResult.cs | 80 + ...aRegistryUpdateProperties.Serialization.cs | 140 + ...e.cs => SchemaRegistryUpdateProperties.cs} | 28 +- ... SchemaVersionListResult.Serialization.cs} | 67 +- .../Models/SchemaVersionListResult.cs | 80 + .../Models/TransportAuthentication.cs | 76 - .../Models/UserAuthenticationMode.cs | 54 - .../Models/UserAuthenticationUpdate.cs | 84 - .../AssetEndpointProfilesRestOperations.cs | 386 +- .../RestOperations/AssetsRestOperations.cs | 386 +- .../BillingContainersRestOperations.cs | 281 + ...eredAssetEndpointProfilesRestOperations.cs | 723 ++ .../DiscoveredAssetsRestOperations.cs | 723 ++ .../SchemaRegistriesRestOperations.cs | 723 ++ .../SchemaVersionsRestOperations.cs | 559 ++ .../RestOperations/SchemasRestOperations.cs | 523 ++ .../src/Properties/AssemblyInfo.cs | 2 +- .../src/{autorest.md => autorest.md.bak} | 13 +- .../tests/DeviceRegistryManagementTestBase.cs | 2 +- ...stryAssetEndpointProfilesOperationsTest.cs | 88 +- .../DeviceRegistryAssetsOperationsTest.cs | 81 +- ...RegistryBillingContainersOperationsTest.cs | 45 + ...eredAssetEndpointProfilesOperationsTest.cs | 115 + ...eRegistryDiscoveredAssetsOperationsTest.cs | 109 + ...eRegistrySchemaRegistriesOperationsTest.cs | 236 + .../tsp-location.yaml | 3 + .../Azure.AI.DocumentIntelligence/README.md | 4 - .../Azure.Analytics.Defender.Easm/README.md | 4 +- ...sticVersionListProperties.Serialization.cs | 129 + ...ernalUserCreationResponse.Serialization.cs | 133 + ...foMarketplaceSubscription.Serialization.cs | 151 + ...IntegrationStatusResponse.Serialization.cs | 133 + ...nStatusResponseProperties.Serialization.cs | 129 + .../MonitoredSubscriptionPropertyResource.cs | 347 + .../MonitoredSubscriptionsRestOperations.cs | 613 ++ .../README.md | 16 +- .../README.md | 2 - .../README.md | 2 - .../Azure.Messaging.EventGrid/CHANGELOG.md | 10 + .../Azure.Messaging.EventGrid/README.md | 2 - .../src/Azure.Messaging.EventGrid.csproj | 4 +- .../README.md | 2 - .../README.md | 2 - .../CHANGELOG.md | 35 +- .../README.md | 18 +- .../perf/README.md | 6 +- .../samples/README.md | 46 +- ...Azure.Messaging.EventHubs.Processor.csproj | 7 +- .../README.md | 6 +- .../BlobCheckpointStoreInternal.cs | 4 +- .../BlobsCheckpointStoreInternalTests.cs | 4 +- .../Azure.Messaging.EventHubs/CHANGELOG.md | 37 +- .../Azure.Messaging.EventHubs/README.md | 2 - .../api/Azure.Messaging.EventHubs.net8.0.cs | 1 + ...zure.Messaging.EventHubs.netstandard2.0.cs | 1 + .../Azure.Messaging.EventHubs/perf/README.md | 6 +- .../samples/README.md | 2 - .../src/Amqp/AmqpConnectionScope.cs | 3 + .../src/Amqp/AmqpError.cs | 13 + .../src/Azure.Messaging.EventHubs.csproj | 2 +- .../src/Diagnostics/EventHubsEventSource.cs | 21 + .../src/Primitives/EventProcessor.cs | 92 +- .../src/Processor/CheckpointPosition.cs | 13 +- .../EventHubBufferedProducerClient.cs | 83 +- .../stress/README.md | 6 +- .../tests/Amqp/AmqpErrorTests.cs | 1 + .../EventHubConsumerClientLiveTests.cs | 239 +- ...EventProcessorTests.PartitionProcessing.cs | 301 +- .../Primitives/PartitionReceiverLiveTests.cs | 160 +- ...EventHubBufferedProducerClientLiveTests.cs | 30 - .../EventHubBufferedProducerClientTests.cs | 6 +- .../EventHubProducerClientLiveTests.cs | 65 - .../Microsoft.Azure.EventHubs/README.md | 40 +- .../README.md | 2 - ....Azure.WebJobs.Extensions.EventHubs.csproj | 5 +- .../CHANGELOG.md | 8 +- .../README.md | 2 - ...ns.AspNetCore.Configuration.Secrets.csproj | 4 +- .../CHANGELOG.md | 8 +- .../README.md | 2 - ...ons.AspNetCore.DataProtection.Blobs.csproj | 4 +- .../CHANGELOG.md | 8 +- .../README.md | 2 - ...ions.AspNetCore.DataProtection.Keys.csproj | 4 +- .../Microsoft.Extensions.Azure/CHANGELOG.md | 7 +- .../src/Microsoft.Extensions.Azure.csproj | 4 +- sdk/extensions/README.md | 2 - .../Azure.AI.FormRecognizer/README.md | 3 - .../Azure.AI.FormRecognizer.Perf/README.md | 6 +- .../ArmHealthcareApisModelFactory.cs | 20 - .../ArmHealthcareApisModelFactory.cs | 22 + .../Azure.Health.Deidentification/README.md | 2 - sdk/identity/Azure.Identity.Broker/README.md | 2 - sdk/identity/Azure.Identity/CHANGELOG.md | 14 +- sdk/identity/Azure.Identity/README.md | 2 - .../Integration.Identity.Common.csproj | 2 +- .../Integration.Identity.Container.csproj | 2 +- .../Integration.Identity.Func/Function1.cs | 1 + .../Integration.Identity.Func.csproj | 2 +- .../WebApp/Controllers/TestController.cs | 1 - .../WebApp/Integration.Identity.WebApp.csproj | 3 - .../Azure.Identity/src/Azure.Identity.csproj | 2 +- .../AuthorizationCodeCredential.cs | 6 +- .../Credentials/AzureApplicationCredential.cs | 6 +- .../Credentials/AzurePowerShellCredential.cs | 4 +- .../src/Credentials/ChainedTokenCredential.cs | 8 +- .../ClientCertificateCredential.cs | 6 +- .../src/Credentials/ClientSecretCredential.cs | 6 +- .../src/Credentials/DefaultAzureCredential.cs | 4 +- .../src/Credentials/DeviceCodeCredential.cs | 8 +- .../src/Credentials/EnvironmentCredential.cs | 4 +- .../InteractiveBrowserCredential.cs | 8 +- .../Credentials/ManagedIdentityCredential.cs | 8 +- .../src/Credentials/OnBehalfOfCredential.cs | 4 +- .../Credentials/SharedTokenCacheCredential.cs | 8 +- .../Credentials/UsernamePasswordCredential.cs | 6 +- .../src/ManagedIdentitySource.cs | 5 +- .../tests/CredentialTestHelpers.cs | 2 +- .../tests/ManagedIdentityCredentialTests.cs | 11 +- .../tests/MultiTenantLiveTests.cs | 1 + sdk/identity/test-resources-post.ps1 | 2 +- .../Azure.ResourceManager.IotOperations.sln | 36 + .../CHANGELOG.md | 29 + .../Directory.Build.props | 6 + .../README.md | 65 + ...re.ResourceManager.IotOperations.net8.0.cs | 2057 +++++ ...rceManager.IotOperations.netstandard2.0.cs | 2057 +++++ .../assets.json | 6 + ...sourceManager.IotOperations.Samples.csproj | 13 + ...perationsBrokerAuthenticationCollection.cs | 301 + ...tOperationsBrokerAuthenticationResource.cs | 209 + .../Sample_IotOperationsBrokerCollection.cs | 473 ++ ...e_IotOperationsBrokerListenerCollection.cs | 344 + ...ple_IotOperationsBrokerListenerResource.cs | 249 + .../Sample_IotOperationsBrokerResource.cs | 377 + .../Sample_IotOperationsDataflowCollection.cs | 580 ++ ...IotOperationsDataflowEndpointCollection.cs | 756 ++ ...e_IotOperationsDataflowEndpointResource.cs | 642 ++ ..._IotOperationsDataflowProfileCollection.cs | 292 + ...le_IotOperationsDataflowProfileResource.cs | 199 + .../Sample_IotOperationsDataflowResource.cs | 476 ++ .../Sample_IotOperationsInstanceCollection.cs | 205 + .../Sample_IotOperationsInstanceResource.cs | 114 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...Azure.ResourceManager.IotOperations.csproj | 12 + .../Models/BrokerAuthenticatorCustomAuth.cs | 24 + .../Generated/ArmIotOperationsModelFactory.cs | 299 + .../Extensions/IotOperationsExtensions.cs | 352 + .../MockableIotOperationsArmClient.cs | 133 + ...kableIotOperationsResourceGroupResource.cs | 105 + ...ckableIotOperationsSubscriptionResource.cs | 102 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...perationsBrokerAuthenticationCollection.cs | 493 ++ ...sBrokerAuthenticationData.Serialization.cs | 164 + .../IotOperationsBrokerAuthenticationData.cs | 89 + ...kerAuthenticationResource.Serialization.cs | 26 + ...tOperationsBrokerAuthenticationResource.cs | 348 + ...OperationsBrokerAuthorizationCollection.cs | 493 ++ ...nsBrokerAuthorizationData.Serialization.cs | 164 + .../IotOperationsBrokerAuthorizationData.cs | 89 + ...okerAuthorizationResource.Serialization.cs | 26 + ...otOperationsBrokerAuthorizationResource.cs | 348 + .../IotOperationsBrokerCollection.cs | 493 ++ .../IotOperationsBrokerData.Serialization.cs | 164 + .../src/Generated/IotOperationsBrokerData.cs | 89 + .../IotOperationsBrokerListenerCollection.cs | 493 ++ ...rationsBrokerListenerData.Serialization.cs | 164 + .../IotOperationsBrokerListenerData.cs | 89 + ...onsBrokerListenerResource.Serialization.cs | 26 + .../IotOperationsBrokerListenerResource.cs | 348 + ...tOperationsBrokerResource.Serialization.cs | 26 + .../Generated/IotOperationsBrokerResource.cs | 554 ++ .../IotOperationsDataflowCollection.cs | 493 ++ ...IotOperationsDataflowData.Serialization.cs | 164 + .../Generated/IotOperationsDataflowData.cs | 89 + ...IotOperationsDataflowEndpointCollection.cs | 493 ++ ...tionsDataflowEndpointData.Serialization.cs | 164 + .../IotOperationsDataflowEndpointData.cs | 89 + ...sDataflowEndpointResource.Serialization.cs | 26 + .../IotOperationsDataflowEndpointResource.cs | 347 + .../IotOperationsDataflowProfileCollection.cs | 493 ++ ...ationsDataflowProfileData.Serialization.cs | 164 + .../IotOperationsDataflowProfileData.cs | 89 + ...nsDataflowProfileResource.Serialization.cs | 26 + .../IotOperationsDataflowProfileResource.cs | 416 ++ ...perationsDataflowResource.Serialization.cs | 26 + .../IotOperationsDataflowResource.cs | 348 + .../IotOperationsInstanceCollection.cs | 494 ++ ...IotOperationsInstanceData.Serialization.cs | 205 + .../Generated/IotOperationsInstanceData.cs | 96 + ...perationsInstanceResource.Serialization.cs | 26 + .../IotOperationsInstanceResource.cs | 906 +++ .../IotOperationsArmOperation.cs | 94 + .../IotOperationsArmOperationOfT.cs | 100 + ...ionsBrokerAuthenticationOperationSource.cs | 38 + ...tionsBrokerAuthorizationOperationSource.cs | 38 + ...OperationsBrokerListenerOperationSource.cs | 38 + .../IotOperationsBrokerOperationSource.cs | 38 + ...erationsDataflowEndpointOperationSource.cs | 38 + .../IotOperationsDataflowOperationSource.cs | 38 + ...perationsDataflowProfileOperationSource.cs | 38 + .../IotOperationsInstanceOperationSource.cs | 38 + .../Models/BlockerListenerServiceType.cs | 54 + .../BrokerAdvancedSettings.Serialization.cs | 163 + .../Models/BrokerAdvancedSettings.cs | 73 + .../Models/BrokerAuthenticationMethod.cs | 54 + ...icationResourceListResult.Serialization.cs | 151 + .../BrokerAuthenticationResourceListResult.cs | 80 + ...erAuthenticatorCustomAuth.Serialization.cs | 126 + .../Models/BrokerAuthenticatorCustomAuth.cs | 81 + ...AuthenticatorMethodCustom.Serialization.cs | 178 + .../Models/BrokerAuthenticatorMethodCustom.cs | 95 + ...kerAuthenticatorMethodSat.Serialization.cs | 136 + .../Models/BrokerAuthenticatorMethodSat.cs | 76 + ...erAuthenticatorMethodX509.Serialization.cs | 155 + .../Models/BrokerAuthenticatorMethodX509.cs | 70 + ...catorMethodX509Attributes.Serialization.cs | 145 + ...BrokerAuthenticatorMethodX509Attributes.cs | 82 + ...rokerAuthenticatorMethods.Serialization.cs | 171 + .../Models/BrokerAuthenticatorMethods.cs | 91 + ...BrokerAuthorizationConfig.Serialization.cs | 158 + .../Models/BrokerAuthorizationConfig.cs | 70 + ...izationResourceListResult.Serialization.cs | 151 + .../BrokerAuthorizationResourceListResult.cs | 80 + .../BrokerAuthorizationRule.Serialization.cs | 169 + .../Models/BrokerAuthorizationRule.cs | 88 + .../BrokerBackendChain.Serialization.cs | 149 + .../Generated/Models/BrokerBackendChain.cs | 82 + .../Models/BrokerCardinality.Serialization.cs | 134 + .../src/Generated/Models/BrokerCardinality.cs | 82 + .../BrokerClientConfig.Serialization.cs | 215 + .../Generated/Models/BrokerClientConfig.cs | 85 + ...rokerDiagnosticSelfCheck.Serialization.cs} | 68 +- .../Models/BrokerDiagnosticSelfCheck.cs | 73 + .../BrokerDiagnosticTraces.Serialization.cs | 178 + .../Models/BrokerDiagnosticTraces.cs | 77 + .../Models/BrokerDiagnostics.Serialization.cs | 178 + .../src/Generated/Models/BrokerDiagnostics.cs | 101 + .../Models/BrokerFrontend.Serialization.cs} | 80 +- .../src/Generated/Models/BrokerFrontend.cs | 76 + .../BrokerListenerPort.Serialization.cs | 200 + .../Generated/Models/BrokerListenerPort.cs | 92 + ...istenerResourceListResult.Serialization.cs | 151 + .../BrokerListenerResourceListResult.cs | 80 + .../Generated/Models/BrokerMemoryProfile.cs | 57 + .../Generated/Models/BrokerOperatorValue.cs | 57 + .../Generated/Models/BrokerProtocolType.cs | 51 + .../Models/BrokerResourceDefinitionMethod.cs | 54 + .../BrokerResourceListResult.Serialization.cs | 151 + .../Models/BrokerResourceListResult.cs | 80 + .../BrokerResourceRule.Serialization.cs | 176 + .../Generated/Models/BrokerResourceRule.cs | 82 + .../CertManagerCertConfig.Serialization.cs | 142 + .../Generated/Models/CertManagerCertConfig.cs | 89 + ...ertManagerCertificateSpec.Serialization.cs | 196 + .../Models/CertManagerCertificateSpec.cs | 95 + .../Generated/Models/CertManagerIssuerKind.cs | 51 + .../CertManagerIssuerRef.Serialization.cs | 142 + .../Generated/Models/CertManagerIssuerRef.cs | 88 + .../CertManagerPrivateKey.Serialization.cs | 134 + .../Generated/Models/CertManagerPrivateKey.cs | 78 + .../Models/CloudEventAttributeType.cs | 51 + .../Models/DataExplorerAuthMethod.cs | 51 + .../Models/DataLakeStorageAuthMethod.cs | 54 + ...ltInTransformationDataset.Serialization.cs | 183 + .../DataflowBuiltInTransformationDataset.cs | 95 + ...iltInTransformationFilter.Serialization.cs | 170 + .../DataflowBuiltInTransformationFilter.cs | 91 + ...wBuiltInTransformationMap.Serialization.cs | 187 + .../DataflowBuiltInTransformationMap.cs | 95 + ...tInTransformationSettings.Serialization.cs | 225 + .../DataflowBuiltInTransformationSettings.cs | 84 + ...tinationOperationSettings.Serialization.cs | 134 + .../DataflowDestinationOperationSettings.cs | 82 + ...AuthenticationAccessToken.Serialization.cs | 187 + ...taflowEndpointAuthenticationAccessToken.cs | 75 + ...ndpointAuthenticationSasl.Serialization.cs | 134 + .../DataflowEndpointAuthenticationSasl.cs | 81 + .../DataflowEndpointAuthenticationSaslType.cs | 54 + ...cationServiceAccountToken.Serialization.cs | 126 + ...dpointAuthenticationServiceAccountToken.cs | 75 + ...emAssignedManagedIdentity.Serialization.cs | 129 + ...enticationSystemAssignedManagedIdentity.cs | 65 + ...erAssignedManagedIdentity.Serialization.cs | 145 + ...thenticationUserAssignedManagedIdentity.cs | 86 + ...ndpointAuthenticationX509.Serialization.cs | 126 + .../DataflowEndpointAuthenticationX509.cs | 75 + ...aflowEndpointDataExplorer.Serialization.cs | 157 + .../Models/DataflowEndpointDataExplorer.cs | 93 + ...ataExplorerAuthentication.Serialization.cs | 156 + ...aflowEndpointDataExplorerAuthentication.cs | 92 + ...owEndpointDataLakeStorage.Serialization.cs | 149 + .../Models/DataflowEndpointDataLakeStorage.cs | 86 + ...LakeStorageAuthentication.Serialization.cs | 171 + ...owEndpointDataLakeStorageAuthentication.cs | 103 + ...flowEndpointFabricOneLake.Serialization.cs | 171 + .../Models/DataflowEndpointFabricOneLake.cs | 99 + ...bricOneLakeAuthentication.Serialization.cs | 156 + ...flowEndpointFabricOneLakeAuthentication.cs | 92 + ...ndpointFabricOneLakeNames.Serialization.cs | 134 + .../DataflowEndpointFabricOneLakeNames.cs | 82 + .../Models/DataflowEndpointFabricPathType.cs | 51 + .../DataflowEndpointKafka.Serialization.cs | 261 + .../Generated/Models/DataflowEndpointKafka.cs | 114 + .../Models/DataflowEndpointKafkaAck.cs | 54 + ...dpointKafkaAuthentication.Serialization.cs | 192 + .../DataflowEndpointKafkaAuthentication.cs | 106 + ...flowEndpointKafkaBatching.Serialization.cs | 178 + .../Models/DataflowEndpointKafkaBatching.cs | 77 + .../DataflowEndpointKafkaCompression.cs | 57 + .../DataflowEndpointKafkaPartitionStrategy.cs | 57 + ...aflowEndpointLocalStorage.Serialization.cs | 203 + .../Models/DataflowEndpointLocalStorage.cs | 75 + .../DataflowEndpointMqtt.Serialization.cs | 280 + .../Generated/Models/DataflowEndpointMqtt.cs | 115 + ...ndpointMqttAuthentication.Serialization.cs | 192 + .../DataflowEndpointMqttAuthentication.cs | 113 + ...ndpointResourceListResult.Serialization.cs | 151 + .../DataflowEndpointResourceListResult.cs | 80 + .../Generated/Models/DataflowEndpointType.cs | 63 + .../Generated/Models/DataflowFilterType.cs | 48 + .../Generated/Models/DataflowMappingType.cs | 60 + ...taflowOperationProperties.Serialization.cs | 188 + .../Models/DataflowOperationProperties.cs | 88 + .../Generated/Models/DataflowOperationType.cs | 54 + ...ataflowProfileDiagnostics.Serialization.cs | 148 + .../Models/DataflowProfileDiagnostics.cs | 92 + ...rofileResourceListResult.Serialization.cs} | 75 +- .../DataflowProfileResourceListResult.cs | 80 + ...ataflowResourceListResult.Serialization.cs | 151 + .../Models/DataflowResourceListResult.cs | 80 + ...owSourceOperationSettings.Serialization.cs | 187 + .../Models/DataflowSourceOperationSettings.cs | 95 + .../DataflowSourceSerializationFormat.cs | 48 + .../DiagnosticSelfTracing.Serialization.cs | 148 + .../Generated/Models/DiagnosticSelfTracing.cs | 69 + .../Models/DiagnosticsLogs.Serialization.cs} | 53 +- .../src/Generated/Models/DiagnosticsLogs.cs | 65 + .../DiskBackedMessageBuffer.Serialization.cs | 156 + .../Models/DiskBackedMessageBuffer.cs | 83 + .../Models/FabricOneLakeAuthMethod.cs | 51 + .../GenerateResourceLimits.Serialization.cs | 133 + .../Models/GenerateResourceLimits.cs | 65 + ...nstanceResourceListResult.Serialization.cs | 151 + .../Models/InstanceResourceListResult.cs | 80 + ...tOperationsBatchingConfig.Serialization.cs | 148 + .../Models/IotOperationsBatchingConfig.cs | 69 + ...rAuthenticationProperties.Serialization.cs | 151 + ...perationsBrokerAuthenticationProperties.cs | 80 + ...erAuthorizationProperties.Serialization.cs | 246 + ...OperationsBrokerAuthorizationProperties.cs | 79 + ...sBrokerListenerProperties.Serialization.cs | 177 + .../IotOperationsBrokerListenerProperties.cs | 88 + ...perationsBrokerProperties.Serialization.cs | 231 + .../Models/IotOperationsBrokerProperties.cs | 101 + ...ataflowEndpointProperties.Serialization.cs | 240 + ...IotOperationsDataflowEndpointProperties.cs | 107 + ...DataflowProfileProperties.Serialization.cs | 163 + .../IotOperationsDataflowProfileProperties.cs | 73 + ...rationsDataflowProperties.Serialization.cs | 166 + .../Models/IotOperationsDataflowProperties.cs | 84 + ...perationsExtendedLocation.Serialization.cs | 134 + .../Models/IotOperationsExtendedLocation.cs | 81 + .../IotOperationsExtendedLocationType.cs | 48 + ...otOperationsInstancePatch.Serialization.cs | 162 + .../Models/IotOperationsInstancePatch.cs | 71 + ...rationsInstanceProperties.Serialization.cs | 163 + .../Models/IotOperationsInstanceProperties.cs | 94 + .../IotOperationsMetrics.Serialization.cs | 133 + .../Generated/Models/IotOperationsMetrics.cs | 65 + .../Models/IotOperationsOperationalMode.cs | 51 + .../Models/IotOperationsProvisioningState.cs | 66 + ...otOperationsTlsProperties.Serialization.cs | 144 + .../Models/IotOperationsTlsProperties.cs | 69 + .../src/Generated/Models/KafkaAuthMethod.cs | 60 + .../KubernetesReference.Serialization.cs | 156 + .../Generated/Models/KubernetesReference.cs | 90 + ...ListenerPortTlsCertMethod.Serialization.cs | 156 + .../Models/ListenerPortTlsCertMethod.cs | 86 + .../LocalKubernetesReference.Serialization.cs | 145 + .../Models/LocalKubernetesReference.cs | 86 + .../src/Generated/Models/MqttAuthMethod.cs | 60 + .../src/Generated/Models/MqttRetainType.cs | 51 + .../Models/PrincipalConfig.Serialization.cs | 216 + .../src/Generated/Models/PrincipalConfig.cs | 76 + .../Generated/Models/PrivateKeyAlgorithm.cs | 66 + .../Models/PrivateKeyRotationPolicy.cs | 51 + .../Models/SanForCert.Serialization.cs | 154 + .../src/Generated/Models/SanForCert.cs | 83 + .../Models/SchemaRegistryRef.Serialization.cs | 126 + .../src/Generated/Models/SchemaRegistryRef.cs | 76 + .../StateStoreResourceDefinitionMethod.cs | 54 + .../Models/StateStoreResourceKeyType.cs | 54 + .../StateStoreResourceRule.Serialization.cs | 152 + .../Models/StateStoreResourceRule.cs | 88 + .../Models/SubscriberMessageDropStrategy.cs | 51 + .../SubscriberQueueLimit.Serialization.cs | 148 + .../Generated/Models/SubscriberQueueLimit.cs | 69 + .../src/Generated/Models/TlsCertMethodMode.cs | 51 + .../TransformationSerializationFormat.cs | 54 + ...ClaimResourceRequirements.Serialization.cs | 170 + .../Models/VolumeClaimResourceRequirements.cs | 71 + .../Models/VolumeClaimSpec.Serialization.cs | 245 + .../src/Generated/Models/VolumeClaimSpec.cs | 94 + .../VolumeClaimSpecSelector.Serialization.cs | 169 + .../Models/VolumeClaimSpecSelector.cs | 71 + ...cSelectorMatchExpressions.Serialization.cs | 159 + ...VolumeClaimSpecSelectorMatchExpressions.cs | 86 + .../X509ManualCertificate.Serialization.cs} | 53 +- .../Models/X509ManualCertificate.cs} | 34 +- .../src/Generated/ProviderConstants.cs | 16 + .../BrokerAuthenticationRestOperations.cs | 549 ++ .../BrokerAuthorizationRestOperations.cs | 549 ++ .../BrokerListenerRestOperations.cs | 549 ++ .../RestOperations/BrokerRestOperations.cs | 513 ++ .../DataflowEndpointRestOperations.cs | 513 ++ .../DataflowProfileRestOperations.cs | 513 ++ .../RestOperations/DataflowRestOperations.cs | 549 ++ .../RestOperations/InstanceRestOperations.cs | 731 ++ .../src/Properties/AssemblyInfo.cs | 11 + ...ResourceManager.IotOperations.Tests.csproj | 12 + .../IotOperationsManagementClientBase.cs | 146 + .../IotOperationsManagementTestEnvironment.cs | 9 + .../tests/Tests/BrokerAuthenticationsTests.cs | 77 + .../tests/Tests/BrokerAuthorizationsTests.cs | 106 + .../tests/Tests/BrokerListenersTests.cs | 107 + .../tests/Tests/BrokersTests.cs | 45 + .../tests/Tests/DataflowEndpointsTests.cs | 76 + .../tests/Tests/DataflowProfilesTests.cs | 75 + .../tests/Tests/DataflowsTests.cs | 92 + .../tests/Tests/InstancesTests.cs | 88 + .../tsp-location.yaml | 3 + sdk/iotoperations/ci.mgmt.yml | 24 + .../README.md | 2 - .../README.md | 2 - .../Azure.Security.KeyVault.Keys/README.md | 6 +- .../samples/Sample4_EncryptDecrypt.md | 4 +- .../src/Cryptography/EncryptionAlgorithm.cs | 14 + .../tests/samples/Sample4_EncryptDecrypt.cs | 4 +- .../samples/Sample4_EncryptDecryptAsync.cs | 4 +- .../tests/samples/SampleSnippets.cs | 4 +- .../Azure.Security.KeyVault.Secrets/README.md | 2 - .../Azure.ResourceManager.Kusto/CHANGELOG.md | 10 + .../src/Azure.ResourceManager.Kusto.csproj | 4 +- .../src/Customized/ArmKustoModelFactory.cs | 59 - .../src/Generated/ArmKustoModelFactory.cs | 41 + .../Azure.Developer.LoadTesting/CHANGELOG.md | 5 + .../ArmManagedNetworkFabricModelFactory.cs | 48 - .../ArmManagedNetworkFabricModelFactory.cs | 48 + sdk/maps/Azure.Maps.Common/README.md | 2 - sdk/maps/Azure.Maps.Geolocation/README.md | 2 - sdk/maps/Azure.Maps.Rendering/README.md | 2 - sdk/maps/Azure.Maps.Routing/README.md | 2 - sdk/maps/Azure.Maps.Search/README.md | 2 - sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md | 7 - sdk/maps/Azure.Maps.TimeZones/README.md | 2 - sdk/maps/Azure.Maps.Weather/README.md | 65 +- .../samples/MapsWeatherSamples.md | 61 +- .../tests/Samples/WeatherClientSamples.cs | 61 +- sdk/maps/README.md | 2 - .../Azure.AI.MetricsAdvisor/README.md | 2 - .../README.md | 7 +- .../README.md | 2 +- .../Custom/ArmMobileNetworkModelFactory.cs | 59 - .../Generated/ArmMobileNetworkModelFactory.cs | 65 + sdk/monitor/Azure.Monitor.Ingestion/README.md | 2 - sdk/monitor/Azure.Monitor.Query/README.md | 2 - .../Azure.ResourceManager.NetApp.net8.0.cs | 10 +- ...e.ResourceManager.NetApp.netstandard2.0.cs | 10 +- .../src/Custom/ArmNetAppModelFactory.cs | 391 - .../src/Generated/ArmNetAppModelFactory.cs | 297 + .../Azure.ResourceManager.Network.net8.0.cs | 2 + ....ResourceManager.Network.netstandard2.0.cs | 2 + .../Customization/ArmNetworkModelFactory.cs | 192 +- .../src/Generated/ArmNetworkModelFactory.cs | 204 + .../CHANGELOG.md | 10 + .../Azure.ResourceManager.NetworkCloud.csproj | 4 +- .../RestOperations/RackSkusRestOperations.cs | 2 +- .../RestOperations/RacksRestOperations.cs | 2 +- .../Azure.AI.OpenAI.Assistants/README.md | 2 - sdk/openai/Azure.AI.OpenAI/CHANGELOG.md | 15 + .../Azure.AI.OpenAI/Directory.Build.props | 6 +- sdk/openai/Azure.AI.OpenAI/README.md | 2 - .../api/Azure.AI.OpenAI.netstandard2.0.cs | 126 +- sdk/openai/Azure.AI.OpenAI/assets.json | 2 +- .../src/Azure.AI.OpenAI.csproj | 2 + .../AzureAssistantClient.Protocol.cs | 2 +- .../Custom/Assistants/AzureAssistantClient.cs | 2 +- .../src/Custom/Audio/AzureAudioClient.cs | 2 +- .../src/Custom/AzureOpenAIClient.cs | 3 + .../src/Custom/AzureOpenAIClientOptions.cs | 94 +- .../src/Custom/Batch/AzureBatchClient.cs | 2 +- .../src/Custom/Chat/AzureChatClient.cs | 25 +- .../src/Custom/Chat/AzureChatExtensions.cs | 37 +- .../src/Custom/Chat/UserSecurityContext.cs | 27 + .../Common/AdditionalPropertyHelpers.cs | 70 +- .../Custom/Common/Internal/GeneratorStubs.cs | 2 +- .../Common/RequestContentFilterResult.cs | 2 +- .../Common/ResponseContentFilterResult.cs | 2 +- .../Custom/Embeddings/AzureEmbeddingClient.cs | 2 +- .../src/Custom/Files/AzureFileClient.cs | 2 +- .../Files/AzureOpenAIFile.Serialization.cs | 4 +- .../src/Custom/Files/AzureOpenAIFile.cs | 6 +- ...AzureOpenAIFileCollection.Serialization.cs | 30 +- .../Custom/Files/AzureOpenAIFileCollection.cs | 18 +- .../src/Custom/Files/OpenAIFileExtensions.cs | 21 + .../FineTuning/AzureFineTuningClient.cs | 2 +- .../src/Custom/Images/AzureImageClient.cs | 2 +- .../src/Custom/Images/AzureImageExtensions.cs | 4 +- .../AzureRealtimeConversationClient.cs | 11 +- .../AzureVectorStoreClient.Protocol.cs | 16 +- .../VectorStores/AzureVectorStoreClient.cs | 2 +- .../AzureOpenAIChatError.Serialization.cs | 11 +- ...reOpenAIChatErrorResponse.Serialization.cs | 11 +- .../AzureOpenAIDalleError.Serialization.cs | 11 +- ...eOpenAIDalleErrorResponse.Serialization.cs | 11 +- ...AzureSearchChatDataSource.Serialization.cs | 36 +- .../Generated/ChatCitation.Serialization.cs | 11 +- .../Generated/ChatDataSource.Serialization.cs | 11 +- .../src/Generated/ChatDocumentFilterReason.cs | 2 +- .../ChatMessageContext.Serialization.cs | 11 +- .../ChatRetrievedDocument.Serialization.cs | 11 +- ...tentFilterBlocklistResult.Serialization.cs | 11 +- ...tentFilterDetectionResult.Serialization.cs | 11 +- ...tedMaterialCitationResult.Serialization.cs | 11 +- ...erProtectedMaterialResult.Serialization.cs | 11 +- .../src/Generated/ContentFilterSeverity.cs | 2 +- ...ntentFilterSeverityResult.Serialization.cs | 11 +- .../ContentFilterTextSpan.Serialization.cs | 11 +- ...ntentFilterTextSpanResult.Serialization.cs | 11 +- .../CosmosChatDataSource.Serialization.cs | 36 +- .../DataSourceAuthentication.Serialization.cs | 11 +- .../src/Generated/DataSourceAuthentication.cs | 4 +- .../DataSourceFieldMappings.Serialization.cs | 11 +- .../src/Generated/DataSourceQueryType.cs | 2 +- .../DataSourceVectorizer.Serialization.cs | 11 +- ...asticsearchChatDataSource.Serialization.cs | 36 +- .../Internal/ModelSerializationExtensions.cs | 2 +- ...okenAuthenticationOptions.Serialization.cs | 36 +- ...aSourceAccessTokenAuthenticationOptions.cs | 2 +- ...iKeyAuthenticationOptions.Serialization.cs | 36 +- ...atDataSourceApiKeyAuthenticationOptions.cs | 2 +- ...ringAuthenticationOptions.Serialization.cs | 36 +- ...ceConnectionStringAuthenticationOptions.cs | 2 +- ...ntNameVectorizationSource.Serialization.cs | 36 +- ...iKeyAuthenticationOptions.Serialization.cs | 36 +- ...ourceEncodedApiKeyAuthenticationOptions.cs | 2 +- ...dpointVectorizationSource.Serialization.cs | 36 +- ...gratedVectorizationSource.Serialization.cs | 36 +- ...eyIdAuthenticationOptions.Serialization.cs | 36 +- ...aSourceKeyAndKeyIdAuthenticationOptions.cs | 2 +- ...odelIdVectorizationSource.Serialization.cs | 36 +- ...hatDataSourceModelIdVectorizationSource.cs | 2 +- ...tityAuthenticationOptions.Serialization.cs | 36 +- ...nedManagedIdentityAuthenticationOptions.cs | 2 +- ...tityAuthenticationOptions.Serialization.cs | 36 +- ...nedManagedIdentityAuthenticationOptions.cs | 2 +- ...wordAuthenticationOptions.Serialization.cs | 36 +- ...sernameAndPasswordAuthenticationOptions.cs | 2 +- ...ntFilterBlocklistIdResult.Serialization.cs | 11 +- ...lterBlocklistResultDetail.Serialization.cs | 11 +- ...lterResultForChoiceError.Serialization.cs} | 51 +- ...AzureContentFilterResultForChoiceError.cs} | 16 +- ...romptContentFilterResults.Serialization.cs | 15 +- ...lterResultForPromptContentFilterResults.cs | 4 +- ...BChatDataSourceParameters.Serialization.cs | 11 +- ...OpenAIChatErrorInnerError.Serialization.cs | 11 +- ...ernalAzureOpenAIChatErrorInnerErrorCode.cs | 2 +- ...penAIDalleErrorInnerError.Serialization.cs | 11 +- ...rnalAzureOpenAIDalleErrorInnerErrorCode.cs | 2 +- ...hChatDataSourceParameters.Serialization.cs | 11 +- ...hChatDataSourceParametersIncludeContext.cs | 2 +- ...hChatDataSourceParameters.Serialization.cs | 11 +- ...BChatDataSourceParameters.Serialization.cs | 11 +- ...eChatDataSourceParameters.Serialization.cs | 11 +- ...nknownAzureChatDataSource.Serialization.cs | 36 +- ...urceAuthenticationOptions.Serialization.cs | 36 +- ...zureChatDataSourceAuthenticationOptions.cs | 2 +- ...SourceVectorizationSource.Serialization.cs | 36 +- .../MongoDBChatDataSource.Serialization.cs | 36 +- .../PineconeChatDataSource.Serialization.cs | 36 +- ...equestContentFilterResult.Serialization.cs | 11 +- ...tImageContentFilterResult.Serialization.cs | 51 +- ...sponseContentFilterResult.Serialization.cs | 19 +- .../Generated/ResponseContentFilterResult.cs | 4 +- ...eImageContentFilterResult.Serialization.cs | 11 +- .../UserSecurityContext.Serialization.cs | 176 + .../src/Generated/UserSecurityContext.cs | 60 + .../tests/Assets/audio_hello_world.mp3 | Bin 0 -> 34080 bytes .../tests/Assets/playback_test_config.json | 17 + .../Azure.AI.OpenAI/tests/AssistantTests.cs | 18 +- .../tests/AzureOpenAIClientSmokeTests.cs | 41 + .../Azure.AI.OpenAI/tests/BatchTests.cs | 85 +- .../Azure.AI.OpenAI/tests/ChatTests.Audio.cs | 112 + .../Azure.AI.OpenAI/tests/ChatTests.Tools.cs | 2 +- sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs | 113 +- .../tests/ConversationProtocolTests.cs | 6 +- .../tests/ConversationTestFixtureBase.cs | 16 +- .../tests/ConversationTests.cs | 179 +- sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs | 32 +- .../Azure.AI.OpenAI/tests/FineTuningTests.cs | 171 +- .../Azure.AI.OpenAI/tests/ImageTests.cs | 1 - .../tests/Utils/AoaiTestBase.cs | 24 +- .../Azure.AI.OpenAI/tests/Utils/Assets.cs | 20 + .../Azure.AI.OpenAI/tests/VectorStoreTests.cs | 3 +- .../src/RecordedTestAttribute.cs | 3 +- .../Azure.AI.Personalizer/README.md | 2 - .../README.md | 4 +- .../README.md | 4 +- .../CHANGELOG.md | 10 + ...Azure.Provisioning.AppConfiguration.csproj | 4 +- .../src/GlobalSuppressions.cs | 8 + .../CHANGELOG.md | 10 + ...zure.Provisioning.CognitiveServices.csproj | 4 +- .../Azure.Provisioning.CosmosDB/CHANGELOG.md | 10 + .../src/Azure.Provisioning.CosmosDB.csproj | 4 +- .../Azure.Provisioning.EventHubs/CHANGELOG.md | 10 + .../src/Azure.Provisioning.EventHubs.csproj | 4 +- .../Azure.Provisioning.KeyVault/CHANGELOG.md | 10 + .../src/Azure.Provisioning.KeyVault.csproj | 4 +- .../CHANGELOG.md | 10 + .../src/Azure.Provisioning.PostgreSql.csproj | 4 +- .../Azure.Provisioning.Redis/CHANGELOG.md | 10 + .../src/Azure.Provisioning.Redis.csproj | 4 +- .../Azure.Provisioning.Search/CHANGELOG.md | 10 + .../src/Azure.Provisioning.Search.csproj | 4 +- .../CHANGELOG.md | 10 + .../src/Azure.Provisioning.ServiceBus.csproj | 4 +- .../Azure.Provisioning.SignalR/CHANGELOG.md | 10 + .../src/Azure.Provisioning.SignalR.csproj | 4 +- .../Azure.Provisioning.Sql/CHANGELOG.md | 10 + .../src/Azure.Provisioning.Sql.csproj | 4 +- .../Azure.Provisioning.Storage/CHANGELOG.md | 10 + .../src/Azure.Provisioning.Storage.csproj | 4 +- .../Azure.Provisioning.WebPubSub/CHANGELOG.md | 10 + .../src/Azure.Provisioning.WebPubSub.csproj | 4 +- .../Azure.Provisioning/CHANGELOG.md | 10 + .../src/Azure.Provisioning.csproj | 4 +- sdk/pullrequest.yml | 25 + .../Azure.Analytics.Purview.Account/README.md | 2 - .../README.md | 2 - .../Azure.Analytics.Purview.Catalog/README.md | 2 - .../Azure.Analytics.Purview.DataMap/README.md | 2 - .../src/Generated/Docs/Discovery.xml | 888 +-- .../Generated/Samples/Samples_Discovery.cs | 888 +-- .../README.md | 2 - .../Azure.Analytics.Purview.Sharing/README.md | 2 - sdk/quantum/Azure.Quantum.Jobs/README.md | 2 - ...QuotaAdditionalAttributes.Serialization.cs | 189 + ...AdditionalAttributesPatch.Serialization.cs | 196 + .../Models/ResourceUsageList.Serialization.cs | 219 + .../ArmRecoveryServicesBackupModelFactory.cs | 491 -- .../ArmRecoveryServicesBackupModelFactory.cs | 501 ++ ...ecoveryServicesSiteRecoveryModelFactory.cs | 259 - ...ecoveryServicesSiteRecoveryModelFactory.cs | 249 + .../api/Azure.ResourceManager.Redis.net8.0.cs | 4 +- ...re.ResourceManager.Redis.netstandard2.0.cs | 4 +- .../src/Customization/ArmRedisModelFactory.cs | 82 - .../src/Generated/ArmRedisModelFactory.cs | 126 + sdk/resourcemanager/ci.mgmt.yml | 2 + .../Azure.ResourceManager.Resources.net8.0.cs | 103 +- ...esourceManager.Resources.netstandard2.0.cs | 103 +- .../Samples/Sample_ArmDeploymentCollection.cs | 2 +- .../Samples/Sample_ArmDeploymentResource.cs | 47 +- .../Sample_TenantResourceExtensions.cs | 2 +- .../src/Generated/ArmDeploymentCollection.cs | 20 +- .../src/Generated/ArmDeploymentResource.cs | 64 +- .../src/Generated/ArmResourcesModelFactory.cs | 175 +- ...ockableResourcesManagementGroupResource.cs | 4 +- .../MockableResourcesResourceGroupResource.cs | 4 +- .../MockableResourcesSubscriptionResource.cs | 4 +- .../MockableResourcesTenantResource.cs | 8 +- .../Extensions/ResourcesExtensions.cs | 20 +- .../ArmDeploymentProperties.Serialization.cs | 16 + .../Models/ArmDeploymentProperties.cs | 8 +- ...loymentPropertiesExtended.Serialization.cs | 80 + .../Models/ArmDeploymentPropertiesExtended.cs | 13 +- ...mDeploymentValidateResult.Serialization.cs | 109 +- .../Models/ArmDeploymentValidateResult.cs | 10 +- ...eploymentWhatIfProperties.Serialization.cs | 11 + .../Models/ArmDeploymentWhatIfProperties.cs | 3 +- ...mentDiagnosticsDefinition.Serialization.cs | 316 + .../Models/DeploymentDiagnosticsDefinition.cs | 98 + .../ErrorAdditionalInfo.Serialization.cs | 207 + .../Generated/Models/ErrorAdditionalInfo.cs | 100 + .../src/Generated/Models/Level.cs | 54 + .../src/Generated/Models/ValidationLevel.cs | 54 + .../Models/WhatIfChange.Serialization.cs | 108 + .../src/Generated/Models/WhatIfChange.cs | 46 +- .../WhatIfOperationResult.Serialization.cs | 104 +- .../Generated/Models/WhatIfOperationResult.cs | 14 +- .../DeploymentRestOperations.cs | 2 +- .../DeploymentsRestOperations.cs | 2 +- .../src/autorest.md | 34 +- .../Azure.Data.SchemaRegistry/README.md | 2 - .../samples/Sample02_Serialization.md | 4 +- .../README.md | 2 - .../perf/README.md | 2 - sdk/search/Azure.Search.Documents/README.md | 4 +- .../api/Azure.Search.Documents.net8.0.cs | 46 +- .../Azure.Search.Documents.netstandard2.0.cs | 46 +- .../Azure.Search.Documents/perf/README.md | 2 - ...ogName.cs => AIFoundryModelCatalogName.cs} | 34 +- ...MachineLearningParameters.Serialization.cs | 4 +- .../Models/AzureMachineLearningParameters.cs | 4 +- .../Azure.Search.Documents/src/autorest.md | 9 + sdk/search/CONTRIBUTING.md | 2 - sdk/search/README.md | 2 - .../Azure.ResourceManager.SelfHelp.net8.0.cs | 2 - ...ResourceManager.SelfHelp.netstandard2.0.cs | 2 - .../src/Custom/ArmSelfHelpModelFactory.cs | 25 - .../src/Generated/ArmSelfHelpModelFactory.cs | 11 + .../Azure.Messaging.ServiceBus/CHANGELOG.md | 8 + .../Azure.Messaging.ServiceBus/README.md | 2 - .../Azure.Messaging.ServiceBus/perf/README.md | 6 +- .../ServiceBusRequestFailedDetailsParser.cs | 2 +- .../src/Amqp/AmqpConnectionScope.cs | 8 +- .../src/Amqp/AmqpReceiver.cs | 34 +- .../src/Amqp/AmqpRuleManager.cs | 2 +- .../src/Amqp/AmqpSender.cs | 4 +- .../src/Azure.Messaging.ServiceBus.csproj | 2 +- .../src/Diagnostics/ServiceBusEventSource.cs | 51 + .../Primitives/ServiceBusReceivedMessage.cs | 2 +- .../stress/README.md | 6 +- ...rviceBusRequestFailedDetailsParserTests.cs | 77 + .../Microsoft.Azure.ServiceBus/README.md | 2 - .../README.md | 2 - .../CHANGELOG.md | 14 +- ...esourceManager.ServiceNetworking.net8.0.cs | 97 +- ...anager.ServiceNetworking.netstandard2.0.cs | 97 +- ...ayForContainersSecurityPolicyCollection.cs | 199 + ...ewayForContainersSecurityPolicyResource.cs | 112 + .../Samples/Sample_AssociationCollection.cs | 10 +- .../Samples/Sample_AssociationResource.cs | 6 +- .../Samples/Sample_FrontendCollection.cs | 10 +- .../Samples/Sample_FrontendResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 2 +- .../Sample_TrafficControllerCollection.cs | 10 +- .../Sample_TrafficControllerResource.cs | 6 +- ...e.ResourceManager.ServiceNetworking.csproj | 2 +- ...ayForContainersSecurityPolicyCollection.cs | 493 ++ ...tainersSecurityPolicyData.Serialization.cs | 226 + ...nGatewayForContainersSecurityPolicyData.cs | 104 + ...ersSecurityPolicyResource.Serialization.cs | 26 + ...ewayForContainersSecurityPolicyResource.cs | 699 ++ .../ArmServiceNetworkingModelFactory.cs | 54 +- .../src/Generated/AssociationCollection.cs | 20 +- .../src/Generated/AssociationResource.cs | 24 +- .../MockableServiceNetworkingArmClient.cs | 12 + ...eServiceNetworkingResourceGroupResource.cs | 4 +- ...leServiceNetworkingSubscriptionResource.cs | 4 +- .../Extensions/ServiceNetworkingExtensions.cs | 27 +- .../src/Generated/FrontendCollection.cs | 20 +- .../src/Generated/FrontendData.cs | 2 +- .../src/Generated/FrontendResource.cs | 24 +- ...ContainersSecurityPolicyOperationSource.cs | 38 + ...ainersSecurityPolicyPatch.Serialization.cs | 175 + ...GatewayForContainersSecurityPolicyPatch.cs | 83 + .../src/Generated/Models/AssociationType.cs | 4 +- .../src/Generated/Models/PolicyType.cs | 48 + .../src/Generated/Models/ProvisioningState.cs | 16 +- ...urityPolicyConfigurations.Serialization.cs | 201 + .../Models/SecurityPolicyConfigurations.cs | 78 + ...olicyConfigurationsUpdate.Serialization.cs | 134 + .../SecurityPolicyConfigurationsUpdate.cs | 78 + .../SecurityPolicyListResult.Serialization.cs | 151 + .../Models/SecurityPolicyListResult.cs | 80 + .../TrafficControllerPatch.Serialization.cs | 32 +- .../Models/TrafficControllerPatch.cs | 18 +- .../AssociationsInterfaceRestOperations.cs | 4 +- .../FrontendsInterfaceRestOperations.cs | 4 +- ...SecurityPoliciesInterfaceRestOperations.cs | 621 ++ ...rafficControllerInterfaceRestOperations.cs | 4 +- .../Generated/TrafficControllerCollection.cs | 20 +- .../TrafficControllerData.Serialization.cs | 42 + .../src/Generated/TrafficControllerData.cs | 23 +- .../Generated/TrafficControllerResource.cs | 101 +- .../src/autorest.md | 4 +- .../README.md | 2 - ...e.WebJobs.Extensions.SignalRService.csproj | 11 + .../Azure.Storage.Blobs.Batch/CHANGELOG.md | 12 +- .../Azure.Storage.Blobs.Batch/README.md | 2 - .../src/Azure.Storage.Blobs.Batch.csproj | 2 +- .../CHANGELOG.md | 12 +- .../src/Azure.Storage.Blobs.ChangeFeed.csproj | 2 +- sdk/storage/Azure.Storage.Blobs/CHANGELOG.md | 13 +- sdk/storage/Azure.Storage.Blobs/README.md | 10 +- sdk/storage/Azure.Storage.Blobs/assets.json | 2 +- .../Azure.Storage.Blobs/perf/README.md | 6 +- .../src/Azure.Storage.Blobs.csproj | 2 +- .../Azure.Storage.Blobs/src/BlobBaseClient.cs | 31 +- .../Azure.Storage.Blobs/src/BlobClient.cs | 7 +- .../src/BlockBlobClient.cs | 25 +- .../src/Models/BlobDownloadOptions.cs | 13 +- .../src/PartitionedDownloader.cs | 21 +- .../tests/BlobBaseClientTests.cs | 118 +- .../tests/PartitionedDownloaderTests.cs | 8 +- sdk/storage/Azure.Storage.Common/CHANGELOG.md | 13 +- sdk/storage/Azure.Storage.Common/README.md | 2 - .../src/Azure.Storage.Common.csproj | 2 +- .../src/Shared/Constants.cs | 2 + .../StorageRequestFailedDetailsParser.cs | 8 +- .../CHANGELOG.md | 16 +- .../README.md | 103 +- ...Azure.Storage.DataMovement.Blobs.net6.0.cs | 29 +- ...Azure.Storage.DataMovement.Blobs.net8.0.cs | 29 +- ...orage.DataMovement.Blobs.netstandard2.0.cs | 29 +- .../assets.json | 2 +- .../Infrastructure/DirectoryTransferTest.cs | 4 +- .../Scenarios/CopyDirectory.cs | 4 +- .../Scenarios/DownloadDirectory.cs | 4 +- .../Scenarios/UploadDirectory.cs | 4 +- .../perf/README.md | 8 +- .../samples/Sample01b_HelloWorldAsync.cs | 233 +- .../Azure.Storage.DataMovement.Blobs.csproj | 5 +- .../src/BlobContainerClientExtensions.cs | 14 +- .../src/BlobDestinationCheckpointDetails.cs | 14 +- .../src/BlobStorageResourceContainer.cs | 4 +- .../BlobStorageResourceContainerOptions.cs | 2 +- .../src/BlobsStorageResourceProvider.cs | 174 +- .../src/DataMovementBlobsExtensions.cs | 4 +- .../stress/README.md | 6 +- .../src/Infrastructure/TestSetupHelper.cs | 3 +- .../stress/src/Scenarios/BlobScenarioBase.cs | 4 - .../CopyBlobDirectoryScenarioBase.cs | 6 +- .../Scenarios/CopyBlobSingleScenarioBase.cs | 12 +- .../DownloadBlobDirectoryScenarioBase.cs | 2 +- .../DownloadBlobSingleScenarioBase.cs | 8 +- .../UploadBlobDirectoryScenarioBase.cs | 4 +- .../Scenarios/UploadBlobSingleScenarioBase.cs | 6 +- ...dBlobDirectoryToBlockBlobDirectoryTests.cs | 4 +- .../AppendBlobDirectoryToDirectoryTests.cs | 4 +- ...ndBlobDirectoryToPageBlobDirectoryTests.cs | 4 +- .../tests/AppendBlobStartTransferCopyTests.cs | 3 +- .../tests/AppendBlobToBlockBlobTests.cs | 3 +- .../tests/AppendBlobToPageBlobTests.cs | 3 +- ...re.Storage.DataMovement.Blobs.Tests.csproj | 3 +- ...ntainerClientExtensionsIntegrationTests.cs | 4 +- .../BlobContainerClientExtensionsTests.cs | 4 +- ...bDirectoryStartTransferDownloadTestBase.cs | 2 +- .../tests/BlobPauseResumeTransferTests.cs | 162 + .../BlobStorageResourceContainerTests.cs | 14 +- ...s => BlobsStorageResourceProviderTests.cs} | 63 +- ...BlobDirectoryToAppendBlobDirectoryTests.cs | 4 +- .../BlockBlobDirectoryToDirectoryTests.cs | 4 +- ...ckBlobDirectoryToPageBlobDirectoryTests.cs | 4 +- .../tests/BlockBlobStartTransferCopyTests.cs | 3 +- .../tests/BlockBlobToAppendBlobTests.cs | 3 +- .../tests/BlockBlobToPageBlobTests.cs | 3 +- ...BlobDirectoryToAppendBlobDirectoryTests.cs | 4 +- ...eBlobDirectoryToBlockBlobDirectoryTests.cs | 4 +- .../PageBlobDirectoryToDirectoryTests.cs | 4 +- .../tests/PageBlobStartTransferCopyTests.cs | 3 +- .../tests/PageBlobToAppendBlobTests.cs | 3 +- .../tests/PageBlobToBlockBlobTests.cs | 3 +- .../tests/ProgressHandlerTests.cs | 9 +- .../tests/RehydrateBlobResourceTests.cs | 26 +- .../tests/StartTransferCheckpointerTests.cs | 2 +- ...ppendBlobDirectoryToShareDirectoryTests.cs | 2 +- ...BlockBlobDirectoryToShareDirectoryTests.cs | 2 +- .../PageBlobDirectoryToShareDirectoryTests.cs | 2 +- ...hareDirectoryToAppendBlobDirectoryTests.cs | 2 +- ...ShareDirectoryToBlockBlobDirectoryTests.cs | 2 +- .../ShareDirectoryToPageBlobDirectoryTests.cs | 2 +- .../CHANGELOG.md | 14 +- .../README.md | 78 +- ...torage.DataMovement.Files.Shares.net6.0.cs | 23 +- ...torage.DataMovement.Files.Shares.net8.0.cs | 23 +- ...ataMovement.Files.Shares.netstandard2.0.cs | 23 +- .../assets.json | 2 +- .../samples/Sample01b_HelloWorldAsync.cs | 73 +- ...e.Storage.DataMovement.Files.Shares.csproj | 5 +- .../src/DataMovementSharesExtensions.cs | 29 + .../src/ShareDirectoryClientExtensions.cs | 10 +- .../ShareDirectoryStorageResourceContainer.cs | 2 +- .../src/ShareFileStorageResource.cs | 33 +- .../src/ShareFilesStorageResourceProvider.cs | 151 +- .../{PathScanner.cs => SharesPathScanner.cs} | 4 +- ...age.DataMovement.Files.Shares.Tests.csproj | 6 +- .../tests/PathScannerTests.cs | 6 +- .../tests/RehydrateShareResourceTests.cs | 33 +- .../ShareDestinationCheckpointDetailsTests.cs | 2 + .../ShareDirectoryClientExtensionsTests.cs | 13 +- .../ShareDirectoryStartTransferCopyTests.cs | 71 +- ...hareDirectoryStartTransferDownloadTests.cs | 2 + .../ShareDirectoryStartTransferUploadTests.cs | 2 + ...eDirectoryStorageResourceContainerTests.cs | 4 +- .../ShareFilePauseResumeTransferTests.cs | 132 + .../tests/ShareFileResourceTests.cs | 2 + .../tests/ShareFileStartTransferCopyTests.cs | 116 +- .../ShareFileStartTransferDownloadTests.cs | 2 + .../ShareFileStartTransferUploadTests.cs | 2 + .../ShareSourceCheckpointDetailsTests.cs | 2 + sdk/storage/Azure.Storage.DataMovement.sln | 6 + .../Azure.Storage.DataMovement/CHANGELOG.md | 11 +- .../Azure.Storage.DataMovement/KnownIssues.md | 37 +- .../MigrationGuide.md | 457 +- .../Azure.Storage.DataMovement/README.md | 212 +- .../api/Azure.Storage.DataMovement.net6.0.cs | 76 +- .../api/Azure.Storage.DataMovement.net8.0.cs | 76 +- ...ure.Storage.DataMovement.netstandard2.0.cs | 76 +- ....Storage.DataMovement.Samples.Tests.csproj | 42 + .../samples/PauseResumeCheckpointing.md | 104 + .../samples/Sample01b_Migration.cs | 441 ++ .../samples/StartTransfer.md | 141 + .../samples/TransferManager.md | 55 + .../src/AssemblyInfo.cs | 6 + .../src/Azure.Storage.DataMovement.csproj | 3 +- .../src/LocalFilesStorageResourceProvider.cs | 19 +- .../src/ServiceToServiceJobPart.cs | 46 +- .../src/StorageResource.cs | 5 + .../src/StorageResourceCheckpointDetails.cs | 4 + .../StorageResourceCompleteTransferOptions.cs | 6 +- .../src/StorageResourceContainer.cs | 6 + .../src/StorageResourceCopyFromUriOptions.cs | 5 + .../src/StorageResourceItem.cs | 24 +- .../src/StorageResourceItemProperties.cs | 7 + .../src/StorageResourceProvider.cs | 8 +- .../src/StorageResourceReadStreamResult.cs | 8 + .../src/StreamToUriJobPart.cs | 105 +- .../src/TransferItemFailedEventArgs.cs | 2 +- .../src/TransferJobInternal.cs | 8 +- .../src/TransferManager.cs | 3 +- .../src/TransferManagerOptions.cs | 2 +- .../src/TransferOptions.cs | 4 +- .../src/TransferProperties.cs | 6 + .../src/TransferStatus.cs | 2 +- .../tests/CleanUpTransferTests.cs | 1 - .../tests/MockStorageResourceItem.cs | 2 - .../tests/MockStorageResourceProvider.cs | 8 +- .../tests/Shared/MemoryStorageResourceItem.cs | 2 - .../Shared/PauseResumeTransferTestBase.cs} | 924 ++- .../tests/Shared/StartTransferCopyTestBase.cs | 42 +- .../StartTransferDirectoryCopyTestBase.cs | 10 +- .../StartTransferDirectoryDownloadTestBase.cs | 15 +- .../Shared/StartTransferDownloadTestBase.cs | 24 +- .../StartTransferUploadDirectoryTestBase.cs | 14 +- .../Shared/StartTransferUploadTestBase.cs | 24 +- .../Shared/StorageResourceTestWrappers.cs | 2 - .../tests/Shared/TestEventsRaised.cs | 11 +- .../Azure.Storage.Files.DataLake/CHANGELOG.md | 12 +- .../Azure.Storage.Files.DataLake/README.md | 2 - .../Azure.Storage.Files.DataLake/assets.json | 2 +- .../perf/README.md | 6 +- .../src/Azure.Storage.Files.DataLake.csproj | 2 +- .../Azure.Storage.Files.Shares/CHANGELOG.md | 12 +- .../Azure.Storage.Files.Shares/README.md | 16 +- .../Azure.Storage.Files.Shares/perf/README.md | 6 +- .../samples/Sample02_Auth.cs | 2 + .../src/Azure.Storage.Files.Shares.csproj | 2 +- .../src/ShareDirectoryClient.cs | 8 +- .../src/ShareFileClient.cs | 8 +- sdk/storage/Azure.Storage.Queues/CHANGELOG.md | 12 +- sdk/storage/Azure.Storage.Queues/README.md | 2 - .../src/Azure.Storage.Queues.csproj | 2 +- sdk/storage/CONTRIBUTING.md | 2 - .../CHANGELOG.md | 7 +- .../README.md | 2 - ...WebJobs.Extensions.Storage.Blobs.net8.0.cs | 60 + ...re.WebJobs.Extensions.Storage.Blobs.csproj | 2 +- .../README.md | 2 - .../CHANGELOG.md | 7 + .../README.md | 2 - ...e.WebJobs.Extensions.Storage.Queues.csproj | 2 +- .../CHANGELOG.md | 5 + .../README.md | 2 - ...Azure.WebJobs.Extensions.Storage.net8.0.cs | 0 ...ft.Azure.WebJobs.Extensions.Storage.csproj | 2 +- sdk/storage/README.md | 2 - ...ure.ResourceManager.StorageCache.net8.0.cs | 3 +- ...urceManager.StorageCache.netstandard2.0.cs | 3 +- .../Customized/ArmStorageCacheModelFactory.cs | 49 - .../Generated/ArmStorageCacheModelFactory.cs | 26 + sdk/tables/Azure.Data.Tables/CHANGELOG.md | 16 + sdk/tables/Azure.Data.Tables/README.md | 2 - .../README.md | 2 - .../.content/packageResource/README.md | 2 - sdk/template/Azure.Template/README.md | 2 - .../README.md | 6 +- .../Azure.AI.TextAnalytics/README.md | 2 - .../Azure.AI.TextAnalytics.Perf/README.md | 2 - .../Azure.AI.Translation.Document/README.md | 5 +- .../Azure.Media.VideoAnalyzer.Edge/README.md | 2 - .../Azure.AI.Vision.ImageAnalysis/README.md | 10 +- .../README.md | 2 - .../Azure.Messaging.WebPubSub/README.md | 2 - .../README.md | 4 +- .../README.md | 4 +- .../README.md | 4 +- .../README.md | 2 - .../README.md | 2 - 2604 files changed, 221940 insertions(+), 23784 deletions(-) create mode 100644 eng/common/pipelines/templates/stages/archetype-spec-gen-sdk.yml create mode 100644 eng/common/scripts/Remove-IssueLabel.ps1 create mode 100644 eng/packages/http-client-csharp/eng/scripts/Generate.ps1 create mode 100644 eng/packages/http-client-csharp/eng/scripts/Generation.psm1 create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/Azure.Generator.StubLibrary.csproj create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubPlugin.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubVisitor.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/src/NamespaceVisitor.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/NewAzureProjectScaffolding.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/MgmtLongRunningOperationProvider.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/src/RestClientVisitor.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ConstructorProviderHelper.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/MgmtLongRunningOperationProviderTests.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_Generic_MgmtLROProviderGeneration.cs create mode 100644 eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_NonGeneric_MgmtLROProviderGeneration.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Directory.Build.props create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{Friend.Serialization.cs => FriendModel.Serialization.cs} (63%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{Friend.cs => FriendModel.cs} (80%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{Thing.Serialization.cs => ThingModel.Serialization.cs} (77%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{Thing.cs => ThingModel.cs} (78%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingOptionalLiteralFloat.Serialization.cs => ThingModelOptionalLiteralFloat.Serialization.cs} (80%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingOptionalLiteralFloat.cs => ThingModelOptionalLiteralFloat.cs} (50%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingOptionalLiteralInt.Serialization.cs => ThingModelOptionalLiteralInt.Serialization.cs} (80%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingOptionalLiteralInt.cs => ThingModelOptionalLiteralInt.cs} (50%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingOptionalLiteralString.cs => ThingModelOptionalLiteralString.cs} (52%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingRequiredLiteralFloat.Serialization.cs => ThingModelRequiredLiteralFloat.Serialization.cs} (80%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingRequiredLiteralFloat.cs => ThingModelRequiredLiteralFloat.cs} (50%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingRequiredLiteralInt.Serialization.cs => ThingModelRequiredLiteralInt.Serialization.cs} (80%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingRequiredLiteralInt.cs => ThingModelRequiredLiteralInt.cs} (50%) rename eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/{ThingRequiredLiteralString.cs => ThingModelRequiredLiteralString.cs} (52%) create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Directory.Build.props create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperation.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperationOfT.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/ApiKey/ApiKeyTests.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/AssemblyCleanFixture.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/BuildPropertiesAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServer.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServerSession.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorTestAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerBase.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerSessionBase.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/SpectorTestBase.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/Directory.Build.props create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Authentication.ApiKey.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Authentication.ApiKey.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Authentication.Http.Custom.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Authentication.Http.Custom.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Authentication.OAuth2.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Authentication.OAuth2.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Authentication.Union.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Authentication.Union.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Client.Structure.Service.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Client.Structure.Service.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Models/ClientType.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Encode.Numeric.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Encode.Numeric.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/EncodeNumericModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Parameters.Basic.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Parameters.Basic.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Parameters.BodyOptionality.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/ParametersBodyOptionalityModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Parameters.BodyOptionality.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Parameters.Spread.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Parameters.Spread.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Payload.ContentNegotiation.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/PayloadContentNegotiationModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Payload.ContentNegotiation.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Payload.JsonMergePatch.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/PayloadJsonMergePatchModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Payload.JsonMergePatch.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Payload.MediaType.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Payload.MediaType.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Serialization.EncodedName.Json.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/SerializationEncodedNameJsonModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Serialization.EncodedName.Json.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Server.Endpoint.NotDefined.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Server.Endpoint.NotDefined.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Server.Path.Single.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Server.Path.Single.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Server.Versions.NotVersioned.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Server.Versions.NotVersioned.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/SpecialHeaders.Repeatability.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/SpecialHeaders.Repeatability.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/SpecialWords.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/SpecialWords.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Type.Enum.Fixed.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Models/DaysOfWeekEnum.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Type.Enum.Fixed.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Type.Model.Empty.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/TypeModelEmptyModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Type.Model.Empty.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Type.Model.Inheritance.NestedDiscriminator.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/TypeModelInheritanceNestedDiscriminatorModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Type.Model.Inheritance.NestedDiscriminator.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Type.Model.Inheritance.NotDiscriminated.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/TypeModelInheritanceNotDiscriminatedModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Type.Model.Inheritance.NotDiscriminated.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Type.Model.Inheritance.Recursive.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/TypeModelInheritanceRecursiveModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Type.Model.Inheritance.Recursive.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Type.Model.Inheritance.SingleDiscriminator.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/TypeModelInheritanceSingleDiscriminatorModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Type.Model.Inheritance.SingleDiscriminator.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Type.Model.Usage.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/TypeModelUsageModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Type.Model.Usage.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Type.Model.Visibility.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/TypeModelVisibilityModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Type.Model.Visibility.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Configuration.json create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Type.Property.Nullable.sln create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.Serialization.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/TypePropertyNullableModelFactory.cs create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Type.Property.Nullable.csproj create mode 100644 eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json create mode 100644 eng/pipelines/templates/steps/set-artifact-packages.yml create mode 100644 eng/scripts/Install-Azurite.ps1 create mode 100644 eng/scripts/splittestdependencies/set-artifact-packages.ps1 create mode 100644 eng/scripts/typespec/Get-Spector-Coverage.ps1 create mode 100644 eng/scripts/typespec/Spector-Helper.psm1 create mode 100644 eng/scripts/typespec/Test-Spector.ps1 create mode 100644 sdk/ai/Azure.AI.Inference/samples/Sample11_ImageEmbeddings.md create mode 100644 sdk/ai/Azure.AI.Inference/samples/Sample12_ChatCompletionsWithAudio.md create mode 100644 sdk/ai/Azure.AI.Inference/samples/Sample13_ChatCompletionsWithStructuredOutputs.md create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsResponseFormat.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageInputAudio.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ChatRequestToolMessage.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingInput.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingsClient.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/AudioContentFormat.cs rename sdk/ai/Azure.AI.Inference/src/Generated/{ChatCompletionsResponseFormatJSON.Serialization.cs => ChatCompletionsResponseFormatJsonObject.Serialization.cs} (61%) rename sdk/ai/Azure.AI.Inference/src/Generated/{ChatCompletionsResponseFormatJSON.cs => ChatCompletionsResponseFormatJsonObject.cs} (68%) create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/Docs/ImageEmbeddingsClient.xml create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsClient.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.cs create mode 100644 sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs rename sdk/ai/Azure.AI.Inference/src/Generated/{ChatCompletionsNamedFunctionToolSelection.Serialization.cs => UnknownChatCompletionsToolCall.Serialization.cs} (55%) create mode 100644 sdk/ai/Azure.AI.Inference/tests/Data/hello_how_are_you.mp3 create mode 100644 sdk/ai/Azure.AI.Inference/tests/Generated/Samples/Samples_ImageEmbeddingsClient.cs create mode 100644 sdk/ai/Azure.AI.Inference/tests/ImageEmbeddingClientTests.cs create mode 100644 sdk/ai/Azure.AI.Inference/tests/Samples/Sample11_ImageEmbeddings.cs create mode 100644 sdk/ai/Azure.AI.Inference/tests/Samples/Sample12_ChatCompletionsWithAudioInput.cs create mode 100644 sdk/ai/Azure.AI.Inference/tests/Samples/Sample13_ChatCompletionsWithStructuredOutput.cs create mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.cs create mode 100644 sdk/ai/Azure.AI.Projects/tests/AgentClientTests.cs create mode 100644 sdk/ai/Azure.AI.Projects/tests/ConnectionsClientTests.cs create mode 100644 sdk/ai/Azure.AI.Projects/tests/Utilities/MockTokenCredential.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotCollection.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotResource.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotCollection.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotResource.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Custom/AppConfigurationSnapshotResource.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotCollection.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/LongRunningOperation/AppConfigurationSnapshotOperationSource.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationSnapshotStatus.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyAuthenticationMode.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyPrivateLinkDelegation.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotCompositionType.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/SnapshotsRestOperations.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotCollectionTests.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotOperationTests.cs create mode 100644 sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AIFoundryClient.cs create mode 100644 sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AzureAIProjectsExensions.cs create mode 100644 sdk/cloudmachine/Azure.CloudMachine/src/ProjectClient.cs create mode 100644 sdk/cloudmachine/Azure.CloudMachine/tests/AIFoundryTests.cs create mode 100644 sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTestEnvironment.cs create mode 100644 sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/ProjectInfrastructure.cs create mode 100644 sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryConnections.cs create mode 100644 sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryFeature.cs create mode 100644 sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/NoOpResource.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample10_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample11_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample9_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RedactionPolicyKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample7_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample8_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample9_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/AnswerCallAndTranscriptionTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/AnswerCallAndTranscriptionTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithCombinationOfTextAndFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithCombinationOfTextAndFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithInvalidFileSourceWithValidSourceTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithInvalidFileSourceWithValidSourceTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithInvalidFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithInvalidFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithMultipleFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithMultipleFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithMultipleTextSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/ChoiceRecognizeWithMultipleTextSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/CreateCallAndTranscriptionTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/CreateCallAndTranscriptionTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithCombinationOfTextAndFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithCombinationOfTextAndFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithInvalidFileSourceWithValidSourceTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithInvalidFileSourceWithValidSourceTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithInvalidFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithInvalidFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithMultipleFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithMultipleFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithMultipleTextSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/DtmfRecognizeWithMultipleTextSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/InterruptAudioAndAnnounceAsyncTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/InterruptAudioAndAnnounceAsyncTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/InterruptHoldAudioForPlayMediaAsyncTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/InterruptHoldAudioForPlayMediaAsyncTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayCombinedTextAndFileSourcesWithPlayMediaAllTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayCombinedTextAndFileSourcesWithPlayMediaAllTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayCombinedTextAndFileSourcesWithPlayMediaTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayCombinedTextAndFileSourcesWithPlayMediaTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidAndInvalidFileSourceWithPlayMediaAllTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidAndInvalidFileSourceWithPlayMediaAllTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidAndValidFileSourceWithPlayMediaTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidAndValidFileSourceWithPlayMediaTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidFileSourceWithPlayMediaAllTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidFileSourceWithPlayMediaAllTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidFileSourceWithPlayMediaTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayInvalidFileSourceWithPlayMediaTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleFilesSourcesWithPlayMediaAllTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleFilesSourcesWithPlayMediaAllTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleFilesSourcesWithPlayMediaTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleFilesSourcesWithPlayMediaTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleTextSourcesWithPlayMediaAllTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleTextSourcesWithPlayMediaAllTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleTextSourcesWithPlayMediaTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/PlayMultipleTextSourcesWithPlayMediaTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithCombinationOfTextAndFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithCombinationOfTextAndFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithInvalidFileSourceWithValidSourceTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithInvalidFileSourceWithValidSourceTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithInvalidFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithInvalidFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithMultipleFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithMultipleFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithMultipleTextSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechOrDtmfRecognizeWithMultipleTextSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithCombinationOfTextAndFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithCombinationOfTextAndFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithInvalidFileSourceWithValidSourceTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithInvalidFileSourceWithValidSourceTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithInvalidFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithInvalidFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithMultipleFileSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithMultipleFileSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithMultipleTextSourcesTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallMediaAutomatedLiveTests/SpeechRecognizeWithMultipleTextSourcesTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/CreateACSCallAndUnmixedAudioTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/CreateACSCallAndUnmixedAudioTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/CreateACSCallUnmixedAudioAffinityTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/CreateACSCallUnmixedAudioAffinityTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/RecordingOperationsTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/RecordingOperationsTestAsync.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/StartRecordingWithCallConnectionIdTest.json create mode 100644 sdk/communication/Azure.Communication.CallAutomation/tests/SessionRecordedEvents/CallRecordingAutomatedLiveTests/StartRecordingWithCallConnectionIdTestAsync.json create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs create mode 100644 sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs create mode 100644 sdk/communication/Azure.Communication.Sms/src/Models/SmsRecipient.cs delete mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCacheRuleOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCredentialSetOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AadAuthenticationAsArmPolicyStatus.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.Serialization.cs => containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs} (59%) create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCertificateType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealthStatus.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialName.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsStatus.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs create mode 100644 sdk/core/System.ClientModel/samples/Logging.md create mode 100644 sdk/core/System.ClientModel/src/Internal/ChangeTrackingStringList.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/ContentTypeUtilities.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/ClientModelEventSource.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/LoggingEventIds.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageHeadersLogValue.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageLogger.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageSanitizer.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/PipelineRetryLogger.cs create mode 100644 sdk/core/System.ClientModel/src/Internal/Logging/PipelineTransportLogger.cs create mode 100644 sdk/core/System.ClientModel/src/Options/ClientLoggingOptions.cs create mode 100644 sdk/core/System.ClientModel/src/Pipeline/MessageLoggingPolicy.cs create mode 100644 sdk/core/System.ClientModel/tests/Options/ClientLoggingOptionsTests.cs create mode 100644 sdk/core/System.ClientModel/tests/Pipeline/MessageLoggingPolicyTests.cs create mode 100644 sdk/core/System.ClientModel/tests/Samples/LoggingSamples.cs create mode 100644 sdk/core/System.ClientModel/tests/TestFramework/Logging/LoggerEvent.cs create mode 100644 sdk/core/System.ClientModel/tests/TestFramework/Logging/TestClientEventListener.cs create mode 100644 sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLogger.cs create mode 100644 sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLoggingFactory.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/ChangeTrackingStringListTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/ClientLoggingOptionsTestsInternal.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/ContentTypeUtilitiesTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageHeadersLogValueTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageLoggerTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageSanitizerTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineRetryLoggerTests.cs create mode 100644 sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineTransportLoggerTests.cs delete mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Customize/ArmDesktopVirtualizationModelFactory.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Data/OperationStatusResult.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/DeviceRegistryExtensions.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/MockableDeviceRegistrySubscriptionResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetStatus.Serialization.cs => AssetEndpointProfileStatus.Serialization.cs} (61%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetStatus.cs => AssetEndpointProfileStatus.cs} (65%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AuthenticationMethod.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.Serialization.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{X509CredentialsUpdate.cs => BillingContainerProperties.cs} (66%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointObservabilityMode.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointsObservabilityMode.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetStatusError.Serialization.cs => DeviceRegistryAssetStatusError.Serialization.cs} (63%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetStatusError.cs => DeviceRegistryAssetStatusError.cs} (84%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{UserAuthentication.Serialization.cs => DeviceRegistryAuthentication.Serialization.cs} (59%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{UserAuthentication.cs => DeviceRegistryAuthentication.cs} (61%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{UsernamePasswordCredentials.Serialization.cs => DeviceRegistryDataPointBase.Serialization.cs} (58%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{TransportAuthenticationUpdate.cs => DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs} (58%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopicRetainType.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.Serialization.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{UsernamePasswordCredentials.cs => DeviceRegistryUsernamePasswordCredentials.cs} (51%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{OwnCertificate.cs => DiscoveredAssetListResult.cs} (55%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{DataPoint.Serialization.cs => DiscoveredDataPoint.Serialization.cs} (61%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{DataPoint.cs => DiscoveredDataPoint.cs} (65%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetEvent.Serialization.cs => DiscoveredEvent.Serialization.cs} (62%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{AssetEvent.cs => DiscoveredEvent.cs} (60%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventObservabilityMode.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventsObservabilityMode.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{UsernamePasswordCredentialsUpdate.cs => SchemaRegistryUpdateProperties.cs} (61%) rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/{TransportAuthentication.Serialization.cs => SchemaVersionListResult.Serialization.cs} (59%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationMode.cs delete mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs rename sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/{autorest.md => autorest.md.bak} (79%) create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryBillingContainersOperationsTest.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetsOperationsTest.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistrySchemaRegistriesOperationsTest.cs create mode 100644 sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticVersionListProperties.Serialization.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ExternalUserCreationResponse.Serialization.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/MarketplaceSaaSInfoMarketplaceSubscription.Serialization.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponse.Serialization.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponseProperties.Serialization.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/MonitoredSubscriptionPropertyResource.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs mode change 100755 => 100644 sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md mode change 100755 => 100644 sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md mode change 100755 => 100644 sdk/eventhub/Microsoft.Azure.EventHubs/README.md create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/Azure.ResourceManager.IotOperations.sln create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/CHANGELOG.md create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/Directory.Build.props create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/README.md create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/assets.json create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Azure.ResourceManager.IotOperations.Samples.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Azure.ResourceManager.IotOperations.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Customization/Models/BrokerAuthenticatorCustomAuth.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsArmClient.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Argument.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Optional.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperation.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperationOfT.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthenticationOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthorizationOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerListenerOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowEndpointOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowProfileOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsInstanceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BlockerListenerServiceType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.Serialization.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.Serialization.cs} (55%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.Serialization.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.Serialization.cs} (57%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerMemoryProfile.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerOperatorValue.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerProtocolType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerKind.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CloudEventAttributeType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataExplorerAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowFilterType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowMappingType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.Serialization.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs} (54%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceSerializationFormat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.Serialization.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs} (65%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocationType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsOperationalMode.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsProvisioningState.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KafkaAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttRetainType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyAlgorithm.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceKeyType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TlsCertMethodMode.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TransformationSerializationFormat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.Serialization.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs} (66%) rename sdk/{deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.cs => iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.cs} (61%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ProviderConstants.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Properties/AssemblyInfo.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Azure.ResourceManager.IotOperations.Tests.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementClientBase.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementTestEnvironment.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthenticationsTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthorizationsTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerListenersTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokersTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowEndpointsTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowProfilesTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowsTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/InstancesTests.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml create mode 100644 sdk/iotoperations/ci.mgmt.yml delete mode 100644 sdk/kusto/Azure.ResourceManager.Kusto/src/Customized/ArmKustoModelFactory.cs delete mode 100644 sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/UserSecurityContext.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Custom/Files/OpenAIFileExtensions.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs => InternalAzureContentFilterResultForChoiceError.Serialization.cs} (63%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureContentFilterResultForPromptContentFilterResultsError.cs => InternalAzureContentFilterResultForChoiceError.cs} (78%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/Assets/audio_hello_world.mp3 create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/AzureOpenAIClientSmokeTests.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Audio.cs create mode 100644 sdk/provisioning/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs create mode 100644 sdk/pullrequest.yml create mode 100644 sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributes.Serialization.cs create mode 100644 sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributesPatch.Serialization.cs create mode 100644 sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/ResourceUsageList.Serialization.cs delete mode 100644 sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Custom/ArmRecoveryServicesBackupModelFactory.cs delete mode 100644 sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Customization/ArmRecoveryServicesSiteRecoveryModelFactory.cs delete mode 100644 sdk/redis/Azure.ResourceManager.Redis/src/Customization/ArmRedisModelFactory.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/Level.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ValidationLevel.cs rename sdk/search/Azure.Search.Documents/src/Generated/Models/{AIStudioModelCatalogName.cs => AIFoundryModelCatalogName.cs} (51%) create mode 100644 sdk/servicebus/Azure.Messaging.ServiceBus/tests/Administration/ServiceBusRequestFailedDetailsParserTests.cs mode change 100755 => 100644 sdk/servicebus/Microsoft.Azure.ServiceBus/README.md create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyCollection.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyResource.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyCollection.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/LongRunningOperation/ApplicationGatewayForContainersSecurityPolicyOperationSource.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/PolicyType.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.Serialization.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/SecurityPoliciesInterfaceRestOperations.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobPauseResumeTransferTests.cs rename sdk/storage/Azure.Storage.DataMovement.Blobs/tests/{BlobStorageResourceProviderTests.cs => BlobsStorageResourceProviderTests.cs} (71%) rename sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/{PathScanner.cs => SharesPathScanner.cs} (95%) create mode 100644 sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFilePauseResumeTransferTests.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement/samples/Azure.Storage.DataMovement.Samples.Tests.csproj create mode 100644 sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md create mode 100644 sdk/storage/Azure.Storage.DataMovement/samples/Sample01b_Migration.cs create mode 100644 sdk/storage/Azure.Storage.DataMovement/samples/StartTransfer.md create mode 100644 sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md rename sdk/storage/{Azure.Storage.DataMovement.Blobs/tests/PauseResumeTransferTests.cs => Azure.Storage.DataMovement/tests/Shared/PauseResumeTransferTestBase.cs} (66%) create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/api/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.net8.0.cs create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/api/Microsoft.Azure.WebJobs.Extensions.Storage.net8.0.cs delete mode 100644 sdk/storagecache/Azure.ResourceManager.StorageCache/src/Customized/ArmStorageCacheModelFactory.cs diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 61310d3a043c..3427c5c6c0ea 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -81,7 +81,7 @@ # ServiceOwners: @adamedx # PRLabel: %AI Model Inference %AI Projects -/sdk/ai/ @trangevi @dargilco @jhakulin @glharper @jhakulin +/sdk/ai/ @trangevi @dargilco @jhakulin @glharper @jhakulin @nick863 # PRLabel: %AI Model Inference /sdk/ai/Azure.AI.Inference @trangevi @dargilco @jhakulin @glharper @@ -90,10 +90,10 @@ # ServiceOwners: @trangevi @dargilco @jhakulin @glharper # PRLabel: %AI Projects -/sdk/ai/Azure.AI.Projects @jhakulin +/sdk/ai/Azure.AI.Projects @jhakulin @nick863 # ServiceLabel: %AI Projects -# ServiceOwners: @dargilco @jhakulin +# ServiceOwners: @dargilco @jhakulin @nick863 # ServiceLabel: %AKS # ServiceOwners: @Azure/aks-pm @@ -970,20 +970,14 @@ # ServiceLabel: %Astronomer %Mgmt # ServiceOwners: @banggaurav -# PRLabel: %Azure Stack Hci -/sdk/azurestackhci/Azure.ResourceManager.Hci/ @priyjain358 - -# ServiceLabel: %Azure Stack Hci %Mgmt -# ServiceOwners: @priyjain358 - # PRLabel: %Communication - Resource Manager /sdk/communication/Azure.ResourceManager.Communication/ @archerzz @ArcturusZhang @ArthurMa1978 # PRLabel: %Compute - Fleet -/sdk/computefleet/Azure.ResourceManager.*/ @sahilarora92 @dhruvil009 @rahuls-microsoft +/sdk/computefleet/Azure.ResourceManager.*/ @sahilarora92 @rahuls-microsoft # ServiceLabel: %Compute - Fleet %Mgmt -# ServiceOwners: @sahilarora92 @dhruvil009 @rahuls-microsoft +# ServiceOwners: @sahilarora92 @rahuls-microsoft # PRLael: %Container Orchestrator Runtime /sdk/containerorchestratorruntime/Azure.ResourceManager.*/ @HE-Xinyu @ddadaal @@ -1111,3 +1105,6 @@ #PRLabel: %CodeGen %Client /eng/packages/http-client-csharp/generator/Azure.Generator/ @JoshLove-msft @m-nash @jorgerangel-msft @jsquire @annelo-msft + +#PRLabel: %CodeGen %Client +/eng/scripts/typespec/ @JoshLove-msft @m-nash @jorgerangel-msft @jsquire @annelo-msft diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9977a311186e..23632732e354 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -1638,6 +1638,15 @@ "words": [ "prebuilts" ] + }, + { + "filename": "**/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/*.cs", + "words": [ + "sasl", + "Sasl", + "Acks", + "acks" + ] } ], "allowCompoundWords": true diff --git a/README.md b/README.md index 73419ed29159..85c322d54605 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Each service might have a number of libraries available from each of the followi New wave of packages that we are announcing as **GA** and several that are currently releasing in **preview**. These libraries follow the [Azure SDK Design Guidelines for .NET](https://azure.github.io/azure-sdk/dotnet/guidelines/) and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features at [Azure.Core](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md). -These new client libraries can be identified by the naming used for their folder, package, and namespace. Each will start with `Azure`, followed by the service category, and then the name of the service. For example `Azure.Storage.Blobs`. +These new client libraries can be identified by the naming used for their folder, package, and namespace. Each will start with `Azure`, followed by the service category, and then the name of the service. For example `Azure.Storage.Blobs`. For a complete list of available packages, please see the [latest available packages](https://azure.github.io/azure-sdk/releases/latest/dotnet.html) page. @@ -33,9 +33,9 @@ Last stable versions of packages that are production-ready. These libraries prov ### Management: New Releases -A new set of management libraries that follow the [Azure SDK Design Guidelines for .NET](https://azure.github.io/azure-sdk/dotnet_introduction.html) and based on [Azure.Core libraries](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core) are now in Public Preview. These new libraries provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. You can find the list of new packages [on this page](https://azure.github.io/azure-sdk/releases/latest/dotnet.html). +A new set of management libraries that follow the [Azure SDK Design Guidelines for .NET](https://azure.github.io/azure-sdk/dotnet_introduction.html) and based on [Azure.Core libraries](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core) are now in Public Preview. These new libraries provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. You can find the list of new packages [on this page](https://azure.github.io/azure-sdk/releases/latest/dotnet.html). -To get started with these new libraries, please see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/mgmt_preview_quickstart.md). These new libraries can be identified by namespaces that start with `Azure.ResourceManager`, e.g. `Azure.ResourceManager.Network` +To get started with these new libraries, please see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/mgmt_preview_quickstart.md). These new libraries can be identified by namespaces that start with `Azure.ResourceManager`, e.g. `Azure.ResourceManager.Network` > NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries. @@ -80,5 +80,3 @@ https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2FREADME.png) diff --git a/doc/README.md b/doc/README.md index fbf070de9477..5916f50f93d6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4,5 +4,3 @@ This folder contains some documentations for this repository: The folder structure is the following - [dev](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev) : contains advanced documentation for _developers_ of SDK (not _consumers_ of SDK) - [ApiDocGeneration](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/ApiDocGeneration) : contains scripts and assets for generating API documentation - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fdoc%2FREADME.png) diff --git a/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets index 43139d8c12e4..abdfbfc01c63 100644 --- a/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets +++ b/eng/Microsoft.Build.CentralPackageVersions/2.0.46/Sdk/Sdk.targets @@ -130,7 +130,7 @@ + Condition=" '$(EnableCentralPackageVersions)' != 'false' And '$(DesignTimeBuild)' != 'true' And @(PackageReference->Count()) > 0"> + + + @@ -113,7 +117,7 @@ - + @@ -121,15 +125,15 @@ + - - - - - - + + + + + @@ -137,7 +141,7 @@ - + @@ -186,7 +190,7 @@ - + @@ -229,7 +233,7 @@ - + @@ -243,7 +247,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + @@ -258,7 +262,7 @@ - + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubPlugin.cs b/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubPlugin.cs new file mode 100644 index 000000000000..f60918f41314 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubPlugin.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator; +using System.ComponentModel.Composition; + +namespace Azure.Generator.StubLibrary +{ + /// + /// The stub library plugin to generate the stub library. + /// + [Export(typeof(CodeModelPlugin))] + [ExportMetadata("PluginName", nameof(AzureStubPlugin))] + public class AzureStubPlugin : AzureClientPlugin + { + /// + /// The stub library plugin to generate the stub library. + /// + /// The Generator Context. + [ImportingConstructor] + public AzureStubPlugin(GeneratorContext context) : base(context) { } + + /// + /// Customize the generation output for stub library. + /// + public override void Configure() + { + base.Configure(); + AddVisitor(new AzureStubVisitor()); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubVisitor.cs b/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubVisitor.cs new file mode 100644 index 000000000000..890636388e29 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubVisitor.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel.Primitives; +using System.Linq; +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; + +namespace Azure.Generator.StubLibrary +{ + internal class AzureStubVisitor : ScmLibraryVisitor + { + private readonly ValueExpression _throwNull = ThrowExpression(Null); + private readonly XmlDocProvider _emptyDocs = new(); + + protected override TypeProvider? Visit(TypeProvider type) + { + if (!type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public) && + !type.Name.StartsWith("Unknown", StringComparison.Ordinal) && + !type.Name.Equals("MultiPartFormDataBinaryContent", StringComparison.Ordinal)) + { + return null; + } + + type.Update(xmlDocs: _emptyDocs); + return type; + } + + protected override TypeProvider? PostVisit(TypeProvider type) + { + if (type is RestClientProvider && + type.Methods.Count == 0 && + type.Constructors.Count == 0 && + type.Properties.Count == 0 && + type.Fields.Count == 0) + { + return null; + } + + return type; + } + + protected override ConstructorProvider? Visit(ConstructorProvider constructor) + { + if (!IsCallingBaseCtor(constructor) && + !IsEffectivelyPublic(constructor.Signature.Modifiers) && + (constructor.EnclosingType is not ModelProvider model || model.DerivedModels.Count == 0)) + { + return null; + } + + constructor.Update( + bodyStatements: null, + bodyExpression: _throwNull, + xmlDocs: _emptyDocs); + + return constructor; + } + + private static bool IsCallingBaseCtor(ConstructorProvider constructor) + { + return constructor.Signature.Initializer is not null && + constructor.Signature.Initializer.IsBase && + constructor.Signature.Initializer.Arguments.Count > 0; + } + + protected override FieldProvider? Visit(FieldProvider field) + { + // For ClientOptions, keep the non-public field as this currently represents the latest service version for a client. + return (field.Modifiers.HasFlag(FieldModifiers.Public) || field.EnclosingType.Implements.Any(i => i.Equals(typeof(ClientPipelineOptions)))) + ? field + : null; + } + + protected override MethodProvider? Visit(MethodProvider method) + { + if (method.Signature.ExplicitInterface is null && !IsEffectivelyPublic(method.Signature.Modifiers)) + { + return null; + } + + method.Signature.Update(modifiers: method.Signature.Modifiers & ~MethodSignatureModifiers.Async); + + var docs = method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Implicit) + ? method.XmlDocs + : _emptyDocs; + + method.Update( + bodyStatements: null, + bodyExpression: _throwNull, + xmlDocProvider: docs); + + return method; + } + + protected override PropertyProvider? Visit(PropertyProvider property) + { + if (!property.IsDiscriminator && !IsEffectivelyPublic(property.Modifiers)) + { + return null; + } + + var propertyBody = new ExpressionPropertyBody(_throwNull, property.Body.HasSetter ? _throwNull : null); + + property.Update( + body: propertyBody, + xmlDocs: _emptyDocs); + + return property; + } + + private bool IsEffectivelyPublic(MethodSignatureModifiers modifiers) + { + if (modifiers.HasFlag(MethodSignatureModifiers.Public)) + { + return true; + } + + if (modifiers.HasFlag(MethodSignatureModifiers.Protected) && !modifiers.HasFlag(MethodSignatureModifiers.Private)) + { + return true; + } + + return false; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator.sln b/eng/packages/http-client-csharp/generator/Azure.Generator.sln index 975f6a6f8cd1..c2022838d5dc 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator.sln +++ b/eng/packages/http-client-csharp/generator/Azure.Generator.sln @@ -5,10 +5,14 @@ VisualStudioVersion = 17.10.35201.131 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Generator", "Azure.Generator\src\Azure.Generator.csproj", "{8DDB0B72-B3F6-4F87-8B04-163EB4880FC8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTypeSpec", "TestProjects\Local\Basic-TypeSpec\src\BasicTypeSpec.csproj", "{F8386530-1166-438C-99DC-AE855036A37C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Generator.Tests", "Azure.Generator\test\Azure.Generator.Tests.csproj", "{A05E6873-DD18-44B2-88A8-DEE3AA103EC4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProjects.Local.Tests", "TestProjects\Local.Tests\TestProjects.Local.Tests.csproj", "{0E941DC3-BC8B-1031-859C-EBB387036FD6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Generator.StubLibrary", "Azure.Generator.StubLibrary\src\Azure.Generator.StubLibrary.csproj", "{CC2E7459-398A-60FA-5138-282707944E43}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProjects.Spector.Tests", "TestProjects\Spector.Tests\TestProjects.Spector.Tests.csproj", "{FD729CC8-FAAC-B384-0328-6F590DCAA5AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -19,14 +23,22 @@ Global {8DDB0B72-B3F6-4F87-8B04-163EB4880FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU {8DDB0B72-B3F6-4F87-8B04-163EB4880FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DDB0B72-B3F6-4F87-8B04-163EB4880FC8}.Release|Any CPU.Build.0 = Release|Any CPU - {F8386530-1166-438C-99DC-AE855036A37C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8386530-1166-438C-99DC-AE855036A37C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8386530-1166-438C-99DC-AE855036A37C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8386530-1166-438C-99DC-AE855036A37C}.Release|Any CPU.Build.0 = Release|Any CPU {A05E6873-DD18-44B2-88A8-DEE3AA103EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A05E6873-DD18-44B2-88A8-DEE3AA103EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU {A05E6873-DD18-44B2-88A8-DEE3AA103EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU {A05E6873-DD18-44B2-88A8-DEE3AA103EC4}.Release|Any CPU.Build.0 = Release|Any CPU + {0E941DC3-BC8B-1031-859C-EBB387036FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E941DC3-BC8B-1031-859C-EBB387036FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E941DC3-BC8B-1031-859C-EBB387036FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E941DC3-BC8B-1031-859C-EBB387036FD6}.Release|Any CPU.Build.0 = Release|Any CPU + {CC2E7459-398A-60FA-5138-282707944E43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC2E7459-398A-60FA-5138-282707944E43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC2E7459-398A-60FA-5138-282707944E43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC2E7459-398A-60FA-5138-282707944E43}.Release|Any CPU.Build.0 = Release|Any CPU + {FD729CC8-FAAC-B384-0328-6F590DCAA5AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD729CC8-FAAC-B384-0328-6F590DCAA5AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD729CC8-FAAC-B384-0328-6F590DCAA5AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD729CC8-FAAC-B384-0328-6F590DCAA5AA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Azure.Generator.csproj b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Azure.Generator.csproj index cc580e9ac201..8ee15c37f1ce 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Azure.Generator.csproj +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Azure.Generator.csproj @@ -1,18 +1,21 @@  - net8.0 Azure.Generator 1.0.0-beta.1 true - CS8002 - latest - - - - + + + + + + + + + + @@ -20,6 +23,7 @@ + @@ -30,6 +34,57 @@ Always + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientPlugin.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientPlugin.cs index dc341ea919c1..066a1dd6c09e 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientPlugin.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientPlugin.cs @@ -3,9 +3,8 @@ using Azure.Generator.Utilities; using Microsoft.CodeAnalysis; -using Microsoft.Generator.CSharp; -using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator; +using Microsoft.TypeSpec.Generator.ClientModel; using System; using System.ComponentModel.Composition; using System.IO; @@ -53,9 +52,10 @@ public override void Configure() AddMetadataReference(MetadataReference.CreateFromFile(typeof(Response).Assembly.Location)); var sharedSourceDirectory = Path.Combine(Path.GetDirectoryName(typeof(AzureClientPlugin).Assembly.Location)!, "Shared", "Core"); AddSharedSourceDirectory(sharedSourceDirectory); + AddVisitor(new NamespaceVisitor()); if (IsAzureArm.Value) { - AddVisitor(new AzureArmVisitor()); + AddVisitor(new RestClientVisitor()); } } diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureOutputLibrary.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureOutputLibrary.cs index ad6c15eeaaef..d2e9a8da24f4 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureOutputLibrary.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureOutputLibrary.cs @@ -4,8 +4,8 @@ using Azure.Generator.Mgmt.Models; using Azure.Generator.Providers; using Azure.Generator.Utilities; -using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.Providers; +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.Providers; using System.Collections.Generic; namespace Azure.Generator @@ -76,7 +76,20 @@ private Dictionary CategorizeClients() /// // TODO: generate resources and collections - protected override TypeProvider[] BuildTypeProviders() => [.. base.BuildTypeProviders(), new RequestContextExtensionsDefinition()]; + protected override TypeProvider[] BuildTypeProviders() + { + if (AzureClientPlugin.Instance.IsAzureArm.Value == true) + { + var armOperation = new MgmtLongRunningOperationProvider(false); + var genericArmOperation = new MgmtLongRunningOperationProvider(true); + + // TODO: remove them once they are referenced in Resource operation implementation + AzureClientPlugin.Instance.AddTypeToKeep(armOperation.Name); + AzureClientPlugin.Instance.AddTypeToKeep(genericArmOperation.Name); + return [.. base.BuildTypeProviders(), new RequestContextExtensionsDefinition(), armOperation, genericArmOperation]; + } + return [.. base.BuildTypeProviders(), new RequestContextExtensionsDefinition()]; + } internal bool IsResource(string name) => _resourceDataBySpecNameMap.ContainsKey(name); } diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs index b42b7fb532a4..93ce7107e0d2 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs @@ -5,14 +5,14 @@ using Azure.Generator.Primitives; using Azure.Generator.Providers; using Azure.Generator.Providers.Abstraction; -using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; using System; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -78,7 +78,9 @@ public class AzureTypeFactory : ScmTypeFactory } /// +#pragma warning disable AZC0014 // Avoid using banned types in public API public override ValueExpression DeserializeJsonValue(Type valueType, ScopedApi element, SerializationFormat format) +#pragma warning restore AZC0014 // Avoid using banned types in public API { var expression = DeserializeJsonValueCore(valueType, element, format); return expression ?? base.DeserializeJsonValue(valueType, element, format); @@ -143,5 +145,11 @@ protected override IReadOnlyList CreateSerializationsCore(InputTyp } return base.CreateModelCore(model); } + + /// + public override NewProjectScaffolding CreateNewProjectScaffolding() + { + return new NewAzureProjectScaffolding(); + } } } diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/InputTransformation/InputClientTransformer.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/InputTransformation/InputClientTransformer.cs index 1b5363ed9769..838f538f00b2 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/InputTransformation/InputClientTransformer.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/InputTransformation/InputClientTransformer.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; using System; using System.Collections.Generic; @@ -26,7 +26,7 @@ internal static class InputClientTransformer // There is no need to check sub-clients or custom code since it is specific to handle the above removing if (operationsToKeep.Count == 0) return null; - return new InputClient(client.Name, client.Summary, client.Doc, operationsToKeep, client.Parameters, client.Parent); + return new InputClient(client.Name, client.Namespace, client.Summary, client.Doc, operationsToKeep, client.Parameters, client.Parent); } private static IReadOnlyList TransformInputOperationParameters(InputOperation operation) diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Mgmt/Models/OperationSet.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Mgmt/Models/OperationSet.cs index bf071b8dc06a..feebbee65b16 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Mgmt/Models/OperationSet.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Mgmt/Models/OperationSet.cs @@ -3,7 +3,7 @@ using Azure.Core; using Azure.Generator.Utilities; -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; using System; using System.Collections; using System.Collections.Generic; @@ -85,8 +85,6 @@ public bool Equals([AllowNull] OperationSet other) return null; } - - private InputOperation? FindBestOperation() { // first we try GET operation diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/NamespaceVisitor.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/NamespaceVisitor.cs new file mode 100644 index 000000000000..50451067f6ac --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/NamespaceVisitor.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Providers; + +namespace Azure.Generator +{ + internal class NamespaceVisitor : ScmLibraryVisitor + { + protected override ModelProvider? Visit(InputModelType model, ModelProvider? type) + { + if (type is not null) + { + UpdateModelsNamespace(type); + } + return type; + } + + protected override TypeProvider? Visit(InputEnumType enumType, TypeProvider? type) + { + if (enumType.Usage.HasFlag(InputModelTypeUsage.ApiVersionEnum)) + { + return type; + } + + if (type is not null) + { + UpdateModelsNamespace(type); + } + return type; + } + + protected override TypeProvider? Visit(TypeProvider type) + { + if (type is EnumProvider && type.Name == "ServiceVersion") + { + return type; + } + + if (type is ModelProvider || type is EnumProvider || type is ModelFactoryProvider + || type is MrwSerializationTypeDefinition || type is FixedEnumSerializationProvider || type is ExtensibleEnumSerializationProvider) + { + UpdateModelsNamespace(type); + } + else + { + type.Type.Namespace = AzureClientPlugin.Instance.TypeFactory.RootNamespace; + } + return type; + } + + private static void UpdateModelsNamespace(TypeProvider type) + { + // TODO: need to take consideration of model-namespace configuration + // if model-namespace is false, set namespace to $"{AzureClientPlugin.Instance.TypeFactory.RootNamespace}" + // if model-namespace is true, set namespace to $"{AzureClientPlugin.Instance.TypeFactory.RootNamespace}.Models" + type.Type.Namespace = AzureClientPlugin.Instance.TypeFactory.GetCleanNameSpace($"{AzureClientPlugin.Instance.TypeFactory.RootNamespace}.Models"); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/KnownAzureTypes.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/KnownAzureTypes.cs index 263e94ca0bd6..22127225b086 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/KnownAzureTypes.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/KnownAzureTypes.cs @@ -2,19 +2,19 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Generator.CSharp.ClientModel.Snippets; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.ClientModel.Snippets; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; using System; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Net; using System.Text.Json; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Primitives { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/NewAzureProjectScaffolding.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/NewAzureProjectScaffolding.cs new file mode 100644 index 000000000000..6211ba5a5054 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/NewAzureProjectScaffolding.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator; +using Microsoft.TypeSpec.Generator.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Generator.Primitives +{ + /// + /// Defines the new project scaffolding needed for an azure sdk. + /// + public class NewAzureProjectScaffolding : NewProjectScaffolding + { + private const string MSBuildThisFileDirectory = "$(MSBuildThisFileDirectory)"; + private const string RelativeCoreSegment = "sdk/core/Azure.Core/src/Shared/"; + private const string ParentDirectory = "../"; + + /// + protected override string GetSourceProjectFileContent() + { + var builder = new CSharpProjectWriter() + { + Description = $"This is the {AzureClientPlugin.Instance.TypeFactory.RootNamespace} client library for developing .NET applications with rich experience.", + AssemblyTitle = $"SDK Code Generation {AzureClientPlugin.Instance.TypeFactory.RootNamespace}", + Version = "1.0.0-beta.1", + PackageTags = AzureClientPlugin.Instance.TypeFactory.RootNamespace, + GenerateDocumentationFile = true, + }; + + foreach (var packages in _azureDependencyPackages) + { + builder.PackageReferences.Add(packages); + } + + int pathSegmentCount = GetPathSegmentCount(); + if (AzureClientPlugin.Instance.InputLibrary.InputNamespace.Auth.ApiKey is not null) + { + builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("AzureKeyCredentialPolicy.cs", pathSegmentCount), "Shared/Core")); + } + + TraverseInput(out bool hasOperation, out bool hasLongRunningOperation); + if (hasOperation) + { + builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("RawRequestUriBuilder.cs", pathSegmentCount), "Shared/Core")); + } + + if (hasLongRunningOperation) + { + foreach (var file in _lroSharedFiles) + { + builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude(file, pathSegmentCount), "Shared/Core")); + } + } + + return builder.Write(); + } + + private static readonly IReadOnlyList _lroSharedFiles = + [ + "AppContextSwitchHelper.cs", + "AsyncLockWithValue.cs", + "FixedDelayWithNoJitterStrategy.cs", + "ClientDiagnostics.cs", + "DiagnosticScopeFactory.cs", + "DiagnosticScope.cs", + "HttpMessageSanitizer.cs", + "IOperationSource.cs", + "NextLinkOperationImplementation.cs", + "OperationFinalStateVia.cs", + "OperationInternal.cs", + "OperationInternalBase.cs", + "OperationInternalOfT.cs", + "OperationPoller.cs", + "SequentialDelayStrategy.cs", + "TaskExtensions.cs", + "TrimmingAttribute.cs", + "VoidValue.cs" + ]; + + private static void TraverseInput(out bool hasOperation, out bool hasLongRunningOperation) + { + hasOperation = false; + hasLongRunningOperation = false; + foreach (var inputClient in AzureClientPlugin.Instance.InputLibrary.InputNamespace.Clients) + { + foreach (var operation in inputClient.Operations) + { + hasOperation = true; + if (operation.LongRunning != null) + { + hasLongRunningOperation = true; + return; + } + } + } + } + + private static int GetPathSegmentCount() + { + ReadOnlySpan text = AzureClientPlugin.Instance.Configuration.OutputDirectory.AsSpan(); + // we are either a spector project in the eng folder or a real sdk in the sdk folder + int beginning = text.IndexOf("eng"); + if (beginning == -1) + { + beginning = text.IndexOf("sdk"); + } + text = text.Slice(beginning); + // starting with 2 to include eng at the beginning and src at the end + int pathSegmentCount = 2 + text.Count('/'); + // count both path separators to normalize + pathSegmentCount += text.Count('\\'); + return pathSegmentCount; + } + + private string GetCompileInclude(string fileName, int pathSegmentCount) + { + return $"{MSBuildThisFileDirectory}{string.Concat(Enumerable.Repeat(ParentDirectory, pathSegmentCount))}{RelativeCoreSegment}{fileName}"; + } + + private static readonly IReadOnlyList _azureDependencyPackages = + AzureClientPlugin.Instance.IsAzureArm.Value == true + ? [ + new("Azure.Core"), + new("Azure.ResourceManager"), + new("System.ClientModel"), + new("System.Text.Json") + ] + : [ + new("Azure.Core"), + new("System.ClientModel"), + new("System.Text.Json") + ]; + + /// + protected override string GetSolutionFileContent() + { + string slnContent = @"Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project(""{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}"") = ""{0}"", ""src\{0}.csproj"", ""{{28FF4005-4467-4E36-92E7-DEA27DEB1519}}"" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {{28FF4005-4467-4E36-92E7-DEA27DEB1519}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {{28FF4005-4467-4E36-92E7-DEA27DEB1519}}.Debug|Any CPU.Build.0 = Debug|Any CPU + {{28FF4005-4467-4E36-92E7-DEA27DEB1519}}.Release|Any CPU.ActiveCfg = Release|Any CPU + {{28FF4005-4467-4E36-92E7-DEA27DEB1519}}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {{A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}} + EndGlobalSection +EndGlobal +"; + return string.Format(slnContent, AzureClientPlugin.Instance.TypeFactory.RootNamespace); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json index d2eb974d8e2f..1fd60a55a7a8 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json @@ -1,9 +1,149 @@ -{ +{ "profiles": { "Basic-TypeSpec": { "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Local/Basic-TypeSpec -p AzureClientPlugin", "commandName": "Executable", "executablePath": "dotnet" + }, + "http-authentication-api-key": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/authentication/api-key -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-authentication-http-custom": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/authentication/http/custom -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-authentication-oauth2": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/authentication/oauth2 -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-authentication-union": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/authentication/union -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-client-structure-default": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/client/structure/default -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-encode-numeric": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/encode/numeric -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-parameters-basic": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/parameters/basic -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-parameters-body-optionality": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/parameters/body-optionality -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-parameters-spread": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/parameters/spread -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-payload-content-negotiation": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/payload/content-negotiation -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-payload-json-merge-patch": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/payload/json-merge-patch -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-payload-media-type": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/payload/media-type -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-serialization-encoded-name-json": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/serialization/encoded-name/json -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-server-endpoint-not-defined": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/server/endpoint/not-defined -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-server-path-single": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/server/path/single -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-server-versions-not-versioned": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/server/versions/not-versioned -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-special-headers-conditional-request": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/special-headers/conditional-request -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-special-headers-repeatability": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/special-headers/repeatability -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-special-words": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/special-words -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-enum-fixed": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/enum/fixed -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-empty": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/empty -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-inheritance-nested-discriminator": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/inheritance/nested-discriminator -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-inheritance-not-discriminated": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/inheritance/not-discriminated -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-inheritance-recursive": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/inheritance/recursive -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-inheritance-single-discriminator": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/inheritance/single-discriminator -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-usage": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/usage -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-model-visibility": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/model/visibility -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + }, + "http-type-property-nullable": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/TestProjects/Spector/http/type/property/nullable -p AzureStubPlugin", + "commandName": "Executable", + "executablePath": "dotnet" } } } diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureClientResponseProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureClientResponseProvider.cs index a47851a04548..1b874baefa79 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureClientResponseProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureClientResponseProvider.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Snippets; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Snippets; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureResponseProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureResponseProvider.cs index 11517a6a7f2e..06e5ce1ea362 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureResponseProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureResponseProvider.cs @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Snippets; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Snippets; using System; using System.IO; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpMessageProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpMessageProvider.cs index c8113b69c484..a8693ad164a8 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpMessageProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpMessageProvider.cs @@ -2,11 +2,10 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Statements; namespace Azure.Generator.Providers { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpPipelineProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpPipelineProvider.cs index 6894d95402cb..aa6fe8374432 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpPipelineProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpPipelineProvider.cs @@ -3,14 +3,14 @@ using Azure.Core; using Azure.Core.Pipeline; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; using System.Threading; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers.Abstraction { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestOptionsProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestOptionsProvider.cs index 5a1240531892..63505af515a7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestOptionsProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestOptionsProvider.cs @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers.Abstraction { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestProvider.cs index b09ce221e158..2d2142d636fc 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/HttpRequestProvider.cs @@ -2,13 +2,13 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Statements; using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/RequestContentProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/RequestContentProvider.cs index 8fbd2922aeda..0b37ebe3bf85 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/RequestContentProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/RequestContentProvider.cs @@ -2,13 +2,13 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; using System.ClientModel.Primitives; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/StatusCodeClassifierProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/StatusCodeClassifierProvider.cs index 1fd171a0514b..1294f205bf1a 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/StatusCodeClassifierProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/StatusCodeClassifierProvider.cs @@ -2,12 +2,12 @@ // Licensed under the MIT License. using Azure.Core; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; using System.Collections.Generic; using System.Linq; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers.Abstraction { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/MgmtLongRunningOperationProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/MgmtLongRunningOperationProvider.cs new file mode 100644 index 000000000000..9082319badf7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/MgmtLongRunningOperationProvider.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Generator.Utilities; +using Azure.ResourceManager; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Statements; +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; + +namespace Azure.Generator.Providers +{ + internal class MgmtLongRunningOperationProvider : TypeProvider + { + private class Template { } + private readonly CSharpType _t = typeof(Template<>).GetGenericArguments()[0]; + + private bool _isGeneric; + private FieldProvider _operationField; + private FieldProvider _rehydrationTokenField; + private FieldProvider _nextLinkOperationField; + private FieldProvider _operationIdField; + + public MgmtLongRunningOperationProvider(bool isGeneric) + { + _isGeneric = isGeneric; + _operationField = new FieldProvider(FieldModifiers.Private | FieldModifiers.ReadOnly, isGeneric ? new CSharpType(typeof(OperationInternal<>), _t) : typeof(OperationInternal), "_operation", this); + _rehydrationTokenField = new FieldProvider(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(RehydrationToken), true), "_completeRehydrationToken", this); + _nextLinkOperationField = new FieldProvider(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(NextLinkOperationImplementation), true), "_nextLinkOperation", this); + _operationIdField = new FieldProvider(FieldModifiers.Private | FieldModifiers.ReadOnly, typeof(string), "_operationId", this); + } + + private readonly string _serviceName = AzureClientPlugin.Instance.InputLibrary.InputNamespace.Name.Split('.').Last(); + protected override string BuildName() => $"{_serviceName}ArmOperation"; + + protected override CSharpType[] GetTypeArguments() => _isGeneric ? new CSharpType[] { _t } : base.GetTypeArguments(); + + protected override string BuildRelativeFilePath() + { + return Path.Combine("src", "Generated", "LongRunningOperation", GetFileName()); + + string GetFileName() => _isGeneric ? $"{_serviceName}ArmOperationOfT.cs" : $"{Name}.cs"; + } + + protected override CSharpType[] BuildImplements() => [_isGeneric ? new CSharpType(typeof(ArmOperation<>), _t) : typeof(ArmOperation)]; + + protected override FieldProvider[] BuildFields() + => [_operationField, _rehydrationTokenField, _nextLinkOperationField, _operationIdField]; + + protected override MethodProvider[] BuildMethods() + { + var getRehydrationTokenMethod = new MethodProvider( + new MethodSignature("GetRehydrationToken", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(RehydrationToken), true), null, []), + _nextLinkOperationField.NullConditional().Invoke(nameof(NextLinkOperationImplementation.GetRehydrationToken)).NullCoalesce(_rehydrationTokenField), + this, XmlDocProvider.InheritDocs); + + var getRawResponseMethod = new MethodProvider( + new MethodSignature("GetRawResponse", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(Response), null, []), + _operationField.Property("RawResponse"), + this, XmlDocProvider.InheritDocs); + + var updateStatusMethod = new MethodProvider( + new MethodSignature("UpdateStatus", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(Response), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("UpdateStatus", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + var updateStatusAsyncMethod = new MethodProvider( + new MethodSignature("UpdateStatusAsync", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(ValueTask<>), typeof(Response)), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("UpdateStatusAsync", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + var waitForCompletionResponseMethod = _isGeneric + ? new MethodProvider( + new MethodSignature("WaitForCompletion", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(Response<>), _t), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletion", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs) + : new MethodProvider( + new MethodSignature("WaitForCompletionResponse", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(Response), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionResponse", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + var timeSpanParameter = new ParameterProvider("pollingInterval", $"The interval between pollings", typeof(TimeSpan)); + var waitForCompletionResponseWithPolingMethod = _isGeneric + ? new MethodProvider( + new MethodSignature("WaitForCompletion", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(Response<>), _t), null, [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletion", [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs) + : new MethodProvider( + new MethodSignature("WaitForCompletionResponse", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(Response), null, [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionResponse", [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + var waitForCompletionResponseAsyncMethod = _isGeneric + ? new MethodProvider( + new MethodSignature("WaitForCompletionAsync", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(ValueTask<>), new CSharpType(typeof(Response<>), _t)), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionAsync", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs) + : new MethodProvider( + new MethodSignature("WaitForCompletionResponseAsync", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(ValueTask<>), typeof(Response)), null, [KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionResponseAsync", [KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + var waitForCompletionResponseWithPollingAsyncMethod = _isGeneric + ? new MethodProvider( + new MethodSignature("WaitForCompletionAsync", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(ValueTask<>), new CSharpType(typeof(Response<>), _t)), null, [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionAsync", [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs) + : new MethodProvider( + new MethodSignature("WaitForCompletionResponseAsync", null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, new CSharpType(typeof(ValueTask<>), typeof(Response)), null, [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + _operationField.Invoke("WaitForCompletionResponseAsync", [timeSpanParameter, KnownParameters.CancellationTokenParameter]), + this, XmlDocProvider.InheritDocs); + + return [BuildGetOperationIdMethod(), getRehydrationTokenMethod, getRawResponseMethod, updateStatusMethod, updateStatusAsyncMethod, waitForCompletionResponseMethod, waitForCompletionResponseWithPolingMethod, waitForCompletionResponseAsyncMethod, waitForCompletionResponseWithPollingAsyncMethod]; + } + + private const string GetOperationIdName = "GetOperationId"; + private MethodProvider BuildGetOperationIdMethod() + { + var rehydrationTokenParaemter = new ParameterProvider("rehydrationToken", $"The token to rehydrate a long-running operation", new CSharpType(typeof(RehydrationToken), true)); + var signature = new MethodSignature(GetOperationIdName, null, MethodSignatureModifiers.Private, typeof(string), null, [rehydrationTokenParaemter]); + var body = new MethodBodyStatement[] + { + new IfStatement(rehydrationTokenParaemter.Is(Null)) + { + Return(Null) + }, + Declare("lroDetails", typeof(Dictionary), Static(typeof(ModelReaderWriter)).Invoke("Write", [rehydrationTokenParaemter, Static(typeof(ModelReaderWriterOptions)).Property("Json")]).Invoke("ToObjectFromJson", [], new List{ typeof(Dictionary) }, false), out var lroDetailsVariable), + Return(new IndexerExpression(lroDetailsVariable, Literal("id"))) + }; + return new MethodProvider(signature, body, this); + } + + protected override ConstructorProvider[] BuildConstructors() + => [ConstructorProviderHelper.BuildMockingConstructor(this), BuildRehydrationConstructor(), BuildInitializationConstructor()]; + + private ConstructorProvider BuildInitializationConstructor() + { + var sourceParameter = new ParameterProvider("source", $"The instance of ", new CSharpType(typeof(IOperationSource<>), _t)); + var clientDiagnosticsParameter = new ParameterProvider("clientDiagnostics", $"The instance of ", typeof(ClientDiagnostics)); + var pipelineParameter = new ParameterProvider("pipeline", $"The instance of ", typeof(HttpPipeline)); + var requestParameter = new ParameterProvider("request", $"The operation request", typeof(Request)); + var responseParameter = new ParameterProvider("response", $"The opertion response", typeof(Response)); + var finalStateViaParameter = new ParameterProvider("finalStateVia", $"The finalStateVia of the operation", typeof(OperationFinalStateVia)); + var skipApiVersionOverrideParameter = new ParameterProvider("skipApiVersionOverride", $"If should skip Api version override", typeof(bool), defaultValue: Literal(false)); + var apiVersionOverrideValueParameter = new ParameterProvider("apiVersionOverrideValue", $"The Api version override value", typeof(string), defaultValue: Null); + var parameters = _isGeneric + ? new List + { + sourceParameter, + clientDiagnosticsParameter, + pipelineParameter, + requestParameter, + responseParameter, + finalStateViaParameter, + skipApiVersionOverrideParameter, + apiVersionOverrideValueParameter, + } + : new List + { + clientDiagnosticsParameter, + pipelineParameter, + requestParameter, + responseParameter, + finalStateViaParameter, + skipApiVersionOverrideParameter, + apiVersionOverrideValueParameter, + }; + var signature = new ConstructorSignature(Type, $"", MethodSignatureModifiers.Internal, parameters, null); + var responseDeclaration = Declare("nextLinkOperation", typeof(IOperation), Static(typeof(NextLinkOperationImplementation)).Invoke("Create", [pipelineParameter, requestParameter.Property("Method"), requestParameter.Property("Uri").Invoke("ToUri"), responseParameter, finalStateViaParameter, skipApiVersionOverrideParameter, apiVersionOverrideValueParameter]), out var nextLinkOperationVariable); + + var body = new MethodBodyStatement[] + { + responseDeclaration, + new IfElseStatement( + nextLinkOperationVariable.Is(Declare("nextLinkOperationImplementation", out var nextLinkOperationImplementationVariable)), + new MethodBodyStatements([ + _nextLinkOperationField.Assign(nextLinkOperationImplementationVariable).Terminate(), + _operationIdField.Assign(_nextLinkOperationField.Property("OperationId")).Terminate(), + ]), + new MethodBodyStatements([ + _rehydrationTokenField.Assign(Static(typeof(NextLinkOperationImplementation)).Invoke("GetRehydrationToken", [requestParameter.Property("Method"), requestParameter.Property("Uri").Invoke("ToUri"), responseParameter, finalStateViaParameter])).Terminate(), + _operationIdField.Assign(This.Invoke(GetOperationIdName, _rehydrationTokenField)).Terminate(), + ])), + _operationField.Assign(_isGeneric + ? New.Instance(new CSharpType(typeof(OperationInternal<>), _t), [Static().Invoke("Create", sourceParameter, nextLinkOperationVariable), clientDiagnosticsParameter, responseParameter, Literal(Name), Null, New.Instance(typeof(SequentialDelayStrategy))]) + : New.Instance(typeof(OperationInternal), [nextLinkOperationVariable, clientDiagnosticsParameter, responseParameter, Literal(Name), Null, New.Instance(typeof(SequentialDelayStrategy))])).Terminate(), + }; + return new ConstructorProvider(signature, body, this); + } + + private ConstructorProvider BuildRehydrationConstructor() + { + var responseParameter = new ParameterProvider("response", $"The operation response", _isGeneric ? new CSharpType(typeof(Response<>), _t) : typeof(Response)); + var rehydrationTokenParameter = new ParameterProvider("rehydrationToken", $"The token to rehydrate the operation", new CSharpType(typeof(RehydrationToken), true), Null); + var signature = new ConstructorSignature(Type, $"", MethodSignatureModifiers.Internal, [responseParameter, rehydrationTokenParameter], null); + var body = new MethodBodyStatement[] + { + _operationField.Assign(_isGeneric + ? Static(new CSharpType(typeof(OperationInternal<>), _t)).Invoke(nameof(OperationInternal.Succeeded), [responseParameter.Invoke("GetRawResponse"), responseParameter.Property("Value")]) + : Static(typeof(OperationInternal)).Invoke(nameof(OperationInternal.Succeeded), [responseParameter]) + ).Terminate(), + _rehydrationTokenField.Assign(rehydrationTokenParameter).Terminate(), + _operationIdField.Assign(This.Invoke(GetOperationIdName, rehydrationTokenParameter)).Terminate(), + }; + return new ConstructorProvider(signature, body, this); + } + + protected override PropertyProvider[] BuildProperties() + { + var idProperty = new PropertyProvider(null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(string), "Id", new ExpressionPropertyBody(_operationIdField.NullCoalesce(Static().Property(nameof(NextLinkOperationImplementation.NotSet)))), this); + var hasCompletedProperty = new PropertyProvider(null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(bool), "HasCompleted", new ExpressionPropertyBody(_operationField.Property("HasCompleted")), this); + + if (_isGeneric) + { + var valueProperty = new PropertyProvider(null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, _t, "Value", new ExpressionPropertyBody(_operationField.Property("Value")), this); + var hasValueProperty = new PropertyProvider(null, MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, typeof(bool), "HasValue", new ExpressionPropertyBody(_operationField.Property("HasValue")), this); + return [idProperty, valueProperty, hasValueProperty, hasCompletedProperty]; + } + + return [idProperty, hasCompletedProperty]; + } + + protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal; + } +} \ No newline at end of file diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/RequestContextExtensionsDefinition.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/RequestContextExtensionsDefinition.cs index 9b34571045dc..9dc9c6b6526d 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/RequestContextExtensionsDefinition.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/RequestContextExtensionsDefinition.cs @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Statements; using System.IO; using System.Threading; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Azure.Generator.Providers { diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataProvider.cs index 6fdd890e490e..451689bebe0d 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataProvider.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Providers; using System.IO; namespace Azure.Generator.Providers diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataSerializationProvider.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataSerializationProvider.cs index 6b415610dcbe..e2a7993997e7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataSerializationProvider.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/ResourceDataSerializationProvider.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Providers; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Providers; using System.IO; namespace Azure.Generator.Providers diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/RestClientVisitor.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/RestClientVisitor.cs new file mode 100644 index 000000000000..c7b44c825670 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/RestClientVisitor.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using System.IO; + +namespace Azure.Generator +{ + // only apply for MPG + internal class RestClientVisitor : ScmLibraryVisitor + { + /// + protected override TypeProvider? Visit(TypeProvider type) + { + base.Visit(type); + + if (type is ClientProvider) + { + type.Update(modifiers: TransfromPublicModifiersToInternal(type), relativeFilePath: TransformRelativeFilePathForClient(type)); + } + // TODO: uncomment this once resources are generated + //if (type is RestClientProvider) + //{ + // type.Update(modifiers: TransfromPublicModifiersToInternal(type), relativeFilePath: TransformRelativeFilePathForRestClient(type)); + //} + return type; + } + + private static string TransformRelativeFilePathForClient(TypeProvider type) + => Path.Combine("src", "Generated", "RestOperations", $"{type.Name}RestOperations.cs"); + + private static string TransformRelativeFilePathForRestClient(TypeProvider type) + => Path.Combine("src", "Generated", "RestOperations", $"{type.Name}.RestClient.cs"); + + private static TypeSignatureModifiers TransfromPublicModifiersToInternal(TypeProvider type) + { + var modifiers = type.DeclarationModifiers; + if (modifiers.HasFlag(TypeSignatureModifiers.Public)) + { + modifiers &= ~TypeSignatureModifiers.Public; + modifiers |= TypeSignatureModifiers.Internal; + } + + return modifiers; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ConstructorProviderHelper.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ConstructorProviderHelper.cs new file mode 100644 index 000000000000..d93c8c0060df --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ConstructorProviderHelper.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Statements; + +namespace Azure.Generator.Utilities +{ + internal static class ConstructorProviderHelper + { + /// + /// Builds a constructor for the enclosing type for mocking purposes. + /// + /// The type provider to build the constructor for. + public static ConstructorProvider BuildMockingConstructor(TypeProvider enclosingType) + { + return new ConstructorProvider( + new ConstructorSignature(enclosingType.Type, $"Initializes a new instance of {enclosingType.Name} for mocking.", MethodSignatureModifiers.Protected, []), + new MethodBodyStatement[] { MethodBodyStatement.Empty }, + enclosingType); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/InputExtensions.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/InputExtensions.cs index 1a43d1e0af4b..7a77b71592be 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/InputExtensions.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/InputExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; using System.Collections.Generic; using System.Linq; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/OperationExtensions.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/OperationExtensions.cs index 12f1b72ee315..8553556a2576 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/OperationExtensions.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/OperationExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; using System; using System.Linq; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ResourceDetection.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ResourceDetection.cs index c99ea619555d..0a956705fde3 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ResourceDetection.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/src/Utilities/ResourceDetection.cs @@ -3,7 +3,7 @@ using Azure.Core; using Azure.Generator.Mgmt.Models; -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; using System; using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; @@ -99,7 +99,6 @@ private bool TryOperationWithMethod(OperationSet set, RequestMethod method, [May return true; } - private static bool IsResourceModel(InputModelType inputModelType) { var allProperties = inputModelType.GetAllProperties(); @@ -114,7 +113,10 @@ private static bool IsResourceModel(InputModelType inputModelType) return true; } - switch (property.SerializedName) + var serializationName = property.SerializationOptions?.Json?.Name; + if (serializationName is null) + continue; + switch (serializationName) { case "id": if (property.Type.GetImplementType() is InputPrimitiveType { Kind: InputPrimitiveTypeKind.String } inputPrimitiveType) diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Azure.Generator.Tests.csproj b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Azure.Generator.Tests.csproj index c837d9c3531e..b61e487a47da 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Azure.Generator.Tests.csproj +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Azure.Generator.Tests.csproj @@ -1,32 +1,33 @@  - - net8.0 + + net8.0 latest - - CS8002 - + + CS8002 + - - - - - - + + + + + + + - - - PreserveNewest - - + + + PreserveNewest + + - - - + + + - - - PreserveNewest - - - + + + PreserveNewest + + + diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/AzureTypeFactoryTests.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/AzureTypeFactoryTests.cs index a1891afa3f61..d2868007023e 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/AzureTypeFactoryTests.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/AzureTypeFactoryTests.cs @@ -4,14 +4,11 @@ using Azure.Core; using Azure.Generator.Tests.Common; using Azure.Generator.Tests.TestHelpers; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; using NUnit.Framework; using System; -using System.Buffers; using System.ClientModel.Primitives; using System.Net; using System.Text.Json; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/Helpers.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/Helpers.cs index 942a4e483bc0..47348ac96aaa 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/Helpers.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/Helpers.cs @@ -23,7 +23,6 @@ private static string GetAssetFileOrDirectoryPath( [CallerMemberName] string method = "", [CallerFilePath] string filePath = "") { - var callingClass = Path.GetFileName(filePath).Split('.').First(); var paramString = parameters is null ? string.Empty : $"({parameters})"; var extName = isFile ? ".cs" : string.Empty; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/InputFactory.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/InputFactory.cs index 06626d67fea9..e4a4a355b9e4 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/InputFactory.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Common/InputFactory.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.Generator.CSharp.Input; +using Microsoft.TypeSpec.Generator.Input; namespace Azure.Generator.Tests.Common { @@ -121,10 +121,12 @@ public static InputEnumType Enum( string access = "public", InputModelTypeUsage usage = InputModelTypeUsage.Output | InputModelTypeUsage.Input, IEnumerable? values = null, - bool isExtensible = false) + bool isExtensible = false, + string clientNamespace = "Sample.Models") { return new InputEnumType( name, + clientNamespace, name, access, null, @@ -148,17 +150,18 @@ public static InputModelProperty Property( { return new InputModelProperty( name, - wireName ?? name, summary, description ?? $"Description for {name}", type, isRequired, isReadOnly, - isDiscriminator); + isDiscriminator, + new(json: new(wireName ?? name))); } public static InputModelType Model( string name, + string clientNamespace = "Sample.Models", string access = "public", InputModelTypeUsage usage = InputModelTypeUsage.Output | InputModelTypeUsage.Input | InputModelTypeUsage.Json, IEnumerable? properties = null, @@ -172,6 +175,7 @@ public static InputModelType Model( IEnumerable propertiesList = properties ?? [Property("StringProperty", InputPrimitiveType.String)]; return new InputModelType( name, + clientNamespace, name, access, null, @@ -185,7 +189,8 @@ public static InputModelType Model( propertiesList.FirstOrDefault(p => p.IsDiscriminator), discriminatedModels is null ? new Dictionary() : discriminatedModels.AsReadOnly(), additionalProperties, - modelAsStruct); + modelAsStruct, + new()); } public static InputType Array(InputType elementType) @@ -244,12 +249,13 @@ public static OperationResponse OperationResponse(IEnumerable? statusCodes ["application/json"]); } - public static InputClient Client(string name, IEnumerable? operations = null, IEnumerable? parameters = null, string? parent = null) + public static InputClient Client(string name, string clientNamespace = "Sample", string? doc = null, IEnumerable? operations = null, IEnumerable? parameters = null, string? parent = null) { return new InputClient( name, - null, - $"{name} description", + clientNamespace, + string.Empty, + doc ?? $"{name} description", operations is null ? [] : [.. operations], parameters is null ? [] : [.. parameters], parent); diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/Abstractions/AzureClientResponseProviderTests.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/Abstractions/AzureClientResponseProviderTests.cs index 47e8a0bf90ee..9bb94fe56ad2 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/Abstractions/AzureClientResponseProviderTests.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/Abstractions/AzureClientResponseProviderTests.cs @@ -3,10 +3,10 @@ using Azure.Generator.Tests.Common; using Azure.Generator.Tests.TestHelpers; -using Microsoft.Generator.CSharp.ClientModel.Providers; using System.Linq; using NUnit.Framework; using Azure.Generator.Providers; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; namespace Azure.Generator.Tests.Providers.Abstractions { @@ -49,7 +49,7 @@ public void ValidateClientResponseExceptionTypeIsOverridden() private static ClientProvider CreateMockClientProvider() { - var client = InputFactory.Client("TestClient", [InputFactory.Operation("foo")]); + var client = InputFactory.Client("TestClient", operations: [InputFactory.Operation("foo")]); MockHelpers.LoadMockPlugin(clientResponseApi: AzureClientResponseProvider.Instance); var clientProvider = AzureClientPlugin.Instance.TypeFactory.CreateClient(client)!; return clientProvider; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ClientProviderTests.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ClientProviderTests.cs index 8254f232db7b..f0cac25c0cc7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ClientProviderTests.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ClientProviderTests.cs @@ -1,10 +1,13 @@ -using Azure.Core; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; using Azure.Generator.Tests.Common; using Azure.Generator.Tests.TestHelpers; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; using NUnit.Framework; using System; using System.Collections.Generic; @@ -19,9 +22,9 @@ internal class ClientProviderTests private const string KeyAuthCategory = "WithKeyAuth"; private const string OAuth2Category = "WithOAuth2"; private const string TestClientName = "TestClient"; - private static readonly InputClient _animalClient = new("animal", null, "AnimalClient description", [], [], TestClientName); - private static readonly InputClient _dogClient = new("dog", null, "DogClient description", [], [], _animalClient.Name); - private static readonly InputClient _huskyClient = new("husky", null, "HuskyClient description", [], [], _dogClient.Name); + private static readonly InputClient _animalClient = new("animal", "Samples", "AnimalClient description", null, [], [], TestClientName); + private static readonly InputClient _dogClient = new("dog", "Samples", "DogClient description", null, [], [], _animalClient.Name); + private static readonly InputClient _huskyClient = new("husky", "Samples", "HuskyClient description", null, [], [], _dogClient.Name); private bool _containsSubClients; private bool _hasKeyAuth; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/MgmtLongRunningOperationProviderTests.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/MgmtLongRunningOperationProviderTests.cs new file mode 100644 index 000000000000..a6e0e6ab332d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/MgmtLongRunningOperationProviderTests.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Generator.Providers; +using Azure.Generator.Tests.Common; +using Azure.Generator.Tests.TestHelpers; +using Microsoft.TypeSpec.Generator.Primitives; +using NUnit.Framework; + +namespace Azure.Generator.Tests.Providers +{ + internal class MgmtLongRunningOperationProviderTests + { + [SetUp] + public void SetUp() + { + MockHelpers.LoadMockPlugin(); + } + + [TestCase] + public void Verify_NonGeneric_MgmtLROProviderGeneration() + { + var nonGenericLROProvider = new MgmtLongRunningOperationProvider(false); + var codeFile = new TypeProviderWriter(nonGenericLROProvider).Write(); + var result = codeFile.Content; + + var exptected = Helpers.GetExpectedFromFile(); + + Assert.AreEqual(exptected, result); + } + + [TestCase] + public void Verify_Generic_MgmtLROProviderGeneration() + { + var genericLROProvider = new MgmtLongRunningOperationProvider(true); + var codeFile = new TypeProviderWriter(genericLROProvider).Write(); + var result = codeFile.Content; + + var exptected = Helpers.GetExpectedFromFile(); + + Assert.AreEqual(exptected, result); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ResourceDataProviderTests.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ResourceDataProviderTests.cs index 8f826276b3c2..fc129892454c 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ResourceDataProviderTests.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/ResourceDataProviderTests.cs @@ -1,8 +1,11 @@ -using Azure.Generator.Providers; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Generator.Providers; using Azure.Generator.Tests.Common; using Azure.Generator.Tests.TestHelpers; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Providers; using NUnit.Framework; using System.Linq; @@ -12,7 +15,7 @@ internal class ResourceDataProviderTests { private const string TestClientName = "TestClient"; - [TestCase()] + [TestCase] public void ValidateResourceDataProviderIsGenerated() { var resourceModelName = "responseType"; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs index 5aec0d8cb783..d0a1a7addb6c 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs @@ -1,6 +1,6 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; Pipeline = global::Azure.Core.Pipeline.HttpPipelineBuilder.Build(options, Array.Empty()); diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs index f9be93c9763e..822997991bc9 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _tokenCredential = tokenCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs index ccf0e0c75201..53e13d59b2c7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _keyCredential = keyCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs index ccf0e0c75201..53e13d59b2c7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _keyCredential = keyCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs index f9be93c9763e..822997991bc9 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _tokenCredential = tokenCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs index 5aec0d8cb783..d0a1a7addb6c 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs @@ -1,6 +1,6 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; Pipeline = global::Azure.Core.Pipeline.HttpPipelineBuilder.Build(options, Array.Empty()); diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs index f9be93c9763e..822997991bc9 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _tokenCredential = tokenCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs index ccf0e0c75201..53e13d59b2c7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _keyCredential = keyCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs index ccf0e0c75201..53e13d59b2c7 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _keyCredential = keyCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs index f9be93c9763e..822997991bc9 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs @@ -1,7 +1,7 @@ -global::sample.namespace.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::sample.namespace.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); +global::Samples.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Samples.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); -options ??= new global::sample.namespace.TestClientOptions(); +options ??= new global::Samples.TestClientOptions(); _endpoint = endpoint; _tokenCredential = tokenCredential; diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_Generic_MgmtLROProviderGeneration.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_Generic_MgmtLROProviderGeneration.cs new file mode 100644 index 000000000000..163ff18cade1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_Generic_MgmtLROProviderGeneration.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Samples +{ + internal partial class SamplesArmOperation : global::Azure.ResourceManager.ArmOperation + { + private readonly global::Azure.Core.OperationInternal _operation; + private readonly global::Azure.Core.RehydrationToken? _completeRehydrationToken; + private readonly global::Azure.Core.NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + protected SamplesArmOperation() + { + } + + internal SamplesArmOperation(global::Azure.Response response, global::Azure.Core.RehydrationToken? rehydrationToken = null) + { + _operation = global::Azure.Core.OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = this.GetOperationId(rehydrationToken); + } + + internal SamplesArmOperation(global::Azure.Core.IOperationSource source, global::Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, global::Azure.Core.Pipeline.HttpPipeline pipeline, global::Azure.Core.Request request, global::Azure.Response response, global::Azure.Core.OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + global::Azure.Core.IOperation nextLinkOperation = global::Azure.Core.NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if ((nextLinkOperation is global::Azure.Core.NextLinkOperationImplementation nextLinkOperationImplementation)) + { + _nextLinkOperation = nextLinkOperationImplementation; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = global::Azure.Core.NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = this.GetOperationId(_completeRehydrationToken); + } + _operation = new global::Azure.Core.OperationInternal( + global::Azure.Core.NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "SamplesArmOperation", + null, + new global::Azure.Core.SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => (_operationId ?? global::Azure.Core.NextLinkOperationImplementation.NotSet); + + /// Gets the Value. + public override T Value => _operation.Value; + + /// Gets the HasValue. + public override bool HasValue => _operation.HasValue; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + private string GetOperationId(global::Azure.Core.RehydrationToken? rehydrationToken) + { + if ((rehydrationToken is null)) + { + return null; + } + global::System.Collections.Generic.Dictionary lroDetails = global::System.ClientModel.Primitives.ModelReaderWriter.Write(rehydrationToken, global::System.ClientModel.Primitives.ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + + /// + public override global::Azure.Core.RehydrationToken? GetRehydrationToken() => (_nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken); + + /// + public override global::Azure.Response GetRawResponse() => _operation.RawResponse; + + /// + public override global::Azure.Response UpdateStatus(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.UpdateStatus(cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask UpdateStatusAsync(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override global::Azure.Response WaitForCompletion(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletion(cancellationToken); + + /// + public override global::Azure.Response WaitForCompletion(global::System.TimeSpan pollingInterval, global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask> WaitForCompletionAsync(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask> WaitForCompletionAsync(global::System.TimeSpan pollingInterval, global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_NonGeneric_MgmtLROProviderGeneration.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_NonGeneric_MgmtLROProviderGeneration.cs new file mode 100644 index 000000000000..99fa4a262f0a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/Providers/TestData/MgmtLongRunningOperationProviderTests/Verify_NonGeneric_MgmtLROProviderGeneration.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Samples +{ + internal partial class SamplesArmOperation : global::Azure.ResourceManager.ArmOperation + { + private readonly global::Azure.Core.OperationInternal _operation; + private readonly global::Azure.Core.RehydrationToken? _completeRehydrationToken; + private readonly global::Azure.Core.NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + protected SamplesArmOperation() + { + } + + internal SamplesArmOperation(global::Azure.Response response, global::Azure.Core.RehydrationToken? rehydrationToken = null) + { + _operation = global::Azure.Core.OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = this.GetOperationId(rehydrationToken); + } + + internal SamplesArmOperation(global::Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, global::Azure.Core.Pipeline.HttpPipeline pipeline, global::Azure.Core.Request request, global::Azure.Response response, global::Azure.Core.OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + global::Azure.Core.IOperation nextLinkOperation = global::Azure.Core.NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if ((nextLinkOperation is global::Azure.Core.NextLinkOperationImplementation nextLinkOperationImplementation)) + { + _nextLinkOperation = nextLinkOperationImplementation; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = global::Azure.Core.NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = this.GetOperationId(_completeRehydrationToken); + } + _operation = new global::Azure.Core.OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "SamplesArmOperation", + null, + new global::Azure.Core.SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => (_operationId ?? global::Azure.Core.NextLinkOperationImplementation.NotSet); + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + private string GetOperationId(global::Azure.Core.RehydrationToken? rehydrationToken) + { + if ((rehydrationToken is null)) + { + return null; + } + global::System.Collections.Generic.Dictionary lroDetails = global::System.ClientModel.Primitives.ModelReaderWriter.Write(rehydrationToken, global::System.ClientModel.Primitives.ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + + /// + public override global::Azure.Core.RehydrationToken? GetRehydrationToken() => (_nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken); + + /// + public override global::Azure.Response GetRawResponse() => _operation.RawResponse; + + /// + public override global::Azure.Response UpdateStatus(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.UpdateStatus(cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask UpdateStatusAsync(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override global::Azure.Response WaitForCompletionResponse(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override global::Azure.Response WaitForCompletionResponse(global::System.TimeSpan pollingInterval, global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask WaitForCompletionResponseAsync(global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override global::System.Threading.Tasks.ValueTask WaitForCompletionResponseAsync(global::System.TimeSpan pollingInterval, global::System.Threading.CancellationToken cancellationToken = ((global::System.Threading.CancellationToken)default)) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/Configuration.json b/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/Configuration.json index f34eb20cbc6f..c49f9d0d580b 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/Configuration.json +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/Configuration.json @@ -1,7 +1,6 @@ { "output-folder": "./outputFolder", "project-folder": "./projectFolder", - "namespace": "sample.namespace", "unknown-bool-property": false, "library-name": "sample-library", "unknown-string-property": "unknownPropertyValue" diff --git a/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/MockHelpers.cs b/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/MockHelpers.cs index 330656827305..d3f796564713 100644 --- a/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/MockHelpers.cs +++ b/eng/packages/http-client-csharp/generator/Azure.Generator/test/TestHelpers/MockHelpers.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Generator.CSharp; -using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Input; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.SourceInput; +using Microsoft.TypeSpec.Generator; +using Microsoft.TypeSpec.Generator.ClientModel; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.SourceInput; using Moq; using Moq.Protected; using System; @@ -41,12 +41,13 @@ public static Mock LoadMockPlugin( IReadOnlyList inputNsModels = inputModels?.Invoke() ?? []; InputAuth inputNsAuth = new InputAuth(apiKeyAuth?.Invoke(), oauth2Auth?.Invoke()); var mockInputNs = new Mock( - string.Empty, + "Samples", inputNsApiVersions, inputNsEnums, inputNsModels, inputNsClients, - inputNsAuth); + inputNsAuth, + null); var mockInputLibrary = new Mock(_configFilePath); mockInputLibrary.Setup(p => p.InputNamespace).Returns(mockInputNs.Object); diff --git a/eng/packages/http-client-csharp/generator/Directory.Build.props b/eng/packages/http-client-csharp/generator/Directory.Build.props index 054d97162e4b..167d97e85200 100644 --- a/eng/packages/http-client-csharp/generator/Directory.Build.props +++ b/eng/packages/http-client-csharp/generator/Directory.Build.props @@ -1,10 +1,12 @@ - false - enable + enable + false + false + $(NoWarn);CS8002 diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Directory.Build.props b/eng/packages/http-client-csharp/generator/TestProjects/Directory.Build.props new file mode 100644 index 000000000000..aa6a7a08734f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Directory.Build.props @@ -0,0 +1,9 @@ + + + true + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj new file mode 100644 index 000000000000..de21ce011954 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj @@ -0,0 +1,32 @@ + + + + net8.0 + net8.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Basic-TypeSpec.tsp b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Basic-TypeSpec.tsp index e772a8aa1ead..17f98a98f443 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Basic-TypeSpec.tsp +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Basic-TypeSpec.tsp @@ -104,8 +104,8 @@ union StringExtensibleEnum { } @doc("A model with a few properties of literal types") -model Thing { - @doc("name of the Thing") +model ThingModel { + @doc("name of the ThingModel") name: string; @doc("required Union") @@ -158,7 +158,7 @@ model ModelWithRequiredNullableProperties { } @doc("this is not a friendly model but with a friendly name") -@friendlyName("Friend") +@friendlyName("FriendModel") model NotFriend { @doc("name of the NotFriend") name: string; @@ -186,7 +186,7 @@ model RoundTripModel { requiredDictionary: Record; @doc("Required model") - requiredModel: Thing; + requiredModel: ThingModel; @doc("this is an int based extensible enum") intExtensibleEnum?: IntExtensibleEnum; @@ -266,7 +266,7 @@ op sayHi( @header headParameter: string, @query queryParameter: string, @query optionalQuery?: string, -): Thing; +): ThingModel; @route("/againHi") @doc("Return hi again") @@ -293,43 +293,43 @@ op noContentType( @doc("Return hi in demo2") @get @convenientAPI(true) -op helloDemo2(): Thing; +op helloDemo2(): ThingModel; @route("/literal") @doc("Create with literal value") @post @convenientAPI(true) -op createLiteral(@body body: Thing): Thing; +op createLiteral(@body body: ThingModel): ThingModel; @route("/helloLiteral") @doc("Send literal parameters") @get @convenientAPI(true) -op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): Thing; +op helloLiteral(@header p1: "test", @path p2: 123, @query p3: true): ThingModel; @route("/top") @doc("top level method") @get @convenientAPI(true) -op topAction(@path action: utcDateTime): Thing; +op topAction(@path action: utcDateTime): ThingModel; @route("/top2") @doc("top level method2") @get @convenientAPI(false) -op topAction2(): Thing; +op topAction2(): ThingModel; @route("/patch") @doc("top level patch") @patch @convenientAPI(true) -op patchAction(@body body: Thing): Thing; +op patchAction(@body body: ThingModel): ThingModel; @route("/anonymousBody") @doc("body parameter without body decorator") @post @convenientAPI(true) -op anonymousBody(...Thing): Thing; +op anonymousBody(...ThingModel): ThingModel; @route("/friendlyName") @doc("Model can have its friendly name") @@ -363,7 +363,7 @@ op getUnknownValue(): DaysOfWeekExtensibleEnum; @post @convenientAPI(true) @protocolAPI(false) -op internalProtocol(@body body: Thing): Thing; +op internalProtocol(@body body: ThingModel): ThingModel; @doc("When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one") @route("stillConvenient") diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/BasicTypeSpec.sln b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/BasicTypeSpec.sln index 710635bbac0a..c6fbd1ba4e2c 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/BasicTypeSpec.sln +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/BasicTypeSpec.sln @@ -1,48 +1,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29709.97 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTypeSpec", "src\BasicTypeSpec.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Configuration.json index 5c6a39e33830..b6c25ae61d32 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Configuration.json +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/Configuration.json @@ -1,6 +1,5 @@ { "output-folder": ".", "namespace": "BasicTypeSpec", - "library-name": "BasicTypeSpec", - "use-model-reader-writer": true + "library-name": "BasicTypeSpec" } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/BasicTypeSpec.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/BasicTypeSpec.csproj index de5464ba7117..5a82b2866e93 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/BasicTypeSpec.csproj +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/BasicTypeSpec.csproj @@ -4,15 +4,18 @@ SDK Code Generation BasicTypeSpec 1.0.0-beta.1 BasicTypeSpec - netstandard2.0 - latest true - - - + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClient.cs index 842b3b3c8b1c..e8ffe4cea722 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClient.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClient.cs @@ -141,13 +141,13 @@ public virtual async Task SayHiAsync(string headParameter, string quer /// The cancellation token that can be used to cancel the operation. /// or is null. /// Service returned a non-success status code. - public virtual Response SayHi(string headParameter, string queryParameter, string optionalQuery = null, CancellationToken cancellationToken = default) + public virtual Response SayHi(string headParameter, string queryParameter, string optionalQuery = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(headParameter, nameof(headParameter)); Argument.AssertNotNull(queryParameter, nameof(queryParameter)); Response result = SayHi(headParameter, queryParameter, optionalQuery, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// Return hi. @@ -157,13 +157,13 @@ public virtual Response SayHi(string headParameter, string queryParameter /// The cancellation token that can be used to cancel the operation. /// or is null. /// Service returned a non-success status code. - public virtual async Task> SayHiAsync(string headParameter, string queryParameter, string optionalQuery = null, CancellationToken cancellationToken = default) + public virtual async Task> SayHiAsync(string headParameter, string queryParameter, string optionalQuery = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(headParameter, nameof(headParameter)); Argument.AssertNotNull(queryParameter, nameof(queryParameter)); Response result = await SayHiAsync(headParameter, queryParameter, optionalQuery, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -337,19 +337,19 @@ public virtual async Task HelloDemo2Async(RequestContext context) /// Return hi in demo2. /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual Response HelloDemo2(CancellationToken cancellationToken = default) + public virtual Response HelloDemo2(CancellationToken cancellationToken = default) { Response result = HelloDemo2(cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// Return hi in demo2. /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual async Task> HelloDemo2Async(CancellationToken cancellationToken = default) + public virtual async Task> HelloDemo2Async(CancellationToken cancellationToken = default) { Response result = await HelloDemo2Async(cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -399,12 +399,12 @@ public virtual async Task CreateLiteralAsync(RequestContent content, R /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual Response CreateLiteral(Thing body, CancellationToken cancellationToken = default) + public virtual Response CreateLiteral(ThingModel body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); Response result = CreateLiteral(body, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// Create with literal value. @@ -412,12 +412,12 @@ public virtual Response CreateLiteral(Thing body, CancellationToken cance /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual async Task> CreateLiteralAsync(Thing body, CancellationToken cancellationToken = default) + public virtual async Task> CreateLiteralAsync(ThingModel body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); Response result = await CreateLiteralAsync(body, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -457,19 +457,19 @@ public virtual async Task HelloLiteralAsync(RequestContext context) /// Send literal parameters. /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual Response HelloLiteral(CancellationToken cancellationToken = default) + public virtual Response HelloLiteral(CancellationToken cancellationToken = default) { Response result = HelloLiteral(cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// Send literal parameters. /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual async Task> HelloLiteralAsync(CancellationToken cancellationToken = default) + public virtual async Task> HelloLiteralAsync(CancellationToken cancellationToken = default) { Response result = await HelloLiteralAsync(cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -512,20 +512,20 @@ public virtual async Task TopActionAsync(DateTimeOffset action, Reques /// /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual Response TopAction(DateTimeOffset action, CancellationToken cancellationToken = default) + public virtual Response TopAction(DateTimeOffset action, CancellationToken cancellationToken = default) { Response result = TopAction(action, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// top level method. /// /// The cancellation token that can be used to cancel the operation. /// Service returned a non-success status code. - public virtual async Task> TopActionAsync(DateTimeOffset action, CancellationToken cancellationToken = default) + public virtual async Task> TopActionAsync(DateTimeOffset action, CancellationToken cancellationToken = default) { Response result = await TopActionAsync(action, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -647,7 +647,7 @@ public virtual async Task AnonymousBodyAsync(RequestContent content, R } /// body parameter without body decorator. - /// name of the Thing. + /// name of the ThingModel. /// required Union. /// required literal string. /// required literal int. @@ -663,13 +663,13 @@ public virtual async Task AnonymousBodyAsync(RequestContent content, R /// The cancellation token that can be used to cancel the operation. /// , or is null. /// Service returned a non-success status code. - public virtual Response AnonymousBody(string name, BinaryData requiredUnion, ThingRequiredLiteralString requiredLiteralString, ThingRequiredLiteralInt requiredLiteralInt, ThingRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingOptionalLiteralString? optionalLiteralString = default, ThingOptionalLiteralInt? optionalLiteralInt = default, ThingOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default, CancellationToken cancellationToken = default) + public virtual Response AnonymousBody(string name, BinaryData requiredUnion, ThingModelRequiredLiteralString requiredLiteralString, ThingModelRequiredLiteralInt requiredLiteralInt, ThingModelRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingModelOptionalLiteralString? optionalLiteralString = default, ThingModelOptionalLiteralInt? optionalLiteralInt = default, ThingModelOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(requiredUnion, nameof(requiredUnion)); Argument.AssertNotNull(requiredBadDescription, nameof(requiredBadDescription)); - Thing spreadModel = new Thing( + ThingModel spreadModel = new ThingModel( name, requiredUnion, requiredLiteralString, @@ -685,11 +685,11 @@ public virtual Response AnonymousBody(string name, BinaryData requiredUni requiredNullableList?.ToList() as IList ?? new ChangeTrackingList(), null); Response result = AnonymousBody(spreadModel, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// body parameter without body decorator. - /// name of the Thing. + /// name of the ThingModel. /// required Union. /// required literal string. /// required literal int. @@ -705,13 +705,13 @@ public virtual Response AnonymousBody(string name, BinaryData requiredUni /// The cancellation token that can be used to cancel the operation. /// , or is null. /// Service returned a non-success status code. - public virtual async Task> AnonymousBodyAsync(string name, BinaryData requiredUnion, ThingRequiredLiteralString requiredLiteralString, ThingRequiredLiteralInt requiredLiteralInt, ThingRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingOptionalLiteralString? optionalLiteralString = default, ThingOptionalLiteralInt? optionalLiteralInt = default, ThingOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default, CancellationToken cancellationToken = default) + public virtual async Task> AnonymousBodyAsync(string name, BinaryData requiredUnion, ThingModelRequiredLiteralString requiredLiteralString, ThingModelRequiredLiteralInt requiredLiteralInt, ThingModelRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingModelOptionalLiteralString? optionalLiteralString = default, ThingModelOptionalLiteralInt? optionalLiteralInt = default, ThingModelOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(requiredUnion, nameof(requiredUnion)); Argument.AssertNotNull(requiredBadDescription, nameof(requiredBadDescription)); - Thing spreadModel = new Thing( + ThingModel spreadModel = new ThingModel( name, requiredUnion, requiredLiteralString, @@ -727,7 +727,7 @@ public virtual async Task> AnonymousBodyAsync(string name, Binar requiredNullableList?.ToList() as IList ?? new ChangeTrackingList(), null); Response result = await AnonymousBodyAsync(spreadModel, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// @@ -777,13 +777,13 @@ public virtual async Task FriendlyModelAsync(RequestContent content, R /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual Response FriendlyModel(string name, CancellationToken cancellationToken = default) + public virtual Response FriendlyModel(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(name, nameof(name)); - Friend spreadModel = new Friend(name, null); + FriendModel spreadModel = new FriendModel(name, null); Response result = FriendlyModel(spreadModel, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Friend)result, result); + return Response.FromValue((FriendModel)result, result); } /// Model can have its friendly name. @@ -791,13 +791,13 @@ public virtual Response FriendlyModel(string name, CancellationToken can /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual async Task> FriendlyModelAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> FriendlyModelAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(name, nameof(name)); - Friend spreadModel = new Friend(name, null); + FriendModel spreadModel = new FriendModel(name, null); Response result = await FriendlyModelAsync(spreadModel, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Friend)result, result); + return Response.FromValue((FriendModel)result, result); } /// @@ -1087,12 +1087,12 @@ public virtual async Task InternalProtocolAsync(RequestContent content /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual Response InternalProtocol(Thing body, CancellationToken cancellationToken = default) + public virtual Response InternalProtocol(ThingModel body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); Response result = InternalProtocol(body, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// When set protocol false and convenient true, then the protocol method should be internal. @@ -1100,12 +1100,12 @@ public virtual Response InternalProtocol(Thing body, CancellationToken ca /// The cancellation token that can be used to cancel the operation. /// is null. /// Service returned a non-success status code. - public virtual async Task> InternalProtocolAsync(Thing body, CancellationToken cancellationToken = default) + public virtual async Task> InternalProtocolAsync(ThingModel body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); Response result = await InternalProtocolAsync(body, cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null).ConfigureAwait(false); - return Response.FromValue((Thing)result, result); + return Response.FromValue((ThingModel)result, result); } /// diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClientOptions.cs index ce57ff03d1bc..63f8b984ecd8 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClientOptions.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecClientOptions.cs @@ -27,6 +27,7 @@ public BasicTypeSpecClientOptions(ServiceVersion version = LatestVersion) }; } + /// Gets the Version. internal string Version { get; } /// The version of the service to use. diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecModelFactory.cs index c14a249fd60e..be59be858fed 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecModelFactory.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/BasicTypeSpecModelFactory.cs @@ -16,7 +16,7 @@ namespace BasicTypeSpec.Models public static partial class BasicTypeSpecModelFactory { /// A model with a few properties of literal types. - /// name of the Thing. + /// name of the ThingModel. /// required Union. /// required literal string. /// required literal int. @@ -29,13 +29,13 @@ public static partial class BasicTypeSpecModelFactory /// description with xml <|endoftext|>. /// optional nullable collection. /// required nullable collection. - /// A new instance for mocking. - public static Thing Thing(string name = default, BinaryData requiredUnion = default, ThingRequiredLiteralString requiredLiteralString = default, ThingRequiredLiteralInt requiredLiteralInt = default, ThingRequiredLiteralFloat requiredLiteralFloat = default, bool requiredLiteralBool = default, ThingOptionalLiteralString? optionalLiteralString = default, ThingOptionalLiteralInt? optionalLiteralInt = default, ThingOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, string requiredBadDescription = default, IEnumerable optionalNullableList = default, IEnumerable requiredNullableList = default) + /// A new instance for mocking. + public static ThingModel ThingModel(string name = default, BinaryData requiredUnion = default, ThingModelRequiredLiteralString requiredLiteralString = default, ThingModelRequiredLiteralInt requiredLiteralInt = default, ThingModelRequiredLiteralFloat requiredLiteralFloat = default, bool requiredLiteralBool = default, ThingModelOptionalLiteralString? optionalLiteralString = default, ThingModelOptionalLiteralInt? optionalLiteralInt = default, ThingModelOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, string requiredBadDescription = default, IEnumerable optionalNullableList = default, IEnumerable requiredNullableList = default) { optionalNullableList ??= new ChangeTrackingList(); requiredNullableList ??= new ChangeTrackingList(); - return new Thing( + return new ThingModel( name, requiredUnion, requiredLiteralString, @@ -78,7 +78,7 @@ public static Thing Thing(string name = default, BinaryData requiredUnion = defa /// this is a model with required nullable properties. /// Required bytes. /// A new instance for mocking. - public static RoundTripModel RoundTripModel(string requiredString = default, int requiredInt = default, IEnumerable requiredCollection = default, IDictionary requiredDictionary = default, Thing requiredModel = default, IntExtensibleEnum? intExtensibleEnum = default, IEnumerable intExtensibleEnumCollection = default, FloatExtensibleEnum? floatExtensibleEnum = default, FloatExtensibleEnumWithIntValue? floatExtensibleEnumWithIntValue = default, IEnumerable floatExtensibleEnumCollection = default, FloatFixedEnum? floatFixedEnum = default, FloatFixedEnumWithIntValue? floatFixedEnumWithIntValue = default, IEnumerable floatFixedEnumCollection = default, IntFixedEnum? intFixedEnum = default, IEnumerable intFixedEnumCollection = default, StringFixedEnum? stringFixedEnum = default, BinaryData requiredUnknown = default, BinaryData optionalUnknown = default, IDictionary requiredRecordUnknown = default, IDictionary optionalRecordUnknown = default, IReadOnlyDictionary readOnlyRequiredRecordUnknown = default, IReadOnlyDictionary readOnlyOptionalRecordUnknown = default, ModelWithRequiredNullableProperties modelWithRequiredNullable = default, BinaryData requiredBytes = default) + public static RoundTripModel RoundTripModel(string requiredString = default, int requiredInt = default, IEnumerable requiredCollection = default, IDictionary requiredDictionary = default, ThingModel requiredModel = default, IntExtensibleEnum? intExtensibleEnum = default, IEnumerable intExtensibleEnumCollection = default, FloatExtensibleEnum? floatExtensibleEnum = default, FloatExtensibleEnumWithIntValue? floatExtensibleEnumWithIntValue = default, IEnumerable floatExtensibleEnumCollection = default, FloatFixedEnum? floatFixedEnum = default, FloatFixedEnumWithIntValue? floatFixedEnumWithIntValue = default, IEnumerable floatFixedEnumCollection = default, IntFixedEnum? intFixedEnum = default, IEnumerable intFixedEnumCollection = default, StringFixedEnum? stringFixedEnum = default, BinaryData requiredUnknown = default, BinaryData optionalUnknown = default, IDictionary requiredRecordUnknown = default, IDictionary optionalRecordUnknown = default, IReadOnlyDictionary readOnlyRequiredRecordUnknown = default, IReadOnlyDictionary readOnlyOptionalRecordUnknown = default, ModelWithRequiredNullableProperties modelWithRequiredNullable = default, BinaryData requiredBytes = default) { requiredCollection ??= new ChangeTrackingList(); requiredDictionary ??= new ChangeTrackingDictionary(); @@ -132,11 +132,11 @@ public static ModelWithRequiredNullableProperties ModelWithRequiredNullablePrope /// this is not a friendly model but with a friendly name. /// name of the NotFriend. - /// A new instance for mocking. - public static Friend Friend(string name = default) + /// A new instance for mocking. + public static FriendModel FriendModel(string name = default) { - return new Friend(name, additionalBinaryDataProperties: null); + return new FriendModel(name, additionalBinaryDataProperties: null); } /// this is a model with a projected name. diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs index 37acbdc93da7..9b2442454da0 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -42,16 +42,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -68,8 +74,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs index 7475aea91e6a..9fceb42d0dca 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs @@ -36,12 +36,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..c47f5b7fd906 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace BasicTypeSpec +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..91d9439c2033 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace BasicTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..483c06d99f17 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace BasicTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..0afbf0de6c8e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace BasicTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ErrorResult.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ErrorResult.cs index cc9535a76e79..2b801f065d70 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ErrorResult.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/ErrorResult.cs @@ -20,6 +20,7 @@ public ErrorResult(Response response, RequestFailedException exception) _exception = exception; } + /// Gets the Value. public override T Value => throw _exception; public override Response GetRawResponse() diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs index d7d35c3dfb08..250e1feee9e7 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs @@ -25,6 +25,7 @@ public Utf8JsonBinaryContent() JsonWriter = new Utf8JsonWriter(_stream); } + /// Gets the JsonWriter. public Utf8JsonWriter JsonWriter { get; } public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.Serialization.cs similarity index 63% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.Serialization.cs index 4f53647f4410..8072fce50f25 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.Serialization.cs @@ -16,13 +16,13 @@ namespace BasicTypeSpec.Models { /// - public partial class Friend : IJsonModel + public partial class FriendModel : IJsonModel { - internal Friend() + internal FriendModel() { } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -33,10 +33,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions op /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Friend)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FriendModel)} does not support writing '{format}' format."); } writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); @@ -57,22 +57,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - Friend IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + FriendModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); /// The JSON reader. /// The client options for reading and writing models. - protected virtual Friend JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + protected virtual FriendModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Friend)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FriendModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFriend(document.RootElement, options); + return DeserializeFriendModel(document.RootElement, options); } - internal static Friend DeserializeFriend(JsonElement element, ModelReaderWriterOptions options) + internal static FriendModel DeserializeFriendModel(JsonElement element, ModelReaderWriterOptions options) { if (element.ValueKind == JsonValueKind.Null) { @@ -92,63 +92,63 @@ internal static Friend DeserializeFriend(JsonElement element, ModelReaderWriterO additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - return new Friend(name, additionalBinaryDataProperties); + return new FriendModel(name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); /// The client options for reading and writing models. protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(Friend)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FriendModel)} does not support writing '{options.Format}' format."); } } - Friend IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + FriendModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); /// The data to parse. /// The client options for reading and writing models. - protected virtual Friend PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + protected virtual FriendModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": using (JsonDocument document = JsonDocument.Parse(data)) { - return DeserializeFriend(document.RootElement, options); + return DeserializeFriendModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(Friend)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FriendModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// The to serialize into . - public static implicit operator RequestContent(Friend friend) + /// The to serialize into . + public static implicit operator RequestContent(FriendModel friendModel) { - if (friend == null) + if (friendModel == null) { return null; } Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteObjectValue(friend, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(friendModel, ModelSerializationExtensions.WireOptions); return content; } - /// The to deserialize the from. - public static explicit operator Friend(Response result) + /// The to deserialize the from. + public static explicit operator FriendModel(Response result) { using Response response = result; using JsonDocument document = JsonDocument.Parse(response.Content); - return DeserializeFriend(document.RootElement, ModelSerializationExtensions.WireOptions); + return DeserializeFriendModel(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.cs similarity index 80% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.cs index f1419a822a26..1fcf55afa212 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Friend.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/FriendModel.cs @@ -11,17 +11,17 @@ namespace BasicTypeSpec.Models { /// this is not a friendly model but with a friendly name. - public partial class Friend + public partial class FriendModel { /// Keeps track of any properties unknown to the library. private protected readonly IDictionary _additionalBinaryDataProperties; - internal Friend(string name) + internal FriendModel(string name) { Name = name; } - internal Friend(string name, IDictionary additionalBinaryDataProperties) + internal FriendModel(string name, IDictionary additionalBinaryDataProperties) { Name = name; _additionalBinaryDataProperties = additionalBinaryDataProperties; diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.Serialization.cs index d3c11e295c7e..0a1ae09a1d1c 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.Serialization.cs @@ -290,7 +290,7 @@ internal static RoundTripModel DeserializeRoundTripModel(JsonElement element, Mo int requiredInt = default; IList requiredCollection = default; IDictionary requiredDictionary = default; - Thing requiredModel = default; + ThingModel requiredModel = default; IntExtensibleEnum? intExtensibleEnum = default; IList intExtensibleEnumCollection = default; FloatExtensibleEnum? floatExtensibleEnum = default; @@ -345,7 +345,7 @@ internal static RoundTripModel DeserializeRoundTripModel(JsonElement element, Mo } if (prop.NameEquals("requiredModel"u8)) { - requiredModel = Thing.DeserializeThing(prop.Value, options); + requiredModel = ThingModel.DeserializeThingModel(prop.Value, options); continue; } if (prop.NameEquals("intExtensibleEnum"u8)) diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.cs index 3f660931d13c..5db69baeebff 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/RoundTripModel.cs @@ -30,7 +30,7 @@ public partial class RoundTripModel /// this is a model with required nullable properties. /// Required bytes. /// , , , , , , or is null. - public RoundTripModel(string requiredString, int requiredInt, IEnumerable requiredCollection, IDictionary requiredDictionary, Thing requiredModel, BinaryData requiredUnknown, IDictionary requiredRecordUnknown, ModelWithRequiredNullableProperties modelWithRequiredNullable, BinaryData requiredBytes) + public RoundTripModel(string requiredString, int requiredInt, IEnumerable requiredCollection, IDictionary requiredDictionary, ThingModel requiredModel, BinaryData requiredUnknown, IDictionary requiredRecordUnknown, ModelWithRequiredNullableProperties modelWithRequiredNullable, BinaryData requiredBytes) { Argument.AssertNotNull(requiredString, nameof(requiredString)); Argument.AssertNotNull(requiredCollection, nameof(requiredCollection)); @@ -59,7 +59,7 @@ public RoundTripModel(string requiredString, int requiredInt, IEnumerable requiredCollection, IDictionary requiredDictionary, Thing requiredModel, IntExtensibleEnum? intExtensibleEnum, IList intExtensibleEnumCollection, FloatExtensibleEnum? floatExtensibleEnum, FloatExtensibleEnumWithIntValue? floatExtensibleEnumWithIntValue, IList floatExtensibleEnumCollection, FloatFixedEnum? floatFixedEnum, FloatFixedEnumWithIntValue? floatFixedEnumWithIntValue, IList floatFixedEnumCollection, IntFixedEnum? intFixedEnum, IList intFixedEnumCollection, StringFixedEnum? stringFixedEnum, BinaryData requiredUnknown, BinaryData optionalUnknown, IDictionary requiredRecordUnknown, IDictionary optionalRecordUnknown, IReadOnlyDictionary readOnlyRequiredRecordUnknown, IReadOnlyDictionary readOnlyOptionalRecordUnknown, ModelWithRequiredNullableProperties modelWithRequiredNullable, BinaryData requiredBytes, IDictionary additionalBinaryDataProperties) + internal RoundTripModel(string requiredString, int requiredInt, IList requiredCollection, IDictionary requiredDictionary, ThingModel requiredModel, IntExtensibleEnum? intExtensibleEnum, IList intExtensibleEnumCollection, FloatExtensibleEnum? floatExtensibleEnum, FloatExtensibleEnumWithIntValue? floatExtensibleEnumWithIntValue, IList floatExtensibleEnumCollection, FloatFixedEnum? floatFixedEnum, FloatFixedEnumWithIntValue? floatFixedEnumWithIntValue, IList floatFixedEnumCollection, IntFixedEnum? intFixedEnum, IList intFixedEnumCollection, StringFixedEnum? stringFixedEnum, BinaryData requiredUnknown, BinaryData optionalUnknown, IDictionary requiredRecordUnknown, IDictionary optionalRecordUnknown, IReadOnlyDictionary readOnlyRequiredRecordUnknown, IReadOnlyDictionary readOnlyOptionalRecordUnknown, ModelWithRequiredNullableProperties modelWithRequiredNullable, BinaryData requiredBytes, IDictionary additionalBinaryDataProperties) { RequiredString = requiredString; RequiredInt = requiredInt; @@ -101,7 +101,7 @@ internal RoundTripModel(string requiredString, int requiredInt, IList RequiredDictionary { get; } /// Required model. - public Thing RequiredModel { get; set; } + public ThingModel RequiredModel { get; set; } /// this is an int based extensible enum. public IntExtensibleEnum? IntExtensibleEnum { get; set; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.Serialization.cs similarity index 77% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.Serialization.cs index d67702d57298..98b9fd91b356 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.Serialization.cs @@ -16,13 +16,13 @@ namespace BasicTypeSpec.Models { /// - public partial class Thing : IJsonModel + public partial class ThingModel : IJsonModel { - internal Thing() + internal ThingModel() { } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -33,10 +33,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions opt /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Thing)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ThingModel)} does not support writing '{format}' format."); } writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); @@ -127,22 +127,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - Thing IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + ThingModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); /// The JSON reader. /// The client options for reading and writing models. - protected virtual Thing JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + protected virtual ThingModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Thing)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ThingModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThing(document.RootElement, options); + return DeserializeThingModel(document.RootElement, options); } - internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOptions options) + internal static ThingModel DeserializeThingModel(JsonElement element, ModelReaderWriterOptions options) { if (element.ValueKind == JsonValueKind.Null) { @@ -150,13 +150,13 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt } string name = default; BinaryData requiredUnion = default; - ThingRequiredLiteralString requiredLiteralString = default; - ThingRequiredLiteralInt requiredLiteralInt = default; - ThingRequiredLiteralFloat requiredLiteralFloat = default; + ThingModelRequiredLiteralString requiredLiteralString = default; + ThingModelRequiredLiteralInt requiredLiteralInt = default; + ThingModelRequiredLiteralFloat requiredLiteralFloat = default; bool requiredLiteralBool = default; - ThingOptionalLiteralString? optionalLiteralString = default; - ThingOptionalLiteralInt? optionalLiteralInt = default; - ThingOptionalLiteralFloat? optionalLiteralFloat = default; + ThingModelOptionalLiteralString? optionalLiteralString = default; + ThingModelOptionalLiteralInt? optionalLiteralInt = default; + ThingModelOptionalLiteralFloat? optionalLiteralFloat = default; bool? optionalLiteralBool = default; string requiredBadDescription = default; IList optionalNullableList = default; @@ -176,17 +176,17 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt } if (prop.NameEquals("requiredLiteralString"u8)) { - requiredLiteralString = new ThingRequiredLiteralString(prop.Value.GetString()); + requiredLiteralString = new ThingModelRequiredLiteralString(prop.Value.GetString()); continue; } if (prop.NameEquals("requiredLiteralInt"u8)) { - requiredLiteralInt = new ThingRequiredLiteralInt(prop.Value.GetInt32()); + requiredLiteralInt = new ThingModelRequiredLiteralInt(prop.Value.GetInt32()); continue; } if (prop.NameEquals("requiredLiteralFloat"u8)) { - requiredLiteralFloat = new ThingRequiredLiteralFloat(prop.Value.GetSingle()); + requiredLiteralFloat = new ThingModelRequiredLiteralFloat(prop.Value.GetSingle()); continue; } if (prop.NameEquals("requiredLiteralBool"u8)) @@ -200,7 +200,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt { continue; } - optionalLiteralString = new ThingOptionalLiteralString(prop.Value.GetString()); + optionalLiteralString = new ThingModelOptionalLiteralString(prop.Value.GetString()); continue; } if (prop.NameEquals("optionalLiteralInt"u8)) @@ -209,7 +209,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt { continue; } - optionalLiteralInt = new ThingOptionalLiteralInt(prop.Value.GetInt32()); + optionalLiteralInt = new ThingModelOptionalLiteralInt(prop.Value.GetInt32()); continue; } if (prop.NameEquals("optionalLiteralFloat"u8)) @@ -218,7 +218,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt { continue; } - optionalLiteralFloat = new ThingOptionalLiteralFloat(prop.Value.GetSingle()); + optionalLiteralFloat = new ThingModelOptionalLiteralFloat(prop.Value.GetSingle()); continue; } if (prop.NameEquals("optionalLiteralBool"u8)) @@ -269,7 +269,7 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - return new Thing( + return new ThingModel( name, requiredUnion, requiredLiteralString, @@ -286,60 +286,60 @@ internal static Thing DeserializeThing(JsonElement element, ModelReaderWriterOpt additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); /// The client options for reading and writing models. protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(Thing)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ThingModel)} does not support writing '{options.Format}' format."); } } - Thing IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + ThingModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); /// The data to parse. /// The client options for reading and writing models. - protected virtual Thing PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + protected virtual ThingModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": using (JsonDocument document = JsonDocument.Parse(data)) { - return DeserializeThing(document.RootElement, options); + return DeserializeThingModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(Thing)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ThingModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// The to serialize into . - public static implicit operator RequestContent(Thing thing) + /// The to serialize into . + public static implicit operator RequestContent(ThingModel thingModel) { - if (thing == null) + if (thingModel == null) { return null; } Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteObjectValue(thing, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(thingModel, ModelSerializationExtensions.WireOptions); return content; } - /// The to deserialize the from. - public static explicit operator Thing(Response result) + /// The to deserialize the from. + public static explicit operator ThingModel(Response result) { using Response response = result; using JsonDocument document = JsonDocument.Parse(response.Content); - return DeserializeThing(document.RootElement, ModelSerializationExtensions.WireOptions); + return DeserializeThingModel(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.cs similarity index 78% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.cs index 62e0c73a58db..40d550750eac 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/Thing.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModel.cs @@ -14,18 +14,18 @@ namespace BasicTypeSpec.Models { /// A model with a few properties of literal types. - public partial class Thing + public partial class ThingModel { /// Keeps track of any properties unknown to the library. private protected readonly IDictionary _additionalBinaryDataProperties; - /// Initializes a new instance of . - /// name of the Thing. + /// Initializes a new instance of . + /// name of the ThingModel. /// required Union. /// description with xml <|endoftext|>. /// required nullable collection. /// , or is null. - public Thing(string name, BinaryData requiredUnion, string requiredBadDescription, IEnumerable requiredNullableList) + public ThingModel(string name, BinaryData requiredUnion, string requiredBadDescription, IEnumerable requiredNullableList) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(requiredUnion, nameof(requiredUnion)); @@ -38,7 +38,7 @@ public Thing(string name, BinaryData requiredUnion, string requiredBadDescriptio RequiredNullableList = requiredNullableList?.ToList(); } - internal Thing(string name, BinaryData requiredUnion, ThingRequiredLiteralString requiredLiteralString, ThingRequiredLiteralInt requiredLiteralInt, ThingRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, ThingOptionalLiteralString? optionalLiteralString, ThingOptionalLiteralInt? optionalLiteralInt, ThingOptionalLiteralFloat? optionalLiteralFloat, bool? optionalLiteralBool, string requiredBadDescription, IList optionalNullableList, IList requiredNullableList, IDictionary additionalBinaryDataProperties) + internal ThingModel(string name, BinaryData requiredUnion, ThingModelRequiredLiteralString requiredLiteralString, ThingModelRequiredLiteralInt requiredLiteralInt, ThingModelRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, ThingModelOptionalLiteralString? optionalLiteralString, ThingModelOptionalLiteralInt? optionalLiteralInt, ThingModelOptionalLiteralFloat? optionalLiteralFloat, bool? optionalLiteralBool, string requiredBadDescription, IList optionalNullableList, IList requiredNullableList, IDictionary additionalBinaryDataProperties) { Name = name; RequiredUnion = requiredUnion; @@ -56,7 +56,7 @@ internal Thing(string name, BinaryData requiredUnion, ThingRequiredLiteralString _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// name of the Thing. + /// name of the ThingModel. public string Name { get; set; } /// @@ -104,25 +104,25 @@ internal Thing(string name, BinaryData requiredUnion, ThingRequiredLiteralString public BinaryData RequiredUnion { get; set; } /// required literal string. - public ThingRequiredLiteralString RequiredLiteralString { get; } = "accept"; + public ThingModelRequiredLiteralString RequiredLiteralString { get; } = "accept"; /// required literal int. - public ThingRequiredLiteralInt RequiredLiteralInt { get; } = 123; + public ThingModelRequiredLiteralInt RequiredLiteralInt { get; } = 123; /// required literal float. - public ThingRequiredLiteralFloat RequiredLiteralFloat { get; } = 1.23F; + public ThingModelRequiredLiteralFloat RequiredLiteralFloat { get; } = 1.23F; /// required literal bool. public bool RequiredLiteralBool { get; } = false; /// optional literal string. - public ThingOptionalLiteralString? OptionalLiteralString { get; set; } + public ThingModelOptionalLiteralString? OptionalLiteralString { get; set; } /// optional literal int. - public ThingOptionalLiteralInt? OptionalLiteralInt { get; set; } + public ThingModelOptionalLiteralInt? OptionalLiteralInt { get; set; } /// optional literal float. - public ThingOptionalLiteralFloat? OptionalLiteralFloat { get; set; } + public ThingModelOptionalLiteralFloat? OptionalLiteralFloat { get; set; } /// optional literal bool. public bool? OptionalLiteralBool { get; set; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.Serialization.cs similarity index 80% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.Serialization.cs index 54d5ba9097d5..3f9dbf5aff19 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.Serialization.cs @@ -8,7 +8,7 @@ namespace BasicTypeSpec.Models { /// - public readonly partial struct ThingOptionalLiteralFloat + public readonly partial struct ThingModelOptionalLiteralFloat { internal float ToSerialSingle() => _value; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.cs similarity index 50% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.cs index 8bdecf41d8e1..584521976cd3 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralFloat.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralFloat.cs @@ -11,43 +11,43 @@ namespace BasicTypeSpec.Models { - /// The Thing_optionalLiteralFloat. - public readonly partial struct ThingOptionalLiteralFloat : IEquatable + /// The ThingModel_optionalLiteralFloat. + public readonly partial struct ThingModelOptionalLiteralFloat : IEquatable { private readonly float _value; /// 4.56. private const float _456Value = 4.56F; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. - public ThingOptionalLiteralFloat(float value) + public ThingModelOptionalLiteralFloat(float value) { _value = value; } /// 4.56. - public static ThingOptionalLiteralFloat _456 { get; } = new ThingOptionalLiteralFloat(_456Value); + public static ThingModelOptionalLiteralFloat _456 { get; } = new ThingModelOptionalLiteralFloat(_456Value); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingOptionalLiteralFloat left, ThingOptionalLiteralFloat right) => left.Equals(right); + public static bool operator ==(ThingModelOptionalLiteralFloat left, ThingModelOptionalLiteralFloat right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingOptionalLiteralFloat left, ThingOptionalLiteralFloat right) => !left.Equals(right); + public static bool operator !=(ThingModelOptionalLiteralFloat left, ThingModelOptionalLiteralFloat right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingOptionalLiteralFloat(float value) => new ThingOptionalLiteralFloat(value); + public static implicit operator ThingModelOptionalLiteralFloat(float value) => new ThingModelOptionalLiteralFloat(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingOptionalLiteralFloat other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelOptionalLiteralFloat other && Equals(other); /// The instance to compare. - public bool Equals(ThingOptionalLiteralFloat other) => Equals(_value, other._value); + public bool Equals(ThingModelOptionalLiteralFloat other) => Equals(_value, other._value); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.Serialization.cs similarity index 80% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.Serialization.cs index 42226648eb0e..efa28872b748 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.Serialization.cs @@ -8,7 +8,7 @@ namespace BasicTypeSpec.Models { /// - public readonly partial struct ThingOptionalLiteralInt + public readonly partial struct ThingModelOptionalLiteralInt { internal int ToSerialInt32() => _value; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.cs similarity index 50% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.cs index a8e34d9deb2e..7e731005b4c5 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralInt.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralInt.cs @@ -11,43 +11,43 @@ namespace BasicTypeSpec.Models { - /// The Thing_optionalLiteralInt. - public readonly partial struct ThingOptionalLiteralInt : IEquatable + /// The ThingModel_optionalLiteralInt. + public readonly partial struct ThingModelOptionalLiteralInt : IEquatable { private readonly int _value; /// 456. private const int _456Value = 456; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. - public ThingOptionalLiteralInt(int value) + public ThingModelOptionalLiteralInt(int value) { _value = value; } /// 456. - public static ThingOptionalLiteralInt _456 { get; } = new ThingOptionalLiteralInt(_456Value); + public static ThingModelOptionalLiteralInt _456 { get; } = new ThingModelOptionalLiteralInt(_456Value); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingOptionalLiteralInt left, ThingOptionalLiteralInt right) => left.Equals(right); + public static bool operator ==(ThingModelOptionalLiteralInt left, ThingModelOptionalLiteralInt right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingOptionalLiteralInt left, ThingOptionalLiteralInt right) => !left.Equals(right); + public static bool operator !=(ThingModelOptionalLiteralInt left, ThingModelOptionalLiteralInt right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingOptionalLiteralInt(int value) => new ThingOptionalLiteralInt(value); + public static implicit operator ThingModelOptionalLiteralInt(int value) => new ThingModelOptionalLiteralInt(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingOptionalLiteralInt other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelOptionalLiteralInt other && Equals(other); /// The instance to compare. - public bool Equals(ThingOptionalLiteralInt other) => Equals(_value, other._value); + public bool Equals(ThingModelOptionalLiteralInt other) => Equals(_value, other._value); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralString.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralString.cs similarity index 52% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralString.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralString.cs index 720acc8b72f2..d9ee97d78449 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingOptionalLiteralString.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelOptionalLiteralString.cs @@ -11,17 +11,17 @@ namespace BasicTypeSpec.Models { - /// The Thing_optionalLiteralString. - public readonly partial struct ThingOptionalLiteralString : IEquatable + /// The ThingModel_optionalLiteralString. + public readonly partial struct ThingModelOptionalLiteralString : IEquatable { private readonly string _value; /// reject. private const string RejectValue = "reject"; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. /// is null. - public ThingOptionalLiteralString(string value) + public ThingModelOptionalLiteralString(string value) { Argument.AssertNotNull(value, nameof(value)); @@ -29,28 +29,28 @@ public ThingOptionalLiteralString(string value) } /// reject. - public static ThingOptionalLiteralString Reject { get; } = new ThingOptionalLiteralString(RejectValue); + public static ThingModelOptionalLiteralString Reject { get; } = new ThingModelOptionalLiteralString(RejectValue); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingOptionalLiteralString left, ThingOptionalLiteralString right) => left.Equals(right); + public static bool operator ==(ThingModelOptionalLiteralString left, ThingModelOptionalLiteralString right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingOptionalLiteralString left, ThingOptionalLiteralString right) => !left.Equals(right); + public static bool operator !=(ThingModelOptionalLiteralString left, ThingModelOptionalLiteralString right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingOptionalLiteralString(string value) => new ThingOptionalLiteralString(value); + public static implicit operator ThingModelOptionalLiteralString(string value) => new ThingModelOptionalLiteralString(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingOptionalLiteralString other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelOptionalLiteralString other && Equals(other); /// The instance to compare. - public bool Equals(ThingOptionalLiteralString other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(ThingModelOptionalLiteralString other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.Serialization.cs similarity index 80% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.Serialization.cs index 55570141a064..ec49597cb08f 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.Serialization.cs @@ -8,7 +8,7 @@ namespace BasicTypeSpec.Models { /// - public readonly partial struct ThingRequiredLiteralFloat + public readonly partial struct ThingModelRequiredLiteralFloat { internal float ToSerialSingle() => _value; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.cs similarity index 50% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.cs index 1c9e12da797b..300e588bdf46 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralFloat.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralFloat.cs @@ -11,43 +11,43 @@ namespace BasicTypeSpec.Models { - /// The Thing_requiredLiteralFloat. - public readonly partial struct ThingRequiredLiteralFloat : IEquatable + /// The ThingModel_requiredLiteralFloat. + public readonly partial struct ThingModelRequiredLiteralFloat : IEquatable { private readonly float _value; /// 1.23. private const float _123Value = 1.23F; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. - public ThingRequiredLiteralFloat(float value) + public ThingModelRequiredLiteralFloat(float value) { _value = value; } /// 1.23. - public static ThingRequiredLiteralFloat _123 { get; } = new ThingRequiredLiteralFloat(_123Value); + public static ThingModelRequiredLiteralFloat _123 { get; } = new ThingModelRequiredLiteralFloat(_123Value); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingRequiredLiteralFloat left, ThingRequiredLiteralFloat right) => left.Equals(right); + public static bool operator ==(ThingModelRequiredLiteralFloat left, ThingModelRequiredLiteralFloat right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingRequiredLiteralFloat left, ThingRequiredLiteralFloat right) => !left.Equals(right); + public static bool operator !=(ThingModelRequiredLiteralFloat left, ThingModelRequiredLiteralFloat right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingRequiredLiteralFloat(float value) => new ThingRequiredLiteralFloat(value); + public static implicit operator ThingModelRequiredLiteralFloat(float value) => new ThingModelRequiredLiteralFloat(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingRequiredLiteralFloat other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelRequiredLiteralFloat other && Equals(other); /// The instance to compare. - public bool Equals(ThingRequiredLiteralFloat other) => Equals(_value, other._value); + public bool Equals(ThingModelRequiredLiteralFloat other) => Equals(_value, other._value); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.Serialization.cs similarity index 80% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.Serialization.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.Serialization.cs index a0caea4186fa..ea7901b4b08a 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.Serialization.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.Serialization.cs @@ -8,7 +8,7 @@ namespace BasicTypeSpec.Models { /// - public readonly partial struct ThingRequiredLiteralInt + public readonly partial struct ThingModelRequiredLiteralInt { internal int ToSerialInt32() => _value; } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.cs similarity index 50% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.cs index 80b2d22ea599..89b2f8648f03 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralInt.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralInt.cs @@ -11,43 +11,43 @@ namespace BasicTypeSpec.Models { - /// The Thing_requiredLiteralInt. - public readonly partial struct ThingRequiredLiteralInt : IEquatable + /// The ThingModel_requiredLiteralInt. + public readonly partial struct ThingModelRequiredLiteralInt : IEquatable { private readonly int _value; /// 123. private const int _123Value = 123; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. - public ThingRequiredLiteralInt(int value) + public ThingModelRequiredLiteralInt(int value) { _value = value; } /// 123. - public static ThingRequiredLiteralInt _123 { get; } = new ThingRequiredLiteralInt(_123Value); + public static ThingModelRequiredLiteralInt _123 { get; } = new ThingModelRequiredLiteralInt(_123Value); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingRequiredLiteralInt left, ThingRequiredLiteralInt right) => left.Equals(right); + public static bool operator ==(ThingModelRequiredLiteralInt left, ThingModelRequiredLiteralInt right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingRequiredLiteralInt left, ThingRequiredLiteralInt right) => !left.Equals(right); + public static bool operator !=(ThingModelRequiredLiteralInt left, ThingModelRequiredLiteralInt right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingRequiredLiteralInt(int value) => new ThingRequiredLiteralInt(value); + public static implicit operator ThingModelRequiredLiteralInt(int value) => new ThingModelRequiredLiteralInt(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingRequiredLiteralInt other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelRequiredLiteralInt other && Equals(other); /// The instance to compare. - public bool Equals(ThingRequiredLiteralInt other) => Equals(_value, other._value); + public bool Equals(ThingModelRequiredLiteralInt other) => Equals(_value, other._value); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralString.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralString.cs similarity index 52% rename from eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralString.cs rename to eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralString.cs index 19e345029dda..62b97b2f99cb 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingRequiredLiteralString.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/src/Generated/Models/ThingModelRequiredLiteralString.cs @@ -11,17 +11,17 @@ namespace BasicTypeSpec.Models { - /// The Thing_requiredLiteralString. - public readonly partial struct ThingRequiredLiteralString : IEquatable + /// The ThingModel_requiredLiteralString. + public readonly partial struct ThingModelRequiredLiteralString : IEquatable { private readonly string _value; /// accept. private const string AcceptValue = "accept"; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The value. /// is null. - public ThingRequiredLiteralString(string value) + public ThingModelRequiredLiteralString(string value) { Argument.AssertNotNull(value, nameof(value)); @@ -29,28 +29,28 @@ public ThingRequiredLiteralString(string value) } /// accept. - public static ThingRequiredLiteralString Accept { get; } = new ThingRequiredLiteralString(AcceptValue); + public static ThingModelRequiredLiteralString Accept { get; } = new ThingModelRequiredLiteralString(AcceptValue); - /// Determines if two values are the same. + /// Determines if two values are the same. /// The left value to compare. /// The right value to compare. - public static bool operator ==(ThingRequiredLiteralString left, ThingRequiredLiteralString right) => left.Equals(right); + public static bool operator ==(ThingModelRequiredLiteralString left, ThingModelRequiredLiteralString right) => left.Equals(right); - /// Determines if two values are not the same. + /// Determines if two values are not the same. /// The left value to compare. /// The right value to compare. - public static bool operator !=(ThingRequiredLiteralString left, ThingRequiredLiteralString right) => !left.Equals(right); + public static bool operator !=(ThingModelRequiredLiteralString left, ThingModelRequiredLiteralString right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a string to a . /// The value. - public static implicit operator ThingRequiredLiteralString(string value) => new ThingRequiredLiteralString(value); + public static implicit operator ThingModelRequiredLiteralString(string value) => new ThingModelRequiredLiteralString(value); /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThingRequiredLiteralString other && Equals(other); + public override bool Equals(object obj) => obj is ThingModelRequiredLiteralString other && Equals(other); /// The instance to compare. - public bool Equals(ThingRequiredLiteralString other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(ThingModelRequiredLiteralString other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/tspCodeModel.json index 9b0b68d8272e..6dca99c72fd7 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/tspCodeModel.json +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Basic-TypeSpec/tspCodeModel.json @@ -9,7 +9,7 @@ { "$id": "2", "kind": "enum", - "name": "Thing_requiredLiteralString", + "name": "ThingModel_requiredLiteralString", "valueType": { "$id": "3", "kind": "string", @@ -33,7 +33,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_requiredLiteralString", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_requiredLiteralString", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -42,7 +43,7 @@ { "$id": "5", "kind": "enum", - "name": "Thing_requiredLiteralInt", + "name": "ThingModel_requiredLiteralInt", "valueType": { "$id": "6", "kind": "int32", @@ -66,7 +67,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_requiredLiteralInt", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_requiredLiteralInt", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -75,7 +77,7 @@ { "$id": "8", "kind": "enum", - "name": "Thing_requiredLiteralFloat", + "name": "ThingModel_requiredLiteralFloat", "valueType": { "$id": "9", "kind": "float32", @@ -99,7 +101,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_requiredLiteralFloat", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_requiredLiteralFloat", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -108,7 +111,7 @@ { "$id": "11", "kind": "enum", - "name": "Thing_optionalLiteralString", + "name": "ThingModel_optionalLiteralString", "valueType": { "$id": "12", "kind": "string", @@ -132,7 +135,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_optionalLiteralString", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_optionalLiteralString", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -141,7 +145,7 @@ { "$id": "14", "kind": "enum", - "name": "Thing_optionalLiteralInt", + "name": "ThingModel_optionalLiteralInt", "valueType": { "$id": "15", "kind": "int32", @@ -165,7 +169,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_optionalLiteralInt", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_optionalLiteralInt", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -174,7 +179,7 @@ { "$id": "17", "kind": "enum", - "name": "Thing_optionalLiteralFloat", + "name": "ThingModel_optionalLiteralFloat", "valueType": { "$id": "18", "kind": "float32", @@ -198,7 +203,8 @@ } ], "crossLanguageDefinitionId": "", - "doc": "The Thing_optionalLiteralFloat", + "clientNamespace": "BasicTypeSpec", + "doc": "The ThingModel_optionalLiteralFloat", "isFixed": false, "isFlags": false, "usage": "Input,Output,Spread,Json", @@ -269,6 +275,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "Simple enum", "isFixed": true, "isFlags": false, @@ -340,6 +347,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "Extensible enum", "isFixed": false, "isFlags": false, @@ -411,6 +419,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "Int based extensible enum", "isFixed": false, "isFlags": false, @@ -482,6 +491,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "Float based extensible enum", "isFixed": false, "isFlags": false, @@ -553,6 +563,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "float fixed enum", "isFixed": false, "isFlags": false, @@ -624,6 +635,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "float fixed enum", "isFixed": true, "isFlags": false, @@ -695,6 +707,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "float fixed enum", "isFixed": true, "isFlags": false, @@ -766,6 +779,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "doc": "int fixed enum", "isFixed": true, "isFlags": false, @@ -820,6 +834,7 @@ "decorators": [] } ], + "clientNamespace": "BasicTypeSpec", "isFixed": true, "isFlags": false, "usage": "ApiVersionEnum", @@ -830,8 +845,9 @@ { "$id": "90", "kind": "model", - "name": "Thing", - "crossLanguageDefinitionId": "BasicTypeSpec.Thing", + "name": "ThingModel", + "clientNamespace": "BasicTypeSpec", + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel", "usage": "Input,Output,Spread,Json", "doc": "A model with a few properties of literal types", "decorators": [], @@ -841,7 +857,7 @@ "kind": "property", "name": "name", "serializedName": "name", - "doc": "name of the Thing", + "doc": "name of the ThingModel", "type": { "$id": "92", "kind": "string", @@ -854,32 +870,39 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.name" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.name", + "serializationOptions": { + "$id": "93", + "json": { + "$id": "94", + "name": "name" + } + } }, { - "$id": "93", + "$id": "95", "kind": "property", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "94", + "$id": "96", "kind": "union", - "name": "ThingRequiredUnion", + "name": "ThingModelRequiredUnion", "variantTypes": [ { - "$id": "95", + "$id": "97", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "96", + "$id": "98", "kind": "array", "name": "Array", "valueType": { - "$id": "97", + "$id": "99", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -889,13 +912,14 @@ "decorators": [] }, { - "$id": "98", + "$id": "100", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] } ], + "clientNamespace": "", "decorators": [] }, "optional": false, @@ -903,16 +927,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredUnion" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredUnion", + "serializationOptions": { + "$id": "101", + "json": { + "$id": "102", + "name": "requiredUnion" + } + } }, { - "$id": "99", + "$id": "103", "kind": "property", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", "doc": "required literal string", "type": { - "$id": "100", + "$id": "104", "kind": "constant", "valueType": { "$ref": "2" @@ -925,16 +956,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredLiteralString" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredLiteralString", + "serializationOptions": { + "$id": "105", + "json": { + "$id": "106", + "name": "requiredLiteralString" + } + } }, { - "$id": "101", + "$id": "107", "kind": "property", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", "doc": "required literal int", "type": { - "$id": "102", + "$id": "108", "kind": "constant", "valueType": { "$ref": "5" @@ -947,16 +985,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredLiteralInt" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredLiteralInt", + "serializationOptions": { + "$id": "109", + "json": { + "$id": "110", + "name": "requiredLiteralInt" + } + } }, { - "$id": "103", + "$id": "111", "kind": "property", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", "doc": "required literal float", "type": { - "$id": "104", + "$id": "112", "kind": "constant", "valueType": { "$ref": "8" @@ -969,19 +1014,26 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredLiteralFloat" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredLiteralFloat", + "serializationOptions": { + "$id": "113", + "json": { + "$id": "114", + "name": "requiredLiteralFloat" + } + } }, { - "$id": "105", + "$id": "115", "kind": "property", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", "doc": "required literal bool", "type": { - "$id": "106", + "$id": "116", "kind": "constant", "valueType": { - "$id": "107", + "$id": "117", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -995,16 +1047,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredLiteralBool" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredLiteralBool", + "serializationOptions": { + "$id": "118", + "json": { + "$id": "119", + "name": "requiredLiteralBool" + } + } }, { - "$id": "108", + "$id": "120", "kind": "property", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "109", + "$id": "121", "kind": "constant", "valueType": { "$ref": "11" @@ -1017,16 +1076,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.optionalLiteralString" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.optionalLiteralString", + "serializationOptions": { + "$id": "122", + "json": { + "$id": "123", + "name": "optionalLiteralString" + } + } }, { - "$id": "110", + "$id": "124", "kind": "property", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "111", + "$id": "125", "kind": "constant", "valueType": { "$ref": "14" @@ -1039,16 +1105,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.optionalLiteralInt" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.optionalLiteralInt", + "serializationOptions": { + "$id": "126", + "json": { + "$id": "127", + "name": "optionalLiteralInt" + } + } }, { - "$id": "112", + "$id": "128", "kind": "property", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "113", + "$id": "129", "kind": "constant", "valueType": { "$ref": "17" @@ -1061,19 +1134,26 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.optionalLiteralFloat" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.optionalLiteralFloat", + "serializationOptions": { + "$id": "130", + "json": { + "$id": "131", + "name": "optionalLiteralFloat" + } + } }, { - "$id": "114", + "$id": "132", "kind": "property", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", "doc": "optional literal bool", "type": { - "$id": "115", + "$id": "133", "kind": "constant", "valueType": { - "$id": "116", + "$id": "134", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -1087,16 +1167,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.optionalLiteralBool" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.optionalLiteralBool", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "optionalLiteralBool" + } + } }, { - "$id": "117", + "$id": "137", "kind": "property", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "118", + "$id": "138", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1107,23 +1194,30 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredBadDescription" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredBadDescription", + "serializationOptions": { + "$id": "139", + "json": { + "$id": "140", + "name": "requiredBadDescription" + } + } }, { - "$id": "119", + "$id": "141", "kind": "property", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "120", + "$id": "142", "kind": "nullable", "type": { - "$id": "121", + "$id": "143", "kind": "array", "name": "Array", "valueType": { - "$id": "122", + "$id": "144", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -1131,30 +1225,38 @@ }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] - } + }, + "clientNamespace": "" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.optionalNullableList" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.optionalNullableList", + "serializationOptions": { + "$id": "145", + "json": { + "$id": "146", + "name": "optionalNullableList" + } + } }, { - "$id": "123", + "$id": "147", "kind": "property", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "124", + "$id": "148", "kind": "nullable", "type": { - "$id": "125", + "$id": "149", "kind": "array", "name": "Array", "valueType": { - "$id": "126", + "$id": "150", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -1162,34 +1264,43 @@ }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] - } + }, + "clientNamespace": "" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.Thing.requiredNullableList" + "crossLanguageDefinitionId": "BasicTypeSpec.ThingModel.requiredNullableList", + "serializationOptions": { + "$id": "151", + "json": { + "$id": "152", + "name": "requiredNullableList" + } + } } ] }, { - "$id": "127", + "$id": "153", "kind": "model", "name": "RoundTripModel", + "clientNamespace": "BasicTypeSpec", "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel", "usage": "Input,Output,Json", "doc": "this is a roundtrip model", "decorators": [], "properties": [ { - "$id": "128", + "$id": "154", "kind": "property", "name": "requiredString", "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "129", + "$id": "155", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1200,16 +1311,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredString" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredString", + "serializationOptions": { + "$id": "156", + "json": { + "$id": "157", + "name": "requiredString" + } + } }, { - "$id": "130", + "$id": "158", "kind": "property", "name": "requiredInt", "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "131", + "$id": "159", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -1220,16 +1338,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredInt" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredInt", + "serializationOptions": { + "$id": "160", + "json": { + "$id": "161", + "name": "requiredInt" + } + } }, { - "$id": "132", + "$id": "162", "kind": "property", "name": "requiredCollection", "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "133", + "$id": "163", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -1243,19 +1368,26 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredCollection" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredCollection", + "serializationOptions": { + "$id": "164", + "json": { + "$id": "165", + "name": "requiredCollection" + } + } }, { - "$id": "134", + "$id": "166", "kind": "property", "name": "requiredDictionary", "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "135", + "$id": "167", "kind": "dict", "keyType": { - "$id": "136", + "$id": "168", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1271,10 +1403,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredDictionary" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredDictionary", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "requiredDictionary" + } + } }, { - "$id": "137", + "$id": "171", "kind": "property", "name": "requiredModel", "serializedName": "requiredModel", @@ -1287,10 +1426,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredModel" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredModel", + "serializationOptions": { + "$id": "172", + "json": { + "$id": "173", + "name": "requiredModel" + } + } }, { - "$id": "138", + "$id": "174", "kind": "property", "name": "intExtensibleEnum", "serializedName": "intExtensibleEnum", @@ -1303,16 +1449,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intExtensibleEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intExtensibleEnum", + "serializationOptions": { + "$id": "175", + "json": { + "$id": "176", + "name": "intExtensibleEnum" + } + } }, { - "$id": "139", + "$id": "177", "kind": "property", "name": "intExtensibleEnumCollection", "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "140", + "$id": "178", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -1326,10 +1479,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intExtensibleEnumCollection" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intExtensibleEnumCollection", + "serializationOptions": { + "$id": "179", + "json": { + "$id": "180", + "name": "intExtensibleEnumCollection" + } + } }, { - "$id": "141", + "$id": "181", "kind": "property", "name": "floatExtensibleEnum", "serializedName": "floatExtensibleEnum", @@ -1342,10 +1502,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnum", + "serializationOptions": { + "$id": "182", + "json": { + "$id": "183", + "name": "floatExtensibleEnum" + } + } }, { - "$id": "142", + "$id": "184", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "serializedName": "floatExtensibleEnumWithIntValue", @@ -1358,16 +1525,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnumWithIntValue" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnumWithIntValue", + "serializationOptions": { + "$id": "185", + "json": { + "$id": "186", + "name": "floatExtensibleEnumWithIntValue" + } + } }, { - "$id": "143", + "$id": "187", "kind": "property", "name": "floatExtensibleEnumCollection", "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "144", + "$id": "188", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -1381,10 +1555,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnumCollection" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatExtensibleEnumCollection", + "serializationOptions": { + "$id": "189", + "json": { + "$id": "190", + "name": "floatExtensibleEnumCollection" + } + } }, { - "$id": "145", + "$id": "191", "kind": "property", "name": "floatFixedEnum", "serializedName": "floatFixedEnum", @@ -1397,10 +1578,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnum", + "serializationOptions": { + "$id": "192", + "json": { + "$id": "193", + "name": "floatFixedEnum" + } + } }, { - "$id": "146", + "$id": "194", "kind": "property", "name": "floatFixedEnumWithIntValue", "serializedName": "floatFixedEnumWithIntValue", @@ -1413,16 +1601,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnumWithIntValue" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnumWithIntValue", + "serializationOptions": { + "$id": "195", + "json": { + "$id": "196", + "name": "floatFixedEnumWithIntValue" + } + } }, { - "$id": "147", + "$id": "197", "kind": "property", "name": "floatFixedEnumCollection", "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "148", + "$id": "198", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -1436,10 +1631,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnumCollection" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.floatFixedEnumCollection", + "serializationOptions": { + "$id": "199", + "json": { + "$id": "200", + "name": "floatFixedEnumCollection" + } + } }, { - "$id": "149", + "$id": "201", "kind": "property", "name": "intFixedEnum", "serializedName": "intFixedEnum", @@ -1452,16 +1654,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intFixedEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intFixedEnum", + "serializationOptions": { + "$id": "202", + "json": { + "$id": "203", + "name": "intFixedEnum" + } + } }, { - "$id": "150", + "$id": "204", "kind": "property", "name": "intFixedEnumCollection", "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "151", + "$id": "205", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -1475,10 +1684,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intFixedEnumCollection" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.intFixedEnumCollection", + "serializationOptions": { + "$id": "206", + "json": { + "$id": "207", + "name": "intFixedEnumCollection" + } + } }, { - "$id": "152", + "$id": "208", "kind": "property", "name": "stringFixedEnum", "serializedName": "stringFixedEnum", @@ -1491,16 +1707,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.stringFixedEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.stringFixedEnum", + "serializationOptions": { + "$id": "209", + "json": { + "$id": "210", + "name": "stringFixedEnum" + } + } }, { - "$id": "153", + "$id": "211", "kind": "property", "name": "requiredUnknown", "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "154", + "$id": "212", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1511,16 +1734,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredUnknown", + "serializationOptions": { + "$id": "213", + "json": { + "$id": "214", + "name": "requiredUnknown" + } + } }, { - "$id": "155", + "$id": "215", "kind": "property", "name": "optionalUnknown", "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "156", + "$id": "216", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1531,26 +1761,33 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.optionalUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.optionalUnknown", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "optionalUnknown" + } + } }, { - "$id": "157", + "$id": "219", "kind": "property", "name": "requiredRecordUnknown", "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "158", + "$id": "220", "kind": "dict", "keyType": { - "$id": "159", + "$id": "221", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "160", + "$id": "222", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1563,26 +1800,33 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredRecordUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredRecordUnknown", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "requiredRecordUnknown" + } + } }, { - "$id": "161", + "$id": "225", "kind": "property", "name": "optionalRecordUnknown", "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$id": "162", + "$id": "226", "kind": "dict", "keyType": { - "$id": "163", + "$id": "227", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "164", + "$id": "228", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1595,26 +1839,33 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.optionalRecordUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.optionalRecordUnknown", + "serializationOptions": { + "$id": "229", + "json": { + "$id": "230", + "name": "optionalRecordUnknown" + } + } }, { - "$id": "165", + "$id": "231", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$id": "166", + "$id": "232", "kind": "dict", "keyType": { - "$id": "167", + "$id": "233", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "168", + "$id": "234", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1627,26 +1878,33 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.readOnlyRequiredRecordUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.readOnlyRequiredRecordUnknown", + "serializationOptions": { + "$id": "235", + "json": { + "$id": "236", + "name": "readOnlyRequiredRecordUnknown" + } + } }, { - "$id": "169", + "$id": "237", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$id": "170", + "$id": "238", "kind": "dict", "keyType": { - "$id": "171", + "$id": "239", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "172", + "$id": "240", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -1659,86 +1917,118 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.readOnlyOptionalRecordUnknown" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.readOnlyOptionalRecordUnknown", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "readOnlyOptionalRecordUnknown" + } + } }, { - "$id": "173", + "$id": "243", "kind": "property", "name": "modelWithRequiredNullable", "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "174", + "$id": "244", "kind": "model", "name": "ModelWithRequiredNullableProperties", + "clientNamespace": "BasicTypeSpec", "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties", "usage": "Input,Output,Json", "doc": "A model with a few required nullable properties", "decorators": [], "properties": [ { - "$id": "175", + "$id": "245", "kind": "property", "name": "requiredNullablePrimitive", "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "176", + "$id": "246", "kind": "nullable", "type": { - "$id": "177", + "$id": "247", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", "decorators": [] - } + }, + "clientNamespace": "" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredNullablePrimitive" + "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredNullablePrimitive", + "serializationOptions": { + "$id": "248", + "json": { + "$id": "249", + "name": "requiredNullablePrimitive" + } + } }, { - "$id": "178", + "$id": "250", "kind": "property", "name": "requiredExtensibleEnum", "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "179", + "$id": "251", "kind": "nullable", "type": { "$ref": "28" - } + }, + "clientNamespace": "" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredExtensibleEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredExtensibleEnum", + "serializationOptions": { + "$id": "252", + "json": { + "$id": "253", + "name": "requiredExtensibleEnum" + } + } }, { - "$id": "180", + "$id": "254", "kind": "property", "name": "requiredFixedEnum", "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "181", + "$id": "255", "kind": "nullable", "type": { "$ref": "20" - } + }, + "clientNamespace": "" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredFixedEnum" + "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithRequiredNullableProperties.requiredFixedEnum", + "serializationOptions": { + "$id": "256", + "json": { + "$id": "257", + "name": "requiredFixedEnum" + } + } } ] }, @@ -1747,16 +2037,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.modelWithRequiredNullable" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.modelWithRequiredNullable", + "serializationOptions": { + "$id": "258", + "json": { + "$id": "259", + "name": "modelWithRequiredNullable" + } + } }, { - "$id": "182", + "$id": "260", "kind": "property", "name": "requiredBytes", "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "183", + "$id": "261", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -1768,30 +2065,38 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredBytes" + "crossLanguageDefinitionId": "BasicTypeSpec.RoundTripModel.requiredBytes", + "serializationOptions": { + "$id": "262", + "json": { + "$id": "263", + "name": "requiredBytes" + } + } } ] }, { - "$ref": "174" + "$ref": "244" }, { - "$id": "184", + "$id": "264", "kind": "model", - "name": "Friend", + "name": "FriendModel", + "clientNamespace": "BasicTypeSpec", "crossLanguageDefinitionId": "BasicTypeSpec.NotFriend", "usage": "Output,Spread,Json", "doc": "this is not a friendly model but with a friendly name", "decorators": [], "properties": [ { - "$id": "185", + "$id": "265", "kind": "property", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "186", + "$id": "266", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1802,27 +2107,35 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.NotFriend.name" + "crossLanguageDefinitionId": "BasicTypeSpec.NotFriend.name", + "serializationOptions": { + "$id": "267", + "json": { + "$id": "268", + "name": "name" + } + } } ] }, { - "$id": "187", + "$id": "269", "kind": "model", "name": "ProjectedModel", + "clientNamespace": "BasicTypeSpec", "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithProjectedName", "usage": "Output,Spread,Json", "doc": "this is a model with a projected name", "decorators": [], "properties": [ { - "$id": "188", + "$id": "270", "kind": "property", "name": "name", "serializedName": "name", "doc": "name of the ModelWithProjectedName", "type": { - "$id": "189", + "$id": "271", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1833,14 +2146,22 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithProjectedName.name" + "crossLanguageDefinitionId": "BasicTypeSpec.ModelWithProjectedName.name", + "serializationOptions": { + "$id": "272", + "json": { + "$id": "273", + "name": "name" + } + } } ] }, { - "$id": "190", + "$id": "274", "kind": "model", "name": "ReturnsAnonymousModelResponse", + "clientNamespace": "BasicTypeSpec", "crossLanguageDefinitionId": "BasicTypeSpec.returnsAnonymousModel.Response.anonymous", "usage": "Output,Json", "decorators": [], @@ -1849,23 +2170,24 @@ ], "Clients": [ { - "$id": "191", + "$id": "275", "Name": "BasicTypeSpecClient", + "ClientNamespace": "BasicTypeSpec", "Doc": "This is a sample typespec project.", "Operations": [ { - "$id": "192", + "$id": "276", "Name": "sayHi", "ResourceName": "BasicTypeSpec", "Doc": "Return hi", "Accessibility": "public", "Parameters": [ { - "$id": "193", + "$id": "277", "Name": "headParameter", "NameInRequest": "head-parameter", "Type": { - "$id": "194", + "$id": "278", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1882,11 +2204,11 @@ "SkipUrlEncoding": false }, { - "$id": "195", + "$id": "279", "Name": "queryParameter", "NameInRequest": "queryParameter", "Type": { - "$id": "196", + "$id": "280", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1903,11 +2225,11 @@ "SkipUrlEncoding": false }, { - "$id": "197", + "$id": "281", "Name": "optionalQuery", "NameInRequest": "optionalQuery", "Type": { - "$id": "198", + "$id": "282", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1924,14 +2246,14 @@ "SkipUrlEncoding": false }, { - "$id": "199", + "$id": "283", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "200", + "$id": "284", "kind": "constant", "valueType": { - "$id": "201", + "$id": "285", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1953,7 +2275,7 @@ ], "Responses": [ { - "$id": "202", + "$id": "286", "StatusCodes": [ 200 ], @@ -1979,18 +2301,18 @@ "Decorators": [] }, { - "$id": "203", + "$id": "287", "Name": "helloAgain", "ResourceName": "BasicTypeSpec", "Doc": "Return hi again", "Accessibility": "public", "Parameters": [ { - "$id": "204", + "$id": "288", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "205", + "$id": "289", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2007,14 +2329,14 @@ "SkipUrlEncoding": false }, { - "$id": "206", + "$id": "290", "Name": "contentType", "NameInRequest": "Content-Type", "Type": { - "$id": "207", + "$id": "291", "kind": "constant", "valueType": { - "$id": "208", + "$id": "292", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2034,11 +2356,11 @@ "SkipUrlEncoding": false }, { - "$id": "209", + "$id": "293", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "210", + "$id": "294", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2055,14 +2377,14 @@ "SkipUrlEncoding": false }, { - "$id": "211", + "$id": "295", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "212", + "$id": "296", "kind": "constant", "valueType": { - "$id": "213", + "$id": "297", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2082,11 +2404,11 @@ "SkipUrlEncoding": false }, { - "$id": "214", + "$id": "298", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "127" + "$ref": "153" }, "Location": "Body", "IsApiVersion": false, @@ -2101,12 +2423,12 @@ ], "Responses": [ { - "$id": "215", + "$id": "299", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "127" + "$ref": "153" }, "BodyMediaType": "Json", "Headers": [], @@ -2130,18 +2452,18 @@ "Decorators": [] }, { - "$id": "216", + "$id": "300", "Name": "noContentType", "ResourceName": "BasicTypeSpec", "Doc": "Return hi again", "Accessibility": "public", "Parameters": [ { - "$id": "217", + "$id": "301", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "218", + "$id": "302", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2158,11 +2480,11 @@ "SkipUrlEncoding": false }, { - "$id": "219", + "$id": "303", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "220", + "$id": "304", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2179,15 +2501,15 @@ "SkipUrlEncoding": false }, { - "$id": "221", + "$id": "305", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "222", + "$id": "306", "kind": "constant", "valueType": { - "$id": "223", + "$id": "307", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2207,14 +2529,14 @@ "SkipUrlEncoding": false }, { - "$id": "224", + "$id": "308", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "225", + "$id": "309", "kind": "constant", "valueType": { - "$id": "226", + "$id": "310", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2234,11 +2556,11 @@ "SkipUrlEncoding": false }, { - "$id": "227", + "$id": "311", "Name": "action", "NameInRequest": "action", "Type": { - "$ref": "127" + "$ref": "153" }, "Location": "Body", "IsApiVersion": false, @@ -2253,12 +2575,12 @@ ], "Responses": [ { - "$id": "228", + "$id": "312", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "127" + "$ref": "153" }, "BodyMediaType": "Json", "Headers": [], @@ -2282,21 +2604,21 @@ "Decorators": [] }, { - "$id": "229", + "$id": "313", "Name": "helloDemo2", "ResourceName": "BasicTypeSpec", "Doc": "Return hi in demo2", "Accessibility": "public", "Parameters": [ { - "$id": "230", + "$id": "314", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "231", + "$id": "315", "kind": "constant", "valueType": { - "$id": "232", + "$id": "316", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2318,7 +2640,7 @@ ], "Responses": [ { - "$id": "233", + "$id": "317", "StatusCodes": [ 200 ], @@ -2344,22 +2666,22 @@ "Decorators": [] }, { - "$id": "234", + "$id": "318", "Name": "createLiteral", "ResourceName": "BasicTypeSpec", "Doc": "Create with literal value", "Accessibility": "public", "Parameters": [ { - "$id": "235", + "$id": "319", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "236", + "$id": "320", "kind": "constant", "valueType": { - "$id": "237", + "$id": "321", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2379,14 +2701,14 @@ "SkipUrlEncoding": false }, { - "$id": "238", + "$id": "322", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "239", + "$id": "323", "kind": "constant", "valueType": { - "$id": "240", + "$id": "324", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2406,7 +2728,7 @@ "SkipUrlEncoding": false }, { - "$id": "241", + "$id": "325", "Name": "body", "NameInRequest": "body", "Type": { @@ -2425,7 +2747,7 @@ ], "Responses": [ { - "$id": "242", + "$id": "326", "StatusCodes": [ 200 ], @@ -2454,21 +2776,21 @@ "Decorators": [] }, { - "$id": "243", + "$id": "327", "Name": "helloLiteral", "ResourceName": "BasicTypeSpec", "Doc": "Send literal parameters", "Accessibility": "public", "Parameters": [ { - "$id": "244", + "$id": "328", "Name": "p1", "NameInRequest": "p1", "Type": { - "$id": "245", + "$id": "329", "kind": "constant", "valueType": { - "$id": "246", + "$id": "330", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2488,14 +2810,14 @@ "SkipUrlEncoding": false }, { - "$id": "247", + "$id": "331", "Name": "p2", "NameInRequest": "p2", "Type": { - "$id": "248", + "$id": "332", "kind": "constant", "valueType": { - "$id": "249", + "$id": "333", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2515,14 +2837,14 @@ "SkipUrlEncoding": false }, { - "$id": "250", + "$id": "334", "Name": "p3", "NameInRequest": "p3", "Type": { - "$id": "251", + "$id": "335", "kind": "constant", "valueType": { - "$id": "252", + "$id": "336", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -2542,14 +2864,14 @@ "SkipUrlEncoding": false }, { - "$id": "253", + "$id": "337", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "254", + "$id": "338", "kind": "constant", "valueType": { - "$id": "255", + "$id": "339", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2571,7 +2893,7 @@ ], "Responses": [ { - "$id": "256", + "$id": "340", "StatusCodes": [ 200 ], @@ -2597,23 +2919,23 @@ "Decorators": [] }, { - "$id": "257", + "$id": "341", "Name": "topAction", "ResourceName": "BasicTypeSpec", "Doc": "top level method", "Accessibility": "public", "Parameters": [ { - "$id": "258", + "$id": "342", "Name": "action", "NameInRequest": "action", "Type": { - "$id": "259", + "$id": "343", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "260", + "$id": "344", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2633,14 +2955,14 @@ "SkipUrlEncoding": false }, { - "$id": "261", + "$id": "345", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "262", + "$id": "346", "kind": "constant", "valueType": { - "$id": "263", + "$id": "347", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2662,7 +2984,7 @@ ], "Responses": [ { - "$id": "264", + "$id": "348", "StatusCodes": [ 200 ], @@ -2688,21 +3010,21 @@ "Decorators": [] }, { - "$id": "265", + "$id": "349", "Name": "topAction2", "ResourceName": "BasicTypeSpec", "Doc": "top level method2", "Accessibility": "public", "Parameters": [ { - "$id": "266", + "$id": "350", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "267", + "$id": "351", "kind": "constant", "valueType": { - "$id": "268", + "$id": "352", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2724,7 +3046,7 @@ ], "Responses": [ { - "$id": "269", + "$id": "353", "StatusCodes": [ 200 ], @@ -2750,22 +3072,22 @@ "Decorators": [] }, { - "$id": "270", + "$id": "354", "Name": "patchAction", "ResourceName": "BasicTypeSpec", "Doc": "top level patch", "Accessibility": "public", "Parameters": [ { - "$id": "271", + "$id": "355", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "272", + "$id": "356", "kind": "constant", "valueType": { - "$id": "273", + "$id": "357", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2785,14 +3107,14 @@ "SkipUrlEncoding": false }, { - "$id": "274", + "$id": "358", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "275", + "$id": "359", "kind": "constant", "valueType": { - "$id": "276", + "$id": "360", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2812,7 +3134,7 @@ "SkipUrlEncoding": false }, { - "$id": "277", + "$id": "361", "Name": "body", "NameInRequest": "body", "Type": { @@ -2831,7 +3153,7 @@ ], "Responses": [ { - "$id": "278", + "$id": "362", "StatusCodes": [ 200 ], @@ -2860,22 +3182,22 @@ "Decorators": [] }, { - "$id": "279", + "$id": "363", "Name": "anonymousBody", "ResourceName": "BasicTypeSpec", "Doc": "body parameter without body decorator", "Accessibility": "public", "Parameters": [ { - "$id": "280", + "$id": "364", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "281", + "$id": "365", "kind": "constant", "valueType": { - "$id": "282", + "$id": "366", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2895,14 +3217,14 @@ "SkipUrlEncoding": false }, { - "$id": "283", + "$id": "367", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "284", + "$id": "368", "kind": "constant", "valueType": { - "$id": "285", + "$id": "369", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2922,9 +3244,9 @@ "SkipUrlEncoding": false }, { - "$id": "286", - "Name": "thing", - "NameInRequest": "thing", + "$id": "370", + "Name": "thingModel", + "NameInRequest": "thingModel", "Type": { "$ref": "90" }, @@ -2941,7 +3263,7 @@ ], "Responses": [ { - "$id": "287", + "$id": "371", "StatusCodes": [ 200 ], @@ -2970,22 +3292,22 @@ "Decorators": [] }, { - "$id": "288", + "$id": "372", "Name": "friendlyModel", "ResourceName": "BasicTypeSpec", "Doc": "Model can have its friendly name", "Accessibility": "public", "Parameters": [ { - "$id": "289", + "$id": "373", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "290", + "$id": "374", "kind": "constant", "valueType": { - "$id": "291", + "$id": "375", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3005,14 +3327,14 @@ "SkipUrlEncoding": false }, { - "$id": "292", + "$id": "376", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "293", + "$id": "377", "kind": "constant", "valueType": { - "$id": "294", + "$id": "378", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3032,11 +3354,11 @@ "SkipUrlEncoding": false }, { - "$id": "295", - "Name": "friend", - "NameInRequest": "friend", + "$id": "379", + "Name": "friendModel", + "NameInRequest": "friendModel", "Type": { - "$ref": "184" + "$ref": "264" }, "Location": "Body", "IsApiVersion": false, @@ -3051,12 +3373,12 @@ ], "Responses": [ { - "$id": "296", + "$id": "380", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "184" + "$ref": "264" }, "BodyMediaType": "Json", "Headers": [], @@ -3080,22 +3402,22 @@ "Decorators": [] }, { - "$id": "297", + "$id": "381", "Name": "addTimeHeader", "ResourceName": "BasicTypeSpec", "Accessibility": "public", "Parameters": [ { - "$id": "298", + "$id": "382", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Type": { - "$id": "299", + "$id": "383", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "300", + "$id": "384", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3117,7 +3439,7 @@ ], "Responses": [ { - "$id": "301", + "$id": "385", "StatusCodes": [ 204 ], @@ -3137,22 +3459,22 @@ "Decorators": [] }, { - "$id": "302", + "$id": "386", "Name": "projectedNameModel", "ResourceName": "BasicTypeSpec", "Doc": "Model can have its projected name", "Accessibility": "public", "Parameters": [ { - "$id": "303", + "$id": "387", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "304", + "$id": "388", "kind": "constant", "valueType": { - "$id": "305", + "$id": "389", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3172,14 +3494,14 @@ "SkipUrlEncoding": false }, { - "$id": "306", + "$id": "390", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "307", + "$id": "391", "kind": "constant", "valueType": { - "$id": "308", + "$id": "392", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3199,11 +3521,11 @@ "SkipUrlEncoding": false }, { - "$id": "309", + "$id": "393", "Name": "projectedModel", "NameInRequest": "projectedModel", "Type": { - "$ref": "187" + "$ref": "269" }, "Location": "Body", "IsApiVersion": false, @@ -3218,12 +3540,12 @@ ], "Responses": [ { - "$id": "310", + "$id": "394", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "187" + "$ref": "269" }, "BodyMediaType": "Json", "Headers": [], @@ -3247,21 +3569,21 @@ "Decorators": [] }, { - "$id": "311", + "$id": "395", "Name": "returnsAnonymousModel", "ResourceName": "BasicTypeSpec", "Doc": "return anonymous model", "Accessibility": "public", "Parameters": [ { - "$id": "312", + "$id": "396", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "313", + "$id": "397", "kind": "constant", "valueType": { - "$id": "314", + "$id": "398", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3283,12 +3605,12 @@ ], "Responses": [ { - "$id": "315", + "$id": "399", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "190" + "$ref": "274" }, "BodyMediaType": "Json", "Headers": [], @@ -3309,18 +3631,18 @@ "Decorators": [] }, { - "$id": "316", + "$id": "400", "Name": "getUnknownValue", "ResourceName": "BasicTypeSpec", "Doc": "get extensible enum", "Accessibility": "public", "Parameters": [ { - "$id": "317", + "$id": "401", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "318", + "$id": "402", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3339,15 +3661,15 @@ ], "Responses": [ { - "$id": "319", + "$id": "403", "StatusCodes": [ 200 ], "BodyType": { - "$id": "320", + "$id": "404", "kind": "constant", "valueType": { - "$id": "321", + "$id": "405", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3382,22 +3704,22 @@ "Decorators": [] }, { - "$id": "322", + "$id": "406", "Name": "internalProtocol", "ResourceName": "BasicTypeSpec", "Doc": "When set protocol false and convenient true, then the protocol method should be internal", "Accessibility": "public", "Parameters": [ { - "$id": "323", + "$id": "407", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "324", + "$id": "408", "kind": "constant", "valueType": { - "$id": "325", + "$id": "409", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3417,14 +3739,14 @@ "SkipUrlEncoding": false }, { - "$id": "326", + "$id": "410", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "327", + "$id": "411", "kind": "constant", "valueType": { - "$id": "328", + "$id": "412", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3444,7 +3766,7 @@ "SkipUrlEncoding": false }, { - "$id": "329", + "$id": "413", "Name": "body", "NameInRequest": "body", "Type": { @@ -3463,7 +3785,7 @@ ], "Responses": [ { - "$id": "330", + "$id": "414", "StatusCodes": [ 200 ], @@ -3492,7 +3814,7 @@ "Decorators": [] }, { - "$id": "331", + "$id": "415", "Name": "stillConvenient", "ResourceName": "BasicTypeSpec", "Doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", @@ -3500,7 +3822,7 @@ "Parameters": [], "Responses": [ { - "$id": "332", + "$id": "416", "StatusCodes": [ 204 ], @@ -3520,18 +3842,18 @@ "Decorators": [] }, { - "$id": "333", + "$id": "417", "Name": "headAsBoolean", "ResourceName": "BasicTypeSpec", "Doc": "head as boolean.", "Accessibility": "public", "Parameters": [ { - "$id": "334", + "$id": "418", "Name": "id", "NameInRequest": "id", "Type": { - "$id": "335", + "$id": "419", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3550,7 +3872,7 @@ ], "Responses": [ { - "$id": "336", + "$id": "420", "StatusCodes": [ 204 ], @@ -3571,15 +3893,15 @@ } ], "Protocol": { - "$id": "337" + "$id": "421" }, "Parameters": [ { - "$id": "338", + "$id": "422", "Name": "basicTypeSpecUrl", "NameInRequest": "basicTypeSpecUrl", "Type": { - "$id": "339", + "$id": "423", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3599,13 +3921,14 @@ } ], "Auth": { - "$id": "340", + "$id": "424", "ApiKey": { - "$id": "341", - "Name": "my-api-key" + "$id": "425", + "Name": "my-api-key", + "In": "header" }, "OAuth2": { - "$id": "342", + "$id": "426", "Scopes": [ "https://theservice.azure.com/.default" ] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Directory.Build.props b/eng/packages/http-client-csharp/generator/TestProjects/Local/Directory.Build.props new file mode 100644 index 000000000000..db1ad39457f0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Directory.Build.props @@ -0,0 +1,10 @@ + + + true + false + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/Configuration.json index 99e9686a9529..c54a61b5a989 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/Configuration.json +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/Configuration.json @@ -1,6 +1,5 @@ { "output-folder": ".", "namespace": "MgmtTypeSpec", - "library-name": "MgmtTypeSpec", - "use-model-reader-writer": true + "library-name": "MgmtTypeSpec" } diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/MgmtTypeSpec.sln b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/MgmtTypeSpec.sln index dd844bd4f034..9fcc69381b70 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/MgmtTypeSpec.sln +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/MgmtTypeSpec.sln @@ -1,48 +1,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29709.97 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MgmtTypeSpec", "src\MgmtTypeSpec.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs index 5acdb3569cc8..854ca6730681 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -42,16 +42,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -68,8 +74,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs index 41d3b84aa336..93f599255021 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ChangeTrackingList.cs @@ -36,12 +36,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..1a1a26c262fd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace MgmtTypeSpec +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..6328982e0bde --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace MgmtTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..13012e94db93 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace MgmtTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..0e7346e47d6c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace MgmtTypeSpec +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ErrorResult.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ErrorResult.cs index dde2d94820bf..98d7257e97e6 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ErrorResult.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/ErrorResult.cs @@ -20,6 +20,7 @@ public ErrorResult(Response response, RequestFailedException exception) _exception = exception; } + /// Gets the Value. public override T Value => throw _exception; public override Response GetRawResponse() diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs index 280e6aef1e2e..4305a53ec158 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs @@ -25,6 +25,7 @@ public Utf8JsonBinaryContent() JsonWriter = new Utf8JsonWriter(_stream); } + /// Gets the JsonWriter. public Utf8JsonWriter JsonWriter { get; } public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperation.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperation.cs new file mode 100644 index 000000000000..07d3a751287a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperation.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace MgmtTypeSpec +{ + internal partial class MgmtTypeSpecArmOperation : Azure.ResourceManager.ArmOperation + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + protected MgmtTypeSpecArmOperation() + { + } + + internal MgmtTypeSpecArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MgmtTypeSpecArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) + { + _nextLinkOperation = nextLinkOperationImplementation; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "MgmtTypeSpecArmOperation", + null, + new SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + Dictionary lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperationOfT.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperationOfT.cs new file mode 100644 index 000000000000..b194efb15887 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/LongRunningOperation/MgmtTypeSpecArmOperationOfT.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace MgmtTypeSpec +{ + internal partial class MgmtTypeSpecArmOperation : Azure.ResourceManager.ArmOperation + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + protected MgmtTypeSpecArmOperation() + { + } + + internal MgmtTypeSpecArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MgmtTypeSpecArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) + { + _nextLinkOperation = nextLinkOperationImplementation; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal( + NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "MgmtTypeSpecArmOperation", + null, + new SequentialDelayStrategy()); + } + + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the Value. + public override T Value => _operation.Value; + + /// Gets the HasValue. + public override bool HasValue => _operation.HasValue; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + Dictionary lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/FoosRestOperations.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/FoosRestOperations.cs index 8f2cf2a728a7..2d4366f46dd7 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/FoosRestOperations.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/FoosRestOperations.cs @@ -32,6 +32,7 @@ internal Foos(HttpPipeline pipeline, Uri endpoint, string apiVersion) _apiVersion = apiVersion; } + /// The HTTP pipeline for sending and receiving REST requests and responses. public HttpPipeline Pipeline { get; } /// diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs index 53f279822f7f..9ce3b466217e 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/RestOperations/PrivateLinksRestOperations.cs @@ -32,6 +32,7 @@ internal PrivateLinks(HttpPipeline pipeline, Uri endpoint, string apiVersion) _apiVersion = apiVersion; } + /// The HTTP pipeline for sending and receiving REST requests and responses. public HttpPipeline Pipeline { get; } /// diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/MgmtTypeSpec.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/MgmtTypeSpec.csproj index 1408010b44f1..1c0dbda0a3a2 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/MgmtTypeSpec.csproj +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/src/MgmtTypeSpec.csproj @@ -4,20 +4,35 @@ SDK Code Generation MgmtTypeSpec 1.0.0-beta.1 MgmtTypeSpec - netstandard2.0 - latest true - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/tspCodeModel.json index 2f8c652d2c80..66461ee0a916 100644 --- a/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/tspCodeModel.json +++ b/eng/packages/http-client-csharp/generator/TestProjects/Local/Mgmt-TypeSpec/tspCodeModel.json @@ -55,6 +55,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", "doc": "The supported ExtendedLocation types.", "isFixed": false, "isFlags": false, @@ -147,6 +148,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", "doc": "The kind of entity that created the resource.", "isFixed": false, "isFlags": false, @@ -221,6 +223,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager", "doc": "The provisioning state of a resource type.", "isFixed": false, "isFlags": false, @@ -313,6 +316,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", "isFixed": false, "isFlags": false, @@ -387,6 +391,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", "isFixed": false, "isFlags": false, @@ -425,6 +430,7 @@ "decorators": [] } ], + "clientNamespace": "Azure.ResourceManager.CommonTypes", "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", "isFixed": false, "isFlags": false, @@ -463,6 +469,7 @@ "decorators": [] } ], + "clientNamespace": "MgmtTypeSpec", "doc": "The available API versions.", "isFixed": true, "isFlags": false, @@ -475,6 +482,7 @@ "$id": "52", "kind": "model", "name": "Foo", + "clientNamespace": "MgmtTypeSpec", "crossLanguageDefinitionId": "MgmtTypeSpec.Foo", "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", "doc": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", @@ -483,6 +491,7 @@ "$id": "53", "kind": "model", "name": "TrackedResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", @@ -491,6 +500,7 @@ "$id": "54", "kind": "model", "name": "Resource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", @@ -521,16 +531,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "58", + "json": { + "$id": "59", + "name": "id" + } + } }, { - "$id": "58", + "$id": "60", "kind": "property", "name": "name", "serializedName": "name", "doc": "The name of the resource", "type": { - "$id": "59", + "$id": "61", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -541,21 +558,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "62", + "json": { + "$id": "63", + "name": "name" + } + } }, { - "$id": "60", + "$id": "64", "kind": "property", "name": "type", "serializedName": "type", "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", "type": { - "$id": "61", + "$id": "65", "kind": "string", "name": "armResourceType", "crossLanguageDefinitionId": "Azure.Core.armResourceType", "baseType": { - "$id": "62", + "$id": "66", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -568,31 +592,39 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "67", + "json": { + "$id": "68", + "name": "type" + } + } }, { - "$id": "63", + "$id": "69", "kind": "property", "name": "systemData", "serializedName": "systemData", "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", "type": { - "$id": "64", + "$id": "70", "kind": "model", "name": "SystemData", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", "usage": "Output,Json,LroInitial,LroFinalEnvelope", "doc": "Metadata pertaining to creation and last modification of the resource.", "decorators": [], "properties": [ { - "$id": "65", + "$id": "71", "kind": "property", "name": "createdBy", "serializedName": "createdBy", "doc": "The identity that created the resource.", "type": { - "$id": "66", + "$id": "72", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -603,10 +635,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "73", + "json": { + "$id": "74", + "name": "createdBy" + } + } }, { - "$id": "67", + "$id": "75", "kind": "property", "name": "createdByType", "serializedName": "createdByType", @@ -619,21 +658,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "76", + "json": { + "$id": "77", + "name": "createdByType" + } + } }, { - "$id": "68", + "$id": "78", "kind": "property", "name": "createdAt", "serializedName": "createdAt", "doc": "The timestamp of resource creation (UTC).", "type": { - "$id": "69", + "$id": "79", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "70", + "$id": "80", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -647,16 +693,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "81", + "json": { + "$id": "82", + "name": "createdAt" + } + } }, { - "$id": "71", + "$id": "83", "kind": "property", "name": "lastModifiedBy", "serializedName": "lastModifiedBy", "doc": "The identity that last modified the resource.", "type": { - "$id": "72", + "$id": "84", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -667,10 +720,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "85", + "json": { + "$id": "86", + "name": "lastModifiedBy" + } + } }, { - "$id": "73", + "$id": "87", "kind": "property", "name": "lastModifiedByType", "serializedName": "lastModifiedByType", @@ -683,21 +743,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "88", + "json": { + "$id": "89", + "name": "lastModifiedByType" + } + } }, { - "$id": "74", + "$id": "90", "kind": "property", "name": "lastModifiedAt", "serializedName": "lastModifiedAt", "doc": "The timestamp of resource last modification (UTC)", "type": { - "$id": "75", + "$id": "91", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "76", + "$id": "92", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -711,7 +778,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "93", + "json": { + "$id": "94", + "name": "lastModifiedAt" + } + } } ] }, @@ -720,29 +794,36 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "95", + "json": { + "$id": "96", + "name": "systemData" + } + } } ] }, "properties": [ { - "$id": "77", + "$id": "97", "kind": "property", "name": "tags", "serializedName": "tags", "doc": "Resource tags.", "type": { - "$id": "78", + "$id": "98", "kind": "dict", "keyType": { - "$id": "79", + "$id": "99", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "80", + "$id": "100", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -755,16 +836,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "101", + "json": { + "$id": "102", + "name": "tags" + } + } }, { - "$id": "81", + "$id": "103", "kind": "property", "name": "location", "serializedName": "location", "doc": "The geo-location where the resource lives", "type": { - "$id": "82", + "$id": "104", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -775,42 +863,50 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "105", + "json": { + "$id": "106", + "name": "location" + } + } } ] }, "properties": [ { - "$id": "83", + "$id": "107", "kind": "property", "name": "properties", "serializedName": "properties", "doc": "The resource-specific properties for this resource.", "type": { - "$id": "84", + "$id": "108", "kind": "model", "name": "FooProperties", + "clientNamespace": "MgmtTypeSpec", "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties", "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", "decorators": [ { - "$id": "85", + "$id": "109", "name": "Azure.ClientGenerator.Core.@useSystemTextJsonConverter", "arguments": { - "$id": "86", + "$id": "110", "scope": "csharp" } } ], "properties": [ { - "$id": "87", + "$id": "111", "kind": "property", "name": "serviceUrl", "serializedName": "serviceUrl", "doc": "the service url", "type": { - "$id": "88", + "$id": "112", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -821,16 +917,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.serviceUrl" + "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.serviceUrl", + "serializationOptions": { + "$id": "113", + "json": { + "$id": "114", + "name": "serviceUrl" + } + } }, { - "$id": "89", + "$id": "115", "kind": "property", "name": "something", "serializedName": "something", "doc": "something", "type": { - "$id": "90", + "$id": "116", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -841,16 +944,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.something" + "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.something", + "serializationOptions": { + "$id": "117", + "json": { + "$id": "118", + "name": "something" + } + } }, { - "$id": "91", + "$id": "119", "kind": "property", "name": "boolValue", "serializedName": "boolValue", "doc": "boolean value", "type": { - "$id": "92", + "$id": "120", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -861,16 +971,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.boolValue" + "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.boolValue", + "serializationOptions": { + "$id": "121", + "json": { + "$id": "122", + "name": "boolValue" + } + } }, { - "$id": "93", + "$id": "123", "kind": "property", "name": "floatValue", "serializedName": "floatValue", "doc": "float value", "type": { - "$id": "94", + "$id": "124", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -881,16 +998,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.floatValue" + "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.floatValue", + "serializationOptions": { + "$id": "125", + "json": { + "$id": "126", + "name": "floatValue" + } + } }, { - "$id": "95", + "$id": "127", "kind": "property", "name": "doubleValue", "serializedName": "doubleValue", "doc": "double value", "type": { - "$id": "96", + "$id": "128", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -901,7 +1025,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.doubleValue" + "crossLanguageDefinitionId": "MgmtTypeSpec.FooProperties.doubleValue", + "serializationOptions": { + "$id": "129", + "json": { + "$id": "130", + "name": "doubleValue" + } + } } ] }, @@ -910,30 +1041,38 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.Foo.properties" + "crossLanguageDefinitionId": "MgmtTypeSpec.Foo.properties", + "serializationOptions": { + "$id": "131", + "json": { + "$id": "132", + "name": "properties" + } + } }, { - "$id": "97", + "$id": "133", "kind": "property", "name": "extendedLocation", "serializedName": "extendedLocation", "type": { - "$id": "98", + "$id": "134", "kind": "model", "name": "ExtendedLocation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ExtendedLocation", "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", "doc": "The complex type of the extended location.", "decorators": [], "properties": [ { - "$id": "99", + "$id": "135", "kind": "property", "name": "name", "serializedName": "name", "doc": "The name of the extended location.", "type": { - "$id": "100", + "$id": "136", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -944,10 +1083,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ExtendedLocation.name" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ExtendedLocation.name", + "serializationOptions": { + "$id": "137", + "json": { + "$id": "138", + "name": "name" + } + } }, { - "$id": "101", + "$id": "139", "kind": "property", "name": "type", "serializedName": "type", @@ -960,7 +1106,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ExtendedLocation.type" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ExtendedLocation.type", + "serializationOptions": { + "$id": "140", + "json": { + "$id": "141", + "name": "type" + } + } } ] }, @@ -969,15 +1122,22 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.Foo.extendedLocation" + "crossLanguageDefinitionId": "MgmtTypeSpec.Foo.extendedLocation", + "serializationOptions": { + "$id": "142", + "json": { + "$id": "143", + "name": "extendedLocation" + } + } } ] }, { - "$ref": "84" + "$ref": "108" }, { - "$ref": "98" + "$ref": "134" }, { "$ref": "53" @@ -986,40 +1146,42 @@ "$ref": "54" }, { - "$ref": "64" + "$ref": "70" }, { - "$id": "102", + "$id": "144", "kind": "model", "name": "ErrorResponse", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", "usage": "Error,Json,Exception", "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "decorators": [], "properties": [ { - "$id": "103", + "$id": "145", "kind": "property", "name": "error", "serializedName": "error", "doc": "The error object.", "type": { - "$id": "104", + "$id": "146", "kind": "model", "name": "ErrorDetail", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", "usage": "Output,Json,Exception,LroInitial,LroPolling,LroFinalEnvelope", "doc": "The error detail.", "decorators": [], "properties": [ { - "$id": "105", + "$id": "147", "kind": "property", "name": "code", "serializedName": "code", "doc": "The error code.", "type": { - "$id": "106", + "$id": "148", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1030,16 +1192,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "149", + "json": { + "$id": "150", + "name": "code" + } + } }, { - "$id": "107", + "$id": "151", "kind": "property", "name": "message", "serializedName": "message", "doc": "The error message.", "type": { - "$id": "108", + "$id": "152", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1050,16 +1219,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "153", + "json": { + "$id": "154", + "name": "message" + } + } }, { - "$id": "109", + "$id": "155", "kind": "property", "name": "target", "serializedName": "target", "doc": "The error target.", "type": { - "$id": "110", + "$id": "156", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1070,20 +1246,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "157", + "json": { + "$id": "158", + "name": "target" + } + } }, { - "$id": "111", + "$id": "159", "kind": "property", "name": "details", "serializedName": "details", "doc": "The error details.", "type": { - "$id": "112", + "$id": "160", "kind": "array", "name": "ArrayErrorDetail", "valueType": { - "$ref": "104" + "$ref": "146" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -1093,35 +1276,43 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "details" + } + } }, { - "$id": "113", + "$id": "163", "kind": "property", "name": "additionalInfo", "serializedName": "additionalInfo", "doc": "The error additional info.", "type": { - "$id": "114", + "$id": "164", "kind": "array", "name": "ArrayErrorAdditionalInfo", "valueType": { - "$id": "115", + "$id": "165", "kind": "model", "name": "ErrorAdditionalInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "usage": "Output,Json,Exception,LroInitial,LroPolling,LroFinalEnvelope", "doc": "The resource management error additional info.", "decorators": [], "properties": [ { - "$id": "116", + "$id": "166", "kind": "property", "name": "type", "serializedName": "type", "doc": "The additional info type.", "type": { - "$id": "117", + "$id": "167", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1132,18 +1323,26 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "168", + "json": { + "$id": "169", + "name": "type" + } + } }, { - "$id": "118", + "$id": "170", "kind": "property", "name": "info", "serializedName": "info", "doc": "The additional info.", "type": { - "$id": "119", + "$id": "171", "kind": "model", "name": "ErrorAdditionalInfoInfo", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", "usage": "Output,Json,Exception,LroInitial,LroPolling,LroFinalEnvelope", "decorators": [], @@ -1154,7 +1353,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "172", + "json": { + "$id": "173", + "name": "info" + } + } } ] }, @@ -1166,7 +1372,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "174", + "json": { + "$id": "175", + "name": "additionalInfo" + } + } } ] }, @@ -1175,30 +1388,38 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "176", + "json": { + "$id": "177", + "name": "error" + } + } } ] }, { - "$ref": "104" + "$ref": "146" }, { - "$ref": "115" + "$ref": "165" }, { - "$ref": "119" + "$ref": "171" }, { - "$id": "120", + "$id": "178", "kind": "model", "name": "ArmOperationStatusResourceProvisioningState", + "clientNamespace": "Azure.ResourceManager", "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", "usage": "LroPolling", "doc": "Standard Azure Resource Manager operation status response", "decorators": [], "properties": [ { - "$id": "121", + "$id": "179", "kind": "property", "name": "status", "serializedName": "status", @@ -1211,16 +1432,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "180", + "json": { + "$id": "181", + "name": "status" + } + } }, { - "$id": "122", + "$id": "182", "kind": "property", "name": "name", "serializedName": "name", "doc": "The name of the operationStatus resource", "type": { - "$id": "123", + "$id": "183", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1231,21 +1459,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "184", + "json": { + "$id": "185", + "name": "name" + } + } }, { - "$id": "124", + "$id": "186", "kind": "property", "name": "startTime", "serializedName": "startTime", "doc": "Operation start time", "type": { - "$id": "125", + "$id": "187", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "126", + "$id": "188", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1259,21 +1494,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "189", + "json": { + "$id": "190", + "name": "startTime" + } + } }, { - "$id": "127", + "$id": "191", "kind": "property", "name": "endTime", "serializedName": "endTime", "doc": "Operation complete time", "type": { - "$id": "128", + "$id": "192", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "129", + "$id": "193", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1287,16 +1529,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "194", + "json": { + "$id": "195", + "name": "endTime" + } + } }, { - "$id": "130", + "$id": "196", "kind": "property", "name": "percentComplete", "serializedName": "percentComplete", "doc": "The progress made toward completing the operation", "type": { - "$id": "131", + "$id": "197", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1307,43 +1556,58 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "198", + "json": { + "$id": "199", + "name": "percentComplete" + } + } }, { - "$id": "132", + "$id": "200", "kind": "property", "name": "error", "serializedName": "error", "doc": "Errors that occurred if the operation ended with Canceled or Failed status", "type": { - "$ref": "104" + "$ref": "146" }, "optional": true, "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error" + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "201", + "json": { + "$id": "202", + "name": "error" + } + } } ] }, { - "$id": "133", + "$id": "203", "kind": "model", "name": "FooListResult", + "clientNamespace": "Azure.ResourceManager", "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", "usage": "Output,Json", "doc": "The response of a Foo list operation.", "decorators": [], "properties": [ { - "$id": "134", + "$id": "204", "kind": "property", "name": "value", "serializedName": "value", "doc": "The Foo items on this page", "type": { - "$id": "135", + "$id": "205", "kind": "array", "name": "ArrayFoo", "valueType": { @@ -1357,21 +1621,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "206", + "json": { + "$id": "207", + "name": "value" + } + } }, { - "$id": "136", + "$id": "208", "kind": "property", "name": "nextLink", "serializedName": "nextLink", "doc": "The link to the next page of items", "type": { - "$id": "137", + "$id": "209", "kind": "url", "name": "ResourceLocation", "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", "baseType": { - "$id": "138", + "$id": "210", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1384,41 +1655,51 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "211", + "json": { + "$id": "212", + "name": "nextLink" + } + } } ] }, { - "$id": "139", + "$id": "213", "kind": "model", "name": "PrivateLinkResourceListResult", + "clientNamespace": "Azure.ResourceManager", "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", "usage": "Output,Json", "doc": "The response of a PrivateLinkResource list operation.", "decorators": [], "properties": [ { - "$id": "140", + "$id": "214", "kind": "property", "name": "value", "serializedName": "value", "doc": "The PrivateLinkResource items on this page", "type": { - "$id": "141", + "$id": "215", "kind": "array", "name": "ArrayPrivateLinkResource", "valueType": { - "$id": "142", + "$id": "216", "kind": "model", "name": "PrivateLinkResource", + "clientNamespace": "MgmtTypeSpec", "crossLanguageDefinitionId": "MgmtTypeSpec.PrivateLinkResource", "usage": "Output,Json", "doc": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", "decorators": [], "baseModel": { - "$id": "143", + "$id": "217", "kind": "model", "name": "ProxyResource", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", "usage": "Output,Json", "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", @@ -1430,28 +1711,29 @@ }, "properties": [ { - "$id": "144", + "$id": "218", "kind": "property", "name": "properties", "serializedName": "properties", "doc": "The resource-specific properties for this resource.", "type": { - "$id": "145", + "$id": "219", "kind": "model", "name": "PrivateLinkResourceProperties", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "usage": "Output,Json", "doc": "Properties of a private link resource.", "decorators": [], "properties": [ { - "$id": "146", + "$id": "220", "kind": "property", "name": "groupId", "serializedName": "groupId", "doc": "The private link resource group id.", "type": { - "$id": "147", + "$id": "221", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1462,20 +1744,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.groupId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.groupId", + "serializationOptions": { + "$id": "222", + "json": { + "$id": "223", + "name": "groupId" + } + } }, { - "$id": "148", + "$id": "224", "kind": "property", "name": "requiredMembers", "serializedName": "requiredMembers", "doc": "The private link resource required member names.", "type": { - "$id": "149", + "$id": "225", "kind": "array", "name": "Array", "valueType": { - "$id": "150", + "$id": "226", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1489,20 +1778,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredMembers" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredMembers", + "serializationOptions": { + "$id": "227", + "json": { + "$id": "228", + "name": "requiredMembers" + } + } }, { - "$id": "151", + "$id": "229", "kind": "property", "name": "requiredZoneNames", "serializedName": "requiredZoneNames", "doc": "The private link resource private link DNS zone name.", "type": { - "$id": "152", + "$id": "230", "kind": "array", "name": "Array", "valueType": { - "$id": "153", + "$id": "231", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1516,7 +1812,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredZoneNames" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredZoneNames", + "serializationOptions": { + "$id": "232", + "json": { + "$id": "233", + "name": "requiredZoneNames" + } + } } ] }, @@ -1525,36 +1828,44 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.PrivateLinkResource.properties" + "crossLanguageDefinitionId": "MgmtTypeSpec.PrivateLinkResource.properties", + "serializationOptions": { + "$id": "234", + "json": { + "$id": "235", + "name": "properties" + } + } }, { - "$id": "154", + "$id": "236", "kind": "property", "name": "identity", "serializedName": "identity", "doc": "The managed service identities assigned to this resource.", "type": { - "$id": "155", + "$id": "237", "kind": "model", "name": "ManagedServiceIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "usage": "Output,Json", "doc": "Managed service identity (system assigned and/or user assigned identities)", "decorators": [], "properties": [ { - "$id": "156", + "$id": "238", "kind": "property", "name": "principalId", "serializedName": "principalId", "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", "type": { - "$id": "157", + "$id": "239", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "158", + "$id": "240", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1567,21 +1878,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "principalId" + } + } }, { - "$id": "159", + "$id": "243", "kind": "property", "name": "tenantId", "serializedName": "tenantId", "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", "type": { - "$id": "160", + "$id": "244", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "161", + "$id": "245", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1594,10 +1912,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "$id": "246", + "json": { + "$id": "247", + "name": "tenantId" + } + } }, { - "$id": "162", + "$id": "248", "kind": "property", "name": "type", "serializedName": "type", @@ -1610,49 +1935,57 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "$id": "249", + "json": { + "$id": "250", + "name": "type" + } + } }, { - "$id": "163", + "$id": "251", "kind": "property", "name": "userAssignedIdentities", "serializedName": "userAssignedIdentities", "doc": "The identities assigned to this resource by the user.", "type": { - "$id": "164", + "$id": "252", "kind": "dict", "keyType": { - "$id": "165", + "$id": "253", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "166", + "$id": "254", "kind": "nullable", "type": { - "$id": "167", + "$id": "255", "kind": "model", "name": "UserAssignedIdentity", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "usage": "Output,Json", "doc": "User assigned identity properties", "decorators": [], "properties": [ { - "$id": "168", + "$id": "256", "kind": "property", "name": "principalId", "serializedName": "principalId", "doc": "The principal ID of the assigned identity.", "type": { - "$id": "169", + "$id": "257", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "170", + "$id": "258", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1665,21 +1998,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "$id": "259", + "json": { + "$id": "260", + "name": "principalId" + } + } }, { - "$id": "171", + "$id": "261", "kind": "property", "name": "clientId", "serializedName": "clientId", "doc": "The client ID of the assigned identity.", "type": { - "$id": "172", + "$id": "262", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "173", + "$id": "263", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1692,10 +2032,18 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "$id": "264", + "json": { + "$id": "265", + "name": "clientId" + } + } } ] - } + }, + "clientNamespace": "" }, "decorators": [] }, @@ -1704,7 +2052,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "$id": "266", + "json": { + "$id": "267", + "name": "userAssignedIdentities" + } + } } ] }, @@ -1713,7 +2068,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.PrivateLinkResource.identity" + "crossLanguageDefinitionId": "MgmtTypeSpec.PrivateLinkResource.identity", + "serializationOptions": { + "$id": "268", + "json": { + "$id": "269", + "name": "identity" + } + } } ] }, @@ -1725,21 +2087,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "270", + "json": { + "$id": "271", + "name": "value" + } + } }, { - "$id": "174", + "$id": "272", "kind": "property", "name": "nextLink", "serializedName": "nextLink", "doc": "The link to the next page of items", "type": { - "$id": "175", + "$id": "273", "kind": "url", "name": "ResourceLocation", "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", "baseType": { - "$id": "176", + "$id": "274", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1752,42 +2121,50 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "275", + "json": { + "$id": "276", + "name": "nextLink" + } + } } ] }, { - "$ref": "142" + "$ref": "216" }, { - "$ref": "145" + "$ref": "219" }, { - "$ref": "155" + "$ref": "237" }, { - "$ref": "167" + "$ref": "255" }, { - "$ref": "143" + "$ref": "217" }, { - "$id": "177", + "$id": "277", "kind": "model", "name": "StartRequest", + "clientNamespace": "MgmtTypeSpec", "crossLanguageDefinitionId": "MgmtTypeSpec.StartRequest", "usage": "Input,Json", "doc": "Start SAP instance(s) request body.", "decorators": [], "properties": [ { - "$id": "178", + "$id": "278", "kind": "property", "name": "startVm", "serializedName": "startVm", "doc": "The boolean value indicates whether to start the virtual machines before starting the SAP instances.", "type": { - "$id": "179", + "$id": "279", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -1798,32 +2175,40 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "MgmtTypeSpec.StartRequest.startVm" + "crossLanguageDefinitionId": "MgmtTypeSpec.StartRequest.startVm", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "startVm" + } + } } ] }, { - "$id": "180", + "$id": "282", "kind": "model", "name": "OperationStatusResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult", "usage": "Output,Json,LroInitial,LroFinalEnvelope", "doc": "The current status of an async operation.", "decorators": [], "properties": [ { - "$id": "181", + "$id": "283", "kind": "property", "name": "id", "serializedName": "id", "doc": "Fully qualified ID for the async operation.", "type": { - "$id": "182", + "$id": "284", "kind": "string", "name": "armResourceIdentifier", "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", "baseType": { - "$id": "183", + "$id": "285", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1836,16 +2221,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.id" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.id", + "serializationOptions": { + "$id": "286", + "json": { + "$id": "287", + "name": "id" + } + } }, { - "$id": "184", + "$id": "288", "kind": "property", "name": "name", "serializedName": "name", "doc": "Name of the async operation.", "type": { - "$id": "185", + "$id": "289", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1856,16 +2248,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.name" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.name", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "name" + } + } }, { - "$id": "186", + "$id": "292", "kind": "property", "name": "status", "serializedName": "status", "doc": "Operation status.", "type": { - "$id": "187", + "$id": "293", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1876,16 +2275,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.status" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.status", + "serializationOptions": { + "$id": "294", + "json": { + "$id": "295", + "name": "status" + } + } }, { - "$id": "188", + "$id": "296", "kind": "property", "name": "percentComplete", "serializedName": "percentComplete", "doc": "Percent of the operation that is complete.", "type": { - "$id": "189", + "$id": "297", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1896,21 +2302,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.percentComplete" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.percentComplete", + "serializationOptions": { + "$id": "298", + "json": { + "$id": "299", + "name": "percentComplete" + } + } }, { - "$id": "190", + "$id": "300", "kind": "property", "name": "startTime", "serializedName": "startTime", "doc": "The start time of the operation.", "type": { - "$id": "191", + "$id": "301", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "192", + "$id": "302", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1924,21 +2337,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.startTime" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.startTime", + "serializationOptions": { + "$id": "303", + "json": { + "$id": "304", + "name": "startTime" + } + } }, { - "$id": "193", + "$id": "305", "kind": "property", "name": "endTime", "serializedName": "endTime", "doc": "The end time of the operation.", "type": { - "$id": "194", + "$id": "306", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "195", + "$id": "307", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1952,20 +2372,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.endTime" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.endTime", + "serializationOptions": { + "$id": "308", + "json": { + "$id": "309", + "name": "endTime" + } + } }, { - "$id": "196", + "$id": "310", "kind": "property", "name": "operations", "serializedName": "operations", "doc": "The operations list.", "type": { - "$id": "197", + "$id": "311", "kind": "array", "name": "ArrayOperationStatusResult", "valueType": { - "$ref": "180" + "$ref": "282" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -1975,32 +2402,46 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.operations" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.operations", + "serializationOptions": { + "$id": "312", + "json": { + "$id": "313", + "name": "operations" + } + } }, { - "$id": "198", + "$id": "314", "kind": "property", "name": "error", "serializedName": "error", "doc": "If present, details of the operation error.", "type": { - "$ref": "104" + "$ref": "146" }, "optional": true, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.error" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.error", + "serializationOptions": { + "$id": "315", + "json": { + "$id": "316", + "name": "error" + } + } }, { - "$id": "199", + "$id": "317", "kind": "property", "name": "resourceId", "serializedName": "resourceId", "doc": "Fully qualified ID of the resource against which the original async operation was started.", "type": { - "$id": "200", + "$id": "318", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2011,46 +2452,55 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.resourceId" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.resourceId", + "serializationOptions": { + "$id": "319", + "json": { + "$id": "320", + "name": "resourceId" + } + } } ] }, { - "$id": "201", + "$id": "321", "kind": "model", "name": "OperationListResult", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", "usage": "Output,Json", "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", "decorators": [], "properties": [ { - "$id": "202", + "$id": "322", "kind": "property", "name": "value", "serializedName": "value", "doc": "The Operation items on this page", "type": { - "$id": "203", + "$id": "323", "kind": "array", "name": "ArrayOperation", "valueType": { - "$id": "204", + "$id": "324", "kind": "model", "name": "Operation", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", "usage": "Output,Json", "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", "decorators": [], "properties": [ { - "$id": "205", + "$id": "325", "kind": "property", "name": "name", "serializedName": "name", "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", "type": { - "$id": "206", + "$id": "326", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2061,16 +2511,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "327", + "json": { + "$id": "328", + "name": "name" + } + } }, { - "$id": "207", + "$id": "329", "kind": "property", "name": "isDataAction", "serializedName": "isDataAction", "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", "type": { - "$id": "208", + "$id": "330", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -2081,31 +2538,39 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "331", + "json": { + "$id": "332", + "name": "isDataAction" + } + } }, { - "$id": "209", + "$id": "333", "kind": "property", "name": "display", "serializedName": "display", "doc": "Localized display information for this particular operation.", "type": { - "$id": "210", + "$id": "334", "kind": "model", "name": "OperationDisplay", + "clientNamespace": "Azure.ResourceManager.CommonTypes", "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", "usage": "Output,Json", "doc": "Localized display information for and operation.", "decorators": [], "properties": [ { - "$id": "211", + "$id": "335", "kind": "property", "name": "provider", "serializedName": "provider", "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", "type": { - "$id": "212", + "$id": "336", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2116,16 +2581,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "337", + "json": { + "$id": "338", + "name": "provider" + } + } }, { - "$id": "213", + "$id": "339", "kind": "property", "name": "resource", "serializedName": "resource", "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", "type": { - "$id": "214", + "$id": "340", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2136,16 +2608,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "341", + "json": { + "$id": "342", + "name": "resource" + } + } }, { - "$id": "215", + "$id": "343", "kind": "property", "name": "operation", "serializedName": "operation", "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", "type": { - "$id": "216", + "$id": "344", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2156,16 +2635,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "345", + "json": { + "$id": "346", + "name": "operation" + } + } }, { - "$id": "217", + "$id": "347", "kind": "property", "name": "description", "serializedName": "description", "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", "type": { - "$id": "218", + "$id": "348", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2176,7 +2662,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "349", + "json": { + "$id": "350", + "name": "description" + } + } } ] }, @@ -2185,10 +2678,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "351", + "json": { + "$id": "352", + "name": "display" + } + } }, { - "$id": "219", + "$id": "353", "kind": "property", "name": "origin", "serializedName": "origin", @@ -2201,10 +2701,17 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "354", + "json": { + "$id": "355", + "name": "origin" + } + } }, { - "$id": "220", + "$id": "356", "kind": "property", "name": "actionType", "serializedName": "actionType", @@ -2217,7 +2724,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "357", + "json": { + "$id": "358", + "name": "actionType" + } + } } ] }, @@ -2229,21 +2743,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "359", + "json": { + "$id": "360", + "name": "value" + } + } }, { - "$id": "221", + "$id": "361", "kind": "property", "name": "nextLink", "serializedName": "nextLink", "doc": "The link to the next page of items", "type": { - "$id": "222", + "$id": "362", "kind": "url", "name": "ResourceLocation", "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", "baseType": { - "$id": "223", + "$id": "363", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -2256,33 +2777,41 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink" + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "364", + "json": { + "$id": "365", + "name": "nextLink" + } + } } ] }, { - "$ref": "204" + "$ref": "324" }, { - "$ref": "210" + "$ref": "334" } ], "Clients": [ { - "$id": "224", + "$id": "366", "Name": "MgmtTypeSpecClient", + "ClientNamespace": "MgmtTypeSpec", "Operations": [], "Protocol": { - "$id": "225" + "$id": "367" }, "Parameters": [ { - "$id": "226", + "$id": "368", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "Service host", "Type": { - "$id": "227", + "$id": "369", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2297,9 +2826,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "228", + "$id": "370", "Type": { - "$id": "229", + "$id": "371", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2310,32 +2839,33 @@ ], "Decorators": [ { - "$id": "230", + "$id": "372", "name": "Azure.ResourceManager.@armProviderNamespace", "arguments": { - "$id": "231" + "$id": "373" } } ] }, { - "$id": "232", + "$id": "374", "Name": "Operations", + "ClientNamespace": "MgmtTypeSpec", "Operations": [ { - "$id": "233", + "$id": "375", "Name": "list", "ResourceName": "Operations", "Doc": "List the operations for the provider", "Accessibility": "public", "Parameters": [ { - "$id": "234", + "$id": "376", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "235", + "$id": "377", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2349,9 +2879,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "236", + "$id": "378", "Type": { - "$id": "237", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2362,14 +2892,14 @@ "SkipUrlEncoding": false }, { - "$id": "238", + "$id": "380", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "239", + "$id": "381", "kind": "constant", "valueType": { - "$id": "240", + "$id": "382", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2391,12 +2921,12 @@ ], "Responses": [ { - "$id": "241", + "$id": "383", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "201" + "$ref": "321" }, "BodyMediaType": "Json", "Headers": [], @@ -2412,7 +2942,7 @@ "Path": "/providers/MgmtTypeSpec/operations", "BufferResponse": true, "Paging": { - "$id": "242", + "$id": "384", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -2423,17 +2953,17 @@ } ], "Protocol": { - "$id": "243" + "$id": "385" }, "Parent": "MgmtTypeSpecClient", "Parameters": [ { - "$id": "244", + "$id": "386", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "Service host", "Type": { - "$id": "245", + "$id": "387", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2448,9 +2978,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "246", + "$id": "388", "Type": { - "$id": "247", + "$id": "389", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2462,23 +2992,24 @@ "Decorators": [] }, { - "$id": "248", + "$id": "390", "Name": "PrivateLinks", + "ClientNamespace": "MgmtTypeSpec", "Operations": [ { - "$id": "249", + "$id": "391", "Name": "GetAllPrivateLinkResources", "ResourceName": "PrivateLinkResource", "Doc": "list private links on the given resource", "Accessibility": "public", "Parameters": [ { - "$id": "250", + "$id": "392", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "251", + "$id": "393", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2492,9 +3023,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "252", + "$id": "394", "Type": { - "$id": "253", + "$id": "395", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2505,17 +3036,17 @@ "SkipUrlEncoding": false }, { - "$id": "254", + "$id": "396", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "255", + "$id": "397", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "256", + "$id": "398", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2534,12 +3065,12 @@ "SkipUrlEncoding": false }, { - "$id": "257", + "$id": "399", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "258", + "$id": "400", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2556,14 +3087,14 @@ "SkipUrlEncoding": false }, { - "$id": "259", + "$id": "401", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "260", + "$id": "402", "kind": "constant", "valueType": { - "$id": "261", + "$id": "403", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2585,12 +3116,12 @@ ], "Responses": [ { - "$id": "262", + "$id": "404", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "139" + "$ref": "213" }, "BodyMediaType": "Json", "Headers": [], @@ -2606,7 +3137,7 @@ "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/privateLinkResources", "BufferResponse": true, "Paging": { - "$id": "263", + "$id": "405", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -2616,19 +3147,19 @@ "Decorators": [] }, { - "$id": "264", + "$id": "406", "Name": "start", "ResourceName": "PrivateLinks", "Doc": "Starts the SAP Application Server Instance.", "Accessibility": "public", "Parameters": [ { - "$id": "265", + "$id": "407", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "266", + "$id": "408", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2642,9 +3173,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "267", + "$id": "409", "Type": { - "$id": "268", + "$id": "410", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2655,17 +3186,17 @@ "SkipUrlEncoding": false }, { - "$id": "269", + "$id": "411", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "270", + "$id": "412", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "271", + "$id": "413", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2684,12 +3215,12 @@ "SkipUrlEncoding": false }, { - "$id": "272", + "$id": "414", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "273", + "$id": "415", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2706,12 +3237,12 @@ "SkipUrlEncoding": false }, { - "$id": "274", + "$id": "416", "Name": "privateLinkResourcenName", "NameInRequest": "privateLinkResourcenName", "Doc": "The name of the private link associated with the Azure resource.", "Type": { - "$id": "275", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2728,15 +3259,15 @@ "SkipUrlEncoding": false }, { - "$id": "276", + "$id": "418", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "277", + "$id": "419", "kind": "constant", "valueType": { - "$id": "278", + "$id": "420", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2756,14 +3287,14 @@ "SkipUrlEncoding": false }, { - "$id": "279", + "$id": "421", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "280", + "$id": "422", "kind": "constant", "valueType": { - "$id": "281", + "$id": "423", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2783,12 +3314,12 @@ "SkipUrlEncoding": false }, { - "$id": "282", + "$id": "424", "Name": "body", "NameInRequest": "body", "Doc": "SAP Application server instance start request body.", "Type": { - "$ref": "177" + "$ref": "277" }, "Location": "Body", "IsApiVersion": false, @@ -2803,19 +3334,19 @@ ], "Responses": [ { - "$id": "283", + "$id": "425", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "284", + "$id": "426", "Name": "location", "NameInResponse": "Location", "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", "Type": { - "$id": "285", + "$id": "427", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2823,12 +3354,12 @@ } }, { - "$id": "286", + "$id": "428", "Name": "retryAfter", "NameInResponse": "Retry-After", "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "Type": { - "$id": "287", + "$id": "429", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2839,12 +3370,12 @@ "IsErrorResponse": false }, { - "$id": "288", + "$id": "430", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "180" + "$ref": "282" }, "BodyMediaType": "Json", "Headers": [], @@ -2863,15 +3394,15 @@ ], "BufferResponse": true, "LongRunning": { - "$id": "289", + "$id": "431", "FinalStateVia": 1, "FinalResponse": { - "$id": "290", + "$id": "432", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "180" + "$ref": "282" }, "BodyMediaType": "Json" } @@ -2883,17 +3414,17 @@ } ], "Protocol": { - "$id": "291" + "$id": "433" }, "Parent": "MgmtTypeSpecClient", "Parameters": [ { - "$id": "292", + "$id": "434", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "Service host", "Type": { - "$id": "293", + "$id": "435", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2908,9 +3439,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "294", + "$id": "436", "Type": { - "$id": "295", + "$id": "437", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2922,23 +3453,24 @@ "Decorators": [] }, { - "$id": "296", + "$id": "438", "Name": "Foos", + "ClientNamespace": "MgmtTypeSpec", "Operations": [ { - "$id": "297", + "$id": "439", "Name": "createOrUpdate", "ResourceName": "Foo", "Doc": "Create a Foo", "Accessibility": "public", "Parameters": [ { - "$id": "298", + "$id": "440", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "299", + "$id": "441", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2952,9 +3484,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "300", + "$id": "442", "Type": { - "$id": "301", + "$id": "443", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2965,17 +3497,17 @@ "SkipUrlEncoding": false }, { - "$id": "302", + "$id": "444", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "303", + "$id": "445", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "304", + "$id": "446", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2994,12 +3526,12 @@ "SkipUrlEncoding": false }, { - "$id": "305", + "$id": "447", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "306", + "$id": "448", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3016,12 +3548,12 @@ "SkipUrlEncoding": false }, { - "$id": "307", + "$id": "449", "Name": "fooName", "NameInRequest": "fooName", "Doc": "The name of the Foo", "Type": { - "$id": "308", + "$id": "450", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3038,15 +3570,15 @@ "SkipUrlEncoding": false }, { - "$id": "309", + "$id": "451", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "310", + "$id": "452", "kind": "constant", "valueType": { - "$id": "311", + "$id": "453", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3066,14 +3598,14 @@ "SkipUrlEncoding": false }, { - "$id": "312", + "$id": "454", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "313", + "$id": "455", "kind": "constant", "valueType": { - "$id": "314", + "$id": "456", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3093,7 +3625,7 @@ "SkipUrlEncoding": false }, { - "$id": "315", + "$id": "457", "Name": "resource", "NameInRequest": "resource", "Doc": "Resource create parameters.", @@ -3113,7 +3645,7 @@ ], "Responses": [ { - "$id": "316", + "$id": "458", "StatusCodes": [ 200 ], @@ -3128,7 +3660,7 @@ ] }, { - "$id": "317", + "$id": "459", "StatusCodes": [ 201 ], @@ -3138,12 +3670,12 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "318", + "$id": "460", "Name": "azureAsyncOperation", "NameInResponse": "Azure-AsyncOperation", "Doc": "A link to the status monitor", "Type": { - "$id": "319", + "$id": "461", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3151,12 +3683,12 @@ } }, { - "$id": "320", + "$id": "462", "Name": "retryAfter", "NameInResponse": "Retry-After", "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "Type": { - "$id": "321", + "$id": "463", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3179,10 +3711,10 @@ ], "BufferResponse": true, "LongRunning": { - "$id": "322", + "$id": "464", "FinalStateVia": 0, "FinalResponse": { - "$id": "323", + "$id": "465", "StatusCodes": [ 200 ], @@ -3198,19 +3730,19 @@ "Decorators": [] }, { - "$id": "324", + "$id": "466", "Name": "get", "ResourceName": "Foo", "Doc": "Get a Foo", "Accessibility": "public", "Parameters": [ { - "$id": "325", + "$id": "467", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "326", + "$id": "468", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3224,9 +3756,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "327", + "$id": "469", "Type": { - "$id": "328", + "$id": "470", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3237,17 +3769,17 @@ "SkipUrlEncoding": false }, { - "$id": "329", + "$id": "471", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "330", + "$id": "472", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "331", + "$id": "473", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3266,12 +3798,12 @@ "SkipUrlEncoding": false }, { - "$id": "332", + "$id": "474", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "333", + "$id": "475", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3288,12 +3820,12 @@ "SkipUrlEncoding": false }, { - "$id": "334", + "$id": "476", "Name": "fooName", "NameInRequest": "fooName", "Doc": "The name of the Foo", "Type": { - "$id": "335", + "$id": "477", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3310,14 +3842,14 @@ "SkipUrlEncoding": false }, { - "$id": "336", + "$id": "478", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "337", + "$id": "479", "kind": "constant", "valueType": { - "$id": "338", + "$id": "480", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3339,7 +3871,7 @@ ], "Responses": [ { - "$id": "339", + "$id": "481", "StatusCodes": [ 200 ], @@ -3365,19 +3897,19 @@ "Decorators": [] }, { - "$id": "340", + "$id": "482", "Name": "delete", "ResourceName": "Foo", "Doc": "Delete a Foo", "Accessibility": "public", "Parameters": [ { - "$id": "341", + "$id": "483", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "342", + "$id": "484", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3391,9 +3923,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "343", + "$id": "485", "Type": { - "$id": "344", + "$id": "486", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3404,17 +3936,17 @@ "SkipUrlEncoding": false }, { - "$id": "345", + "$id": "487", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "346", + "$id": "488", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "347", + "$id": "489", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3433,12 +3965,12 @@ "SkipUrlEncoding": false }, { - "$id": "348", + "$id": "490", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "349", + "$id": "491", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3455,12 +3987,12 @@ "SkipUrlEncoding": false }, { - "$id": "350", + "$id": "492", "Name": "fooName", "NameInRequest": "fooName", "Doc": "The name of the Foo", "Type": { - "$id": "351", + "$id": "493", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3477,14 +4009,14 @@ "SkipUrlEncoding": false }, { - "$id": "352", + "$id": "494", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "353", + "$id": "495", "kind": "constant", "valueType": { - "$id": "354", + "$id": "496", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3506,19 +4038,19 @@ ], "Responses": [ { - "$id": "355", + "$id": "497", "StatusCodes": [ 202 ], "BodyMediaType": "Json", "Headers": [ { - "$id": "356", + "$id": "498", "Name": "location", "NameInResponse": "Location", "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", "Type": { - "$id": "357", + "$id": "499", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3526,12 +4058,12 @@ } }, { - "$id": "358", + "$id": "500", "Name": "retryAfter", "NameInResponse": "Retry-After", "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "Type": { - "$id": "359", + "$id": "501", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3542,7 +4074,7 @@ "IsErrorResponse": false }, { - "$id": "360", + "$id": "502", "StatusCodes": [ 204 ], @@ -3557,10 +4089,10 @@ "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos/{fooName}", "BufferResponse": true, "LongRunning": { - "$id": "361", + "$id": "503", "FinalStateVia": 1, "FinalResponse": { - "$id": "362", + "$id": "504", "StatusCodes": [ 204 ], @@ -3573,19 +4105,19 @@ "Decorators": [] }, { - "$id": "363", + "$id": "505", "Name": "list", "ResourceName": "Foo", "Doc": "List Foo resources by resource group", "Accessibility": "public", "Parameters": [ { - "$id": "364", + "$id": "506", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "365", + "$id": "507", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3599,9 +4131,9 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "366", + "$id": "508", "Type": { - "$id": "367", + "$id": "509", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3612,17 +4144,17 @@ "SkipUrlEncoding": false }, { - "$id": "368", + "$id": "510", "Name": "subscriptionId", "NameInRequest": "subscriptionId", "Doc": "The ID of the target subscription. The value must be an UUID.", "Type": { - "$id": "369", + "$id": "511", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "370", + "$id": "512", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3641,12 +4173,12 @@ "SkipUrlEncoding": false }, { - "$id": "371", + "$id": "513", "Name": "resourceGroupName", "NameInRequest": "resourceGroupName", "Doc": "The name of the resource group. The name is case insensitive.", "Type": { - "$id": "372", + "$id": "514", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3663,14 +4195,14 @@ "SkipUrlEncoding": false }, { - "$id": "373", + "$id": "515", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "374", + "$id": "516", "kind": "constant", "valueType": { - "$id": "375", + "$id": "517", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3692,12 +4224,12 @@ ], "Responses": [ { - "$id": "376", + "$id": "518", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "133" + "$ref": "203" }, "BodyMediaType": "Json", "Headers": [], @@ -3713,7 +4245,7 @@ "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MgmtTypeSpec/foos", "BufferResponse": true, "Paging": { - "$id": "377", + "$id": "519", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -3724,17 +4256,17 @@ } ], "Protocol": { - "$id": "378" + "$id": "520" }, "Parent": "MgmtTypeSpecClient", "Parameters": [ { - "$id": "379", + "$id": "521", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "Service host", "Type": { - "$id": "380", + "$id": "522", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3749,9 +4281,9 @@ "Explode": false, "Kind": "Client", "DefaultValue": { - "$id": "381", + "$id": "523", "Type": { - "$id": "382", + "$id": "524", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3764,9 +4296,9 @@ } ], "Auth": { - "$id": "383", + "$id": "525", "OAuth2": { - "$id": "384", + "$id": "526", "Scopes": [ "user_impersonation" ] diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/ApiKey/ApiKeyTests.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/ApiKey/ApiKeyTests.cs new file mode 100644 index 000000000000..a7edd4f4f6a0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/ApiKey/ApiKeyTests.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Authentication.ApiKey; +using Azure; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace TestProjects.Spector.Tests.Http.Authentication.ApiKey +{ + public class ApiKeyTests : SpectorTestBase + { + [SpectorTest] + public Task Valid() => Test(async (host) => + { + Response response = await new ApiKeyClient(host, new AzureKeyCredential("valid-key"), null).ValidAsync(); + Assert.AreEqual(204, response.Status); + }); + + [SpectorTest] + public Task Invalid() => Test((host) => + { + var exception = Assert.ThrowsAsync(() => new ApiKeyClient(host, new AzureKeyCredential("invalid-key"), null).InvalidAsync()); + Assert.AreEqual(403, exception!.Status); + return Task.CompletedTask; + }); + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/AssemblyCleanFixture.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/AssemblyCleanFixture.cs new file mode 100644 index 000000000000..3d5865a36078 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/AssemblyCleanFixture.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace TestProjects.Spector.Tests +{ + [SetUpFixture] + public static class AssemblyCleanFixture + { + [OneTimeTearDown] + public static void RunOnAssemblyCleanUp() + { + SpectorServerSession.Start().Server?.Dispose(); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/BuildPropertiesAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/BuildPropertiesAttribute.cs new file mode 100644 index 000000000000..2de3a28415d1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/BuildPropertiesAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace TestProjects.Spector.Tests +{ + [AttributeUsage(AttributeTargets.Assembly)] + internal sealed class BuildPropertiesAttribute : Attribute + { + public string RepoRoot { get; } + public string ArtifactsDirectory { get; } + + public BuildPropertiesAttribute(string repoRoot, string artifactsDirectory) + { + RepoRoot = repoRoot; + ArtifactsDirectory = artifactsDirectory; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServer.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServer.cs new file mode 100644 index 000000000000..5e5f82f203db --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServer.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; + +namespace TestProjects.Spector.Tests +{ + public class SpectorServer : TestServerBase + { + public SpectorServer() : base(GetProcessPath(), $"serve {string.Join(" ", GetScenariosPaths())} --port 0 --coverageFile {GetCoverageFilePath()}") + { + } + + internal static string GetProcessPath() + { + var nodeModules = GetNodeModulesDirectory(); + return Path.Combine(nodeModules, "@typespec", "spector", "dist", "src", "cli", "cli.js"); + } + + internal static string GetSpecDirectory() + { + var nodeModules = GetNodeModulesDirectory(); + return Path.Combine(nodeModules, "@typespec", "http-specs"); + } + + internal static string GetAzureSpecDirectory() + { + var nodeModules = GetNodeModulesDirectory(); + return Path.Combine(nodeModules, "@azure-tools", "azure-http-specs"); + } + + internal static IEnumerable GetScenariosPaths() + { + yield return Path.Combine(GetSpecDirectory(), "specs"); + yield return Path.Combine(GetAzureSpecDirectory(), "specs"); + } + internal static string GetCoverageFilePath() + { + return Path.Combine(GetCoverageDirectory(), "tsp-spector-coverage-azure.json"); + } + + protected override void Stop(Process process) + { + Process.Start(new ProcessStartInfo("node", $"{GetProcessPath()} server stop --port {Port}")); + process.WaitForExit(); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServerSession.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServerSession.cs new file mode 100644 index 000000000000..1b6086c9e84f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorServerSession.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; + +namespace TestProjects.Spector.Tests +{ + public class SpectorServerSession : TestServerSessionBase + { + private SpectorServerSession() : base() + { + } + + public static SpectorServerSession Start() + { + var server = new SpectorServerSession(); + return server; + } + + public override ValueTask DisposeAsync() + { + Return(); + return new ValueTask(); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorTestAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorTestAttribute.cs new file mode 100644 index 000000000000..c89b3f0736e7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/SpectorTestAttribute.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using NUnit.Framework; +using NUnit.Framework.Interfaces; +using NUnit.Framework.Internal; + +namespace TestProjects.Spector.Tests +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + internal partial class SpectorTestAttribute : TestAttribute, IApplyToTest + { + [GeneratedRegex("(?<=[a-z])([A-Z])")] + private static partial Regex ToKebabCase(); + + public new void ApplyToTest(Test test) + { + string clientCodeDirectory = GetGeneratedDirectory(test); + + if (!Directory.Exists(clientCodeDirectory)) + { + // Not all spector scenarios use kebab-case directories, so try again without kebab-case. + clientCodeDirectory = GetGeneratedDirectory(test, false); + } + + var clientCsFile = GetClientCsFile(clientCodeDirectory); + + TestContext.Progress.WriteLine($"Checking if '{clientCsFile}' is a stubbed implementation."); + if (clientCsFile is null || IsLibraryStubbed(clientCsFile)) + { + SkipTest(test); + } + } + + private static bool IsLibraryStubbed(string clientCsFile) + { + SyntaxTree tree = CSharpSyntaxTree.ParseText(File.ReadAllText(clientCsFile)); + CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); + + var constructors = root.DescendantNodes() + .OfType() + .Where(c => c.Modifiers.Any(SyntaxKind.PublicKeyword)) + .ToList(); + + if (constructors.Count != 0) + { + ConstructorDeclarationSyntax? constructorWithMostParameters = constructors + .OrderByDescending(c => c.ParameterList.Parameters.Count) + .FirstOrDefault(); + + return constructorWithMostParameters?.ExpressionBody != null; + } + + return true; + } + + private static void SkipTest(Test test) + { + test.RunState = RunState.Ignored; + TestContext.Progress.WriteLine($"Test skipped because {test.FullName} is currently a stubbed implementation."); + test.Properties.Set(PropertyNames.SkipReason, $"Test skipped because {test.FullName} is currently a stubbed implementation."); + } + + private static string? GetClientCsFile(string clientCodeDirectory) + { + return Directory.GetFiles(clientCodeDirectory, "*.cs", SearchOption.TopDirectoryOnly) + .Where(f => f.EndsWith("Client.cs", StringComparison.Ordinal) && !f.EndsWith("RestClient.cs", StringComparison.Ordinal)) + .FirstOrDefault(); + } + + private static string GetGeneratedDirectory(Test test, bool kebabCaseDirectories = true) + { + var namespaceParts = test.FullName.Split('.').Skip(3); + namespaceParts = namespaceParts.Take(namespaceParts.Count() - 2); + var clientCodeDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "..", "..", "..", "..", "eng", "packages", "http-client-csharp", "generator", "TestProjects", "Spector"); + foreach (var part in namespaceParts) + { + clientCodeDirectory = Path.Combine(clientCodeDirectory, FixName(part, kebabCaseDirectories)); + } + return Path.Combine(clientCodeDirectory, "src", "Generated"); + } + + private static string FixName(string part, bool kebabCaseDirectories) + { + if (kebabCaseDirectories) + { + return ToKebabCase().Replace(part.StartsWith("_", StringComparison.Ordinal) ? part.Substring(1) : part, "-$1").ToLowerInvariant(); + } + // Use camelCase + return char.ToLowerInvariant(part[0]) + part[1..]; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerBase.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerBase.cs new file mode 100644 index 000000000000..d8bcbba79b62 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerBase.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; +using System; +using System.Diagnostics; +using System.IO; +using System.Net.Http; +using System.Threading.Tasks; + +namespace TestProjects.Spector.Tests +{ + public class TestServerBase : IDisposable + { + private static Lazy _buildProperties = new(() => (BuildPropertiesAttribute)typeof(TestServerBase).Assembly.GetCustomAttributes(typeof(BuildPropertiesAttribute), false)[0]); + + private readonly Process? _process; + public HttpClient Client { get; } + public Uri Host { get; } + public string Port { get; } + + public TestServerBase(string processPath, string processArguments) + { + var portPhrase = "Started server on port "; + + var processStartInfo = new ProcessStartInfo("node", $"{processPath} {processArguments}") + { + RedirectStandardOutput = true, + RedirectStandardError = true + }; + + _process = Process.Start(processStartInfo); + if (_process == null) + { + throw new InvalidOperationException($"Unable to start process {processStartInfo.FileName} {processStartInfo.Arguments}"); + } + ProcessTracker.Add(_process); + Debug.Assert(_process != null); + while (!_process.HasExited) + { + var s = _process.StandardOutput.ReadLine(); + var indexOfPort = s?.IndexOf(portPhrase); + if (indexOfPort > 0) + { + Port = s!.Substring(indexOfPort.Value + portPhrase.Length).Trim(); + Host = new Uri($"http://localhost:{Port}"); + Client = new HttpClient + { + BaseAddress = Host + }; + _ = Task.Run(ReadOutput); + return; + } + } + + if (Client == null || Host == null || Port == null) + { + throw new InvalidOperationException($"Unable to detect server port {_process.StandardOutput.ReadToEnd()} {_process.StandardError.ReadToEnd()}"); + } + } + + protected static string GetCoverageDirectory() + { + return Path.Combine(_buildProperties.Value.ArtifactsDirectory, "coverage"); + } + + protected static string GetRepoRootDirectory() + { + return _buildProperties.Value.RepoRoot; + } + + protected static string GetNodeModulesDirectory() + { + var repoRoot = _buildProperties.Value.RepoRoot; + var nodeModulesDirectory = Path.Combine(repoRoot, "eng", "packages", "http-client-csharp", "node_modules"); + if (Directory.Exists(nodeModulesDirectory)) + { + return nodeModulesDirectory; + } + + throw new InvalidOperationException($"Cannot find 'node_modules' in parent directories of {typeof(SpectorServer).Assembly.Location}."); + } + + private void ReadOutput() + { + while (_process is not null && !_process.HasExited && !_process.StandardOutput.EndOfStream) + { + _process.StandardOutput.ReadToEnd(); + _process.StandardError.ReadToEnd(); + } + } + + protected virtual void Stop(Process process) + { + process.Kill(true); + } + + public void Dispose() + { + if (_process is not null) + Stop(_process); + + _process?.Dispose(); + Client?.Dispose(); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerSessionBase.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerSessionBase.cs new file mode 100644 index 000000000000..a2d40991ed54 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerSessionBase.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; + +namespace TestProjects.Spector.Tests +{ + public abstract class TestServerSessionBase : IAsyncDisposable where T : TestServerBase + { + private static readonly object _serverCacheLock = new object(); + private static T? s_serverCache; + + public T? Server { get; private set; } + public Uri Host => Server?.Host ?? throw new InvalidOperationException("Server is not instantiated"); + + protected TestServerSessionBase() + { + Server = GetServer(); + } + + private ref T? GetServerCache() + { + return ref s_serverCache; + } + + private T CreateServer() + { + var server = Activator.CreateInstance(typeof(T)); + if (server is null) + { + throw new InvalidOperationException($"Unable to construct a new instance of {typeof(T).Name}"); + } + + return (T)server; + } + + private T GetServer() + { + T? server; + lock (_serverCacheLock) + { + ref var cache = ref GetServerCache(); + server = cache; + cache = null; + } + + if (server == null) + { + server = CreateServer(); + } + + return server; + } + + public abstract ValueTask DisposeAsync(); + + protected void Return() + { + bool disposeServer = true; + lock (_serverCacheLock) + { + ref var cache = ref GetServerCache(); + if (cache == null) + { + cache = Server; + Server = null; + disposeServer = false; + } + } + + if (disposeServer) + { + Server?.Dispose(); + } + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/SpectorTestBase.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/SpectorTestBase.cs new file mode 100644 index 000000000000..10c00af27ea9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/SpectorTestBase.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using System; + +namespace TestProjects.Spector.Tests +{ + public abstract class SpectorTestBase + { + public async Task Test(Func test) + { + var server = SpectorServerSession.Start(); + + try + { + await test(server.Host); + } + catch (Exception ex) + { + try + { + await server.DisposeAsync(); + } + catch (Exception disposeException) + { + throw new AggregateException(ex, disposeException); + } + + throw; + } + + await server.DisposeAsync(); + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj new file mode 100644 index 000000000000..e8e1eb6879bb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj @@ -0,0 +1,36 @@ + + + + net8.0 + net8.0 + + + + + + + + + + + + + + + + + + + <_Parameter1>$(RepoRoot) + <_Parameter2>$(RepoRoot)\eng\packages\http-client-csharp\generator\artifacts + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/Directory.Build.props b/eng/packages/http-client-csharp/generator/TestProjects/Spector/Directory.Build.props new file mode 100644 index 000000000000..fe94bb581fd8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/Directory.Build.props @@ -0,0 +1,12 @@ + + + true + false + + $(NoWarn);CS1591;AZC0006;AZC0007;AZC0008 + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Authentication.ApiKey.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Authentication.ApiKey.sln new file mode 100644 index 000000000000..582c251c0480 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Authentication.ApiKey.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ApiKey", "src\Authentication.ApiKey.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Configuration.json new file mode 100644 index 000000000000..e4a7baeb68a1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Authentication.ApiKey", + "library-name": "Authentication.ApiKey" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Authentication.ApiKey.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Authentication.ApiKey.csproj new file mode 100644 index 000000000000..59a91f5cc9ff --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Authentication.ApiKey.csproj @@ -0,0 +1,19 @@ + + + This is the Authentication.ApiKey client library for developing .NET applications with rich experience. + SDK Code Generation Authentication.ApiKey + 1.0.0-beta.1 + Authentication.ApiKey + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs new file mode 100644 index 000000000000..4a0e0469d512 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Authentication.ApiKey +{ + public partial class ApiKeyClient + { + protected ApiKeyClient() => throw null; + + public ApiKeyClient(AzureKeyCredential keyCredential) : this(new Uri("http://localhost:3000"), keyCredential, new ApiKeyClientOptions()) => throw null; + + public ApiKeyClient(Uri endpoint, AzureKeyCredential keyCredential, ApiKeyClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Valid(RequestContext context) => throw null; + + public virtual Task ValidAsync(RequestContext context) => throw null; + + public virtual Response Valid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Invalid(RequestContext context) => throw null; + + public virtual Task InvalidAsync(RequestContext context) => throw null; + + public virtual Response Invalid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs new file mode 100644 index 000000000000..899dedb69bdd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Authentication.ApiKey +{ + public partial class ApiKeyClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..8b269e3292bb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.ApiKey +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..8f6920078049 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.ApiKey +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..dc5e991bf4c2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.ApiKey +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..304d33548b8f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.ApiKey +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json new file mode 100644 index 000000000000..4c9ab31f491b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/tspCodeModel.json @@ -0,0 +1,184 @@ +{ + "$id": "1", + "Name": "Authentication.ApiKey", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "InvalidAuth", + "clientNamespace": "Authentication.ApiKey", + "crossLanguageDefinitionId": "Authentication.ApiKey.InvalidAuth", + "usage": "Error,Json,Exception", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Authentication.ApiKey.InvalidAuth.error", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "error" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "ApiKeyClient", + "ClientNamespace": "Authentication.ApiKey", + "Doc": "Illustrates clients generated with ApiKey authentication.", + "Operations": [ + { + "$id": "8", + "Name": "valid", + "ResourceName": "ApiKey", + "Doc": "Check whether client is authenticated", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "9", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/api-key/valid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.ApiKey.valid", + "Decorators": [] + }, + { + "$id": "10", + "Name": "invalid", + "ResourceName": "ApiKey", + "Doc": "Check whether client is authenticated.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "11", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "12", + "kind": "constant", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "14", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/api-key/invalid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.ApiKey.invalid", + "Decorators": [] + } + ], + "Protocol": { + "$id": "15" + }, + "Parameters": [ + { + "$id": "16", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "17", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "18", + "Type": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "20", + "ApiKey": { + "$id": "21", + "Name": "x-ms-api-key", + "In": "header" + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Authentication.Http.Custom.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Authentication.Http.Custom.sln new file mode 100644 index 000000000000..002a89bd41b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Authentication.Http.Custom.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.Http.Custom", "src\Authentication.Http.Custom.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Configuration.json new file mode 100644 index 000000000000..cde7833740ac --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Authentication.Http.Custom", + "library-name": "Authentication.Http.Custom" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Authentication.Http.Custom.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Authentication.Http.Custom.csproj new file mode 100644 index 000000000000..f82d53a1393f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Authentication.Http.Custom.csproj @@ -0,0 +1,19 @@ + + + This is the Authentication.Http.Custom client library for developing .NET applications with rich experience. + SDK Code Generation Authentication.Http.Custom + 1.0.0-beta.1 + Authentication.Http.Custom + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs new file mode 100644 index 000000000000..708d5a0e1a18 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Authentication.Http.Custom +{ + public partial class CustomClient + { + protected CustomClient() => throw null; + + public CustomClient(AzureKeyCredential keyCredential) : this(new Uri("http://localhost:3000"), keyCredential, new CustomClientOptions()) => throw null; + + public CustomClient(Uri endpoint, AzureKeyCredential keyCredential, CustomClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Valid(RequestContext context) => throw null; + + public virtual Task ValidAsync(RequestContext context) => throw null; + + public virtual Response Valid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Invalid(RequestContext context) => throw null; + + public virtual Task InvalidAsync(RequestContext context) => throw null; + + public virtual Response Invalid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs new file mode 100644 index 000000000000..76d12d7aacf0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Authentication.Http.Custom +{ + public partial class CustomClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..ca120da24c2e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Http.Custom +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..241bd9aa2eaf --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Http.Custom +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..33573d41b98c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Http.Custom +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..a78b04504bd2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Http.Custom +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json new file mode 100644 index 000000000000..1484f57a9c61 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/tspCodeModel.json @@ -0,0 +1,185 @@ +{ + "$id": "1", + "Name": "Authentication.Http.Custom", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "InvalidAuth", + "clientNamespace": "Authentication.Http.Custom", + "crossLanguageDefinitionId": "Authentication.Http.Custom.InvalidAuth", + "usage": "Error,Json,Exception", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Authentication.Http.Custom.InvalidAuth.error", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "error" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "CustomClient", + "ClientNamespace": "Authentication.Http.Custom", + "Doc": "Illustrates clients generated with generic HTTP auth.", + "Operations": [ + { + "$id": "8", + "Name": "valid", + "ResourceName": "Custom", + "Doc": "Check whether client is authenticated", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "9", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/http/custom/valid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.Http.Custom.valid", + "Decorators": [] + }, + { + "$id": "10", + "Name": "invalid", + "ResourceName": "Custom", + "Doc": "Check whether client is authenticated.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "11", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "12", + "kind": "constant", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "14", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/http/custom/invalid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.Http.Custom.invalid", + "Decorators": [] + } + ], + "Protocol": { + "$id": "15" + }, + "Parameters": [ + { + "$id": "16", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "17", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "18", + "Type": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "20", + "ApiKey": { + "$id": "21", + "Name": "Authorization", + "In": "header", + "Prefix": "SharedAccessKey" + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Authentication.OAuth2.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Authentication.OAuth2.sln new file mode 100644 index 000000000000..5f54e6ae7a46 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Authentication.OAuth2.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.OAuth2", "src\Authentication.OAuth2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Configuration.json new file mode 100644 index 000000000000..37ad9f28e3db --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Authentication.OAuth2", + "library-name": "Authentication.OAuth2" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Authentication.OAuth2.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Authentication.OAuth2.csproj new file mode 100644 index 000000000000..79737477e69e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Authentication.OAuth2.csproj @@ -0,0 +1,14 @@ + + + This is the Authentication.OAuth2 client library for developing .NET applications with rich experience. + SDK Code Generation Authentication.OAuth2 + 1.0.0-beta.1 + Authentication.OAuth2 + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..a2c36d70a3cb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.OAuth2 +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..782fcf61e122 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.OAuth2 +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..a9b3f77859e5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.OAuth2 +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f28e17cf32e5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.OAuth2 +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs new file mode 100644 index 000000000000..33cccb135a76 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Authentication.OAuth2 +{ + public partial class OAuth2Client + { + protected OAuth2Client() => throw null; + + public OAuth2Client(TokenCredential tokenCredential) : this(new Uri("http://localhost:3000"), tokenCredential, new OAuth2ClientOptions()) => throw null; + + public OAuth2Client(Uri endpoint, TokenCredential tokenCredential, OAuth2ClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Valid(RequestContext context) => throw null; + + public virtual Task ValidAsync(RequestContext context) => throw null; + + public virtual Response Valid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Invalid(RequestContext context) => throw null; + + public virtual Task InvalidAsync(RequestContext context) => throw null; + + public virtual Response Invalid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs new file mode 100644 index 000000000000..161c931af26d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Authentication.OAuth2 +{ + public partial class OAuth2ClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json new file mode 100644 index 000000000000..881d4962698b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/tspCodeModel.json @@ -0,0 +1,185 @@ +{ + "$id": "1", + "Name": "Authentication.OAuth2", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "InvalidAuth", + "clientNamespace": "Authentication.OAuth2", + "crossLanguageDefinitionId": "Authentication.OAuth2.InvalidAuth", + "usage": "Error,Json,Exception", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Authentication.OAuth2.InvalidAuth.error", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "error" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "OAuth2Client", + "ClientNamespace": "Authentication.OAuth2", + "Doc": "Illustrates clients generated with OAuth2 authentication.", + "Operations": [ + { + "$id": "8", + "Name": "valid", + "ResourceName": "OAuth2", + "Doc": "Check whether client is authenticated", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "9", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/oauth2/valid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.OAuth2.valid", + "Decorators": [] + }, + { + "$id": "10", + "Name": "invalid", + "ResourceName": "OAuth2", + "Doc": "Check whether client is authenticated. Will return an invalid bearer error.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "11", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "12", + "kind": "constant", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "14", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/oauth2/invalid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.OAuth2.invalid", + "Decorators": [] + } + ], + "Protocol": { + "$id": "15" + }, + "Parameters": [ + { + "$id": "16", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "17", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "18", + "Type": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "20", + "OAuth2": { + "$id": "21", + "Scopes": [ + "https://security.microsoft.com/.default" + ] + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Authentication.Union.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Authentication.Union.sln new file mode 100644 index 000000000000..db8271863fb2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Authentication.Union.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.Union", "src\Authentication.Union.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Configuration.json new file mode 100644 index 000000000000..58a3cfa88cdc --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Authentication.Union", + "library-name": "Authentication.Union" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Authentication.Union.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Authentication.Union.csproj new file mode 100644 index 000000000000..eaec81061be6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Authentication.Union.csproj @@ -0,0 +1,19 @@ + + + This is the Authentication.Union client library for developing .NET applications with rich experience. + SDK Code Generation Authentication.Union + 1.0.0-beta.1 + Authentication.Union + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..8f0209c915f3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Union +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..1720ca5f800e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Union +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..86c9483a331c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Union +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..5356ea10cf9e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Authentication.Union +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs new file mode 100644 index 000000000000..848be84d5d9e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Authentication.Union +{ + public partial class UnionClient + { + protected UnionClient() => throw null; + + public UnionClient(AzureKeyCredential keyCredential) : this(new Uri("http://localhost:3000"), keyCredential, new UnionClientOptions()) => throw null; + + public UnionClient(TokenCredential tokenCredential) : this(new Uri("http://localhost:3000"), tokenCredential, new UnionClientOptions()) => throw null; + + public UnionClient(Uri endpoint, AzureKeyCredential keyCredential, UnionClientOptions options) => throw null; + + public UnionClient(Uri endpoint, TokenCredential tokenCredential, UnionClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response ValidKey(RequestContext context) => throw null; + + public virtual Task ValidKeyAsync(RequestContext context) => throw null; + + public virtual Response ValidKey(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidKeyAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response ValidToken(RequestContext context) => throw null; + + public virtual Task ValidTokenAsync(RequestContext context) => throw null; + + public virtual Response ValidToken(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidTokenAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs new file mode 100644 index 000000000000..90d6bd7a0df2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Authentication.Union +{ + public partial class UnionClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/tspCodeModel.json new file mode 100644 index 000000000000..2224a7c8e440 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/tspCodeModel.json @@ -0,0 +1,124 @@ +{ + "$id": "1", + "Name": "Authentication.Union", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "UnionClient", + "ClientNamespace": "Authentication.Union", + "Doc": "Illustrates clients generated with ApiKey and OAuth2 authentication.", + "Operations": [ + { + "$id": "3", + "Name": "validKey", + "ResourceName": "Union", + "Doc": "Check whether client is authenticated", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "4", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/union/validkey", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.Union.validKey", + "Decorators": [] + }, + { + "$id": "5", + "Name": "validToken", + "ResourceName": "Union", + "Doc": "Check whether client is authenticated", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "6", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/authentication/union/validtoken", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Authentication.Union.validToken", + "Decorators": [] + } + ], + "Protocol": { + "$id": "7" + }, + "Parameters": [ + { + "$id": "8", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "9", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "10", + "Type": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "12", + "ApiKey": { + "$id": "13", + "Name": "x-ms-api-key", + "In": "header" + }, + "OAuth2": { + "$id": "14", + "Scopes": [ + "https://security.microsoft.com/.default" + ] + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Client.Structure.Service.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Client.Structure.Service.sln new file mode 100644 index 000000000000..6145c2ce63ed --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Client.Structure.Service.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client.Structure.Service", "src\Client.Structure.Service.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Configuration.json new file mode 100644 index 000000000000..902908c57923 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Client.Structure.Service", + "library-name": "Client.Structure.Service" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Client.Structure.Service.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Client.Structure.Service.csproj new file mode 100644 index 000000000000..6476a30f354d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Client.Structure.Service.csproj @@ -0,0 +1,14 @@ + + + This is the Client.Structure.Service client library for developing .NET applications with rich experience. + SDK Code Generation Client.Structure.Service + 1.0.0-beta.1 + Client.Structure.Service + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs new file mode 100644 index 000000000000..f49e8538522c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class Bar + { + protected Bar() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Five(RequestContext context) => throw null; + + public virtual Task FiveAsync(RequestContext context) => throw null; + + public virtual Response Five(CancellationToken cancellationToken = default) => throw null; + + public virtual Task FiveAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Six(RequestContext context) => throw null; + + public virtual Task SixAsync(RequestContext context) => throw null; + + public virtual Response Six(CancellationToken cancellationToken = default) => throw null; + + public virtual Task SixAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs new file mode 100644 index 000000000000..cb4e3b32137e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class Baz + { + protected Baz() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual BazFoo GetBazFooClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs new file mode 100644 index 000000000000..6d26fa867342 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class BazFoo + { + protected BazFoo() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Seven(RequestContext context) => throw null; + + public virtual Task SevenAsync(RequestContext context) => throw null; + + public virtual Response Seven(CancellationToken cancellationToken = default) => throw null; + + public virtual Task SevenAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs new file mode 100644 index 000000000000..e746f9818252 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class Foo + { + protected Foo() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Three(RequestContext context) => throw null; + + public virtual Task ThreeAsync(RequestContext context) => throw null; + + public virtual Response Three(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ThreeAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Four(RequestContext context) => throw null; + + public virtual Task FourAsync(RequestContext context) => throw null; + + public virtual Response Four(CancellationToken cancellationToken = default) => throw null; + + public virtual Task FourAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..31c90b2d693b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Client.Structure.Service +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..24b97f400e57 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Client.Structure.Service +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..29ff641e94f7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Client.Structure.Service +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..c452094bbdb9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Client.Structure.Service +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Models/ClientType.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Models/ClientType.cs new file mode 100644 index 000000000000..3ff557525847 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Models/ClientType.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Client.Structure.Service.Models +{ + public enum ClientType + { + /// Default. + Default, + /// MultiClient. + MultiClient, + /// RenamedOperation. + RenamedOperation, + /// TwoOperationGroup. + TwoOperationGroup, + /// ClientOperationGroup. + ClientOperationGroup + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs new file mode 100644 index 000000000000..949ebd5fb855 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class Qux + { + protected Qux() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Eight(RequestContext context) => throw null; + + public virtual Task EightAsync(RequestContext context) => throw null; + + public virtual Response Eight(CancellationToken cancellationToken = default) => throw null; + + public virtual Task EightAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual QuxBar GetQuxBarClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs new file mode 100644 index 000000000000..7ab9dbd08f6d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Client.Structure.Service +{ + public partial class QuxBar + { + protected QuxBar() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Nine(RequestContext context) => throw null; + + public virtual Task NineAsync(RequestContext context) => throw null; + + public virtual Response Nine(CancellationToken cancellationToken = default) => throw null; + + public virtual Task NineAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs new file mode 100644 index 000000000000..07bf25440bc7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; +using Client.Structure.Service.Models; + +namespace Client.Structure.Service +{ + public partial class ServiceClient + { + protected ServiceClient() => throw null; + + public ServiceClient(Uri endpoint, ClientType client) : this(endpoint, client, new ServiceClientOptions()) => throw null; + + public ServiceClient(Uri endpoint, ClientType client, ServiceClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response One(RequestContext context) => throw null; + + public virtual Task OneAsync(RequestContext context) => throw null; + + public virtual Response One(CancellationToken cancellationToken = default) => throw null; + + public virtual Task OneAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Two(RequestContext context) => throw null; + + public virtual Task TwoAsync(RequestContext context) => throw null; + + public virtual Response Two(CancellationToken cancellationToken = default) => throw null; + + public virtual Task TwoAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Baz GetBazClient() => throw null; + + public virtual Qux GetQuxClient() => throw null; + + public virtual Foo GetFooClient() => throw null; + + public virtual Bar GetBarClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs new file mode 100644 index 000000000000..cd242f1699ab --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Client.Structure.Service +{ + public partial class ServiceClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/tspCodeModel.json new file mode 100644 index 000000000000..50b117240567 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/tspCodeModel.json @@ -0,0 +1,728 @@ +{ + "$id": "1", + "Name": "Client.Structure.Service", + "ApiVersions": [], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "ClientType", + "crossLanguageDefinitionId": "Client.Structure.Service.ClientType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Default", + "value": "default", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "MultiClient", + "value": "multi-client", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "RenamedOperation", + "value": "renamed-operation", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "TwoOperationGroup", + "value": "two-operation-group", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "ClientOperationGroup", + "value": "client-operation-group", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "clientNamespace": "Client.Structure.Service", + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + } + ], + "Models": [], + "Clients": [ + { + "$id": "14", + "Name": "ServiceClient", + "ClientNamespace": "Client.Structure.Service", + "Doc": "Test that we can use @client and @operationGroup decorators to customize client side code structure, such as:\n1. have everything as default.\n2. to rename client or operation group\n3. one client can have more than one operations groups\n4. split one interface into two clients\n5. have two clients with operations come from different interfaces\n6. have two clients with a hierarchy relation.", + "Operations": [ + { + "$id": "15", + "Name": "one", + "ResourceName": "Service", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "16", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/one", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.one", + "Decorators": [] + }, + { + "$id": "17", + "Name": "two", + "ResourceName": "Service", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "18", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/two", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.two", + "Decorators": [] + } + ], + "Protocol": { + "$id": "19" + }, + "Parameters": [ + { + "$id": "20", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "21", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "22", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "23", + "Name": "Baz", + "ClientNamespace": "Client.Structure.Service.Baz", + "Operations": [], + "Protocol": { + "$id": "24" + }, + "Parent": "ServiceClient", + "Parameters": [ + { + "$id": "25", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "26", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "27", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "28", + "Name": "BazFoo", + "ClientNamespace": "Client.Structure.Service.Baz", + "Operations": [ + { + "$id": "29", + "Name": "seven", + "ResourceName": "Foo", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "30", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/seven", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Baz.Foo.seven", + "Decorators": [] + } + ], + "Protocol": { + "$id": "31" + }, + "Parent": "Baz", + "Parameters": [ + { + "$id": "32", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "33", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "34", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "35", + "Name": "Qux", + "ClientNamespace": "Client.Structure.Service.Qux", + "Operations": [ + { + "$id": "36", + "Name": "eight", + "ResourceName": "Qux", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "37", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/eight", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Qux.eight", + "Decorators": [] + } + ], + "Protocol": { + "$id": "38" + }, + "Parent": "ServiceClient", + "Parameters": [ + { + "$id": "39", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "40", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "41", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "42", + "Name": "QuxBar", + "ClientNamespace": "Client.Structure.Service.Qux", + "Operations": [ + { + "$id": "43", + "Name": "nine", + "ResourceName": "Bar", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "44", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/nine", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Qux.Bar.nine", + "Decorators": [] + } + ], + "Protocol": { + "$id": "45" + }, + "Parent": "Qux", + "Parameters": [ + { + "$id": "46", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "47", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "48", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "49", + "Name": "Foo", + "ClientNamespace": "Client.Structure.Service", + "Operations": [ + { + "$id": "50", + "Name": "three", + "ResourceName": "Foo", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "51", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/three", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Foo.three", + "Decorators": [] + }, + { + "$id": "52", + "Name": "four", + "ResourceName": "Foo", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "53", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/four", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Foo.four", + "Decorators": [] + } + ], + "Protocol": { + "$id": "54" + }, + "Parent": "ServiceClient", + "Parameters": [ + { + "$id": "55", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "56", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "57", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "58", + "Name": "Bar", + "ClientNamespace": "Client.Structure.Service", + "Operations": [ + { + "$id": "59", + "Name": "five", + "ResourceName": "Bar", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "60", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/five", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Bar.five", + "Decorators": [] + }, + { + "$id": "61", + "Name": "six", + "ResourceName": "Bar", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "62", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}/client/structure/{client}", + "Path": "/six", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Client.Structure.Service.Bar.six", + "Decorators": [] + } + ], + "Protocol": { + "$id": "63" + }, + "Parent": "ServiceClient", + "Parameters": [ + { + "$id": "64", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "65", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "66", + "Name": "client", + "NameInRequest": "client", + "Doc": "Need to be set as 'default', 'multi-client', 'renamed-operation', 'two-operation-group' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Configuration.json new file mode 100644 index 000000000000..f524617dfc2c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Encode.Numeric", + "library-name": "Encode.Numeric" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Encode.Numeric.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Encode.Numeric.sln new file mode 100644 index 000000000000..ed9006fadd24 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/Encode.Numeric.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Encode.Numeric", "src\Encode.Numeric.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Encode.Numeric.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Encode.Numeric.csproj new file mode 100644 index 000000000000..30620e82d517 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Encode.Numeric.csproj @@ -0,0 +1,14 @@ + + + This is the Encode.Numeric client library for developing .NET applications with rich experience. + SDK Code Generation Encode.Numeric + 1.0.0-beta.1 + Encode.Numeric + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/EncodeNumericModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/EncodeNumericModelFactory.cs new file mode 100644 index 000000000000..750c0d09c5b4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/EncodeNumericModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Encode.Numeric.Models +{ + public static partial class EncodeNumericModelFactory + { + public static SafeintAsStringProperty SafeintAsStringProperty(long value = default) => throw null; + + public static Uint32AsStringProperty Uint32AsStringProperty(object value = default) => throw null; + + public static Uint8AsStringProperty Uint8AsStringProperty(byte value = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..5e7ca9e637a0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Encode.Numeric +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..0aefd2ea975a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Encode.Numeric +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..6a8b3ceeb3ab --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Encode.Numeric +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..9fe4728290e0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Encode.Numeric +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.Serialization.cs new file mode 100644 index 000000000000..e00db1d7a998 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Encode.Numeric.Models +{ + public partial class SafeintAsStringProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + SafeintAsStringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual SafeintAsStringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + SafeintAsStringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual SafeintAsStringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(SafeintAsStringProperty safeintAsStringProperty) => throw null; + + public static explicit operator SafeintAsStringProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.cs new file mode 100644 index 000000000000..95dc8a599959 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/SafeintAsStringProperty.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Encode.Numeric.Models +{ + public partial class SafeintAsStringProperty + { + public SafeintAsStringProperty(long value) => throw null; + + public long Value + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.Serialization.cs new file mode 100644 index 000000000000..0f3debd18a14 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Encode.Numeric.Models +{ + public partial class Uint32AsStringProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Uint32AsStringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Uint32AsStringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Uint32AsStringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Uint32AsStringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Uint32AsStringProperty uint32AsStringProperty) => throw null; + + public static explicit operator Uint32AsStringProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.cs new file mode 100644 index 000000000000..699744f0835b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint32AsStringProperty.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Encode.Numeric.Models +{ + public partial class Uint32AsStringProperty + { + public Uint32AsStringProperty() => throw null; + + public object Value + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.Serialization.cs new file mode 100644 index 000000000000..7d210d4400df --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Encode.Numeric.Models +{ + public partial class Uint8AsStringProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Uint8AsStringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Uint8AsStringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Uint8AsStringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Uint8AsStringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Uint8AsStringProperty uint8AsStringProperty) => throw null; + + public static explicit operator Uint8AsStringProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.cs new file mode 100644 index 000000000000..106610d12569 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Models/Uint8AsStringProperty.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Encode.Numeric.Models +{ + public partial class Uint8AsStringProperty + { + public Uint8AsStringProperty(byte value) => throw null; + + public byte Value + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs new file mode 100644 index 000000000000..7d849ac0f882 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Encode.Numeric +{ + public partial class NumericClient + { + public NumericClient() : this(new Uri("http://localhost:3000"), new NumericClientOptions()) => throw null; + + public NumericClient(Uri endpoint, NumericClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Property GetPropertyClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs new file mode 100644 index 000000000000..8e0856bc7d9c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Encode.Numeric +{ + public partial class NumericClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs new file mode 100644 index 000000000000..b3591d877b28 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Encode.Numeric.Models; + +namespace Encode.Numeric +{ + public partial class Property + { + protected Property() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response SafeintAsString(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SafeintAsStringAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SafeintAsString(SafeintAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> SafeintAsStringAsync(SafeintAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Uint32AsStringOptional(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task Uint32AsStringOptionalAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Uint32AsStringOptional(Uint32AsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> Uint32AsStringOptionalAsync(Uint32AsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Uint8AsString(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task Uint8AsStringAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Uint8AsString(Uint8AsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> Uint8AsStringAsync(Uint8AsStringProperty value, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json new file mode 100644 index 000000000000..9fdf021d68b7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/tspCodeModel.json @@ -0,0 +1,540 @@ +{ + "$id": "1", + "Name": "Encode.Numeric", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "SafeintAsStringProperty", + "clientNamespace": "Encode.Numeric.Property", + "crossLanguageDefinitionId": "Encode.Numeric.Property.SafeintAsStringProperty", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "value", + "serializedName": "value", + "type": { + "$id": "4", + "kind": "safeint", + "name": "safeint", + "encode": "string", + "crossLanguageDefinitionId": "TypeSpec.safeint", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Numeric.Property.SafeintAsStringProperty.value", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "value" + } + } + } + ] + }, + { + "$id": "7", + "kind": "model", + "name": "Uint32AsStringProperty", + "clientNamespace": "Encode.Numeric.Property", + "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint32AsStringProperty", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "value", + "serializedName": "value", + "type": { + "$id": "9", + "kind": "uint32", + "name": "uint32", + "encode": "string", + "crossLanguageDefinitionId": "TypeSpec.uint32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint32AsStringProperty.value", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "value" + } + } + } + ] + }, + { + "$id": "12", + "kind": "model", + "name": "Uint8AsStringProperty", + "clientNamespace": "Encode.Numeric.Property", + "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint8AsStringProperty", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "value", + "serializedName": "value", + "type": { + "$id": "14", + "kind": "uint8", + "name": "uint8", + "encode": "string", + "crossLanguageDefinitionId": "TypeSpec.uint8", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Numeric.Property.Uint8AsStringProperty.value", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "value" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "17", + "Name": "NumericClient", + "ClientNamespace": "Encode.Numeric", + "Doc": "Test for encode decorator on integer.", + "Operations": [], + "Protocol": { + "$id": "18" + }, + "Parameters": [ + { + "$id": "19", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "20", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "21", + "Type": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "23", + "Name": "Property", + "ClientNamespace": "Encode.Numeric.Property", + "Operations": [ + { + "$id": "24", + "Name": "safeintAsString", + "ResourceName": "Property", + "Accessibility": "public", + "Parameters": [ + { + "$id": "25", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "26", + "kind": "constant", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "28", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "29", + "kind": "constant", + "valueType": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "31", + "Name": "value", + "NameInRequest": "value", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "32", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/encode/numeric/property/safeint", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Encode.Numeric.Property.safeintAsString", + "Decorators": [] + }, + { + "$id": "33", + "Name": "uint32AsStringOptional", + "ResourceName": "Property", + "Accessibility": "public", + "Parameters": [ + { + "$id": "34", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "35", + "kind": "constant", + "valueType": { + "$id": "36", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "37", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "38", + "kind": "constant", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "40", + "Name": "value", + "NameInRequest": "value", + "Type": { + "$ref": "7" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "41", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "7" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/encode/numeric/property/uint32", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Encode.Numeric.Property.uint32AsStringOptional", + "Decorators": [] + }, + { + "$id": "42", + "Name": "uint8AsString", + "ResourceName": "Property", + "Accessibility": "public", + "Parameters": [ + { + "$id": "43", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "44", + "kind": "constant", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "46", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "47", + "kind": "constant", + "valueType": { + "$id": "48", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "49", + "Name": "value", + "NameInRequest": "value", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "50", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "12" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/encode/numeric/property/uint8", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Encode.Numeric.Property.uint8AsString", + "Decorators": [] + } + ], + "Protocol": { + "$id": "51" + }, + "Parent": "NumericClient", + "Parameters": [ + { + "$id": "52", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "53", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "54", + "Type": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Configuration.json new file mode 100644 index 000000000000..fb38e08d86ad --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Parameters.Basic", + "library-name": "Parameters.Basic" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Parameters.Basic.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Parameters.Basic.sln new file mode 100644 index 000000000000..5d864c152801 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/Parameters.Basic.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Parameters.Basic", "src\Parameters.Basic.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs new file mode 100644 index 000000000000..abdc21a3be4a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Parameters.Basic +{ + public partial class BasicClient + { + public BasicClient() : this(new Uri("http://localhost:3000"), new BasicClientOptions()) => throw null; + + public BasicClient(Uri endpoint, BasicClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual ExplicitBody GetExplicitBodyClient() => throw null; + + public virtual ImplicitBody GetImplicitBodyClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs new file mode 100644 index 000000000000..5f068dd42caf --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Parameters.Basic +{ + public partial class BasicClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs new file mode 100644 index 000000000000..10444aab3541 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Parameters.Basic.Models; + +namespace Parameters.Basic +{ + public partial class ExplicitBody + { + protected ExplicitBody() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Simple(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SimpleAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Simple(User body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SimpleAsync(User body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs new file mode 100644 index 000000000000..969c96f9c37a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Parameters.Basic +{ + public partial class ImplicitBody + { + protected ImplicitBody() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Simple(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SimpleAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Simple(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SimpleAsync(string name, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..6cae89b9daf8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Basic +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..922c73c8fecc --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Basic +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..9bc4cd4830a3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Basic +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..9186bbbe6600 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Basic +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.Serialization.cs new file mode 100644 index 000000000000..1811e482b3f4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Parameters.Basic.Models +{ + public partial class User : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + User IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual User JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + User IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual User PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(User user) => throw null; + + public static explicit operator User(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.cs new file mode 100644 index 000000000000..84ecf6e914d8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/User.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Parameters.Basic.Models +{ + public partial class User + { + public User(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs new file mode 100644 index 000000000000..f49bc11df6e7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Parameters.Basic.Models +{ + public static partial class ParametersBasicModelFactory + { + + public static User User(string name = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Parameters.Basic.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Parameters.Basic.csproj new file mode 100644 index 000000000000..4ed5075cf82b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Parameters.Basic.csproj @@ -0,0 +1,14 @@ + + + This is the Parameters.Basic client library for developing .NET applications with rich experience. + SDK Code Generation Parameters.Basic + 1.0.0-beta.1 + Parameters.Basic + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json new file mode 100644 index 000000000000..8f458de3c3ac --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/tspCodeModel.json @@ -0,0 +1,371 @@ +{ + "$id": "1", + "Name": "Parameters.Basic", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "SimpleRequest", + "clientNamespace": "Parameters.Basic.ImplicitBody", + "crossLanguageDefinitionId": "Parameters.Basic.ImplicitBody.simple.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Parameters.Basic.ImplicitBody.simple.name", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "name" + } + } + } + ] + }, + { + "$id": "7", + "kind": "model", + "name": "User", + "clientNamespace": "Parameters.Basic.ExplicitBody", + "crossLanguageDefinitionId": "Parameters.Basic.ExplicitBody.User", + "usage": "Input,Json", + "doc": "This is a simple model.", + "decorators": [], + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Parameters.Basic.ExplicitBody.User.name", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "name" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "12", + "Name": "BasicClient", + "ClientNamespace": "Parameters.Basic", + "Doc": "Test for basic parameters cases.", + "Operations": [], + "Protocol": { + "$id": "13" + }, + "Parameters": [ + { + "$id": "14", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "15", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "16", + "Type": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "18", + "Name": "ExplicitBody", + "ClientNamespace": "Parameters.Basic.ExplicitBody", + "Operations": [ + { + "$id": "19", + "Name": "simple", + "ResourceName": "ExplicitBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "20", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "21", + "kind": "constant", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "23", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "7" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "24", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/basic/explicit-body/simple", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Basic.ExplicitBody.simple", + "Decorators": [] + } + ], + "Protocol": { + "$id": "25" + }, + "Parent": "BasicClient", + "Parameters": [ + { + "$id": "26", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "27", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "28", + "Type": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "30", + "Name": "ImplicitBody", + "ClientNamespace": "Parameters.Basic.ImplicitBody", + "Operations": [ + { + "$id": "31", + "Name": "simple", + "ResourceName": "ImplicitBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "32", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "33", + "kind": "constant", + "valueType": { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "35", + "Name": "simpleRequest", + "NameInRequest": "simpleRequest", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "36", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/basic/implicit-body/simple", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Basic.ImplicitBody.simple", + "Decorators": [] + } + ], + "Protocol": { + "$id": "37" + }, + "Parent": "BasicClient", + "Parameters": [ + { + "$id": "38", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "39", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "40", + "Type": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Configuration.json new file mode 100644 index 000000000000..9047e7431f93 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Parameters.BodyOptionality", + "library-name": "Parameters.BodyOptionality" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Parameters.BodyOptionality.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Parameters.BodyOptionality.sln new file mode 100644 index 000000000000..5e68d427a287 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/Parameters.BodyOptionality.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Parameters.BodyOptionality", "src\Parameters.BodyOptionality.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs new file mode 100644 index 000000000000..b47847e70198 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Parameters.BodyOptionality.Models; + +namespace Parameters.BodyOptionality +{ + public partial class BodyOptionalityClient + { + public BodyOptionalityClient() : this(new Uri("http://localhost:3000"), new BodyOptionalityClientOptions()) => throw null; + + public BodyOptionalityClient(Uri endpoint, BodyOptionalityClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response RequiredExplicit(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task RequiredExplicitAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response RequiredExplicit(BodyModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task RequiredExplicitAsync(BodyModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response RequiredImplicit(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task RequiredImplicitAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response RequiredImplicit(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task RequiredImplicitAsync(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual OptionalExplicit GetOptionalExplicitClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs new file mode 100644 index 000000000000..61574b2d6285 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Parameters.BodyOptionality +{ + public partial class BodyOptionalityClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..5d3a2d5b95e6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.BodyOptionality +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..0e7d07df11fd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.BodyOptionality +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..ed6e7662800e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.BodyOptionality +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..a6da4978408e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.BodyOptionality +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.Serialization.cs new file mode 100644 index 000000000000..f11275add13f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Parameters.BodyOptionality.Models +{ + public partial class BodyModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + BodyModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual BodyModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BodyModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BodyModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(BodyModel bodyModel) => throw null; + + public static explicit operator BodyModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.cs new file mode 100644 index 000000000000..b7ad6f93248b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/Models/BodyModel.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Parameters.BodyOptionality.Models +{ + public partial class BodyModel + { + public BodyModel(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs new file mode 100644 index 000000000000..16f7be53ea66 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Parameters.BodyOptionality.Models; + +namespace Parameters.BodyOptionality +{ + public partial class OptionalExplicit + { + protected OptionalExplicit() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Set(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SetAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Set(BodyModel body = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SetAsync(BodyModel body = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Omit(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task OmitAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Omit(BodyModel body = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task OmitAsync(BodyModel body = null, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/ParametersBodyOptionalityModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/ParametersBodyOptionalityModelFactory.cs new file mode 100644 index 000000000000..f5f5709e1260 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/ParametersBodyOptionalityModelFactory.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Parameters.BodyOptionality.Models +{ + public static partial class ParametersBodyOptionalityModelFactory + { + public static BodyModel BodyModel(string name = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Parameters.BodyOptionality.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Parameters.BodyOptionality.csproj new file mode 100644 index 000000000000..07eab2e17a2f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Parameters.BodyOptionality.csproj @@ -0,0 +1,14 @@ + + + This is the Parameters.BodyOptionality client library for developing .NET applications with rich experience. + SDK Code Generation Parameters.BodyOptionality + 1.0.0-beta.1 + Parameters.BodyOptionality + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json new file mode 100644 index 000000000000..443445ef44a2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/tspCodeModel.json @@ -0,0 +1,441 @@ +{ + "$id": "1", + "Name": "Parameters.BodyOptionality", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "BodyModel", + "clientNamespace": "Parameters.BodyOptionality", + "crossLanguageDefinitionId": "Parameters.BodyOptionality.BodyModel", + "usage": "Input,Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Parameters.BodyOptionality.BodyModel.name", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "name" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "BodyOptionalityClient", + "ClientNamespace": "Parameters.BodyOptionality", + "Doc": "Test describing optionality of the request body.", + "Operations": [ + { + "$id": "8", + "Name": "requiredExplicit", + "ResourceName": "BodyOptionality", + "Accessibility": "public", + "Parameters": [ + { + "$id": "9", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "10", + "kind": "constant", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "12", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "13", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/body-optionality/required-explicit", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.BodyOptionality.requiredExplicit", + "Decorators": [] + }, + { + "$id": "14", + "Name": "requiredImplicit", + "ResourceName": "BodyOptionality", + "Accessibility": "public", + "Parameters": [ + { + "$id": "15", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "16", + "kind": "constant", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "18", + "Name": "bodyModel", + "NameInRequest": "bodyModel", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "19", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/body-optionality/required-implicit", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.BodyOptionality.requiredImplicit", + "Decorators": [] + } + ], + "Protocol": { + "$id": "20" + }, + "Parameters": [ + { + "$id": "21", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "22", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "23", + "Type": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "25", + "Name": "OptionalExplicit", + "ClientNamespace": "Parameters.BodyOptionality.OptionalExplicit", + "Operations": [ + { + "$id": "26", + "Name": "set", + "ResourceName": "OptionalExplicit", + "Accessibility": "public", + "Parameters": [ + { + "$id": "27", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "28", + "kind": "constant", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "30", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "31", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/body-optionality/optional-explicit/set", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.BodyOptionality.OptionalExplicit.set", + "Decorators": [] + }, + { + "$id": "32", + "Name": "omit", + "ResourceName": "OptionalExplicit", + "Accessibility": "public", + "Parameters": [ + { + "$id": "33", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "34", + "kind": "constant", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "36", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "37", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/body-optionality/optional-explicit/omit", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.BodyOptionality.OptionalExplicit.omit", + "Decorators": [] + } + ], + "Protocol": { + "$id": "38" + }, + "Parent": "BodyOptionalityClient", + "Parameters": [ + { + "$id": "39", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "40", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "41", + "Type": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Configuration.json new file mode 100644 index 000000000000..c42d128fe25f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Parameters.Spread", + "library-name": "Parameters.Spread" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Parameters.Spread.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Parameters.Spread.sln new file mode 100644 index 000000000000..a412dccd42b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/Parameters.Spread.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Parameters.Spread", "src\Parameters.Spread.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs new file mode 100644 index 000000000000..c25907151e28 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Parameters.Spread +{ + public partial class Alias + { + protected Alias() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response SpreadAsRequestBody(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadAsRequestBodyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadAsRequestBody(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadAsRequestBodyAsync(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadParameterWithInnerModel(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadParameterWithInnerModelAsync(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadParameterWithInnerModel(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadParameterWithInnerModelAsync(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadAsRequestParameter(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadAsRequestParameterAsync(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadAsRequestParameter(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadAsRequestParameterAsync(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadWithMultipleParameters(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadWithMultipleParametersAsync(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadWithMultipleParameters(string id, string xMsTestHeader, string requiredString, IEnumerable requiredIntList, int? optionalInt = default, IEnumerable optionalStringList = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadWithMultipleParametersAsync(string id, string xMsTestHeader, string requiredString, IEnumerable requiredIntList, int? optionalInt = default, IEnumerable optionalStringList = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadParameterWithInnerAlias(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadParameterWithInnerAliasAsync(string id, string xMsTestHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadParameterWithInnerAlias(string id, string xMsTestHeader, string name, int age, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadParameterWithInnerAliasAsync(string id, string xMsTestHeader, string name, int age, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..d981092a23aa --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Spread +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..48a6c88e1778 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Spread +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..84b422d951cb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Spread +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..22d38979908b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Parameters.Spread +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs new file mode 100644 index 000000000000..aa60e323f5ec --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Parameters.Spread.Models; + +namespace Parameters.Spread +{ + public partial class Model + { + protected Model() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response SpreadAsRequestBody(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadAsRequestBodyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadAsRequestBody(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadAsRequestBodyAsync(string name, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadCompositeRequestOnlyWithBody(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadCompositeRequestOnlyWithBodyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadCompositeRequestOnlyWithBody(BodyParameter body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadCompositeRequestOnlyWithBodyAsync(BodyParameter body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadCompositeRequestWithoutBody(string name, string testHeader, RequestContext context) => throw null; + + public virtual Task SpreadCompositeRequestWithoutBodyAsync(string name, string testHeader, RequestContext context) => throw null; + + public virtual Response SpreadCompositeRequestWithoutBody(string name, string testHeader, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadCompositeRequestWithoutBodyAsync(string name, string testHeader, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadCompositeRequest(string name, string testHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadCompositeRequestAsync(string name, string testHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadCompositeRequest(string name, string testHeader, BodyParameter body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadCompositeRequestAsync(string name, string testHeader, BodyParameter body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response SpreadCompositeRequestMix(string name, string testHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SpreadCompositeRequestMixAsync(string name, string testHeader, RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SpreadCompositeRequestMix(string name, string testHeader, string prop, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SpreadCompositeRequestMixAsync(string name, string testHeader, string prop, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.Serialization.cs new file mode 100644 index 000000000000..53917ebcb1b9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Parameters.Spread.Models +{ + public partial class BodyParameter : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + BodyParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual BodyParameter JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BodyParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BodyParameter PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(BodyParameter bodyParameter) => throw null; + + public static explicit operator BodyParameter(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.cs new file mode 100644 index 000000000000..dff2f7f26661 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/BodyParameter.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Parameters.Spread.Models +{ + public partial class BodyParameter + { + public BodyParameter(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs new file mode 100644 index 000000000000..7c1c29da0ae8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Parameters.Spread.Models +{ + public static partial class ParametersSpreadModelFactory + { + + public static BodyParameter BodyParameter(string name = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs new file mode 100644 index 000000000000..eebe2527095c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Parameters.Spread +{ + public partial class SpreadClient + { + public SpreadClient() : this(new Uri("http://localhost:3000"), new SpreadClientOptions()) => throw null; + + public SpreadClient(Uri endpoint, SpreadClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Model GetModelClient() => throw null; + + public virtual Alias GetAliasClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs new file mode 100644 index 000000000000..e0bfcce79948 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Parameters.Spread +{ + public partial class SpreadClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Parameters.Spread.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Parameters.Spread.csproj new file mode 100644 index 000000000000..dc63c91939b6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Parameters.Spread.csproj @@ -0,0 +1,14 @@ + + + This is the Parameters.Spread client library for developing .NET applications with rich experience. + SDK Code Generation Parameters.Spread + 1.0.0-beta.1 + Parameters.Spread + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json new file mode 100644 index 000000000000..e998cc3d6ba3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/tspCodeModel.json @@ -0,0 +1,1535 @@ +{ + "$id": "1", + "Name": "Parameters.Spread", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "SpreadAsRequestBodyRequest", + "clientNamespace": "Parameters.Spread.Alias", + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestBody.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestBody.name", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "name" + } + } + } + ] + }, + { + "$id": "7", + "kind": "model", + "name": "SpreadParameterWithInnerModelRequest", + "clientNamespace": "", + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerModel.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadParameterWithInnerModel.Request.anonymous.name", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "name" + } + } + } + ] + }, + { + "$id": "12", + "kind": "model", + "name": "SpreadAsRequestParameterRequest", + "clientNamespace": "", + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestParameter.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadAsRequestParameter.Request.anonymous.name", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "name" + } + } + } + ] + }, + { + "$id": "17", + "kind": "model", + "name": "SpreadWithMultipleParametersRequest", + "clientNamespace": "", + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadWithMultipleParameters.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "18", + "kind": "property", + "name": "requiredString", + "serializedName": "requiredString", + "doc": "required string", + "type": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadWithMultipleParameters.Request.anonymous.requiredString", + "serializationOptions": { + "$id": "20", + "json": { + "$id": "21", + "name": "requiredString" + } + } + }, + { + "$id": "22", + "kind": "property", + "name": "optionalInt", + "serializedName": "optionalInt", + "doc": "optional int", + "type": { + "$id": "23", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadWithMultipleParameters.Request.anonymous.optionalInt", + "serializationOptions": { + "$id": "24", + "json": { + "$id": "25", + "name": "optionalInt" + } + } + }, + { + "$id": "26", + "kind": "property", + "name": "requiredIntList", + "serializedName": "requiredIntList", + "doc": "required int", + "type": { + "$id": "27", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "28", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadWithMultipleParameters.Request.anonymous.requiredIntList", + "serializationOptions": { + "$id": "29", + "json": { + "$id": "30", + "name": "requiredIntList" + } + } + }, + { + "$id": "31", + "kind": "property", + "name": "optionalStringList", + "serializedName": "optionalStringList", + "doc": "optional string", + "type": { + "$id": "32", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadWithMultipleParameters.Request.anonymous.optionalStringList", + "serializationOptions": { + "$id": "34", + "json": { + "$id": "35", + "name": "optionalStringList" + } + } + } + ] + }, + { + "$id": "36", + "kind": "model", + "name": "SpreadParameterWithInnerAliasRequest", + "clientNamespace": "", + "crossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerAlias.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "37", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "name of the Thing", + "type": { + "$id": "38", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadParameterWithInnerAlias.Request.anonymous.name", + "serializationOptions": { + "$id": "39", + "json": { + "$id": "40", + "name": "name" + } + } + }, + { + "$id": "41", + "kind": "property", + "name": "age", + "serializedName": "age", + "doc": "age of the Thing", + "type": { + "$id": "42", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadParameterWithInnerAlias.Request.anonymous.age", + "serializationOptions": { + "$id": "43", + "json": { + "$id": "44", + "name": "age" + } + } + } + ] + }, + { + "$id": "45", + "kind": "model", + "name": "BodyParameter", + "clientNamespace": "Parameters.Spread.Model", + "crossLanguageDefinitionId": "Parameters.Spread.Model.BodyParameter", + "usage": "Input,Spread,Json", + "doc": "This is a simple model.", + "decorators": [], + "properties": [ + { + "$id": "46", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Parameters.Spread.Model.BodyParameter.name", + "serializationOptions": { + "$id": "48", + "json": { + "$id": "49", + "name": "name" + } + } + } + ] + }, + { + "$id": "50", + "kind": "model", + "name": "SpreadCompositeRequestMixRequest", + "clientNamespace": "", + "crossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequestMix.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "51", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "52", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "spreadCompositeRequestMix.Request.anonymous.prop", + "serializationOptions": { + "$id": "53", + "json": { + "$id": "54", + "name": "prop" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "55", + "Name": "SpreadClient", + "ClientNamespace": "Parameters.Spread", + "Doc": "Test for the spread operator.", + "Operations": [], + "Protocol": { + "$id": "56" + }, + "Parameters": [ + { + "$id": "57", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "58", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "59", + "Type": { + "$id": "60", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "61", + "Name": "Model", + "ClientNamespace": "Parameters.Spread.Model", + "Operations": [ + { + "$id": "62", + "Name": "spreadAsRequestBody", + "ResourceName": "Model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "63", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "64", + "kind": "constant", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "66", + "Name": "bodyParameter", + "NameInRequest": "bodyParameter", + "Type": { + "$ref": "45" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "67", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/model/request-body", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Model.spreadAsRequestBody", + "Decorators": [] + }, + { + "$id": "68", + "Name": "spreadCompositeRequestOnlyWithBody", + "ResourceName": "Model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "69", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "70", + "kind": "constant", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "72", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "45" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "73", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/model/composite-request-only-with-body", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequestOnlyWithBody", + "Decorators": [] + }, + { + "$id": "74", + "Name": "spreadCompositeRequestWithoutBody", + "ResourceName": "Model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "75", + "Name": "name", + "NameInRequest": "name", + "Type": { + "$id": "76", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "77", + "Name": "testHeader", + "NameInRequest": "test-header", + "Type": { + "$id": "78", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "79", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/parameters/spread/model/composite-request-without-body/{name}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequestWithoutBody", + "Decorators": [] + }, + { + "$id": "80", + "Name": "spreadCompositeRequest", + "ResourceName": "Model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "81", + "Name": "name", + "NameInRequest": "name", + "Type": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "83", + "Name": "testHeader", + "NameInRequest": "test-header", + "Type": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "85", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "86", + "kind": "constant", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "88", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "45" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "89", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/model/composite-request/{name}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequest", + "Decorators": [] + }, + { + "$id": "90", + "Name": "spreadCompositeRequestMix", + "ResourceName": "Model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "91", + "Name": "name", + "NameInRequest": "name", + "Type": { + "$id": "92", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "93", + "Name": "testHeader", + "NameInRequest": "test-header", + "Type": { + "$id": "94", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "95", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "96", + "kind": "constant", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "98", + "Name": "spreadCompositeRequestMixRequest", + "NameInRequest": "spreadCompositeRequestMixRequest", + "Type": { + "$ref": "50" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "99", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/model/composite-request-mix/{name}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Model.spreadCompositeRequestMix", + "Decorators": [] + } + ], + "Protocol": { + "$id": "100" + }, + "Parent": "SpreadClient", + "Parameters": [ + { + "$id": "101", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "102", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "103", + "Type": { + "$id": "104", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "105", + "Name": "Alias", + "ClientNamespace": "Parameters.Spread.Alias", + "Operations": [ + { + "$id": "106", + "Name": "spreadAsRequestBody", + "ResourceName": "Alias", + "Accessibility": "public", + "Parameters": [ + { + "$id": "107", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "108", + "kind": "constant", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "110", + "Name": "spreadAsRequestBodyRequest", + "NameInRequest": "spreadAsRequestBodyRequest", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "111", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/alias/request-body", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestBody", + "Decorators": [] + }, + { + "$id": "112", + "Name": "spreadParameterWithInnerModel", + "ResourceName": "Alias", + "Accessibility": "public", + "Parameters": [ + { + "$id": "113", + "Name": "id", + "NameInRequest": "id", + "Type": { + "$id": "114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "115", + "Name": "x-ms-test-header", + "NameInRequest": "x-ms-test-header", + "Type": { + "$id": "116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "117", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "118", + "kind": "constant", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "120", + "Name": "spreadParameterWithInnerModelRequest", + "NameInRequest": "spreadParameterWithInnerModelRequest", + "Type": { + "$ref": "7" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "121", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/alias/inner-model-parameter/{id}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerModel", + "Decorators": [] + }, + { + "$id": "122", + "Name": "spreadAsRequestParameter", + "ResourceName": "Alias", + "Accessibility": "public", + "Parameters": [ + { + "$id": "123", + "Name": "id", + "NameInRequest": "id", + "Type": { + "$id": "124", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "125", + "Name": "x-ms-test-header", + "NameInRequest": "x-ms-test-header", + "Type": { + "$id": "126", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "127", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "128", + "kind": "constant", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "130", + "Name": "spreadAsRequestParameterRequest", + "NameInRequest": "spreadAsRequestParameterRequest", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "131", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/alias/request-parameter/{id}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Alias.spreadAsRequestParameter", + "Decorators": [] + }, + { + "$id": "132", + "Name": "spreadWithMultipleParameters", + "ResourceName": "Alias", + "Accessibility": "public", + "Parameters": [ + { + "$id": "133", + "Name": "id", + "NameInRequest": "id", + "Type": { + "$id": "134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "135", + "Name": "x-ms-test-header", + "NameInRequest": "x-ms-test-header", + "Type": { + "$id": "136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "137", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "138", + "kind": "constant", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "140", + "Name": "spreadWithMultipleParametersRequest", + "NameInRequest": "spreadWithMultipleParametersRequest", + "Type": { + "$ref": "17" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "141", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/alias/multiple-parameters/{id}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Alias.spreadWithMultipleParameters", + "Decorators": [] + }, + { + "$id": "142", + "Name": "spreadParameterWithInnerAlias", + "ResourceName": "Alias", + "Doc": "spread an alias with contains another alias property as body.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "143", + "Name": "id", + "NameInRequest": "id", + "Type": { + "$id": "144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "145", + "Name": "x-ms-test-header", + "NameInRequest": "x-ms-test-header", + "Type": { + "$id": "146", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "147", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "148", + "kind": "constant", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "150", + "Name": "spreadParameterWithInnerAliasRequest", + "NameInRequest": "spreadParameterWithInnerAliasRequest", + "Type": { + "$ref": "36" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "151", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/parameters/spread/alias/inner-alias-parameter/{id}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Parameters.Spread.Alias.spreadParameterWithInnerAlias", + "Decorators": [] + } + ], + "Protocol": { + "$id": "152" + }, + "Parent": "SpreadClient", + "Parameters": [ + { + "$id": "153", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "154", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "155", + "Type": { + "$id": "156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Configuration.json new file mode 100644 index 000000000000..7f6ca60569c8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Payload.ContentNegotiation", + "library-name": "Payload.ContentNegotiation" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Payload.ContentNegotiation.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Payload.ContentNegotiation.sln new file mode 100644 index 000000000000..f227c17cb31d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/Payload.ContentNegotiation.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payload.ContentNegotiation", "src\Payload.ContentNegotiation.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs new file mode 100644 index 000000000000..1a96e185ab81 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Payload.ContentNegotiation +{ + public partial class ContentNegotiationClient + { + public ContentNegotiationClient() : this(new Uri("http://localhost:3000"), new ContentNegotiationClientOptions()) => throw null; + + public ContentNegotiationClient(Uri endpoint, ContentNegotiationClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual SameBody GetSameBodyClient() => throw null; + + public virtual DifferentBody GetDifferentBodyClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs new file mode 100644 index 000000000000..a5d6798f147b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Payload.ContentNegotiation +{ + public partial class ContentNegotiationClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs new file mode 100644 index 000000000000..17c0f553ab31 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; +using Payload.ContentNegotiation.Models; + +namespace Payload.ContentNegotiation +{ + public partial class DifferentBody + { + protected DifferentBody() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetAvatarAsPng(RequestContext context) => throw null; + + public virtual Task GetAvatarAsPngAsync(RequestContext context) => throw null; + + public virtual Response GetAvatarAsPng(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAvatarAsPngAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetAvatarAsJson(RequestContext context) => throw null; + + public virtual Task GetAvatarAsJsonAsync(RequestContext context) => throw null; + + public virtual Response GetAvatarAsJson(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAvatarAsJsonAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..6935bc2ec6b2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..8b1940e56956 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..51185ec0bfe7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..cacf166de3de --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.Serialization.cs new file mode 100644 index 000000000000..bf1e3340ffd9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Payload.ContentNegotiation.Models +{ + public partial class PngImageAsJson : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + PngImageAsJson IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual PngImageAsJson JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + PngImageAsJson IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual PngImageAsJson PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(PngImageAsJson pngImageAsJson) => throw null; + + public static explicit operator PngImageAsJson(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.cs new file mode 100644 index 000000000000..3bc0298c2424 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/Models/PngImageAsJson.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation.Models +{ + public partial class PngImageAsJson + { + public BinaryData Content => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/PayloadContentNegotiationModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/PayloadContentNegotiationModelFactory.cs new file mode 100644 index 000000000000..79d7c4ff1936 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/PayloadContentNegotiationModelFactory.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.ContentNegotiation.Models +{ + public static partial class PayloadContentNegotiationModelFactory + { + public static PngImageAsJson PngImageAsJson(BinaryData content = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs new file mode 100644 index 000000000000..f68c5fc910af --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Payload.ContentNegotiation +{ + public partial class SameBody + { + protected SameBody() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetAvatarAsPng(RequestContext context) => throw null; + + public virtual Task GetAvatarAsPngAsync(RequestContext context) => throw null; + + public virtual Response GetAvatarAsPng(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAvatarAsPngAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetAvatarAsJpeg(RequestContext context) => throw null; + + public virtual Task GetAvatarAsJpegAsync(RequestContext context) => throw null; + + public virtual Response GetAvatarAsJpeg(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAvatarAsJpegAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Payload.ContentNegotiation.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Payload.ContentNegotiation.csproj new file mode 100644 index 000000000000..7e4e4be9b7f9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Payload.ContentNegotiation.csproj @@ -0,0 +1,14 @@ + + + This is the Payload.ContentNegotiation client library for developing .NET applications with rich experience. + SDK Code Generation Payload.ContentNegotiation + 1.0.0-beta.1 + Payload.ContentNegotiation + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json new file mode 100644 index 000000000000..eac17f5a96c0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/tspCodeModel.json @@ -0,0 +1,514 @@ +{ + "$id": "1", + "Name": "Payload.ContentNegotiation", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "PngImageAsJson", + "clientNamespace": "Payload.ContentNegotiation.DifferentBody", + "crossLanguageDefinitionId": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "content", + "serializedName": "content", + "type": { + "$id": "4", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.ContentNegotiation.DifferentBody.PngImageAsJson.content", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "content" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "ContentNegotiationClient", + "ClientNamespace": "Payload.ContentNegotiation", + "Doc": "Test describing optionality of the request body.", + "Operations": [], + "Protocol": { + "$id": "8" + }, + "Parameters": [ + { + "$id": "9", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "10", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "11", + "Type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "13", + "Name": "SameBody", + "ClientNamespace": "Payload.ContentNegotiation.SameBody", + "Operations": [ + { + "$id": "14", + "Name": "getAvatarAsPng", + "ResourceName": "SameBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "15", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "16", + "kind": "constant", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/png", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "18", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "19", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "20", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "21", + "kind": "constant", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/png", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "image/png" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/content-negotiation/same-body", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.ContentNegotiation.SameBody.getAvatarAsPng", + "Decorators": [] + }, + { + "$id": "23", + "Name": "getAvatarAsJpeg", + "ResourceName": "SameBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "24", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "25", + "kind": "constant", + "valueType": { + "$id": "26", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/jpeg", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "27", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "28", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "29", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "30", + "kind": "constant", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/jpeg", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "image/jpeg" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/content-negotiation/same-body", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.ContentNegotiation.SameBody.getAvatarAsJpeg", + "Decorators": [] + } + ], + "Protocol": { + "$id": "32" + }, + "Parent": "ContentNegotiationClient", + "Parameters": [ + { + "$id": "33", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "34", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "35", + "Type": { + "$id": "36", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "37", + "Name": "DifferentBody", + "ClientNamespace": "Payload.ContentNegotiation.DifferentBody", + "Operations": [ + { + "$id": "38", + "Name": "getAvatarAsPng", + "ResourceName": "DifferentBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "39", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "40", + "kind": "constant", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/png", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "42", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "43", + "kind": "bytes", + "name": "bytes", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "44", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "45", + "kind": "constant", + "valueType": { + "$id": "46", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image/png", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "image/png" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/content-negotiation/different-body", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.ContentNegotiation.DifferentBody.getAvatarAsPng", + "Decorators": [] + }, + { + "$id": "47", + "Name": "getAvatarAsJson", + "ResourceName": "DifferentBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "48", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "49", + "kind": "constant", + "valueType": { + "$id": "50", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "51", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "52", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "53", + "kind": "constant", + "valueType": { + "$id": "54", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/content-negotiation/different-body", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.ContentNegotiation.DifferentBody.getAvatarAsJson", + "Decorators": [] + } + ], + "Protocol": { + "$id": "55" + }, + "Parent": "ContentNegotiationClient", + "Parameters": [ + { + "$id": "56", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "57", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "58", + "Type": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Configuration.json new file mode 100644 index 000000000000..5f02c13d5a8b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Payload.JsonMergePatch", + "library-name": "Payload.JsonMergePatch" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Payload.JsonMergePatch.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Payload.JsonMergePatch.sln new file mode 100644 index 000000000000..308cd4385141 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/Payload.JsonMergePatch.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payload.JsonMergePatch", "src\Payload.JsonMergePatch.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..693a5ada0793 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.JsonMergePatch +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..f2460113e9b5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.JsonMergePatch +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..905049af253b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.JsonMergePatch +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..305b5a7e97ce --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.JsonMergePatch +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs new file mode 100644 index 000000000000..ea34e18cf567 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Payload.JsonMergePatch.Models; + +namespace Payload.JsonMergePatch +{ + public partial class JsonMergePatchClient + { + public JsonMergePatchClient() : this(new Uri("http://localhost:3000"), new JsonMergePatchClientOptions()) => throw null; + + public JsonMergePatchClient(Uri endpoint, JsonMergePatchClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response CreateResource(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task CreateResourceAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response CreateResource(Resource body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> CreateResourceAsync(Resource body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response UpdateResource(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task UpdateResourceAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response UpdateOptionalResource(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task UpdateOptionalResourceAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs new file mode 100644 index 000000000000..6d24a3f8b595 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Payload.JsonMergePatch +{ + public partial class JsonMergePatchClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.Serialization.cs new file mode 100644 index 000000000000..915d5bb02c70 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Payload.JsonMergePatch.Models +{ + public partial class InnerModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + InnerModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual InnerModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + InnerModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual InnerModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(InnerModel innerModel) => throw null; + + public static explicit operator InnerModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.cs new file mode 100644 index 000000000000..11c3e1318aa8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/InnerModel.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Payload.JsonMergePatch.Models +{ + public partial class InnerModel + { + public InnerModel() => throw null; + + public string Name + { + get => throw null; + set => throw null; + } + + public string Description + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.Serialization.cs new file mode 100644 index 000000000000..5e5baa7abbfb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Payload.JsonMergePatch.Models +{ + public partial class Resource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Resource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Resource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Resource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Resource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Resource resource) => throw null; + + public static explicit operator Resource(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..4cb2bdc58704 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/Models/Resource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Payload.JsonMergePatch.Models +{ + public partial class Resource + { + public Resource(string name) => throw null; + + public string Name + { + get => throw null; + set => throw null; + } + + public string Description + { + get => throw null; + set => throw null; + } + + public IDictionary Map => throw null; + + public IList Array => throw null; + + public int? IntValue + { + get => throw null; + set => throw null; + } + + public float? FloatValue + { + get => throw null; + set => throw null; + } + + public InnerModel InnerModel + { + get => throw null; + set => throw null; + } + + public IList IntArray => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/PayloadJsonMergePatchModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/PayloadJsonMergePatchModelFactory.cs new file mode 100644 index 000000000000..4488a386d90b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/PayloadJsonMergePatchModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Payload.JsonMergePatch.Models +{ + public static partial class PayloadJsonMergePatchModelFactory + { + public static Resource Resource(string name = default, string description = default, IDictionary map = default, IEnumerable array = default, int? intValue = default, float? floatValue = default, InnerModel innerModel = default, IEnumerable intArray = default) => throw null; + + public static InnerModel InnerModel(string name = default, string description = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Payload.JsonMergePatch.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Payload.JsonMergePatch.csproj new file mode 100644 index 000000000000..36fef5c4b7d8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Payload.JsonMergePatch.csproj @@ -0,0 +1,14 @@ + + + This is the Payload.JsonMergePatch client library for developing .NET applications with rich experience. + SDK Code Generation Payload.JsonMergePatch + 1.0.0-beta.1 + Payload.JsonMergePatch + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json new file mode 100644 index 000000000000..37711265d5d4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/tspCodeModel.json @@ -0,0 +1,889 @@ +{ + "$id": "1", + "Name": "Payload.JsonMergePatch", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "Resource", + "clientNamespace": "Payload.JsonMergePatch", + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource", + "usage": "Input,Output,Json", + "doc": "Details about a resource.", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.name", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "name" + } + } + }, + { + "$id": "7", + "kind": "property", + "name": "description", + "serializedName": "description", + "type": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.description", + "serializationOptions": { + "$id": "9", + "json": { + "$id": "10", + "name": "description" + } + } + }, + { + "$id": "11", + "kind": "property", + "name": "map", + "serializedName": "map", + "type": { + "$id": "12", + "kind": "dict", + "keyType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "14", + "kind": "model", + "name": "InnerModel", + "clientNamespace": "Payload.JsonMergePatch", + "crossLanguageDefinitionId": "Payload.JsonMergePatch.InnerModel", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "It is the model used by Resource model", + "decorators": [], + "properties": [ + { + "$id": "15", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.InnerModel.name", + "serializationOptions": { + "$id": "17", + "json": { + "$id": "18", + "name": "name" + } + } + }, + { + "$id": "19", + "kind": "property", + "name": "description", + "serializedName": "description", + "type": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.InnerModel.description", + "serializationOptions": { + "$id": "21", + "json": { + "$id": "22", + "name": "description" + } + } + } + ] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.map", + "serializationOptions": { + "$id": "23", + "json": { + "$id": "24", + "name": "map" + } + } + }, + { + "$id": "25", + "kind": "property", + "name": "array", + "serializedName": "array", + "type": { + "$id": "26", + "kind": "array", + "name": "ArrayInnerModel", + "valueType": { + "$ref": "14" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.array", + "serializationOptions": { + "$id": "27", + "json": { + "$id": "28", + "name": "array" + } + } + }, + { + "$id": "29", + "kind": "property", + "name": "intValue", + "serializedName": "intValue", + "type": { + "$id": "30", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.intValue", + "serializationOptions": { + "$id": "31", + "json": { + "$id": "32", + "name": "intValue" + } + } + }, + { + "$id": "33", + "kind": "property", + "name": "floatValue", + "serializedName": "floatValue", + "type": { + "$id": "34", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.floatValue", + "serializationOptions": { + "$id": "35", + "json": { + "$id": "36", + "name": "floatValue" + } + } + }, + { + "$id": "37", + "kind": "property", + "name": "innerModel", + "serializedName": "innerModel", + "type": { + "$ref": "14" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.innerModel", + "serializationOptions": { + "$id": "38", + "json": { + "$id": "39", + "name": "innerModel" + } + } + }, + { + "$id": "40", + "kind": "property", + "name": "intArray", + "serializedName": "intArray", + "type": { + "$id": "41", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "42", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.Resource.intArray", + "serializationOptions": { + "$id": "43", + "json": { + "$id": "44", + "name": "intArray" + } + } + } + ] + }, + { + "$ref": "14" + }, + { + "$id": "45", + "kind": "model", + "name": "ResourcePatch", + "clientNamespace": "Payload.JsonMergePatch", + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch", + "usage": "Input,JsonMergePatch,Json", + "doc": "Details about a resource for patch operation.", + "decorators": [], + "properties": [ + { + "$id": "46", + "kind": "property", + "name": "description", + "serializedName": "description", + "type": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.description", + "serializationOptions": { + "$id": "48", + "json": { + "$id": "49", + "name": "description" + } + } + }, + { + "$id": "50", + "kind": "property", + "name": "map", + "serializedName": "map", + "type": { + "$id": "51", + "kind": "dict", + "keyType": { + "$id": "52", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "14" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.map", + "serializationOptions": { + "$id": "53", + "json": { + "$id": "54", + "name": "map" + } + } + }, + { + "$id": "55", + "kind": "property", + "name": "array", + "serializedName": "array", + "type": { + "$id": "56", + "kind": "array", + "name": "ArrayInnerModel", + "valueType": { + "$ref": "14" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.array", + "serializationOptions": { + "$id": "57", + "json": { + "$id": "58", + "name": "array" + } + } + }, + { + "$id": "59", + "kind": "property", + "name": "intValue", + "serializedName": "intValue", + "type": { + "$id": "60", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.intValue", + "serializationOptions": { + "$id": "61", + "json": { + "$id": "62", + "name": "intValue" + } + } + }, + { + "$id": "63", + "kind": "property", + "name": "floatValue", + "serializedName": "floatValue", + "type": { + "$id": "64", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.floatValue", + "serializationOptions": { + "$id": "65", + "json": { + "$id": "66", + "name": "floatValue" + } + } + }, + { + "$id": "67", + "kind": "property", + "name": "innerModel", + "serializedName": "innerModel", + "type": { + "$ref": "14" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.innerModel", + "serializationOptions": { + "$id": "68", + "json": { + "$id": "69", + "name": "innerModel" + } + } + }, + { + "$id": "70", + "kind": "property", + "name": "intArray", + "serializedName": "intArray", + "type": { + "$id": "71", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "72", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Payload.JsonMergePatch.ResourcePatch.intArray", + "serializationOptions": { + "$id": "73", + "json": { + "$id": "74", + "name": "intArray" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "75", + "Name": "JsonMergePatchClient", + "ClientNamespace": "Payload.JsonMergePatch", + "Doc": "Test for merge-patch+json content-type", + "Operations": [ + { + "$id": "76", + "Name": "createResource", + "ResourceName": "JsonMergePatch", + "Doc": "Test content-type: application/merge-patch+json with required body", + "Accessibility": "public", + "Parameters": [ + { + "$id": "77", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "78", + "kind": "constant", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "80", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "81", + "kind": "constant", + "valueType": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "83", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "84", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/json-merge-patch/create/resource", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.JsonMergePatch.createResource", + "Decorators": [] + }, + { + "$id": "85", + "Name": "updateResource", + "ResourceName": "JsonMergePatch", + "Doc": "Test content-type: application/merge-patch+json with required body", + "Accessibility": "public", + "Parameters": [ + { + "$id": "86", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Type": { + "$id": "87", + "kind": "constant", + "valueType": { + "$id": "88", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "89", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "90", + "kind": "constant", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "92", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "45" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "93", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/json-merge-patch/update/resource", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Payload.JsonMergePatch.updateResource", + "Decorators": [] + }, + { + "$id": "94", + "Name": "updateOptionalResource", + "ResourceName": "JsonMergePatch", + "Doc": "Test content-type: application/merge-patch+json with optional body", + "Accessibility": "public", + "Parameters": [ + { + "$id": "95", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Type": { + "$id": "96", + "kind": "constant", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "98", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "99", + "kind": "constant", + "valueType": { + "$id": "100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "101", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "45" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "102", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/json-merge-patch/update/resource/optional", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Payload.JsonMergePatch.updateOptionalResource", + "Decorators": [] + } + ], + "Protocol": { + "$id": "103" + }, + "Parameters": [ + { + "$id": "104", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "105", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "106", + "Type": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Configuration.json new file mode 100644 index 000000000000..df8e97cf97dc --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Payload.MediaType", + "library-name": "Payload.MediaType" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Payload.MediaType.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Payload.MediaType.sln new file mode 100644 index 000000000000..a25e507fea6e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/Payload.MediaType.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payload.MediaType", "src\Payload.MediaType.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..f0135fe24237 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.MediaType +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..cc77843b7f7e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.MediaType +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..f434a9e45d6e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.MediaType +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..5785e56ffac4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Payload.MediaType +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs new file mode 100644 index 000000000000..26436705728f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Payload.MediaType +{ + public partial class MediaTypeClient + { + public MediaTypeClient() : this(new Uri("http://localhost:3000"), new MediaTypeClientOptions()) => throw null; + + public MediaTypeClient(Uri endpoint, MediaTypeClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual StringBody GetStringBodyClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs new file mode 100644 index 000000000000..d197cbad5e89 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Payload.MediaType +{ + public partial class MediaTypeClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs new file mode 100644 index 000000000000..89e47ed203c6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Payload.MediaType +{ + public partial class StringBody + { + protected StringBody() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response SendAsText(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SendAsTextAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SendAsText(string text, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SendAsTextAsync(string text, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetAsText(RequestContext context) => throw null; + + public virtual Task GetAsTextAsync(RequestContext context) => throw null; + + public virtual Response GetAsText(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAsTextAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response SendAsJson(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SendAsJsonAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SendAsJson(string text, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SendAsJsonAsync(string text, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetAsJson(RequestContext context) => throw null; + + public virtual Task GetAsJsonAsync(RequestContext context) => throw null; + + public virtual Response GetAsJson(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAsJsonAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Payload.MediaType.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Payload.MediaType.csproj new file mode 100644 index 000000000000..719a4c8b4ed2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Payload.MediaType.csproj @@ -0,0 +1,14 @@ + + + This is the Payload.MediaType client library for developing .NET applications with rich experience. + SDK Code Generation Payload.MediaType + 1.0.0-beta.1 + Payload.MediaType + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/tspCodeModel.json new file mode 100644 index 000000000000..eebf0b00c70a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/tspCodeModel.json @@ -0,0 +1,424 @@ +{ + "$id": "1", + "Name": "Payload.MediaType", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "MediaTypeClient", + "ClientNamespace": "Payload.MediaType", + "Doc": "Test the payload with different media types and different types of the payload itself.", + "Operations": [], + "Protocol": { + "$id": "3" + }, + "Parameters": [ + { + "$id": "4", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "5", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "6", + "Type": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "8", + "Name": "StringBody", + "ClientNamespace": "Payload.MediaType.StringBody", + "Operations": [ + { + "$id": "9", + "Name": "sendAsText", + "ResourceName": "StringBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "10", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Type": { + "$id": "11", + "kind": "constant", + "valueType": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text/plain", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "13", + "Name": "text", + "NameInRequest": "text", + "Type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "15", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Text", + "Uri": "{endpoint}", + "Path": "/payload/media-type/string-body/sendAsText", + "RequestMediaTypes": [ + "text/plain" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.MediaType.StringBody.sendAsText", + "Decorators": [] + }, + { + "$id": "16", + "Name": "getAsText", + "ResourceName": "StringBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "17", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "18", + "kind": "constant", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text/plain", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "20", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "22", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "23", + "kind": "constant", + "valueType": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text/plain", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "text/plain" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/payload/media-type/string-body/getAsText", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.MediaType.StringBody.getAsText", + "Decorators": [] + }, + { + "$id": "25", + "Name": "sendAsJson", + "ResourceName": "StringBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "26", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Type": { + "$id": "27", + "kind": "constant", + "valueType": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "29", + "Name": "text", + "NameInRequest": "text", + "Type": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "31", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Text", + "Uri": "{endpoint}", + "Path": "/payload/media-type/string-body/sendAsJson", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.MediaType.StringBody.sendAsJson", + "Decorators": [] + }, + { + "$id": "32", + "Name": "getAsJson", + "ResourceName": "StringBody", + "Accessibility": "public", + "Parameters": [ + { + "$id": "33", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "34", + "kind": "constant", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "36", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "38", + "Name": "contentType", + "NameInResponse": "content-type", + "Type": { + "$id": "39", + "kind": "constant", + "valueType": { + "$id": "40", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/payload/media-type/string-body/getAsJson", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Payload.MediaType.StringBody.getAsJson", + "Decorators": [] + } + ], + "Protocol": { + "$id": "41" + }, + "Parent": "MediaTypeClient", + "Parameters": [ + { + "$id": "42", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "43", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "44", + "Type": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Configuration.json new file mode 100644 index 000000000000..1e7ad838aea5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Serialization.EncodedName.Json", + "library-name": "Serialization.EncodedName.Json" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Serialization.EncodedName.Json.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Serialization.EncodedName.Json.sln new file mode 100644 index 000000000000..8dc3189a35ee --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/Serialization.EncodedName.Json.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serialization.EncodedName.Json", "src\Serialization.EncodedName.Json.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..8c5d008950b8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Serialization.EncodedName.Json +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..68998f3993d8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Serialization.EncodedName.Json +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..c50ba16cf375 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Serialization.EncodedName.Json +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..0d7dea846176 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Serialization.EncodedName.Json +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs new file mode 100644 index 000000000000..97d8be85436e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace Serialization.EncodedName.Json +{ + public partial class JsonClient + { + public JsonClient() : this(new Uri("http://localhost:3000"), new JsonClientOptions()) => throw null; + + public JsonClient(Uri endpoint, JsonClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Property GetPropertyClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs new file mode 100644 index 000000000000..52234e1d4ed5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Serialization.EncodedName.Json +{ + public partial class JsonClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.Serialization.cs new file mode 100644 index 000000000000..eb5afbcfa115 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Serialization.EncodedName.Json.Models +{ + public partial class JsonEncodedNameModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + JsonEncodedNameModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual JsonEncodedNameModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + JsonEncodedNameModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual JsonEncodedNameModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(JsonEncodedNameModel jsonEncodedNameModel) => throw null; + + public static explicit operator JsonEncodedNameModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.cs new file mode 100644 index 000000000000..ee4bbc8d3b1f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Models/JsonEncodedNameModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Serialization.EncodedName.Json.Models +{ + public partial class JsonEncodedNameModel + { + public JsonEncodedNameModel(bool defaultName) => throw null; + + public bool DefaultName + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs new file mode 100644 index 000000000000..8b15824f3588 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Serialization.EncodedName.Json.Models; + +namespace Serialization.EncodedName.Json +{ + public partial class Property + { + protected Property() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Send(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SendAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Send(JsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SendAsync(JsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Get(RequestContext context) => throw null; + + public virtual Task GetAsync(RequestContext context) => throw null; + + public virtual Response Get(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/SerializationEncodedNameJsonModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/SerializationEncodedNameJsonModelFactory.cs new file mode 100644 index 000000000000..7e902a713eab --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/SerializationEncodedNameJsonModelFactory.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Serialization.EncodedName.Json.Models +{ + public static partial class SerializationEncodedNameJsonModelFactory + { + public static JsonEncodedNameModel JsonEncodedNameModel(bool defaultName = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Serialization.EncodedName.Json.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Serialization.EncodedName.Json.csproj new file mode 100644 index 000000000000..e129601d29f4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Serialization.EncodedName.Json.csproj @@ -0,0 +1,14 @@ + + + This is the Serialization.EncodedName.Json client library for developing .NET applications with rich experience. + SDK Code Generation Serialization.EncodedName.Json + 1.0.0-beta.1 + Serialization.EncodedName.Json + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json new file mode 100644 index 000000000000..65edf182022e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/tspCodeModel.json @@ -0,0 +1,274 @@ +{ + "$id": "1", + "Name": "Serialization.EncodedName.Json", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "JsonEncodedNameModel", + "clientNamespace": "Serialization.EncodedName.Json.Property", + "crossLanguageDefinitionId": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "defaultName", + "serializedName": "wireName", + "doc": "Pass in true", + "type": { + "$id": "4", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Serialization.EncodedName.Json.Property.JsonEncodedNameModel.defaultName", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "wireName" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "7", + "Name": "JsonClient", + "ClientNamespace": "Serialization.EncodedName.Json", + "Doc": "Projection", + "Operations": [], + "Protocol": { + "$id": "8" + }, + "Parameters": [ + { + "$id": "9", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "10", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "11", + "Type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "13", + "Name": "Property", + "ClientNamespace": "Serialization.EncodedName.Json.Property", + "Operations": [ + { + "$id": "14", + "Name": "send", + "ResourceName": "Property", + "Accessibility": "public", + "Parameters": [ + { + "$id": "15", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "16", + "kind": "constant", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "18", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "19", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/serialization/encoded-name/json/property", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Serialization.EncodedName.Json.Property.send", + "Decorators": [] + }, + { + "$id": "20", + "Name": "get", + "ResourceName": "Property", + "Accessibility": "public", + "Parameters": [ + { + "$id": "21", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "22", + "kind": "constant", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "24", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/serialization/encoded-name/json/property", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Serialization.EncodedName.Json.Property.get", + "Decorators": [] + } + ], + "Protocol": { + "$id": "25" + }, + "Parent": "JsonClient", + "Parameters": [ + { + "$id": "26", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "27", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "28", + "Type": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Configuration.json new file mode 100644 index 000000000000..307fdb17b9fb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Server.Endpoint.NotDefined", + "library-name": "Server.Endpoint.NotDefined" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Server.Endpoint.NotDefined.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Server.Endpoint.NotDefined.sln new file mode 100644 index 000000000000..f36aaf740821 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/Server.Endpoint.NotDefined.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.Endpoint.NotDefined", "src\Server.Endpoint.NotDefined.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..7a29cbc3640e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Endpoint.NotDefined +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..580b27caae75 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Endpoint.NotDefined +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..4fa33e226e50 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Endpoint.NotDefined +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f21e1ef992b6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Endpoint.NotDefined +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs new file mode 100644 index 000000000000..c49d97a3b0de --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Server.Endpoint.NotDefined +{ + public partial class NotDefinedClient + { + protected NotDefinedClient() => throw null; + + public NotDefinedClient(Uri endpoint) : this(endpoint, new NotDefinedClientOptions()) => throw null; + + public NotDefinedClient(Uri endpoint, NotDefinedClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Valid(RequestContext context) => throw null; + + public virtual Task ValidAsync(RequestContext context) => throw null; + + public virtual Response Valid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs new file mode 100644 index 000000000000..70b913d310a3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Server.Endpoint.NotDefined +{ + public partial class NotDefinedClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Server.Endpoint.NotDefined.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Server.Endpoint.NotDefined.csproj new file mode 100644 index 000000000000..b461a75c81a3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Server.Endpoint.NotDefined.csproj @@ -0,0 +1,14 @@ + + + This is the Server.Endpoint.NotDefined client library for developing .NET applications with rich experience. + SDK Code Generation Server.Endpoint.NotDefined + 1.0.0-beta.1 + Server.Endpoint.NotDefined + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/tspCodeModel.json new file mode 100644 index 000000000000..b709fe40a0ad --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/tspCodeModel.json @@ -0,0 +1,71 @@ +{ + "$id": "1", + "Name": "Server.Endpoint.NotDefined", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "NotDefinedClient", + "ClientNamespace": "Server.Endpoint.NotDefined", + "Doc": "Illustrates server doesn't define endpoint. Client should automatically add an endpoint to let user pass in.", + "Operations": [ + { + "$id": "3", + "Name": "valid", + "ResourceName": "NotDefined", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "4", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/server/endpoint/not-defined/valid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Server.Endpoint.NotDefined.valid", + "Decorators": [] + } + ], + "Protocol": { + "$id": "5" + }, + "Parameters": [ + { + "$id": "6", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "7", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Configuration.json new file mode 100644 index 000000000000..a650867777f5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Server.Path.Single", + "library-name": "Server.Path.Single" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Server.Path.Single.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Server.Path.Single.sln new file mode 100644 index 000000000000..99ac967e6587 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/Server.Path.Single.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.Path.Single", "src\Server.Path.Single.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..9e73e80b266c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Path.Single +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..1fbbe44d2e19 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Path.Single +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..382daf74e7db --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Path.Single +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..d28e80b91c6a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Path.Single +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs new file mode 100644 index 000000000000..b3b134c40430 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Server.Path.Single +{ + public partial class SingleClient + { + protected SingleClient() => throw null; + + public SingleClient(Uri endpoint) : this(endpoint, new SingleClientOptions()) => throw null; + + public SingleClient(Uri endpoint, SingleClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response MyOp(RequestContext context) => throw null; + + public virtual Task MyOpAsync(RequestContext context) => throw null; + + public virtual Response MyOp(CancellationToken cancellationToken = default) => throw null; + + public virtual Task MyOpAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs new file mode 100644 index 000000000000..6af942a1334f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Server.Path.Single +{ + public partial class SingleClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Server.Path.Single.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Server.Path.Single.csproj new file mode 100644 index 000000000000..52eea01488e6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Server.Path.Single.csproj @@ -0,0 +1,14 @@ + + + This is the Server.Path.Single client library for developing .NET applications with rich experience. + SDK Code Generation Server.Path.Single + 1.0.0-beta.1 + Server.Path.Single + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/tspCodeModel.json new file mode 100644 index 000000000000..502196f3ff67 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/tspCodeModel.json @@ -0,0 +1,71 @@ +{ + "$id": "1", + "Name": "Server.Path.Single", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "SingleClient", + "ClientNamespace": "Server.Path.Single", + "Doc": "Illustrates server with a single path parameter @server", + "Operations": [ + { + "$id": "3", + "Name": "myOp", + "ResourceName": "Single", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "4", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/server/path/single/myOp", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Server.Path.Single.myOp", + "Decorators": [] + } + ], + "Protocol": { + "$id": "5" + }, + "Parameters": [ + { + "$id": "6", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "7", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Configuration.json new file mode 100644 index 000000000000..144e9cfdfe84 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Server.Versions.NotVersioned", + "library-name": "Server.Versions.NotVersioned" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Server.Versions.NotVersioned.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Server.Versions.NotVersioned.sln new file mode 100644 index 000000000000..837c737d434f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/Server.Versions.NotVersioned.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.Versions.NotVersioned", "src\Server.Versions.NotVersioned.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..650342c2fab2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Versions.NotVersioned +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..bba621a77944 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Versions.NotVersioned +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..50606c8d1965 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Versions.NotVersioned +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..7796baeea6c3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Server.Versions.NotVersioned +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs new file mode 100644 index 000000000000..14f5feff09a6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace Server.Versions.NotVersioned +{ + public partial class NotVersionedClient + { + protected NotVersionedClient() => throw null; + + public NotVersionedClient(Uri endpoint) : this(endpoint, new NotVersionedClientOptions()) => throw null; + + public NotVersionedClient(Uri endpoint, NotVersionedClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response WithoutApiVersion(RequestContext context) => throw null; + + public virtual Task WithoutApiVersionAsync(RequestContext context) => throw null; + + public virtual Response WithoutApiVersion(CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithoutApiVersionAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithQueryApiVersion(string apiVersion, RequestContext context) => throw null; + + public virtual Task WithQueryApiVersionAsync(string apiVersion, RequestContext context) => throw null; + + public virtual Response WithQueryApiVersion(string apiVersion, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryApiVersionAsync(string apiVersion, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithPathApiVersion(string apiVersion, RequestContext context) => throw null; + + public virtual Task WithPathApiVersionAsync(string apiVersion, RequestContext context) => throw null; + + public virtual Response WithPathApiVersion(string apiVersion, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithPathApiVersionAsync(string apiVersion, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs new file mode 100644 index 000000000000..a82ec1d2f49a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Server.Versions.NotVersioned +{ + public partial class NotVersionedClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Server.Versions.NotVersioned.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Server.Versions.NotVersioned.csproj new file mode 100644 index 000000000000..2cb1446aa567 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Server.Versions.NotVersioned.csproj @@ -0,0 +1,14 @@ + + + This is the Server.Versions.NotVersioned client library for developing .NET applications with rich experience. + SDK Code Generation Server.Versions.NotVersioned + 1.0.0-beta.1 + Server.Versions.NotVersioned + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/tspCodeModel.json new file mode 100644 index 000000000000..0d095ffaf474 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/tspCodeModel.json @@ -0,0 +1,169 @@ +{ + "$id": "1", + "Name": "Server.Versions.NotVersioned", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "NotVersionedClient", + "ClientNamespace": "Server.Versions.NotVersioned", + "Doc": "Illustrates not-versioned server.", + "Operations": [ + { + "$id": "3", + "Name": "withoutApiVersion", + "ResourceName": "NotVersioned", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "4", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/server/versions/not-versioned/without-api-version", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Server.Versions.NotVersioned.withoutApiVersion", + "Decorators": [] + }, + { + "$id": "5", + "Name": "withQueryApiVersion", + "ResourceName": "NotVersioned", + "Accessibility": "public", + "Parameters": [ + { + "$id": "6", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Type": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "8", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/server/versions/not-versioned/with-query-api-version", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Server.Versions.NotVersioned.withQueryApiVersion", + "Decorators": [] + }, + { + "$id": "9", + "Name": "withPathApiVersion", + "ResourceName": "NotVersioned", + "Accessibility": "public", + "Parameters": [ + { + "$id": "10", + "Name": "apiVersion", + "NameInRequest": "apiVersion", + "Type": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "12", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/server/versions/not-versioned/with-path-api-version/{apiVersion}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Server.Versions.NotVersioned.withPathApiVersion", + "Decorators": [] + } + ], + "Protocol": { + "$id": "13" + }, + "Parameters": [ + { + "$id": "14", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "15", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/Configuration.json new file mode 100644 index 000000000000..12273e123079 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "SpecialHeaders.ConditionalRequest", + "library-name": "SpecialHeaders.ConditionalRequest" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln new file mode 100644 index 000000000000..9d0fe746c58f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecialHeaders.ConditionalRequest", "src\SpecialHeaders.ConditionalRequest.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs new file mode 100644 index 000000000000..619318988ade --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace SpecialHeaders.ConditionalRequest +{ + public partial class ConditionalRequestClient + { + public ConditionalRequestClient() : this(new Uri("http://localhost:3000"), new ConditionalRequestClientOptions()) => throw null; + + public ConditionalRequestClient(Uri endpoint, ConditionalRequestClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response PostIfMatch(string ifMatch, RequestContext context) => throw null; + + public virtual Task PostIfMatchAsync(string ifMatch, RequestContext context) => throw null; + + public virtual Response PostIfMatch(string ifMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfMatchAsync(string ifMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PostIfNoneMatch(string ifNoneMatch, RequestContext context) => throw null; + + public virtual Task PostIfNoneMatchAsync(string ifNoneMatch, RequestContext context) => throw null; + + public virtual Response PostIfNoneMatch(string ifNoneMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfNoneMatchAsync(string ifNoneMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Response HeadIfModifiedSince(DateTimeOffset? ifModifiedSince, RequestContext context) => throw null; + + public virtual Task HeadIfModifiedSinceAsync(DateTimeOffset? ifModifiedSince, RequestContext context) => throw null; + + public virtual Response HeadIfModifiedSince(DateTimeOffset? ifModifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task HeadIfModifiedSinceAsync(DateTimeOffset? ifModifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PostIfUnmodifiedSince(DateTimeOffset? ifUnmodifiedSince, RequestContext context) => throw null; + + public virtual Task PostIfUnmodifiedSinceAsync(DateTimeOffset? ifUnmodifiedSince, RequestContext context) => throw null; + + public virtual Response PostIfUnmodifiedSince(DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfUnmodifiedSinceAsync(DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs new file mode 100644 index 000000000000..21580f063613 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace SpecialHeaders.ConditionalRequest +{ + public partial class ConditionalRequestClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..cc7d7e1c5453 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.ConditionalRequest +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..35a137b9a250 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.ConditionalRequest +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..ff037cfc413c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.ConditionalRequest +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..ffd4be8fa9e0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.ConditionalRequest +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj new file mode 100644 index 000000000000..c0aa5e03539d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj @@ -0,0 +1,14 @@ + + + This is the SpecialHeaders.ConditionalRequest client library for developing .NET applications with rich experience. + SDK Code Generation SpecialHeaders.ConditionalRequest + 1.0.0-beta.1 + SpecialHeaders.ConditionalRequest + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/tspCodeModel.json new file mode 100644 index 000000000000..37200b3689f4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/tspCodeModel.json @@ -0,0 +1,274 @@ +{ + "$id": "1", + "Name": "SpecialHeaders.ConditionalRequest", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "ConditionalRequestClient", + "ClientNamespace": "SpecialHeaders.ConditionalRequest", + "Doc": "Illustrates conditional request headers", + "Operations": [ + { + "$id": "3", + "Name": "postIfMatch", + "ResourceName": "ConditionalRequest", + "Doc": "Check when only If-Match in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4", + "Name": "ifMatch", + "NameInRequest": "If-Match", + "Doc": "The request should only proceed if an entity matches this string.", + "Type": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-match", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfMatch", + "Decorators": [] + }, + { + "$id": "7", + "Name": "postIfNoneMatch", + "ResourceName": "ConditionalRequest", + "Doc": "Check when only If-None-Match in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "8", + "Name": "ifNoneMatch", + "NameInRequest": "If-None-Match", + "Doc": "The request should only proceed if no entity matches this string.", + "Type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "10", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-none-match", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", + "Decorators": [] + }, + { + "$id": "11", + "Name": "headIfModifiedSince", + "ResourceName": "ConditionalRequest", + "Doc": "Check when only If-Modified-Since in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "12", + "Name": "ifModifiedSince", + "NameInRequest": "If-Modified-Since", + "Doc": "A timestamp indicating the last modified time of the resource known to the\nclient. The operation will be performed only if the resource on the service has\nbeen modified since the specified time.", + "Type": { + "$id": "13", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "15", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-modified-since", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", + "Decorators": [] + }, + { + "$id": "16", + "Name": "postIfUnmodifiedSince", + "ResourceName": "ConditionalRequest", + "Doc": "Check when only If-Unmodified-Since in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "17", + "Name": "ifUnmodifiedSince", + "NameInRequest": "If-Unmodified-Since", + "Doc": "A timestamp indicating the last modified time of the resource known to the\nclient. The operation will be performed only if the resource on the service has\nnot been modified since the specified time.", + "Type": { + "$id": "18", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "20", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-unmodified-since", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", + "Decorators": [] + } + ], + "Protocol": { + "$id": "21" + }, + "Parameters": [ + { + "$id": "22", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "23", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "24", + "Type": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/Configuration.json new file mode 100644 index 000000000000..0da4cee4820b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "SpecialHeaders.Repeatability", + "library-name": "SpecialHeaders.Repeatability" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/SpecialHeaders.Repeatability.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/SpecialHeaders.Repeatability.sln new file mode 100644 index 000000000000..890d9e4be2c7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/SpecialHeaders.Repeatability.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecialHeaders.Repeatability", "src\SpecialHeaders.Repeatability.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..00611d3c3b8d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.Repeatability +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..8c06a3008e52 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.Repeatability +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..7d8b50f094bb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.Repeatability +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..cec4d834a28c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialHeaders.Repeatability +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs new file mode 100644 index 000000000000..1fd548cf22b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace SpecialHeaders.Repeatability +{ + public partial class RepeatabilityClient + { + public RepeatabilityClient() : this(new Uri("http://localhost:3000"), new RepeatabilityClientOptions()) => throw null; + + public RepeatabilityClient(Uri endpoint, RepeatabilityClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response ImmediateSuccess(RequestContext context) => throw null; + + public virtual Task ImmediateSuccessAsync(RequestContext context) => throw null; + + public virtual Response ImmediateSuccess(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ImmediateSuccessAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs new file mode 100644 index 000000000000..d2ac6cb8e360 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace SpecialHeaders.Repeatability +{ + public partial class RepeatabilityClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/SpecialHeaders.Repeatability.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/SpecialHeaders.Repeatability.csproj new file mode 100644 index 000000000000..64565b6ffa44 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/SpecialHeaders.Repeatability.csproj @@ -0,0 +1,14 @@ + + + This is the SpecialHeaders.Repeatability client library for developing .NET applications with rich experience. + SDK Code Generation SpecialHeaders.Repeatability + 1.0.0-beta.1 + SpecialHeaders.Repeatability + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/tspCodeModel.json new file mode 100644 index 000000000000..56201c6018e8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/tspCodeModel.json @@ -0,0 +1,198 @@ +{ + "$id": "1", + "Name": "SpecialHeaders.Repeatability", + "ApiVersions": [], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "ImmediateSuccessResponseRepeatabilityResult", + "crossLanguageDefinitionId": "SpecialHeaders.Repeatability.immediateSuccess.ResponseRepeatabilityResult.anonymous", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "accepted", + "value": "accepted", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "rejected", + "value": "rejected", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "clientNamespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + } + ], + "Models": [], + "Clients": [ + { + "$id": "8", + "Name": "RepeatabilityClient", + "ClientNamespace": "SpecialHeaders.Repeatability", + "Doc": "Illustrates OASIS repeatability headers", + "Operations": [ + { + "$id": "9", + "Name": "immediateSuccess", + "ResourceName": "Repeatability", + "Doc": "Check we recognize Repeatability-Request-ID and Repeatability-First-Sent.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "10", + "Name": "repeatabilityRequestID", + "NameInRequest": "Repeatability-Request-ID", + "Type": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "12", + "Name": "repeatabilityFirstSent", + "NameInRequest": "Repeatability-First-Sent", + "Type": { + "$id": "13", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "15", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "16", + "Name": "repeatabilityResult", + "NameInResponse": "Repeatability-Result", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", + "Type": { + "$ref": "2" + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/repeatability/immediateSuccess", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.Repeatability.immediateSuccess", + "Decorators": [] + } + ], + "Protocol": { + "$id": "17" + }, + "Parameters": [ + { + "$id": "18", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "19", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "20", + "Type": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/Configuration.json new file mode 100644 index 000000000000..33a730cffea7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "SpecialWords", + "library-name": "SpecialWords" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/SpecialWords.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/SpecialWords.sln new file mode 100644 index 000000000000..8f36cfec1750 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/SpecialWords.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecialWords", "src\SpecialWords.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..c6675feebfd5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialWords +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..4185e7b8cd16 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialWords +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..c88f55bb5668 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialWords +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..bb077c4b5c86 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace SpecialWords +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs new file mode 100644 index 000000000000..fb93653fa6d4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using SpecialWords._Models; + +namespace SpecialWords +{ + public partial class ModelProperties + { + protected ModelProperties() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response SameAsModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task SameAsModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response SameAsModel(SameAsModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task SameAsModelAsync(SameAsModel body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs new file mode 100644 index 000000000000..a12b14f8971d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using SpecialWords._Models; + +namespace SpecialWords +{ + public partial class Models + { + protected Models() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response WithAnd(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithAndAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithAnd(And body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAndAsync(And body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAs(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithAsAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithAs(As body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAsAsync(As body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAssert(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithAssertAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithAssert(Assert body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAssertAsync(Assert body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithAsyncAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithAsync(Async body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAsyncAsync(Async body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAwait(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithAwaitAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithAwait(Await body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAwaitAsync(Await body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithBreak(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithBreakAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithBreak(Break body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithBreakAsync(Break body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithClass(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithClassAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithClass(Class body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithClassAsync(Class body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithConstructor(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithConstructorAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithConstructor(Constructor body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithConstructorAsync(Constructor body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithContinue(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithContinueAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithContinue(Continue body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithContinueAsync(Continue body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithDef(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithDefAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithDef(Def body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithDefAsync(Def body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithDel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithDelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithDel(Del body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithDelAsync(Del body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithElif(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithElifAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithElif(Elif body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithElifAsync(Elif body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithElse(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithElseAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithElse(Else body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithElseAsync(Else body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithExcept(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithExceptAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithExcept(Except body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithExceptAsync(Except body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithExec(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithExecAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithExec(Exec body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithExecAsync(Exec body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFinally(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithFinallyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithFinally(Finally body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithFinallyAsync(Finally body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFor(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithForAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithFor(For body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithForAsync(For body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFrom(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithFromAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithFrom(From body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithFromAsync(From body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithGlobal(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithGlobalAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithGlobal(Global body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithGlobalAsync(Global body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIf(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithIfAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithIf(If body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithIfAsync(If body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithImport(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithImportAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithImport(Import body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithImportAsync(Import body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIn(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithInAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithIn(In body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithInAsync(In body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIs(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithIsAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithIs(Is body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithIsAsync(Is body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithLambda(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithLambdaAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithLambda(Lambda body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithLambdaAsync(Lambda body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithNot(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithNotAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithNot(Not body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithNotAsync(Not body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithOr(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithOrAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithOr(Or body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithOrAsync(Or body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithPass(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithPassAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithPass(Pass body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithPassAsync(Pass body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithRaise(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithRaiseAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithRaise(Raise body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithRaiseAsync(Raise body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithReturn(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithReturnAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithReturn(Return body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithReturnAsync(Return body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithTry(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithTryAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithTry(Try body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithTryAsync(Try body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithWhile(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithWhileAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithWhile(While body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithWhileAsync(While body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithWith(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithWithAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithWith(With body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithWithAsync(With body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithYield(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task WithYieldAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response WithYield(Yield body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithYieldAsync(Yield body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.Serialization.cs new file mode 100644 index 000000000000..fcdad95eb6af --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class And : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + And IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual And JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + And IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual And PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(And @and) => throw null; + + public static explicit operator And(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.cs new file mode 100644 index 000000000000..8f304fb8611d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/And.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class And + { + public And(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.Serialization.cs new file mode 100644 index 000000000000..097f5925eb96 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class As : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + As IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual As JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + As IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual As PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(As @as) => throw null; + + public static explicit operator As(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.cs new file mode 100644 index 000000000000..8065025a2be6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/As.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class As + { + public As(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.Serialization.cs new file mode 100644 index 000000000000..8c874a71cee1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Assert : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Assert IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Assert JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Assert IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Assert PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Assert assert) => throw null; + + public static explicit operator Assert(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.cs new file mode 100644 index 000000000000..53c4c98d67d9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Assert.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Assert + { + public Assert(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.Serialization.cs new file mode 100644 index 000000000000..cdfe0e628b5b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Async : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Async IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Async JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Async IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Async PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Async @async) => throw null; + + public static explicit operator Async(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.cs new file mode 100644 index 000000000000..9d395e5541e5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Async.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Async + { + public Async(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.Serialization.cs new file mode 100644 index 000000000000..5a1fe3720612 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Await : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Await IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Await JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Await IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Await PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Await @await) => throw null; + + public static explicit operator Await(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.cs new file mode 100644 index 000000000000..7e8b145a7476 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Await.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Await + { + public Await(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.Serialization.cs new file mode 100644 index 000000000000..89f56329fc5c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Break : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Break IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Break JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Break IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Break PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Break @break) => throw null; + + public static explicit operator Break(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.cs new file mode 100644 index 000000000000..9f969eb2207f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Break.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Break + { + public Break(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.Serialization.cs new file mode 100644 index 000000000000..3e983a224fac --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Class : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Class IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Class JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Class IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Class PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Class @class) => throw null; + + public static explicit operator Class(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.cs new file mode 100644 index 000000000000..84a6036bbe3d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Class.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Class + { + public Class(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.Serialization.cs new file mode 100644 index 000000000000..ad3b86daadca --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Constructor : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Constructor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Constructor JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Constructor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Constructor PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Constructor constructor) => throw null; + + public static explicit operator Constructor(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.cs new file mode 100644 index 000000000000..6eb3d652cdea --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Constructor.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Constructor + { + public Constructor(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.Serialization.cs new file mode 100644 index 000000000000..4e43a1532cf8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Continue : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Continue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Continue JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Continue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Continue PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Continue @continue) => throw null; + + public static explicit operator Continue(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.cs new file mode 100644 index 000000000000..dde4822142f9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Continue.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Continue + { + public Continue(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.Serialization.cs new file mode 100644 index 000000000000..9689803ecb52 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Def : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Def IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Def JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Def IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Def PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Def def) => throw null; + + public static explicit operator Def(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.cs new file mode 100644 index 000000000000..160a56cac5c5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Def.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Def + { + public Def(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.Serialization.cs new file mode 100644 index 000000000000..a285404a1d44 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Del : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Del IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Del JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Del IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Del PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Del del) => throw null; + + public static explicit operator Del(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.cs new file mode 100644 index 000000000000..a1a156f8ae6f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Del.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Del + { + public Del(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.Serialization.cs new file mode 100644 index 000000000000..35d155401f4a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Elif : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Elif IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Elif JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Elif IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Elif PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Elif elif) => throw null; + + public static explicit operator Elif(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.cs new file mode 100644 index 000000000000..26ec92cdfe0a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Elif.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Elif + { + public Elif(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.Serialization.cs new file mode 100644 index 000000000000..2dd820a9f812 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Else : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Else IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Else JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Else IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Else PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Else @else) => throw null; + + public static explicit operator Else(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.cs new file mode 100644 index 000000000000..37244202b5cd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Else.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Else + { + public Else(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.Serialization.cs new file mode 100644 index 000000000000..4f431ab520f1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Except : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Except IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Except JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Except IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Except PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Except except) => throw null; + + public static explicit operator Except(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.cs new file mode 100644 index 000000000000..5af51eefc572 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Except.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Except + { + public Except(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.Serialization.cs new file mode 100644 index 000000000000..2446299ee282 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Exec : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Exec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Exec JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Exec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Exec PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Exec exec) => throw null; + + public static explicit operator Exec(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.cs new file mode 100644 index 000000000000..a67a2c894df0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Exec.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Exec + { + public Exec(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.Serialization.cs new file mode 100644 index 000000000000..34c1fb0aef8b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Finally : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Finally IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Finally JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Finally IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Finally PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Finally @finally) => throw null; + + public static explicit operator Finally(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.cs new file mode 100644 index 000000000000..83758d62cf99 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Finally.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Finally + { + public Finally(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.Serialization.cs new file mode 100644 index 000000000000..d5dc2a4e4cb4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class For : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + For IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual For JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + For IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual For PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(For @for) => throw null; + + public static explicit operator For(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.cs new file mode 100644 index 000000000000..0f5b02c0848e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/For.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class For + { + public For(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.Serialization.cs new file mode 100644 index 000000000000..ae5d89bbeb87 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class From : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + From IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual From JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + From IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual From PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(From @from) => throw null; + + public static explicit operator From(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.cs new file mode 100644 index 000000000000..bbbfe1cadb85 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/From.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class From + { + public From(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.Serialization.cs new file mode 100644 index 000000000000..16f7d75d283b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Global : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Global IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Global JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Global IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Global PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Global @global) => throw null; + + public static explicit operator Global(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.cs new file mode 100644 index 000000000000..3cc158711efe --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Global.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Global + { + public Global(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.Serialization.cs new file mode 100644 index 000000000000..7e6ec7769e40 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class If : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + If IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual If JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + If IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual If PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(If @if) => throw null; + + public static explicit operator If(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.cs new file mode 100644 index 000000000000..81263cdab599 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/If.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class If + { + public If(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.Serialization.cs new file mode 100644 index 000000000000..19837b4c1108 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Import : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Import IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Import JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Import IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Import PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Import import) => throw null; + + public static explicit operator Import(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.cs new file mode 100644 index 000000000000..4f924f4a29fb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Import.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Import + { + public Import(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.Serialization.cs new file mode 100644 index 000000000000..6ddca6662b22 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class In : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + In IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual In JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + In IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual In PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(In @in) => throw null; + + public static explicit operator In(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.cs new file mode 100644 index 000000000000..5c180a4b2ce0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/In.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class In + { + public In(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.Serialization.cs new file mode 100644 index 000000000000..23848f040629 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Is : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Is IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Is JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Is IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Is PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Is @is) => throw null; + + public static explicit operator Is(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.cs new file mode 100644 index 000000000000..137c5fad734a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Is.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Is + { + public Is(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.Serialization.cs new file mode 100644 index 000000000000..f076f27d05af --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Lambda : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Lambda IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Lambda JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Lambda IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Lambda PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Lambda lambda) => throw null; + + public static explicit operator Lambda(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.cs new file mode 100644 index 000000000000..4d54536e70c2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Lambda.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Lambda + { + public Lambda(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.Serialization.cs new file mode 100644 index 000000000000..a5d11d7cc4ef --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Not : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Not IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Not JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Not IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Not PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Not @not) => throw null; + + public static explicit operator Not(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.cs new file mode 100644 index 000000000000..847a0cdc8821 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Not.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Not + { + public Not(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.Serialization.cs new file mode 100644 index 000000000000..8ffc86e52944 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Or : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Or IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Or JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Or IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Or PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Or @or) => throw null; + + public static explicit operator Or(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.cs new file mode 100644 index 000000000000..0c56f1f74e53 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Or.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Or + { + public Or(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.Serialization.cs new file mode 100644 index 000000000000..bee6c3bb54cc --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Pass : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Pass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Pass JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Pass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Pass PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Pass pass) => throw null; + + public static explicit operator Pass(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.cs new file mode 100644 index 000000000000..90e76eb7f7e6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Pass.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Pass + { + public Pass(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.Serialization.cs new file mode 100644 index 000000000000..85d9dd5715a4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Raise : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Raise IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Raise JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Raise IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Raise PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Raise raise) => throw null; + + public static explicit operator Raise(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.cs new file mode 100644 index 000000000000..75ea3040042f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Raise.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Raise + { + public Raise(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.Serialization.cs new file mode 100644 index 000000000000..04d964fda385 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Return : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Return IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Return JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Return IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Return PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Return @return) => throw null; + + public static explicit operator Return(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.cs new file mode 100644 index 000000000000..7043c55ce96d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Return.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Return + { + public Return(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.Serialization.cs new file mode 100644 index 000000000000..d3012db05936 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class SameAsModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + SameAsModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual SameAsModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + SameAsModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual SameAsModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(SameAsModel sameAsModel) => throw null; + + public static explicit operator SameAsModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.cs new file mode 100644 index 000000000000..4d47bc25ae1e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SameAsModel.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class SameAsModel + { + public SameAsModel(string sameAsModelProperty) => throw null; + + public string SameAsModelProperty => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.Serialization.cs new file mode 100644 index 000000000000..187de25daa4e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Try : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Try IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Try JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Try IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Try PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Try @try) => throw null; + + public static explicit operator Try(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.cs new file mode 100644 index 000000000000..9b0bc93ebffb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Try.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Try + { + public Try(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.Serialization.cs new file mode 100644 index 000000000000..6971ed1eeb17 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class While : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + While IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual While JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + While IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual While PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(While @while) => throw null; + + public static explicit operator While(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.cs new file mode 100644 index 000000000000..66ec77a6e705 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/While.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class While + { + public While(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.Serialization.cs new file mode 100644 index 000000000000..8fdf25a03fd4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class With : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + With IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual With JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + With IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual With PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(With @with) => throw null; + + public static explicit operator With(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.cs new file mode 100644 index 000000000000..bbdcef9463a7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/With.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class With + { + public With(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.Serialization.cs new file mode 100644 index 000000000000..67e2694be622 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace SpecialWords._Models +{ + public partial class Yield : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Yield IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Yield JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Yield IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Yield PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Yield @yield) => throw null; + + public static explicit operator Yield(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.cs new file mode 100644 index 000000000000..f7c89a8ecb87 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/Yield.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public partial class Yield + { + public Yield(string name) => throw null; + + public string Name => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs new file mode 100644 index 000000000000..a76233518d9e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace SpecialWords +{ + public partial class Operations + { + protected Operations() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response And(RequestContext context) => throw null; + + public virtual Task AndAsync(RequestContext context) => throw null; + + public virtual Response And(CancellationToken cancellationToken = default) => throw null; + + public virtual Task AndAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response As(RequestContext context) => throw null; + + public virtual Task AsAsync(RequestContext context) => throw null; + + public virtual Response As(CancellationToken cancellationToken = default) => throw null; + + public virtual Task AsAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Assert(RequestContext context) => throw null; + + public virtual Task AssertAsync(RequestContext context) => throw null; + + public virtual Response Assert(CancellationToken cancellationToken = default) => throw null; + + public virtual Task AssertAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Async(RequestContext context) => throw null; + + public virtual Task AsyncAsync(RequestContext context) => throw null; + + public virtual Response Async(CancellationToken cancellationToken = default) => throw null; + + public virtual Task AsyncAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Await(RequestContext context) => throw null; + + public virtual Task AwaitAsync(RequestContext context) => throw null; + + public virtual Response Await(CancellationToken cancellationToken = default) => throw null; + + public virtual Task AwaitAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Break(RequestContext context) => throw null; + + public virtual Task BreakAsync(RequestContext context) => throw null; + + public virtual Response Break(CancellationToken cancellationToken = default) => throw null; + + public virtual Task BreakAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Class(RequestContext context) => throw null; + + public virtual Task ClassAsync(RequestContext context) => throw null; + + public virtual Response Class(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ClassAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Constructor(RequestContext context) => throw null; + + public virtual Task ConstructorAsync(RequestContext context) => throw null; + + public virtual Response Constructor(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ConstructorAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Continue(RequestContext context) => throw null; + + public virtual Task ContinueAsync(RequestContext context) => throw null; + + public virtual Response Continue(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ContinueAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Def(RequestContext context) => throw null; + + public virtual Task DefAsync(RequestContext context) => throw null; + + public virtual Response Def(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DefAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Del(RequestContext context) => throw null; + + public virtual Task DelAsync(RequestContext context) => throw null; + + public virtual Response Del(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DelAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Elif(RequestContext context) => throw null; + + public virtual Task ElifAsync(RequestContext context) => throw null; + + public virtual Response Elif(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ElifAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Else(RequestContext context) => throw null; + + public virtual Task ElseAsync(RequestContext context) => throw null; + + public virtual Response Else(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ElseAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Except(RequestContext context) => throw null; + + public virtual Task ExceptAsync(RequestContext context) => throw null; + + public virtual Response Except(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ExceptAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Exec(RequestContext context) => throw null; + + public virtual Task ExecAsync(RequestContext context) => throw null; + + public virtual Response Exec(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ExecAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Finally(RequestContext context) => throw null; + + public virtual Task FinallyAsync(RequestContext context) => throw null; + + public virtual Response Finally(CancellationToken cancellationToken = default) => throw null; + + public virtual Task FinallyAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response For(RequestContext context) => throw null; + + public virtual Task ForAsync(RequestContext context) => throw null; + + public virtual Response For(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ForAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response From(RequestContext context) => throw null; + + public virtual Task FromAsync(RequestContext context) => throw null; + + public virtual Response From(CancellationToken cancellationToken = default) => throw null; + + public virtual Task FromAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Global(RequestContext context) => throw null; + + public virtual Task GlobalAsync(RequestContext context) => throw null; + + public virtual Response Global(CancellationToken cancellationToken = default) => throw null; + + public virtual Task GlobalAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response If(RequestContext context) => throw null; + + public virtual Task IfAsync(RequestContext context) => throw null; + + public virtual Response If(CancellationToken cancellationToken = default) => throw null; + + public virtual Task IfAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Import(RequestContext context) => throw null; + + public virtual Task ImportAsync(RequestContext context) => throw null; + + public virtual Response Import(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ImportAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response In(RequestContext context) => throw null; + + public virtual Task InAsync(RequestContext context) => throw null; + + public virtual Response In(CancellationToken cancellationToken = default) => throw null; + + public virtual Task InAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Is(RequestContext context) => throw null; + + public virtual Task IsAsync(RequestContext context) => throw null; + + public virtual Response Is(CancellationToken cancellationToken = default) => throw null; + + public virtual Task IsAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Lambda(RequestContext context) => throw null; + + public virtual Task LambdaAsync(RequestContext context) => throw null; + + public virtual Response Lambda(CancellationToken cancellationToken = default) => throw null; + + public virtual Task LambdaAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Not(RequestContext context) => throw null; + + public virtual Task NotAsync(RequestContext context) => throw null; + + public virtual Response Not(CancellationToken cancellationToken = default) => throw null; + + public virtual Task NotAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Or(RequestContext context) => throw null; + + public virtual Task OrAsync(RequestContext context) => throw null; + + public virtual Response Or(CancellationToken cancellationToken = default) => throw null; + + public virtual Task OrAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Pass(RequestContext context) => throw null; + + public virtual Task PassAsync(RequestContext context) => throw null; + + public virtual Response Pass(CancellationToken cancellationToken = default) => throw null; + + public virtual Task PassAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Raise(RequestContext context) => throw null; + + public virtual Task RaiseAsync(RequestContext context) => throw null; + + public virtual Response Raise(CancellationToken cancellationToken = default) => throw null; + + public virtual Task RaiseAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Return(RequestContext context) => throw null; + + public virtual Task ReturnAsync(RequestContext context) => throw null; + + public virtual Response Return(CancellationToken cancellationToken = default) => throw null; + + public virtual Task ReturnAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Try(RequestContext context) => throw null; + + public virtual Task TryAsync(RequestContext context) => throw null; + + public virtual Response Try(CancellationToken cancellationToken = default) => throw null; + + public virtual Task TryAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response While(RequestContext context) => throw null; + + public virtual Task WhileAsync(RequestContext context) => throw null; + + public virtual Response While(CancellationToken cancellationToken = default) => throw null; + + public virtual Task WhileAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response With(RequestContext context) => throw null; + + public virtual Task WithAsync(RequestContext context) => throw null; + + public virtual Response With(CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response Yield(RequestContext context) => throw null; + + public virtual Task YieldAsync(RequestContext context) => throw null; + + public virtual Response Yield(CancellationToken cancellationToken = default) => throw null; + + public virtual Task YieldAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs new file mode 100644 index 000000000000..757108a291a0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; + +namespace SpecialWords +{ + public partial class Parameters + { + protected Parameters() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response WithAnd(string @and, RequestContext context) => throw null; + + public virtual Task WithAndAsync(string @and, RequestContext context) => throw null; + + public virtual Response WithAnd(string @and, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAndAsync(string @and, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAs(string @as, RequestContext context) => throw null; + + public virtual Task WithAsAsync(string @as, RequestContext context) => throw null; + + public virtual Response WithAs(string @as, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAsAsync(string @as, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAssert(string assert, RequestContext context) => throw null; + + public virtual Task WithAssertAsync(string assert, RequestContext context) => throw null; + + public virtual Response WithAssert(string assert, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAssertAsync(string assert, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAsync(string @async, RequestContext context) => throw null; + + public virtual Task WithAsyncAsync(string @async, RequestContext context) => throw null; + + public virtual Response WithAsync(string @async, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAsyncAsync(string @async, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithAwait(string @await, RequestContext context) => throw null; + + public virtual Task WithAwaitAsync(string @await, RequestContext context) => throw null; + + public virtual Response WithAwait(string @await, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAwaitAsync(string @await, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithBreak(string @break, RequestContext context) => throw null; + + public virtual Task WithBreakAsync(string @break, RequestContext context) => throw null; + + public virtual Response WithBreak(string @break, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithBreakAsync(string @break, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithClass(string @class, RequestContext context) => throw null; + + public virtual Task WithClassAsync(string @class, RequestContext context) => throw null; + + public virtual Response WithClass(string @class, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithClassAsync(string @class, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithConstructor(string constructor, RequestContext context) => throw null; + + public virtual Task WithConstructorAsync(string constructor, RequestContext context) => throw null; + + public virtual Response WithConstructor(string constructor, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithConstructorAsync(string constructor, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithContinue(string @continue, RequestContext context) => throw null; + + public virtual Task WithContinueAsync(string @continue, RequestContext context) => throw null; + + public virtual Response WithContinue(string @continue, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithContinueAsync(string @continue, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithDef(string def, RequestContext context) => throw null; + + public virtual Task WithDefAsync(string def, RequestContext context) => throw null; + + public virtual Response WithDef(string def, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithDefAsync(string def, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithDel(string del, RequestContext context) => throw null; + + public virtual Task WithDelAsync(string del, RequestContext context) => throw null; + + public virtual Response WithDel(string del, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithDelAsync(string del, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithElif(string elif, RequestContext context) => throw null; + + public virtual Task WithElifAsync(string elif, RequestContext context) => throw null; + + public virtual Response WithElif(string elif, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithElifAsync(string elif, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithElse(string @else, RequestContext context) => throw null; + + public virtual Task WithElseAsync(string @else, RequestContext context) => throw null; + + public virtual Response WithElse(string @else, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithElseAsync(string @else, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithExcept(string except, RequestContext context) => throw null; + + public virtual Task WithExceptAsync(string except, RequestContext context) => throw null; + + public virtual Response WithExcept(string except, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithExceptAsync(string except, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithExec(string exec, RequestContext context) => throw null; + + public virtual Task WithExecAsync(string exec, RequestContext context) => throw null; + + public virtual Response WithExec(string exec, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithExecAsync(string exec, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFinally(string @finally, RequestContext context) => throw null; + + public virtual Task WithFinallyAsync(string @finally, RequestContext context) => throw null; + + public virtual Response WithFinally(string @finally, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithFinallyAsync(string @finally, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFor(string @for, RequestContext context) => throw null; + + public virtual Task WithForAsync(string @for, RequestContext context) => throw null; + + public virtual Response WithFor(string @for, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithForAsync(string @for, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithFrom(string @from, RequestContext context) => throw null; + + public virtual Task WithFromAsync(string @from, RequestContext context) => throw null; + + public virtual Response WithFrom(string @from, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithFromAsync(string @from, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithGlobal(string @global, RequestContext context) => throw null; + + public virtual Task WithGlobalAsync(string @global, RequestContext context) => throw null; + + public virtual Response WithGlobal(string @global, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithGlobalAsync(string @global, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIf(string @if, RequestContext context) => throw null; + + public virtual Task WithIfAsync(string @if, RequestContext context) => throw null; + + public virtual Response WithIf(string @if, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithIfAsync(string @if, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithImport(string import, RequestContext context) => throw null; + + public virtual Task WithImportAsync(string import, RequestContext context) => throw null; + + public virtual Response WithImport(string import, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithImportAsync(string import, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIn(string @in, RequestContext context) => throw null; + + public virtual Task WithInAsync(string @in, RequestContext context) => throw null; + + public virtual Response WithIn(string @in, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithInAsync(string @in, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithIs(string @is, RequestContext context) => throw null; + + public virtual Task WithIsAsync(string @is, RequestContext context) => throw null; + + public virtual Response WithIs(string @is, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithIsAsync(string @is, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithLambda(string lambda, RequestContext context) => throw null; + + public virtual Task WithLambdaAsync(string lambda, RequestContext context) => throw null; + + public virtual Response WithLambda(string lambda, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithLambdaAsync(string lambda, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithNot(string @not, RequestContext context) => throw null; + + public virtual Task WithNotAsync(string @not, RequestContext context) => throw null; + + public virtual Response WithNot(string @not, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithNotAsync(string @not, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithOr(string @or, RequestContext context) => throw null; + + public virtual Task WithOrAsync(string @or, RequestContext context) => throw null; + + public virtual Response WithOr(string @or, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithOrAsync(string @or, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithPass(string pass, RequestContext context) => throw null; + + public virtual Task WithPassAsync(string pass, RequestContext context) => throw null; + + public virtual Response WithPass(string pass, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithPassAsync(string pass, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithRaise(string raise, RequestContext context) => throw null; + + public virtual Task WithRaiseAsync(string raise, RequestContext context) => throw null; + + public virtual Response WithRaise(string raise, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithRaiseAsync(string raise, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithReturn(string @return, RequestContext context) => throw null; + + public virtual Task WithReturnAsync(string @return, RequestContext context) => throw null; + + public virtual Response WithReturn(string @return, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithReturnAsync(string @return, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithTry(string @try, RequestContext context) => throw null; + + public virtual Task WithTryAsync(string @try, RequestContext context) => throw null; + + public virtual Response WithTry(string @try, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithTryAsync(string @try, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithWhile(string @while, RequestContext context) => throw null; + + public virtual Task WithWhileAsync(string @while, RequestContext context) => throw null; + + public virtual Response WithWhile(string @while, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithWhileAsync(string @while, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithWith(string @with, RequestContext context) => throw null; + + public virtual Task WithWithAsync(string @with, RequestContext context) => throw null; + + public virtual Response WithWith(string @with, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithWithAsync(string @with, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithYield(string @yield, RequestContext context) => throw null; + + public virtual Task WithYieldAsync(string @yield, RequestContext context) => throw null; + + public virtual Response WithYield(string @yield, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithYieldAsync(string @yield, CancellationToken cancellationToken = default) => throw null; + + public virtual Response WithCancellationToken(string cancellationToken, RequestContext context) => throw null; + + public virtual Task WithCancellationTokenAsync(string cancellationToken, RequestContext context) => throw null; + + public virtual Response WithCancellationToken(string cancellationToken, CancellationToken cancellationToken0 = default) => throw null; + + public virtual Task WithCancellationTokenAsync(string cancellationToken, CancellationToken cancellationToken0 = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs new file mode 100644 index 000000000000..cd2ebdd38b35 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace SpecialWords +{ + public partial class SpecialWordsClient + { + public SpecialWordsClient() : this(new Uri("http://localhost:3000"), new SpecialWordsClientOptions()) => throw null; + + public SpecialWordsClient(Uri endpoint, SpecialWordsClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Models GetModelsClient() => throw null; + + public virtual ModelProperties GetModelPropertiesClient() => throw null; + + public virtual Operations GetOperationsClient() => throw null; + + public virtual Parameters GetParametersClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs new file mode 100644 index 000000000000..2c6f0891619d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace SpecialWords +{ + public partial class SpecialWordsClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs new file mode 100644 index 000000000000..051f27ab1c5d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace SpecialWords._Models +{ + public static partial class SpecialWordsModelFactory + { + public static SameAsModel SameAsModel(string sameAsModelProperty = default) => throw null; + + public static And And(string name = default) => throw null; + + public static As As(string name = default) => throw null; + + public static Assert Assert(string name = default) => throw null; + + public static Async Async(string name = default) => throw null; + + public static Await Await(string name = default) => throw null; + + public static Break Break(string name = default) => throw null; + + public static Class Class(string name = default) => throw null; + + public static Constructor Constructor(string name = default) => throw null; + + public static Continue Continue(string name = default) => throw null; + + public static Def Def(string name = default) => throw null; + + public static Del Del(string name = default) => throw null; + + public static Elif Elif(string name = default) => throw null; + + public static Else Else(string name = default) => throw null; + + public static Except Except(string name = default) => throw null; + + public static Exec Exec(string name = default) => throw null; + + public static Finally Finally(string name = default) => throw null; + + public static For For(string name = default) => throw null; + + public static From From(string name = default) => throw null; + + public static Global Global(string name = default) => throw null; + + public static If If(string name = default) => throw null; + + public static Import Import(string name = default) => throw null; + + public static In In(string name = default) => throw null; + + public static Is Is(string name = default) => throw null; + + public static Lambda Lambda(string name = default) => throw null; + + public static Not Not(string name = default) => throw null; + + public static Or Or(string name = default) => throw null; + + public static Pass Pass(string name = default) => throw null; + + public static Raise Raise(string name = default) => throw null; + + public static Return Return(string name = default) => throw null; + + public static Try Try(string name = default) => throw null; + + public static While While(string name = default) => throw null; + + public static With With(string name = default) => throw null; + + public static Yield Yield(string name = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/SpecialWords.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/SpecialWords.csproj new file mode 100644 index 000000000000..d3521890453f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/SpecialWords.csproj @@ -0,0 +1,14 @@ + + + This is the SpecialWords client library for developing .NET applications with rich experience. + SDK Code Generation SpecialWords + 1.0.0-beta.1 + SpecialWords + true + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json new file mode 100644 index 000000000000..d2165fc702ff --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/tspCodeModel.json @@ -0,0 +1,6637 @@ +{ + "$id": "1", + "Name": "SpecialWords", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "SameAsModel", + "clientNamespace": "SpecialWords.ModelProperties", + "crossLanguageDefinitionId": "SpecialWords.ModelProperties.SameAsModel", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "SameAsModel", + "serializedName": "SameAsModel", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.ModelProperties.SameAsModel.SameAsModel", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "SameAsModel" + } + } + } + ] + }, + { + "$id": "7", + "kind": "model", + "name": "and", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.and", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.and.name", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "name" + } + } + } + ] + }, + { + "$id": "12", + "kind": "model", + "name": "as", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.as", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.as.name", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "name" + } + } + } + ] + }, + { + "$id": "17", + "kind": "model", + "name": "assert", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.assert", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "18", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.assert.name", + "serializationOptions": { + "$id": "20", + "json": { + "$id": "21", + "name": "name" + } + } + } + ] + }, + { + "$id": "22", + "kind": "model", + "name": "async", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.async", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "23", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.async.name", + "serializationOptions": { + "$id": "25", + "json": { + "$id": "26", + "name": "name" + } + } + } + ] + }, + { + "$id": "27", + "kind": "model", + "name": "await", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.await", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "28", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.await.name", + "serializationOptions": { + "$id": "30", + "json": { + "$id": "31", + "name": "name" + } + } + } + ] + }, + { + "$id": "32", + "kind": "model", + "name": "break", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.break", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "33", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.break.name", + "serializationOptions": { + "$id": "35", + "json": { + "$id": "36", + "name": "name" + } + } + } + ] + }, + { + "$id": "37", + "kind": "model", + "name": "class", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.class", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "38", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.class.name", + "serializationOptions": { + "$id": "40", + "json": { + "$id": "41", + "name": "name" + } + } + } + ] + }, + { + "$id": "42", + "kind": "model", + "name": "constructor", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.constructor", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "43", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "44", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.constructor.name", + "serializationOptions": { + "$id": "45", + "json": { + "$id": "46", + "name": "name" + } + } + } + ] + }, + { + "$id": "47", + "kind": "model", + "name": "continue", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.continue", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "48", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.continue.name", + "serializationOptions": { + "$id": "50", + "json": { + "$id": "51", + "name": "name" + } + } + } + ] + }, + { + "$id": "52", + "kind": "model", + "name": "def", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.def", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "53", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "54", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.def.name", + "serializationOptions": { + "$id": "55", + "json": { + "$id": "56", + "name": "name" + } + } + } + ] + }, + { + "$id": "57", + "kind": "model", + "name": "del", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.del", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "58", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.del.name", + "serializationOptions": { + "$id": "60", + "json": { + "$id": "61", + "name": "name" + } + } + } + ] + }, + { + "$id": "62", + "kind": "model", + "name": "elif", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.elif", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "63", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "64", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.elif.name", + "serializationOptions": { + "$id": "65", + "json": { + "$id": "66", + "name": "name" + } + } + } + ] + }, + { + "$id": "67", + "kind": "model", + "name": "else", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.else", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "68", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.else.name", + "serializationOptions": { + "$id": "70", + "json": { + "$id": "71", + "name": "name" + } + } + } + ] + }, + { + "$id": "72", + "kind": "model", + "name": "except", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.except", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "73", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "74", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.except.name", + "serializationOptions": { + "$id": "75", + "json": { + "$id": "76", + "name": "name" + } + } + } + ] + }, + { + "$id": "77", + "kind": "model", + "name": "exec", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.exec", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "78", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.exec.name", + "serializationOptions": { + "$id": "80", + "json": { + "$id": "81", + "name": "name" + } + } + } + ] + }, + { + "$id": "82", + "kind": "model", + "name": "finally", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.finally", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "83", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.finally.name", + "serializationOptions": { + "$id": "85", + "json": { + "$id": "86", + "name": "name" + } + } + } + ] + }, + { + "$id": "87", + "kind": "model", + "name": "for", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.for", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "88", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.for.name", + "serializationOptions": { + "$id": "90", + "json": { + "$id": "91", + "name": "name" + } + } + } + ] + }, + { + "$id": "92", + "kind": "model", + "name": "from", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.from", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "93", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "94", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.from.name", + "serializationOptions": { + "$id": "95", + "json": { + "$id": "96", + "name": "name" + } + } + } + ] + }, + { + "$id": "97", + "kind": "model", + "name": "global", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.global", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "98", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.global.name", + "serializationOptions": { + "$id": "100", + "json": { + "$id": "101", + "name": "name" + } + } + } + ] + }, + { + "$id": "102", + "kind": "model", + "name": "if", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.if", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "103", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "104", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.if.name", + "serializationOptions": { + "$id": "105", + "json": { + "$id": "106", + "name": "name" + } + } + } + ] + }, + { + "$id": "107", + "kind": "model", + "name": "import", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.import", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "108", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.import.name", + "serializationOptions": { + "$id": "110", + "json": { + "$id": "111", + "name": "name" + } + } + } + ] + }, + { + "$id": "112", + "kind": "model", + "name": "in", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.in", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "113", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.in.name", + "serializationOptions": { + "$id": "115", + "json": { + "$id": "116", + "name": "name" + } + } + } + ] + }, + { + "$id": "117", + "kind": "model", + "name": "is", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.is", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "118", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.is.name", + "serializationOptions": { + "$id": "120", + "json": { + "$id": "121", + "name": "name" + } + } + } + ] + }, + { + "$id": "122", + "kind": "model", + "name": "lambda", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.lambda", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "123", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "124", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.lambda.name", + "serializationOptions": { + "$id": "125", + "json": { + "$id": "126", + "name": "name" + } + } + } + ] + }, + { + "$id": "127", + "kind": "model", + "name": "not", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.not", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "128", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.not.name", + "serializationOptions": { + "$id": "130", + "json": { + "$id": "131", + "name": "name" + } + } + } + ] + }, + { + "$id": "132", + "kind": "model", + "name": "or", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.or", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "133", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.or.name", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "name" + } + } + } + ] + }, + { + "$id": "137", + "kind": "model", + "name": "pass", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.pass", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "138", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.pass.name", + "serializationOptions": { + "$id": "140", + "json": { + "$id": "141", + "name": "name" + } + } + } + ] + }, + { + "$id": "142", + "kind": "model", + "name": "raise", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.raise", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "143", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.raise.name", + "serializationOptions": { + "$id": "145", + "json": { + "$id": "146", + "name": "name" + } + } + } + ] + }, + { + "$id": "147", + "kind": "model", + "name": "return", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.return", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "148", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.return.name", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "name" + } + } + } + ] + }, + { + "$id": "152", + "kind": "model", + "name": "try", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.try", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "153", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "154", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.try.name", + "serializationOptions": { + "$id": "155", + "json": { + "$id": "156", + "name": "name" + } + } + } + ] + }, + { + "$id": "157", + "kind": "model", + "name": "while", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.while", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "158", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.while.name", + "serializationOptions": { + "$id": "160", + "json": { + "$id": "161", + "name": "name" + } + } + } + ] + }, + { + "$id": "162", + "kind": "model", + "name": "with", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.with", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "163", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.with.name", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "name" + } + } + } + ] + }, + { + "$id": "167", + "kind": "model", + "name": "yield", + "clientNamespace": "SpecialWords.Models", + "crossLanguageDefinitionId": "SpecialWords.Models.yield", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "168", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "SpecialWords.Models.yield.name", + "serializationOptions": { + "$id": "170", + "json": { + "$id": "171", + "name": "name" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "172", + "Name": "SpecialWordsClient", + "ClientNamespace": "SpecialWords", + "Doc": "Scenarios to verify that reserved words can be used in service and generators will handle it appropriately.\n\nCurrent list of special words\n```txt\nand\nas\nassert\nasync\nawait\nbreak\nclass\nconstructor\ncontinue\ndef\ndel\nelif\nelse\nexcept\nexec\nfinally\nfor\nfrom\nglobal\nif\nimport\nin\nis\nlambda\nnot\nor\npass\nraise\nreturn\ntry\nwhile\nwith\nyield\n```", + "Operations": [], + "Protocol": { + "$id": "173" + }, + "Parameters": [ + { + "$id": "174", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "175", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "176", + "Type": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "178", + "Name": "Models", + "ClientNamespace": "SpecialWords.Models", + "Doc": "Verify model names", + "Operations": [ + { + "$id": "179", + "Name": "withAnd", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "180", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "181", + "kind": "constant", + "valueType": { + "$id": "182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "183", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "7" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "184", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/and", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withAnd", + "Decorators": [] + }, + { + "$id": "185", + "Name": "withAs", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "186", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "187", + "kind": "constant", + "valueType": { + "$id": "188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "189", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "190", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/as", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withAs", + "Decorators": [] + }, + { + "$id": "191", + "Name": "withAssert", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "192", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "193", + "kind": "constant", + "valueType": { + "$id": "194", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "195", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "17" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "196", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/assert", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withAssert", + "Decorators": [] + }, + { + "$id": "197", + "Name": "withAsync", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "198", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "199", + "kind": "constant", + "valueType": { + "$id": "200", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "201", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "22" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "202", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/async", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withAsync", + "Decorators": [] + }, + { + "$id": "203", + "Name": "withAwait", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "204", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "205", + "kind": "constant", + "valueType": { + "$id": "206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "207", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "27" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "208", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/await", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withAwait", + "Decorators": [] + }, + { + "$id": "209", + "Name": "withBreak", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "210", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "211", + "kind": "constant", + "valueType": { + "$id": "212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "213", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "32" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "214", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/break", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withBreak", + "Decorators": [] + }, + { + "$id": "215", + "Name": "withClass", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "216", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "217", + "kind": "constant", + "valueType": { + "$id": "218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "219", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "37" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "220", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/class", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withClass", + "Decorators": [] + }, + { + "$id": "221", + "Name": "withConstructor", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "222", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "223", + "kind": "constant", + "valueType": { + "$id": "224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "225", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "42" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "226", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/constructor", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withConstructor", + "Decorators": [] + }, + { + "$id": "227", + "Name": "withContinue", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "228", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "229", + "kind": "constant", + "valueType": { + "$id": "230", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "231", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "47" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "232", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/continue", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withContinue", + "Decorators": [] + }, + { + "$id": "233", + "Name": "withDef", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "234", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "235", + "kind": "constant", + "valueType": { + "$id": "236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "237", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "52" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "238", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/def", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withDef", + "Decorators": [] + }, + { + "$id": "239", + "Name": "withDel", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "240", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "241", + "kind": "constant", + "valueType": { + "$id": "242", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "243", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "57" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "244", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/del", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withDel", + "Decorators": [] + }, + { + "$id": "245", + "Name": "withElif", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "246", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "247", + "kind": "constant", + "valueType": { + "$id": "248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "249", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "62" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "250", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/elif", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withElif", + "Decorators": [] + }, + { + "$id": "251", + "Name": "withElse", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "252", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "253", + "kind": "constant", + "valueType": { + "$id": "254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "255", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "67" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "256", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/else", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withElse", + "Decorators": [] + }, + { + "$id": "257", + "Name": "withExcept", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "258", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "259", + "kind": "constant", + "valueType": { + "$id": "260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "261", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "72" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "262", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/except", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withExcept", + "Decorators": [] + }, + { + "$id": "263", + "Name": "withExec", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "264", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "265", + "kind": "constant", + "valueType": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "267", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "77" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "268", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/exec", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withExec", + "Decorators": [] + }, + { + "$id": "269", + "Name": "withFinally", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "270", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "271", + "kind": "constant", + "valueType": { + "$id": "272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "273", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "82" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "274", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/finally", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withFinally", + "Decorators": [] + }, + { + "$id": "275", + "Name": "withFor", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "276", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "277", + "kind": "constant", + "valueType": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "279", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "87" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "280", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/for", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withFor", + "Decorators": [] + }, + { + "$id": "281", + "Name": "withFrom", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "282", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "283", + "kind": "constant", + "valueType": { + "$id": "284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "285", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "92" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "286", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/from", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withFrom", + "Decorators": [] + }, + { + "$id": "287", + "Name": "withGlobal", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "288", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "289", + "kind": "constant", + "valueType": { + "$id": "290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "291", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "97" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "292", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/global", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withGlobal", + "Decorators": [] + }, + { + "$id": "293", + "Name": "withIf", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "294", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "295", + "kind": "constant", + "valueType": { + "$id": "296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "297", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "102" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "298", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/if", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withIf", + "Decorators": [] + }, + { + "$id": "299", + "Name": "withImport", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "300", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "301", + "kind": "constant", + "valueType": { + "$id": "302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "303", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "107" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "304", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/import", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withImport", + "Decorators": [] + }, + { + "$id": "305", + "Name": "withIn", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "306", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "307", + "kind": "constant", + "valueType": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "309", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "112" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "310", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/in", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withIn", + "Decorators": [] + }, + { + "$id": "311", + "Name": "withIs", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "312", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "313", + "kind": "constant", + "valueType": { + "$id": "314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "315", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "117" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "316", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/is", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withIs", + "Decorators": [] + }, + { + "$id": "317", + "Name": "withLambda", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "318", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "319", + "kind": "constant", + "valueType": { + "$id": "320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "321", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "122" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "322", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/lambda", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withLambda", + "Decorators": [] + }, + { + "$id": "323", + "Name": "withNot", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "324", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "325", + "kind": "constant", + "valueType": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "327", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "127" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "328", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/not", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withNot", + "Decorators": [] + }, + { + "$id": "329", + "Name": "withOr", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "330", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "331", + "kind": "constant", + "valueType": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "333", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "132" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "334", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/or", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withOr", + "Decorators": [] + }, + { + "$id": "335", + "Name": "withPass", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "336", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "337", + "kind": "constant", + "valueType": { + "$id": "338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "339", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "137" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "340", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/pass", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withPass", + "Decorators": [] + }, + { + "$id": "341", + "Name": "withRaise", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "342", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "343", + "kind": "constant", + "valueType": { + "$id": "344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "345", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "142" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "346", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/raise", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withRaise", + "Decorators": [] + }, + { + "$id": "347", + "Name": "withReturn", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "348", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "349", + "kind": "constant", + "valueType": { + "$id": "350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "351", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "147" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "352", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/return", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withReturn", + "Decorators": [] + }, + { + "$id": "353", + "Name": "withTry", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "354", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "355", + "kind": "constant", + "valueType": { + "$id": "356", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "357", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "152" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "358", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/try", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withTry", + "Decorators": [] + }, + { + "$id": "359", + "Name": "withWhile", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "360", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "361", + "kind": "constant", + "valueType": { + "$id": "362", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "363", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "157" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "364", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/while", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withWhile", + "Decorators": [] + }, + { + "$id": "365", + "Name": "withWith", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "366", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "367", + "kind": "constant", + "valueType": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "369", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "162" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "370", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/with", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withWith", + "Decorators": [] + }, + { + "$id": "371", + "Name": "withYield", + "ResourceName": "Models", + "Accessibility": "public", + "Parameters": [ + { + "$id": "372", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "373", + "kind": "constant", + "valueType": { + "$id": "374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "375", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "167" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "376", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/models/yield", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Models.withYield", + "Decorators": [] + } + ], + "Protocol": { + "$id": "377" + }, + "Parent": "SpecialWordsClient", + "Parameters": [ + { + "$id": "378", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "379", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "380", + "Type": { + "$id": "381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "382", + "Name": "ModelProperties", + "ClientNamespace": "SpecialWords.ModelProperties", + "Doc": "Verify model names", + "Operations": [ + { + "$id": "383", + "Name": "sameAsModel", + "ResourceName": "ModelProperties", + "Accessibility": "public", + "Parameters": [ + { + "$id": "384", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "385", + "kind": "constant", + "valueType": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "387", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "388", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/special-words/model-properties/same-as-model", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.ModelProperties.sameAsModel", + "Decorators": [] + } + ], + "Protocol": { + "$id": "389" + }, + "Parent": "SpecialWordsClient", + "Parameters": [ + { + "$id": "390", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "391", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "392", + "Type": { + "$id": "393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "394", + "Name": "Operations", + "ClientNamespace": "SpecialWords", + "Doc": "Test reserved words as operation name.", + "Operations": [ + { + "$id": "395", + "Name": "and", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "396", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/and", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.and", + "Decorators": [] + }, + { + "$id": "397", + "Name": "as", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "398", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/as", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.as", + "Decorators": [] + }, + { + "$id": "399", + "Name": "assert", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "400", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/assert", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.assert", + "Decorators": [] + }, + { + "$id": "401", + "Name": "async", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "402", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/async", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.async", + "Decorators": [] + }, + { + "$id": "403", + "Name": "await", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "404", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/await", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.await", + "Decorators": [] + }, + { + "$id": "405", + "Name": "break", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "406", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/break", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.break", + "Decorators": [] + }, + { + "$id": "407", + "Name": "class", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "408", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/class", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.class", + "Decorators": [] + }, + { + "$id": "409", + "Name": "constructor", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "410", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/constructor", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.constructor", + "Decorators": [] + }, + { + "$id": "411", + "Name": "continue", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "412", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/continue", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.continue", + "Decorators": [] + }, + { + "$id": "413", + "Name": "def", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "414", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/def", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.def", + "Decorators": [] + }, + { + "$id": "415", + "Name": "del", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "416", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/del", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.del", + "Decorators": [] + }, + { + "$id": "417", + "Name": "elif", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "418", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/elif", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.elif", + "Decorators": [] + }, + { + "$id": "419", + "Name": "else", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "420", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/else", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.else", + "Decorators": [] + }, + { + "$id": "421", + "Name": "except", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "422", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/except", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.except", + "Decorators": [] + }, + { + "$id": "423", + "Name": "exec", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "424", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/exec", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.exec", + "Decorators": [] + }, + { + "$id": "425", + "Name": "finally", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "426", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/finally", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.finally", + "Decorators": [] + }, + { + "$id": "427", + "Name": "for", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "428", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/for", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.for", + "Decorators": [] + }, + { + "$id": "429", + "Name": "from", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "430", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/from", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.from", + "Decorators": [] + }, + { + "$id": "431", + "Name": "global", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "432", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/global", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.global", + "Decorators": [] + }, + { + "$id": "433", + "Name": "if", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "434", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/if", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.if", + "Decorators": [] + }, + { + "$id": "435", + "Name": "import", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "436", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/import", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.import", + "Decorators": [] + }, + { + "$id": "437", + "Name": "in", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "438", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/in", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.in", + "Decorators": [] + }, + { + "$id": "439", + "Name": "is", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "440", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/is", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.is", + "Decorators": [] + }, + { + "$id": "441", + "Name": "lambda", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "442", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/lambda", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.lambda", + "Decorators": [] + }, + { + "$id": "443", + "Name": "not", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "444", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/not", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.not", + "Decorators": [] + }, + { + "$id": "445", + "Name": "or", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "446", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/or", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.or", + "Decorators": [] + }, + { + "$id": "447", + "Name": "pass", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "448", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/pass", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.pass", + "Decorators": [] + }, + { + "$id": "449", + "Name": "raise", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "450", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/raise", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.raise", + "Decorators": [] + }, + { + "$id": "451", + "Name": "return", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "452", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/return", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.return", + "Decorators": [] + }, + { + "$id": "453", + "Name": "try", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "454", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/try", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.try", + "Decorators": [] + }, + { + "$id": "455", + "Name": "while", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "456", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/while", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.while", + "Decorators": [] + }, + { + "$id": "457", + "Name": "with", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "458", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/with", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.with", + "Decorators": [] + }, + { + "$id": "459", + "Name": "yield", + "ResourceName": "Operations", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "460", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/operations/yield", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Operations.yield", + "Decorators": [] + } + ], + "Protocol": { + "$id": "461" + }, + "Parent": "SpecialWordsClient", + "Parameters": [ + { + "$id": "462", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "463", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "464", + "Type": { + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "466", + "Name": "Parameters", + "ClientNamespace": "SpecialWords", + "Doc": "Verify reserved words as parameter name.", + "Operations": [ + { + "$id": "467", + "Name": "withAnd", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "468", + "Name": "and", + "NameInRequest": "and", + "Type": { + "$id": "469", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "470", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/and", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withAnd", + "Decorators": [] + }, + { + "$id": "471", + "Name": "withAs", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "472", + "Name": "as", + "NameInRequest": "as", + "Type": { + "$id": "473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "474", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/as", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withAs", + "Decorators": [] + }, + { + "$id": "475", + "Name": "withAssert", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "476", + "Name": "assert", + "NameInRequest": "assert", + "Type": { + "$id": "477", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "478", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/assert", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withAssert", + "Decorators": [] + }, + { + "$id": "479", + "Name": "withAsync", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "480", + "Name": "async", + "NameInRequest": "async", + "Type": { + "$id": "481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "482", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/async", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withAsync", + "Decorators": [] + }, + { + "$id": "483", + "Name": "withAwait", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "484", + "Name": "await", + "NameInRequest": "await", + "Type": { + "$id": "485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "486", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/await", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withAwait", + "Decorators": [] + }, + { + "$id": "487", + "Name": "withBreak", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "488", + "Name": "break", + "NameInRequest": "break", + "Type": { + "$id": "489", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "490", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/break", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withBreak", + "Decorators": [] + }, + { + "$id": "491", + "Name": "withClass", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "492", + "Name": "class", + "NameInRequest": "class", + "Type": { + "$id": "493", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "494", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/class", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withClass", + "Decorators": [] + }, + { + "$id": "495", + "Name": "withConstructor", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "496", + "Name": "constructor", + "NameInRequest": "constructor", + "Type": { + "$id": "497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "498", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/constructor", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withConstructor", + "Decorators": [] + }, + { + "$id": "499", + "Name": "withContinue", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "500", + "Name": "continue", + "NameInRequest": "continue", + "Type": { + "$id": "501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "502", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/continue", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withContinue", + "Decorators": [] + }, + { + "$id": "503", + "Name": "withDef", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "504", + "Name": "def", + "NameInRequest": "def", + "Type": { + "$id": "505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "506", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/def", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withDef", + "Decorators": [] + }, + { + "$id": "507", + "Name": "withDel", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "508", + "Name": "del", + "NameInRequest": "del", + "Type": { + "$id": "509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "510", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/del", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withDel", + "Decorators": [] + }, + { + "$id": "511", + "Name": "withElif", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "512", + "Name": "elif", + "NameInRequest": "elif", + "Type": { + "$id": "513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "514", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/elif", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withElif", + "Decorators": [] + }, + { + "$id": "515", + "Name": "withElse", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "516", + "Name": "else", + "NameInRequest": "else", + "Type": { + "$id": "517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "518", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/else", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withElse", + "Decorators": [] + }, + { + "$id": "519", + "Name": "withExcept", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "520", + "Name": "except", + "NameInRequest": "except", + "Type": { + "$id": "521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "522", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/except", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withExcept", + "Decorators": [] + }, + { + "$id": "523", + "Name": "withExec", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "524", + "Name": "exec", + "NameInRequest": "exec", + "Type": { + "$id": "525", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "526", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/exec", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withExec", + "Decorators": [] + }, + { + "$id": "527", + "Name": "withFinally", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "528", + "Name": "finally", + "NameInRequest": "finally", + "Type": { + "$id": "529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "530", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/finally", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withFinally", + "Decorators": [] + }, + { + "$id": "531", + "Name": "withFor", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "532", + "Name": "for", + "NameInRequest": "for", + "Type": { + "$id": "533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "534", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/for", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withFor", + "Decorators": [] + }, + { + "$id": "535", + "Name": "withFrom", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "536", + "Name": "from", + "NameInRequest": "from", + "Type": { + "$id": "537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "538", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/from", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withFrom", + "Decorators": [] + }, + { + "$id": "539", + "Name": "withGlobal", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "540", + "Name": "global", + "NameInRequest": "global", + "Type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "542", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/global", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withGlobal", + "Decorators": [] + }, + { + "$id": "543", + "Name": "withIf", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "544", + "Name": "if", + "NameInRequest": "if", + "Type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "546", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/if", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withIf", + "Decorators": [] + }, + { + "$id": "547", + "Name": "withImport", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "548", + "Name": "import", + "NameInRequest": "import", + "Type": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "550", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/import", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withImport", + "Decorators": [] + }, + { + "$id": "551", + "Name": "withIn", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "552", + "Name": "in", + "NameInRequest": "in", + "Type": { + "$id": "553", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "554", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/in", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withIn", + "Decorators": [] + }, + { + "$id": "555", + "Name": "withIs", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "556", + "Name": "is", + "NameInRequest": "is", + "Type": { + "$id": "557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "558", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/is", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withIs", + "Decorators": [] + }, + { + "$id": "559", + "Name": "withLambda", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "560", + "Name": "lambda", + "NameInRequest": "lambda", + "Type": { + "$id": "561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "562", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/lambda", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withLambda", + "Decorators": [] + }, + { + "$id": "563", + "Name": "withNot", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "564", + "Name": "not", + "NameInRequest": "not", + "Type": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "566", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/not", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withNot", + "Decorators": [] + }, + { + "$id": "567", + "Name": "withOr", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "568", + "Name": "or", + "NameInRequest": "or", + "Type": { + "$id": "569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "570", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/or", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withOr", + "Decorators": [] + }, + { + "$id": "571", + "Name": "withPass", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "572", + "Name": "pass", + "NameInRequest": "pass", + "Type": { + "$id": "573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "574", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/pass", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withPass", + "Decorators": [] + }, + { + "$id": "575", + "Name": "withRaise", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "576", + "Name": "raise", + "NameInRequest": "raise", + "Type": { + "$id": "577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "578", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/raise", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withRaise", + "Decorators": [] + }, + { + "$id": "579", + "Name": "withReturn", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "580", + "Name": "return", + "NameInRequest": "return", + "Type": { + "$id": "581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "582", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/return", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withReturn", + "Decorators": [] + }, + { + "$id": "583", + "Name": "withTry", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "584", + "Name": "try", + "NameInRequest": "try", + "Type": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "586", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/try", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withTry", + "Decorators": [] + }, + { + "$id": "587", + "Name": "withWhile", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "588", + "Name": "while", + "NameInRequest": "while", + "Type": { + "$id": "589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "590", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/while", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withWhile", + "Decorators": [] + }, + { + "$id": "591", + "Name": "withWith", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "592", + "Name": "with", + "NameInRequest": "with", + "Type": { + "$id": "593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "594", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/with", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withWith", + "Decorators": [] + }, + { + "$id": "595", + "Name": "withYield", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "596", + "Name": "yield", + "NameInRequest": "yield", + "Type": { + "$id": "597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "598", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/yield", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withYield", + "Decorators": [] + }, + { + "$id": "599", + "Name": "withCancellationToken", + "ResourceName": "Parameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "600", + "Name": "cancellationToken", + "NameInRequest": "cancellationToken", + "Type": { + "$id": "601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "602", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-words/parameters/cancellationToken", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialWords.Parameters.withCancellationToken", + "Decorators": [] + } + ], + "Protocol": { + "$id": "603" + }, + "Parent": "SpecialWordsClient", + "Parameters": [ + { + "$id": "604", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "605", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "606", + "Type": { + "$id": "607", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Configuration.json new file mode 100644 index 000000000000..89d92349120f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Enum.Fixed", + "library-name": "Type.Enum.Fixed" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Type.Enum.Fixed.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Type.Enum.Fixed.sln new file mode 100644 index 000000000000..c63b62646e3f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/Type.Enum.Fixed.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type._Enum.Fixed", "src\_Type._Enum.Fixed.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs new file mode 100644 index 000000000000..c413fa8354b0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace _Type._Enum.Fixed +{ + public partial class FixedClient + { + public FixedClient() : this(new Uri("http://localhost:3000"), new FixedClientOptions()) => throw null; + + public FixedClient(Uri endpoint, FixedClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual String GetStringClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs new file mode 100644 index 000000000000..651029324f5b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type._Enum.Fixed +{ + public partial class FixedClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..9587acce1ac3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type._Enum.Fixed +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..5d0a9c7a1513 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type._Enum.Fixed +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..e96100f1f775 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type._Enum.Fixed +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..821862fd745d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type._Enum.Fixed +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Models/DaysOfWeekEnum.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Models/DaysOfWeekEnum.cs new file mode 100644 index 000000000000..c3255c329986 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/Models/DaysOfWeekEnum.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type._Enum.Fixed.Models +{ + public enum DaysOfWeekEnum + { + /// Monday. + Monday, + /// Tuesday. + Tuesday, + /// Wednesday. + Wednesday, + /// Thursday. + Thursday, + /// Friday. + Friday, + /// Saturday. + Saturday, + /// Sunday. + Sunday + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs new file mode 100644 index 000000000000..62fe7ad709fd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type._Enum.Fixed.Models; + +namespace _Type._Enum.Fixed +{ + public partial class String + { + protected String() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetKnownValue(RequestContext context) => throw null; + + public virtual Task GetKnownValueAsync(RequestContext context) => throw null; + + public virtual Response GetKnownValue(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetKnownValueAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutKnownValue(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutKnownValueAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutKnownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutKnownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutUnknownValue(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutUnknownValueAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutUnknownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutUnknownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Type.Enum.Fixed.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Type.Enum.Fixed.csproj new file mode 100644 index 000000000000..2f38bbcf7c8b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Type.Enum.Fixed.csproj @@ -0,0 +1,19 @@ + + + This is the _Type._Enum.Fixed client library for developing .NET applications with rich experience. + SDK Code Generation _Type._Enum.Fixed + 1.0.0-beta.1 + _Type._Enum.Fixed + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/tspCodeModel.json new file mode 100644 index 000000000000..a3a4e749c367 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/tspCodeModel.json @@ -0,0 +1,463 @@ +{ + "$id": "1", + "Name": "Type.Enum.Fixed", + "ApiVersions": [], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "DaysOfWeekEnum", + "crossLanguageDefinitionId": "Type.Enum.Fixed.DaysOfWeekEnum", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Monday", + "value": "Monday", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Monday.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Tuesday", + "value": "Tuesday", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Tuesday.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Wednesday", + "value": "Wednesday", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Wednesday.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Thursday", + "value": "Thursday", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Thursday.", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "Friday", + "value": "Friday", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Friday.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Saturday", + "value": "Saturday", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Saturday.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Sunday", + "value": "Sunday", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Sunday.", + "decorators": [] + } + ], + "clientNamespace": "Type.Enum.Fixed", + "doc": "Days of the week", + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + } + ], + "Models": [], + "Clients": [ + { + "$id": "18", + "Name": "FixedClient", + "ClientNamespace": "Type.Enum.Fixed", + "Operations": [], + "Protocol": { + "$id": "19" + }, + "Parameters": [ + { + "$id": "20", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "21", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "22", + "Type": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "24", + "Name": "String", + "ClientNamespace": "Type.Enum.Fixed", + "Operations": [ + { + "$id": "25", + "Name": "getKnownValue", + "ResourceName": "String", + "Doc": "getKnownValue", + "Accessibility": "public", + "Parameters": [ + { + "$id": "26", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "27", + "kind": "constant", + "valueType": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "29", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/enum/fixed/string/known-value", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Enum.Fixed.String.getKnownValue", + "Decorators": [] + }, + { + "$id": "30", + "Name": "putKnownValue", + "ResourceName": "String", + "Doc": "putKnownValue", + "Accessibility": "public", + "Parameters": [ + { + "$id": "31", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "32", + "kind": "constant", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "34", + "Name": "body", + "NameInRequest": "body", + "Doc": "_", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "35", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/enum/fixed/string/known-value", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Enum.Fixed.String.putKnownValue", + "Decorators": [] + }, + { + "$id": "36", + "Name": "putUnknownValue", + "ResourceName": "String", + "Doc": "putUnknownValue", + "Accessibility": "public", + "Parameters": [ + { + "$id": "37", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "38", + "kind": "constant", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "40", + "Name": "body", + "NameInRequest": "body", + "Doc": "_", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "41", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/enum/fixed/string/unknown-value", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Enum.Fixed.String.putUnknownValue", + "Decorators": [] + } + ], + "Protocol": { + "$id": "42" + }, + "Parent": "FixedClient", + "Parameters": [ + { + "$id": "43", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "44", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "45", + "Type": { + "$id": "46", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Configuration.json new file mode 100644 index 000000000000..e1f6d8582134 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Empty", + "library-name": "Type.Model.Empty" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Type.Model.Empty.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Type.Model.Empty.sln new file mode 100644 index 000000000000..f7e6a33aa48c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/Type.Model.Empty.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Empty", "src\_Type.Model.Empty.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs new file mode 100644 index 000000000000..b66b426a02fe --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Empty.Models; + +namespace _Type.Model.Empty +{ + public partial class EmptyClient + { + public EmptyClient() : this(new Uri("http://localhost:3000"), new EmptyClientOptions()) => throw null; + + public EmptyClient(Uri endpoint, EmptyClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response PutEmpty(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutEmptyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutEmpty(EmptyInput input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutEmptyAsync(EmptyInput input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetEmpty(RequestContext context) => throw null; + + public virtual Task GetEmptyAsync(RequestContext context) => throw null; + + public virtual Response GetEmpty(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetEmptyAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PostRoundTripEmpty(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PostRoundTripEmptyAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PostRoundTripEmpty(EmptyInputOutput body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> PostRoundTripEmptyAsync(EmptyInputOutput body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs new file mode 100644 index 000000000000..7f3d8ec695be --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Empty +{ + public partial class EmptyClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..3498f3edebf9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Empty +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..97284891af06 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Empty +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..af57c350413a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Empty +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..094dc6cf79de --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Empty +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.Serialization.cs new file mode 100644 index 000000000000..e775ff5f5e86 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyInput : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + EmptyInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyInput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + EmptyInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyInput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(EmptyInput emptyInput) => throw null; + + public static explicit operator EmptyInput(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.cs new file mode 100644 index 000000000000..8de422f20259 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInput.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyInput + { + public EmptyInput() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.Serialization.cs new file mode 100644 index 000000000000..14d22d36c095 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyInputOutput : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + EmptyInputOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyInputOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + EmptyInputOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyInputOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(EmptyInputOutput emptyInputOutput) => throw null; + + public static explicit operator EmptyInputOutput(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.cs new file mode 100644 index 000000000000..8125c8628469 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyInputOutput.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyInputOutput + { + public EmptyInputOutput() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.Serialization.cs new file mode 100644 index 000000000000..70b0b1275f8b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyOutput : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + EmptyOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + EmptyOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual EmptyOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(EmptyOutput emptyOutput) => throw null; + + public static explicit operator EmptyOutput(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.cs new file mode 100644 index 000000000000..b05f4301ea2a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/Models/EmptyOutput.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Empty.Models +{ + public partial class EmptyOutput + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/TypeModelEmptyModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/TypeModelEmptyModelFactory.cs new file mode 100644 index 000000000000..772afcee0700 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/TypeModelEmptyModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Empty.Models +{ + public static partial class TypeModelEmptyModelFactory + { + public static EmptyInput EmptyInput() => throw null; + + public static EmptyOutput EmptyOutput() => throw null; + + public static EmptyInputOutput EmptyInputOutput() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Type.Model.Empty.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Type.Model.Empty.csproj new file mode 100644 index 000000000000..df51a50ee68b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Type.Model.Empty.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Empty client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Empty + 1.0.0-beta.1 + _Type.Model.Empty + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json new file mode 100644 index 000000000000..614df41678b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/tspCodeModel.json @@ -0,0 +1,334 @@ +{ + "$id": "1", + "Name": "Type.Model.Empty", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "EmptyInput", + "clientNamespace": "Type.Model.Empty", + "crossLanguageDefinitionId": "Type.Model.Empty.EmptyInput", + "usage": "Input,Json", + "doc": "Empty model used in operation parameters", + "decorators": [], + "properties": [] + }, + { + "$id": "3", + "kind": "model", + "name": "EmptyOutput", + "clientNamespace": "Type.Model.Empty", + "crossLanguageDefinitionId": "Type.Model.Empty.EmptyOutput", + "usage": "Output,Json", + "doc": "Empty model used in operation return type", + "decorators": [], + "properties": [] + }, + { + "$id": "4", + "kind": "model", + "name": "EmptyInputOutput", + "clientNamespace": "Type.Model.Empty", + "crossLanguageDefinitionId": "Type.Model.Empty.EmptyInputOutput", + "usage": "Input,Output,Json", + "doc": "Empty model used in both parameter and return type", + "decorators": [], + "properties": [] + } + ], + "Clients": [ + { + "$id": "5", + "Name": "EmptyClient", + "ClientNamespace": "Type.Model.Empty", + "Doc": "Illustrates usage of empty model used in operation's parameters and responses.", + "Operations": [ + { + "$id": "6", + "Name": "putEmpty", + "ResourceName": "Empty", + "Accessibility": "public", + "Parameters": [ + { + "$id": "7", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "8", + "kind": "constant", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "10", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "11", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/empty/alone", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Empty.putEmpty", + "Decorators": [] + }, + { + "$id": "12", + "Name": "getEmpty", + "ResourceName": "Empty", + "Accessibility": "public", + "Parameters": [ + { + "$id": "13", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "14", + "kind": "constant", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "16", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "3" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/empty/alone", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Empty.getEmpty", + "Decorators": [] + }, + { + "$id": "17", + "Name": "postRoundTripEmpty", + "ResourceName": "Empty", + "Accessibility": "public", + "Parameters": [ + { + "$id": "18", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "19", + "kind": "constant", + "valueType": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "21", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "22", + "kind": "constant", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "24", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "4" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "25", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "4" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/empty/round-trip", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Empty.postRoundTripEmpty", + "Decorators": [] + } + ], + "Protocol": { + "$id": "26" + }, + "Parameters": [ + { + "$id": "27", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "28", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "29", + "Type": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Configuration.json new file mode 100644 index 000000000000..f664abf01cca --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Inheritance.NestedDiscriminator", + "library-name": "Type.Model.Inheritance.NestedDiscriminator" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Type.Model.Inheritance.NestedDiscriminator.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Type.Model.Inheritance.NestedDiscriminator.sln new file mode 100644 index 000000000000..da39107bd781 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/Type.Model.Inheritance.NestedDiscriminator.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Inheritance.NestedDiscriminator", "src\_Type.Model.Inheritance.NestedDiscriminator.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..54e90a6dd562 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..1f17964f2e21 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..5bbaa3463346 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..b44e7374b2fb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.Serialization.cs new file mode 100644 index 000000000000..48fbb0c217a7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + [PersistableModelProxy(typeof(UnknownFish))] + public abstract partial class Fish : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Fish IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Fish IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Fish fish) => throw null; + + public static explicit operator Fish(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.cs new file mode 100644 index 000000000000..de8a5dea279a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Fish.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public abstract partial class Fish + { + private protected Fish(string kind, int age) => throw null; + + internal Fish(string kind, int age, IDictionary additionalBinaryDataProperties) => throw null; + + internal string Kind + { + get => throw null; + set => throw null; + } + + public int Age + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.Serialization.cs new file mode 100644 index 000000000000..4f35f924a55c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class GoblinShark : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + GoblinShark IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + GoblinShark IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(GoblinShark goblinShark) => throw null; + + public static explicit operator GoblinShark(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.cs new file mode 100644 index 000000000000..b124e96d9b18 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/GoblinShark.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class GoblinShark : Shark + { + public GoblinShark(int age) : base(age, "goblin") => throw null; + + internal GoblinShark(string kind, int age, IDictionary additionalBinaryDataProperties, string sharktype) : base(kind, age, additionalBinaryDataProperties, sharktype) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.Serialization.cs new file mode 100644 index 000000000000..e27417c1056d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class Salmon : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Salmon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Salmon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Salmon salmon) => throw null; + + public static explicit operator Salmon(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.cs new file mode 100644 index 000000000000..4dfea279416f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Salmon.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class Salmon : Fish + { + public Salmon(int age) : base("salmon", age) => throw null; + + internal Salmon(string kind, int age, IDictionary additionalBinaryDataProperties, IList friends, IDictionary hate, Fish partner) : base(kind, age, additionalBinaryDataProperties) => throw null; + + public IList Friends => throw null; + + public IDictionary Hate => throw null; + + public Fish Partner + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.Serialization.cs new file mode 100644 index 000000000000..c507dbe20215 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class SawShark : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + SawShark IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + SawShark IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(SawShark sawShark) => throw null; + + public static explicit operator SawShark(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.cs new file mode 100644 index 000000000000..b9525fd501a3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/SawShark.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class SawShark : Shark + { + public SawShark(int age) : base(age, "saw") => throw null; + + internal SawShark(string kind, int age, IDictionary additionalBinaryDataProperties, string sharktype) : base(kind, age, additionalBinaryDataProperties, sharktype) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.Serialization.cs new file mode 100644 index 000000000000..6fcecfda55b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class Shark : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Shark IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Shark IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Shark shark) => throw null; + + public static explicit operator Shark(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.cs new file mode 100644 index 000000000000..14bed0fc3ec5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/Shark.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public partial class Shark : Fish + { + public Shark(int age, string sharktype) : base("shark", age) => throw null; + + internal Shark(string kind, int age, IDictionary additionalBinaryDataProperties, string sharktype) : base(kind, age, additionalBinaryDataProperties) => throw null; + + internal string Sharktype + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.Serialization.cs new file mode 100644 index 000000000000..d4a0eef7948b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + internal partial class UnknownFish : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Fish IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Fish IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.cs new file mode 100644 index 000000000000..c4d9ab52d297 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownFish.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + internal partial class UnknownFish : Fish + { + internal UnknownFish(string kind, int age, IDictionary additionalBinaryDataProperties) : base(kind ?? "unknown", age, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.Serialization.cs new file mode 100644 index 000000000000..1b91aad93e82 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + internal partial class UnknownShark : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Shark IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Fish JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Shark IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Fish PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.cs new file mode 100644 index 000000000000..f684666c20aa --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/Models/UnknownShark.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + internal partial class UnknownShark : Shark + { + internal UnknownShark(string kind, int age, IDictionary additionalBinaryDataProperties, string sharktype) : base(kind ?? "unknown", age, additionalBinaryDataProperties, sharktype ?? "unknown") => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs new file mode 100644 index 000000000000..b324ac85be43 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Inheritance.NestedDiscriminator.Models; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + public partial class NestedDiscriminatorClient + { + public NestedDiscriminatorClient() : this(new Uri("http://localhost:3000"), new NestedDiscriminatorClientOptions()) => throw null; + + public NestedDiscriminatorClient(Uri endpoint, NestedDiscriminatorClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetModel(RequestContext context) => throw null; + + public virtual Task GetModelAsync(RequestContext context) => throw null; + + public virtual Response GetModel(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetModelAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutModel(Fish input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutModelAsync(Fish input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetRecursiveModel(RequestContext context) => throw null; + + public virtual Task GetRecursiveModelAsync(RequestContext context) => throw null; + + public virtual Response GetRecursiveModel(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetRecursiveModelAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutRecursiveModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutRecursiveModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutRecursiveModel(Fish input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutRecursiveModelAsync(Fish input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetMissingDiscriminator(RequestContext context) => throw null; + + public virtual Task GetMissingDiscriminatorAsync(RequestContext context) => throw null; + + public virtual Response GetMissingDiscriminator(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetWrongDiscriminator(RequestContext context) => throw null; + + public virtual Task GetWrongDiscriminatorAsync(RequestContext context) => throw null; + + public virtual Response GetWrongDiscriminator(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs new file mode 100644 index 000000000000..254aa8686791 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + public partial class NestedDiscriminatorClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/TypeModelInheritanceNestedDiscriminatorModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/TypeModelInheritanceNestedDiscriminatorModelFactory.cs new file mode 100644 index 000000000000..5ae2f875910f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/TypeModelInheritanceNestedDiscriminatorModelFactory.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NestedDiscriminator.Models +{ + public static partial class TypeModelInheritanceNestedDiscriminatorModelFactory + { + public static Fish Fish(string kind = default, int age = default) => throw null; + + public static Shark Shark(int age = default) => throw null; + + public static SawShark SawShark(int age = default) => throw null; + + public static GoblinShark GoblinShark(int age = default) => throw null; + + public static Salmon Salmon(int age = default, IEnumerable friends = default, IDictionary hate = default, Fish partner = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Type.Model.Inheritance.NestedDiscriminator.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Type.Model.Inheritance.NestedDiscriminator.csproj new file mode 100644 index 000000000000..7cf0d26847ab --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Type.Model.Inheritance.NestedDiscriminator.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Inheritance.NestedDiscriminator client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Inheritance.NestedDiscriminator + 1.0.0-beta.1 + _Type.Model.Inheritance.NestedDiscriminator + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json new file mode 100644 index 000000000000..86f8208f55b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/tspCodeModel.json @@ -0,0 +1,843 @@ +{ + "$id": "1", + "Name": "Type.Model.Inheritance.NestedDiscriminator", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "Fish", + "clientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Fish", + "usage": "Input,Output,Json", + "doc": "This is base model for polymorphic multiple levels inheritance with a discriminator.", + "decorators": [], + "discriminatorProperty": { + "$id": "3", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Discriminator property for Fish.", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Fish.kind", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "3" + }, + { + "$id": "7", + "kind": "property", + "name": "age", + "serializedName": "age", + "type": { + "$id": "8", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Fish.age", + "serializationOptions": { + "$id": "9", + "json": { + "$id": "10", + "name": "age" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "11", + "shark": { + "$id": "12", + "kind": "model", + "name": "Shark", + "clientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Shark", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic multiple levels inheritance and it defines a new discriminator.", + "discriminatorValue": "shark", + "decorators": [], + "discriminatorProperty": { + "$id": "13", + "kind": "property", + "name": "sharktype", + "serializedName": "sharktype", + "type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Shark.sharktype", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "sharktype" + } + } + }, + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "17", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "18", + "kind": "constant", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "shark", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Shark.kind", + "serializationOptions": { + "$id": "20", + "json": { + "$id": "21", + "name": "kind" + } + } + }, + { + "$ref": "13" + } + ], + "discriminatedSubtypes": { + "$id": "22", + "saw": { + "$id": "23", + "kind": "model", + "name": "SawShark", + "clientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.SawShark", + "usage": "Input,Output,Json", + "doc": "The third level model SawShark in polymorphic multiple levels inheritance.", + "discriminatorValue": "saw", + "decorators": [], + "baseModel": { + "$ref": "12" + }, + "properties": [ + { + "$id": "24", + "kind": "property", + "name": "sharktype", + "serializedName": "sharktype", + "type": { + "$id": "25", + "kind": "constant", + "valueType": { + "$id": "26", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "saw", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.SawShark.sharktype", + "serializationOptions": { + "$id": "27", + "json": { + "$id": "28", + "name": "sharktype" + } + } + } + ] + }, + "goblin": { + "$id": "29", + "kind": "model", + "name": "GoblinShark", + "clientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.GoblinShark", + "usage": "Input,Output,Json", + "doc": "The third level model GoblinShark in polymorphic multiple levels inheritance.", + "discriminatorValue": "goblin", + "decorators": [], + "baseModel": { + "$ref": "12" + }, + "properties": [ + { + "$id": "30", + "kind": "property", + "name": "sharktype", + "serializedName": "sharktype", + "type": { + "$id": "31", + "kind": "constant", + "valueType": { + "$id": "32", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "goblin", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.GoblinShark.sharktype", + "serializationOptions": { + "$id": "33", + "json": { + "$id": "34", + "name": "sharktype" + } + } + } + ] + } + } + }, + "salmon": { + "$id": "35", + "kind": "model", + "name": "Salmon", + "clientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Salmon", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic multiple levels inheritance which contains references to other polymorphic instances.", + "discriminatorValue": "salmon", + "decorators": [], + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "36", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "37", + "kind": "constant", + "valueType": { + "$id": "38", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "salmon", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Salmon.kind", + "serializationOptions": { + "$id": "39", + "json": { + "$id": "40", + "name": "kind" + } + } + }, + { + "$id": "41", + "kind": "property", + "name": "friends", + "serializedName": "friends", + "type": { + "$id": "42", + "kind": "array", + "name": "ArrayFish", + "valueType": { + "$ref": "2" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Salmon.friends", + "serializationOptions": { + "$id": "43", + "json": { + "$id": "44", + "name": "friends" + } + } + }, + { + "$id": "45", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "type": { + "$id": "46", + "kind": "dict", + "keyType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "2" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Salmon.hate", + "serializationOptions": { + "$id": "48", + "json": { + "$id": "49", + "name": "hate" + } + } + }, + { + "$id": "50", + "kind": "property", + "name": "partner", + "serializedName": "partner", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.Salmon.partner", + "serializationOptions": { + "$id": "51", + "json": { + "$id": "52", + "name": "partner" + } + } + } + ] + } + } + }, + { + "$ref": "12" + }, + { + "$ref": "23" + }, + { + "$ref": "29" + }, + { + "$ref": "35" + } + ], + "Clients": [ + { + "$id": "53", + "Name": "NestedDiscriminatorClient", + "ClientNamespace": "Type.Model.Inheritance.NestedDiscriminator", + "Doc": "Illustrates multiple level inheritance with multiple discriminators.", + "Operations": [ + { + "$id": "54", + "Name": "getModel", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "55", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "56", + "kind": "constant", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "58", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/model", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.getModel", + "Decorators": [] + }, + { + "$id": "59", + "Name": "putModel", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "60", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "61", + "kind": "constant", + "valueType": { + "$id": "62", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "63", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "64", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/model", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.putModel", + "Decorators": [] + }, + { + "$id": "65", + "Name": "getRecursiveModel", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "66", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "67", + "kind": "constant", + "valueType": { + "$id": "68", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "69", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/recursivemodel", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.getRecursiveModel", + "Decorators": [] + }, + { + "$id": "70", + "Name": "putRecursiveModel", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "71", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "72", + "kind": "constant", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "74", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "75", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/recursivemodel", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.putRecursiveModel", + "Decorators": [] + }, + { + "$id": "76", + "Name": "getMissingDiscriminator", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "77", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "78", + "kind": "constant", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "80", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/missingdiscriminator", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.getMissingDiscriminator", + "Decorators": [] + }, + { + "$id": "81", + "Name": "getWrongDiscriminator", + "ResourceName": "NestedDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "82", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "83", + "kind": "constant", + "valueType": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "85", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/nested-discriminator/wrongdiscriminator", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NestedDiscriminator.getWrongDiscriminator", + "Decorators": [] + } + ], + "Protocol": { + "$id": "86" + }, + "Parameters": [ + { + "$id": "87", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "88", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "89", + "Type": { + "$id": "90", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Configuration.json new file mode 100644 index 000000000000..99ad3240894a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Inheritance.NotDiscriminated", + "library-name": "Type.Model.Inheritance.NotDiscriminated" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Type.Model.Inheritance.NotDiscriminated.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Type.Model.Inheritance.NotDiscriminated.sln new file mode 100644 index 000000000000..52139156d6cd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/Type.Model.Inheritance.NotDiscriminated.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Inheritance.NotDiscriminated", "src\_Type.Model.Inheritance.NotDiscriminated.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..47ddaa5ed8b3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..2108118ba89a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..b4708cec8d75 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..c1a647ab92f0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.Serialization.cs new file mode 100644 index 000000000000..0379d67dbf0e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Cat : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Cat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Pet JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Cat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Pet PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Cat cat) => throw null; + + public static explicit operator Cat(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.cs new file mode 100644 index 000000000000..b823bfb3b8c5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Cat.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Cat : Pet + { + public Cat(string name, int age) : base(name) => throw null; + + internal Cat(string name, IDictionary additionalBinaryDataProperties, int age) : base(name, additionalBinaryDataProperties) => throw null; + + public int Age + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.Serialization.cs new file mode 100644 index 000000000000..ad7ebc45e569 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Pet : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Pet IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Pet JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Pet IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Pet PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Pet pet) => throw null; + + public static explicit operator Pet(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.cs new file mode 100644 index 000000000000..5ccfa38fa148 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Pet.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Pet + { + public Pet(string name) => throw null; + + internal Pet(string name, IDictionary additionalBinaryDataProperties) => throw null; + + public string Name + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.Serialization.cs new file mode 100644 index 000000000000..67db6cc6f3af --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Siamese : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Siamese IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Pet JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Siamese IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Pet PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Siamese siamese) => throw null; + + public static explicit operator Siamese(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.cs new file mode 100644 index 000000000000..483b933ff8e2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/Models/Siamese.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public partial class Siamese : Cat + { + public Siamese(string name, int age, bool smart) : base(name, age) => throw null; + + internal Siamese(string name, IDictionary additionalBinaryDataProperties, int age, bool smart) : base(name, additionalBinaryDataProperties, age) => throw null; + + public bool Smart + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs new file mode 100644 index 000000000000..640d6362feb3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Inheritance.NotDiscriminated.Models; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + public partial class NotDiscriminatedClient + { + public NotDiscriminatedClient() : this(new Uri("http://localhost:3000"), new NotDiscriminatedClientOptions()) => throw null; + + public NotDiscriminatedClient(Uri endpoint, NotDiscriminatedClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response PostValid(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PostValidAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PostValid(Siamese input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostValidAsync(Siamese input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetValid(RequestContext context) => throw null; + + public virtual Task GetValidAsync(RequestContext context) => throw null; + + public virtual Response GetValid(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetValidAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutValid(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutValidAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutValid(Siamese input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> PutValidAsync(Siamese input, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs new file mode 100644 index 000000000000..fb0537e3ca32 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + public partial class NotDiscriminatedClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/TypeModelInheritanceNotDiscriminatedModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/TypeModelInheritanceNotDiscriminatedModelFactory.cs new file mode 100644 index 000000000000..9d29f123fec0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/TypeModelInheritanceNotDiscriminatedModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Inheritance.NotDiscriminated.Models +{ + public static partial class TypeModelInheritanceNotDiscriminatedModelFactory + { + public static Siamese Siamese(string name = default, int age = default, bool smart = default) => throw null; + + public static Cat Cat(string name = default, int age = default) => throw null; + + public static Pet Pet(string name = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Type.Model.Inheritance.NotDiscriminated.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Type.Model.Inheritance.NotDiscriminated.csproj new file mode 100644 index 000000000000..af69f0269fae --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Type.Model.Inheritance.NotDiscriminated.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Inheritance.NotDiscriminated client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Inheritance.NotDiscriminated + 1.0.0-beta.1 + _Type.Model.Inheritance.NotDiscriminated + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json new file mode 100644 index 000000000000..cc4fcfa00a19 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/tspCodeModel.json @@ -0,0 +1,421 @@ +{ + "$id": "1", + "Name": "Type.Model.Inheritance.NotDiscriminated", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "Siamese", + "clientNamespace": "Type.Model.Inheritance.NotDiscriminated", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Siamese", + "usage": "Input,Output,Json", + "doc": "The third level model in the normal multiple levels inheritance.", + "decorators": [], + "baseModel": { + "$id": "3", + "kind": "model", + "name": "Cat", + "clientNamespace": "Type.Model.Inheritance.NotDiscriminated", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Cat", + "usage": "Input,Output,Json", + "doc": "The second level model in the normal multiple levels inheritance.", + "decorators": [], + "baseModel": { + "$id": "4", + "kind": "model", + "name": "Pet", + "clientNamespace": "Type.Model.Inheritance.NotDiscriminated", + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Pet", + "usage": "Input,Output,Json", + "doc": "This is base model for not-discriminated normal multiple levels inheritance.", + "decorators": [], + "properties": [ + { + "$id": "5", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "6", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Pet.name", + "serializationOptions": { + "$id": "7", + "json": { + "$id": "8", + "name": "name" + } + } + } + ] + }, + "properties": [ + { + "$id": "9", + "kind": "property", + "name": "age", + "serializedName": "age", + "type": { + "$id": "10", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Cat.age", + "serializationOptions": { + "$id": "11", + "json": { + "$id": "12", + "name": "age" + } + } + } + ] + }, + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "smart", + "serializedName": "smart", + "type": { + "$id": "14", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.Siamese.smart", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "smart" + } + } + } + ] + }, + { + "$ref": "3" + }, + { + "$ref": "4" + } + ], + "Clients": [ + { + "$id": "17", + "Name": "NotDiscriminatedClient", + "ClientNamespace": "Type.Model.Inheritance.NotDiscriminated", + "Doc": "Illustrates not-discriminated inheritance model.", + "Operations": [ + { + "$id": "18", + "Name": "postValid", + "ResourceName": "NotDiscriminated", + "Accessibility": "public", + "Parameters": [ + { + "$id": "19", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "20", + "kind": "constant", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "22", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "23", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/not-discriminated/valid", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.postValid", + "Decorators": [] + }, + { + "$id": "24", + "Name": "getValid", + "ResourceName": "NotDiscriminated", + "Accessibility": "public", + "Parameters": [ + { + "$id": "25", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "26", + "kind": "constant", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "28", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/not-discriminated/valid", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.getValid", + "Decorators": [] + }, + { + "$id": "29", + "Name": "putValid", + "ResourceName": "NotDiscriminated", + "Accessibility": "public", + "Parameters": [ + { + "$id": "30", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "31", + "kind": "constant", + "valueType": { + "$id": "32", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "33", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "34", + "kind": "constant", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "36", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "37", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/not-discriminated/valid", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.NotDiscriminated.putValid", + "Decorators": [] + } + ], + "Protocol": { + "$id": "38" + }, + "Parameters": [ + { + "$id": "39", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "40", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "41", + "Type": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Configuration.json new file mode 100644 index 000000000000..9f11d774fe16 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Inheritance.Recursive", + "library-name": "Type.Model.Inheritance.Recursive" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Type.Model.Inheritance.Recursive.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Type.Model.Inheritance.Recursive.sln new file mode 100644 index 000000000000..fa97a4079e00 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/Type.Model.Inheritance.Recursive.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Inheritance.Recursive", "src\_Type.Model.Inheritance.Recursive.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..78ef06bd024c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.Recursive +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..797ebedb399b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.Recursive +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..b4c3a5631cb2 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.Recursive +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..7d9e572f0487 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.Recursive +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.Serialization.cs new file mode 100644 index 000000000000..691d1afc0814 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.Recursive.Models +{ + public partial class Element : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Element IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Element JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Element IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Element PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Element element) => throw null; + + public static explicit operator Element(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.cs new file mode 100644 index 000000000000..bdbdf7be3302 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Element.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.Recursive.Models +{ + public partial class Element + { + public Element() => throw null; + + internal Element(IList extension, IDictionary additionalBinaryDataProperties) => throw null; + + public IList Extension => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.Serialization.cs new file mode 100644 index 000000000000..bdf143c574e5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.Recursive.Models +{ + public partial class Extension : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Extension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Element JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Extension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Element PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Extension extension) => throw null; + + public static explicit operator Extension(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.cs new file mode 100644 index 000000000000..f64339243bfb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/Models/Extension.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.Recursive.Models +{ + public partial class Extension : Element + { + public Extension(sbyte level) => throw null; + + internal Extension(IList extension, IDictionary additionalBinaryDataProperties, sbyte level) : base(extension, additionalBinaryDataProperties) => throw null; + + public sbyte Level + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs new file mode 100644 index 000000000000..a398624327cd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Inheritance.Recursive.Models; + +namespace _Type.Model.Inheritance.Recursive +{ + public partial class RecursiveClient + { + public RecursiveClient() : this(new Uri("http://localhost:3000"), new RecursiveClientOptions()) => throw null; + + public RecursiveClient(Uri endpoint, RecursiveClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Put(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Put(Extension input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutAsync(Extension input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Get(RequestContext context) => throw null; + + public virtual Task GetAsync(RequestContext context) => throw null; + + public virtual Response Get(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs new file mode 100644 index 000000000000..ebc955cc02ec --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Inheritance.Recursive +{ + public partial class RecursiveClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/TypeModelInheritanceRecursiveModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/TypeModelInheritanceRecursiveModelFactory.cs new file mode 100644 index 000000000000..e828a3619332 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/TypeModelInheritanceRecursiveModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.Recursive.Models +{ + public static partial class TypeModelInheritanceRecursiveModelFactory + { + public static Extension Extension(IEnumerable extension = default, sbyte level = default) => throw null; + + public static Element Element(IEnumerable extension = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Type.Model.Inheritance.Recursive.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Type.Model.Inheritance.Recursive.csproj new file mode 100644 index 000000000000..ca5fafde5c82 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Type.Model.Inheritance.Recursive.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Inheritance.Recursive client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Inheritance.Recursive + 1.0.0-beta.1 + _Type.Model.Inheritance.Recursive + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json new file mode 100644 index 000000000000..5b99c3955fa7 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/tspCodeModel.json @@ -0,0 +1,274 @@ +{ + "$id": "1", + "Name": "Type.Model.Inheritance.Recursive", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "Extension", + "clientNamespace": "Type.Model.Inheritance.Recursive", + "crossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.Extension", + "usage": "Input,Output,Json", + "doc": "extension", + "decorators": [], + "baseModel": { + "$id": "3", + "kind": "model", + "name": "Element", + "clientNamespace": "Type.Model.Inheritance.Recursive", + "crossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.Element", + "usage": "Input,Output,Json", + "doc": "element", + "decorators": [], + "properties": [ + { + "$id": "4", + "kind": "property", + "name": "extension", + "serializedName": "extension", + "type": { + "$id": "5", + "kind": "array", + "name": "ArrayExtension", + "valueType": { + "$ref": "2" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.Element.extension", + "serializationOptions": { + "$id": "6", + "json": { + "$id": "7", + "name": "extension" + } + } + } + ] + }, + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "level", + "serializedName": "level", + "type": { + "$id": "9", + "kind": "int8", + "name": "int8", + "crossLanguageDefinitionId": "TypeSpec.int8", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.Extension.level", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "level" + } + } + } + ] + }, + { + "$ref": "3" + } + ], + "Clients": [ + { + "$id": "12", + "Name": "RecursiveClient", + "ClientNamespace": "Type.Model.Inheritance.Recursive", + "Doc": "Illustrates inheritance recursion", + "Operations": [ + { + "$id": "13", + "Name": "put", + "ResourceName": "Recursive", + "Accessibility": "public", + "Parameters": [ + { + "$id": "14", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "15", + "kind": "constant", + "valueType": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "17", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "18", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/recursive", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.put", + "Decorators": [] + }, + { + "$id": "19", + "Name": "get", + "ResourceName": "Recursive", + "Accessibility": "public", + "Parameters": [ + { + "$id": "20", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "21", + "kind": "constant", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "23", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/recursive", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.Recursive.get", + "Decorators": [] + } + ], + "Protocol": { + "$id": "24" + }, + "Parameters": [ + { + "$id": "25", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "26", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "27", + "Type": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Configuration.json new file mode 100644 index 000000000000..4b01417059df --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Inheritance.SingleDiscriminator", + "library-name": "Type.Model.Inheritance.SingleDiscriminator" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Type.Model.Inheritance.SingleDiscriminator.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Type.Model.Inheritance.SingleDiscriminator.sln new file mode 100644 index 000000000000..93a2a0aad0cf --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/Type.Model.Inheritance.SingleDiscriminator.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Inheritance.SingleDiscriminator", "src\_Type.Model.Inheritance.SingleDiscriminator.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..315b03fa0e81 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..cf6760abff43 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..e36cfc906dfd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..ed44fe3b6810 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.Serialization.cs new file mode 100644 index 000000000000..3ac2972381d8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + [PersistableModelProxy(typeof(UnknownBird))] + public abstract partial class Bird : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Bird IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Bird IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Bird bird) => throw null; + + public static explicit operator Bird(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.cs new file mode 100644 index 000000000000..04958b1fbcdd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Bird.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public abstract partial class Bird + { + private protected Bird(string kind, int wingspan) => throw null; + + internal Bird(string kind, int wingspan, IDictionary additionalBinaryDataProperties) => throw null; + + internal string Kind + { + get => throw null; + set => throw null; + } + + public int Wingspan + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.Serialization.cs new file mode 100644 index 000000000000..0eae4b5cfe01 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + [PersistableModelProxy(typeof(UnknownDinosaur))] + public abstract partial class Dinosaur : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Dinosaur IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual Dinosaur JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Dinosaur IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual Dinosaur PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Dinosaur dinosaur) => throw null; + + public static explicit operator Dinosaur(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.cs new file mode 100644 index 000000000000..ac7d3a40a597 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Dinosaur.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public abstract partial class Dinosaur + { + private protected Dinosaur(string kind, int size) => throw null; + + internal Dinosaur(string kind, int size, IDictionary additionalBinaryDataProperties) => throw null; + + internal string Kind + { + get => throw null; + set => throw null; + } + + public int Size => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.Serialization.cs new file mode 100644 index 000000000000..0d26ec5d4a84 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Eagle : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Eagle IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Eagle IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Eagle eagle) => throw null; + + public static explicit operator Eagle(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.cs new file mode 100644 index 000000000000..32955dd1074a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Eagle.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Eagle : Bird + { + public Eagle(int wingspan) : base("eagle", wingspan) => throw null; + + internal Eagle(string kind, int wingspan, IDictionary additionalBinaryDataProperties, IList friends, IDictionary hate, Bird partner) : base(kind, wingspan, additionalBinaryDataProperties) => throw null; + + public IList Friends => throw null; + + public IDictionary Hate => throw null; + + public Bird Partner + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.Serialization.cs new file mode 100644 index 000000000000..f2fe1dbc5f34 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Goose : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Goose IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Goose IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Goose goose) => throw null; + + public static explicit operator Goose(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.cs new file mode 100644 index 000000000000..f6a4725023bf --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Goose.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Goose : Bird + { + public Goose(int wingspan) : base("goose", wingspan) => throw null; + + internal Goose(string kind, int wingspan, IDictionary additionalBinaryDataProperties) : base(kind, wingspan, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.Serialization.cs new file mode 100644 index 000000000000..114a9806894d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class SeaGull : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + SeaGull IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + SeaGull IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(SeaGull seaGull) => throw null; + + public static explicit operator SeaGull(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.cs new file mode 100644 index 000000000000..2e98b3b99320 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/SeaGull.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class SeaGull : Bird + { + public SeaGull(int wingspan) : base("seagull", wingspan) => throw null; + + internal SeaGull(string kind, int wingspan, IDictionary additionalBinaryDataProperties) : base(kind, wingspan, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.Serialization.cs new file mode 100644 index 000000000000..87cea43ca485 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Sparrow : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Sparrow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Sparrow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(Sparrow sparrow) => throw null; + + public static explicit operator Sparrow(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.cs new file mode 100644 index 000000000000..13c52393c630 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/Sparrow.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class Sparrow : Bird + { + public Sparrow(int wingspan) : base("sparrow", wingspan) => throw null; + + internal Sparrow(string kind, int wingspan, IDictionary additionalBinaryDataProperties) : base(kind, wingspan, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.Serialization.cs new file mode 100644 index 000000000000..d5913b2ed65a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class TRex : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + TRex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Dinosaur JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + TRex IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Dinosaur PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(TRex tRex) => throw null; + + public static explicit operator TRex(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.cs new file mode 100644 index 000000000000..b0454080bf80 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/TRex.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public partial class TRex : Dinosaur + { + internal TRex(int size) : base("t-rex", size) => throw null; + + internal TRex(string kind, int size, IDictionary additionalBinaryDataProperties) : base(kind, size, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.Serialization.cs new file mode 100644 index 000000000000..23eaf092593b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + internal partial class UnknownBird : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Bird IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Bird JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Bird IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Bird PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.cs new file mode 100644 index 000000000000..f3555d0b5833 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownBird.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + internal partial class UnknownBird : Bird + { + internal UnknownBird(string kind, int wingspan, IDictionary additionalBinaryDataProperties) : base(kind ?? "unknown", wingspan, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.Serialization.cs new file mode 100644 index 000000000000..70ecb9a6fdf5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + internal partial class UnknownDinosaur : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + Dinosaur IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected override Dinosaur JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + Dinosaur IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected override Dinosaur PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.cs new file mode 100644 index 000000000000..ccc682e63684 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/Models/UnknownDinosaur.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + internal partial class UnknownDinosaur : Dinosaur + { + internal UnknownDinosaur(string kind, int size, IDictionary additionalBinaryDataProperties) : base(kind ?? "unknown", size, additionalBinaryDataProperties) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs new file mode 100644 index 000000000000..79dc18e43e34 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Inheritance.SingleDiscriminator.Models; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + public partial class SingleDiscriminatorClient + { + public SingleDiscriminatorClient() : this(new Uri("http://localhost:3000"), new SingleDiscriminatorClientOptions()) => throw null; + + public SingleDiscriminatorClient(Uri endpoint, SingleDiscriminatorClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetModel(RequestContext context) => throw null; + + public virtual Task GetModelAsync(RequestContext context) => throw null; + + public virtual Response GetModel(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetModelAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutModel(Bird input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutModelAsync(Bird input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetRecursiveModel(RequestContext context) => throw null; + + public virtual Task GetRecursiveModelAsync(RequestContext context) => throw null; + + public virtual Response GetRecursiveModel(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetRecursiveModelAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutRecursiveModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutRecursiveModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutRecursiveModel(Bird input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutRecursiveModelAsync(Bird input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetMissingDiscriminator(RequestContext context) => throw null; + + public virtual Task GetMissingDiscriminatorAsync(RequestContext context) => throw null; + + public virtual Response GetMissingDiscriminator(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetWrongDiscriminator(RequestContext context) => throw null; + + public virtual Task GetWrongDiscriminatorAsync(RequestContext context) => throw null; + + public virtual Response GetWrongDiscriminator(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetLegacyModel(RequestContext context) => throw null; + + public virtual Task GetLegacyModelAsync(RequestContext context) => throw null; + + public virtual Response GetLegacyModel(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetLegacyModelAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs new file mode 100644 index 000000000000..396c79ea17f8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + public partial class SingleDiscriminatorClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/TypeModelInheritanceSingleDiscriminatorModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/TypeModelInheritanceSingleDiscriminatorModelFactory.cs new file mode 100644 index 000000000000..81afd2701579 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/TypeModelInheritanceSingleDiscriminatorModelFactory.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Inheritance.SingleDiscriminator.Models +{ + public static partial class TypeModelInheritanceSingleDiscriminatorModelFactory + { + public static Bird Bird(string kind = default, int wingspan = default) => throw null; + + public static SeaGull SeaGull(int wingspan = default) => throw null; + + public static Sparrow Sparrow(int wingspan = default) => throw null; + + public static Goose Goose(int wingspan = default) => throw null; + + public static Eagle Eagle(int wingspan = default, IEnumerable friends = default, IDictionary hate = default, Bird partner = default) => throw null; + + public static Dinosaur Dinosaur(string kind = default, int size = default) => throw null; + + public static TRex TRex(int size = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Type.Model.Inheritance.SingleDiscriminator.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Type.Model.Inheritance.SingleDiscriminator.csproj new file mode 100644 index 000000000000..04a6834aacaa --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Type.Model.Inheritance.SingleDiscriminator.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Inheritance.SingleDiscriminator client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Inheritance.SingleDiscriminator + 1.0.0-beta.1 + _Type.Model.Inheritance.SingleDiscriminator + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json new file mode 100644 index 000000000000..61d816578339 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/tspCodeModel.json @@ -0,0 +1,993 @@ +{ + "$id": "1", + "Name": "Type.Model.Inheritance.SingleDiscriminator", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "Bird", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Bird", + "usage": "Input,Output,Json", + "doc": "This is base model for polymorphic single level inheritance with a discriminator.", + "decorators": [], + "discriminatorProperty": { + "$id": "3", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Bird.kind", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "3" + }, + { + "$id": "7", + "kind": "property", + "name": "wingspan", + "serializedName": "wingspan", + "type": { + "$id": "8", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Bird.wingspan", + "serializationOptions": { + "$id": "9", + "json": { + "$id": "10", + "name": "wingspan" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "11", + "seagull": { + "$id": "12", + "kind": "model", + "name": "SeaGull", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.SeaGull", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic single level inheritance.", + "discriminatorValue": "seagull", + "decorators": [], + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "14", + "kind": "constant", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "seagull", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.SeaGull.kind", + "serializationOptions": { + "$id": "16", + "json": { + "$id": "17", + "name": "kind" + } + } + } + ] + }, + "sparrow": { + "$id": "18", + "kind": "model", + "name": "Sparrow", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Sparrow", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic single level inheritance.", + "discriminatorValue": "sparrow", + "decorators": [], + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "19", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "20", + "kind": "constant", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "sparrow", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Sparrow.kind", + "serializationOptions": { + "$id": "22", + "json": { + "$id": "23", + "name": "kind" + } + } + } + ] + }, + "goose": { + "$id": "24", + "kind": "model", + "name": "Goose", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Goose", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic single level inheritance.", + "discriminatorValue": "goose", + "decorators": [], + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "25", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "26", + "kind": "constant", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "goose", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Goose.kind", + "serializationOptions": { + "$id": "28", + "json": { + "$id": "29", + "name": "kind" + } + } + } + ] + }, + "eagle": { + "$id": "30", + "kind": "model", + "name": "Eagle", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Eagle", + "usage": "Input,Output,Json", + "doc": "The second level model in polymorphic single levels inheritance which contains references to other polymorphic instances.", + "discriminatorValue": "eagle", + "decorators": [], + "baseModel": { + "$ref": "2" + }, + "properties": [ + { + "$id": "31", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "32", + "kind": "constant", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "eagle", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Eagle.kind", + "serializationOptions": { + "$id": "34", + "json": { + "$id": "35", + "name": "kind" + } + } + }, + { + "$id": "36", + "kind": "property", + "name": "friends", + "serializedName": "friends", + "type": { + "$id": "37", + "kind": "array", + "name": "ArrayBird", + "valueType": { + "$ref": "2" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Eagle.friends", + "serializationOptions": { + "$id": "38", + "json": { + "$id": "39", + "name": "friends" + } + } + }, + { + "$id": "40", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "type": { + "$id": "41", + "kind": "dict", + "keyType": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "2" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Eagle.hate", + "serializationOptions": { + "$id": "43", + "json": { + "$id": "44", + "name": "hate" + } + } + }, + { + "$id": "45", + "kind": "property", + "name": "partner", + "serializedName": "partner", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Eagle.partner", + "serializationOptions": { + "$id": "46", + "json": { + "$id": "47", + "name": "partner" + } + } + } + ] + } + } + }, + { + "$ref": "12" + }, + { + "$ref": "18" + }, + { + "$ref": "24" + }, + { + "$ref": "30" + }, + { + "$id": "48", + "kind": "model", + "name": "Dinosaur", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Dinosaur", + "usage": "Output,Json", + "doc": "Define a base class in the legacy way. Discriminator property is not explicitly defined in the model.", + "decorators": [], + "discriminatorProperty": { + "$id": "49", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Discriminator property for Dinosaur.", + "type": { + "$id": "50", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Dinosaur.kind", + "serializationOptions": { + "$id": "51", + "json": { + "$id": "52", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "49" + }, + { + "$id": "53", + "kind": "property", + "name": "size", + "serializedName": "size", + "type": { + "$id": "54", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.Dinosaur.size", + "serializationOptions": { + "$id": "55", + "json": { + "$id": "56", + "name": "size" + } + } + } + ], + "discriminatedSubtypes": { + "$id": "57", + "t-rex": { + "$id": "58", + "kind": "model", + "name": "TRex", + "clientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.TRex", + "usage": "Output,Json", + "doc": "The second level legacy model in polymorphic single level inheritance.", + "discriminatorValue": "t-rex", + "decorators": [], + "baseModel": { + "$ref": "48" + }, + "properties": [ + { + "$id": "59", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "type": { + "$id": "60", + "kind": "constant", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "t-rex", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.TRex.kind", + "serializationOptions": { + "$id": "62", + "json": { + "$id": "63", + "name": "kind" + } + } + } + ] + } + } + }, + { + "$ref": "58" + } + ], + "Clients": [ + { + "$id": "64", + "Name": "SingleDiscriminatorClient", + "ClientNamespace": "Type.Model.Inheritance.SingleDiscriminator", + "Doc": "Illustrates inheritance with single discriminator.", + "Operations": [ + { + "$id": "65", + "Name": "getModel", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "66", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "67", + "kind": "constant", + "valueType": { + "$id": "68", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "69", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/model", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.getModel", + "Decorators": [] + }, + { + "$id": "70", + "Name": "putModel", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "71", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "72", + "kind": "constant", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "74", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "75", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/model", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.putModel", + "Decorators": [] + }, + { + "$id": "76", + "Name": "getRecursiveModel", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "77", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "78", + "kind": "constant", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "80", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/recursivemodel", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.getRecursiveModel", + "Decorators": [] + }, + { + "$id": "81", + "Name": "putRecursiveModel", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "82", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "83", + "kind": "constant", + "valueType": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "85", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "86", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/recursivemodel", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.putRecursiveModel", + "Decorators": [] + }, + { + "$id": "87", + "Name": "getMissingDiscriminator", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "88", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "89", + "kind": "constant", + "valueType": { + "$id": "90", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "91", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/missingdiscriminator", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.getMissingDiscriminator", + "Decorators": [] + }, + { + "$id": "92", + "Name": "getWrongDiscriminator", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "93", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "94", + "kind": "constant", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "96", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/wrongdiscriminator", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.getWrongDiscriminator", + "Decorators": [] + }, + { + "$id": "97", + "Name": "getLegacyModel", + "ResourceName": "SingleDiscriminator", + "Accessibility": "public", + "Parameters": [ + { + "$id": "98", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "99", + "kind": "constant", + "valueType": { + "$id": "100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "101", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "48" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/inheritance/single-discriminator/legacy-model", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Inheritance.SingleDiscriminator.getLegacyModel", + "Decorators": [] + } + ], + "Protocol": { + "$id": "102" + }, + "Parameters": [ + { + "$id": "103", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "104", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "105", + "Type": { + "$id": "106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Configuration.json new file mode 100644 index 000000000000..7192d9988370 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Usage", + "library-name": "Type.Model.Usage" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Type.Model.Usage.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Type.Model.Usage.sln new file mode 100644 index 000000000000..add90d7c3d8f --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/Type.Model.Usage.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Usage", "src\_Type.Model.Usage.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..9e4a94b0b5b4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Usage +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..85c9c6fe3651 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Usage +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..9e9285e29380 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Usage +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..14291184f6c9 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Usage +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.Serialization.cs new file mode 100644 index 000000000000..b41fcae845bb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Usage.Models +{ + public partial class InputOutputRecord : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + InputOutputRecord IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual InputOutputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + InputOutputRecord IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual InputOutputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(InputOutputRecord inputOutputRecord) => throw null; + + public static explicit operator InputOutputRecord(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.cs new file mode 100644 index 000000000000..56ed7f2ec3df --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputOutputRecord.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Usage.Models +{ + public partial class InputOutputRecord + { + public InputOutputRecord(string requiredProp) => throw null; + + public string RequiredProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.Serialization.cs new file mode 100644 index 000000000000..e223eafde077 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Usage.Models +{ + public partial class InputRecord : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + InputRecord IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual InputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + InputRecord IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual InputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(InputRecord inputRecord) => throw null; + + public static explicit operator InputRecord(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.cs new file mode 100644 index 000000000000..242d9bf32ed3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/InputRecord.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Usage.Models +{ + public partial class InputRecord + { + public InputRecord(string requiredProp) => throw null; + + public string RequiredProp => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.Serialization.cs new file mode 100644 index 000000000000..1bdd0625f6bd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Usage.Models +{ + public partial class OutputRecord : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + OutputRecord IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual OutputRecord JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + OutputRecord IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual OutputRecord PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(OutputRecord outputRecord) => throw null; + + public static explicit operator OutputRecord(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.cs new file mode 100644 index 000000000000..2a00353356f5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/Models/OutputRecord.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Usage.Models +{ + public partial class OutputRecord + { + public string RequiredProp => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/TypeModelUsageModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/TypeModelUsageModelFactory.cs new file mode 100644 index 000000000000..133b4590c5ab --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/TypeModelUsageModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Model.Usage.Models +{ + public static partial class TypeModelUsageModelFactory + { + public static InputRecord InputRecord(string requiredProp = default) => throw null; + + public static OutputRecord OutputRecord(string requiredProp = default) => throw null; + + public static InputOutputRecord InputOutputRecord(string requiredProp = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs new file mode 100644 index 000000000000..911b16bc0d22 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Usage.Models; + +namespace _Type.Model.Usage +{ + public partial class UsageClient + { + public UsageClient() : this(new Uri("http://localhost:3000"), new UsageClientOptions()) => throw null; + + public UsageClient(Uri endpoint, UsageClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response Input(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task InputAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response Input(InputRecord input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task InputAsync(InputRecord input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response Output(RequestContext context) => throw null; + + public virtual Task OutputAsync(RequestContext context) => throw null; + + public virtual Response Output(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> OutputAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response InputAndOutput(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task InputAndOutputAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response InputAndOutput(InputOutputRecord body, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> InputAndOutputAsync(InputOutputRecord body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs new file mode 100644 index 000000000000..7bb2126126f0 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Usage +{ + public partial class UsageClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Type.Model.Usage.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Type.Model.Usage.csproj new file mode 100644 index 000000000000..2aafc13a96dc --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Type.Model.Usage.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Usage client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Usage + 1.0.0-beta.1 + _Type.Model.Usage + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json new file mode 100644 index 000000000000..81a5a9b33026 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/tspCodeModel.json @@ -0,0 +1,415 @@ +{ + "$id": "1", + "Name": "Type.Model.Usage", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "InputRecord", + "clientNamespace": "Type.Model.Usage", + "crossLanguageDefinitionId": "Type.Model.Usage.InputRecord", + "usage": "Input,Json", + "doc": "Record used in operation parameters", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "requiredProp", + "serializedName": "requiredProp", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Usage.InputRecord.requiredProp", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "requiredProp" + } + } + } + ] + }, + { + "$id": "7", + "kind": "model", + "name": "OutputRecord", + "clientNamespace": "Type.Model.Usage", + "crossLanguageDefinitionId": "Type.Model.Usage.OutputRecord", + "usage": "Output,Json", + "doc": "Record used in operation return type", + "decorators": [], + "properties": [ + { + "$id": "8", + "kind": "property", + "name": "requiredProp", + "serializedName": "requiredProp", + "type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Usage.OutputRecord.requiredProp", + "serializationOptions": { + "$id": "10", + "json": { + "$id": "11", + "name": "requiredProp" + } + } + } + ] + }, + { + "$id": "12", + "kind": "model", + "name": "InputOutputRecord", + "clientNamespace": "Type.Model.Usage", + "crossLanguageDefinitionId": "Type.Model.Usage.InputOutputRecord", + "usage": "Input,Output,Json", + "doc": "Record used both as operation parameter and return type", + "decorators": [], + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "requiredProp", + "serializedName": "requiredProp", + "type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Usage.InputOutputRecord.requiredProp", + "serializationOptions": { + "$id": "15", + "json": { + "$id": "16", + "name": "requiredProp" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "17", + "Name": "UsageClient", + "ClientNamespace": "Type.Model.Usage", + "Doc": "Illustrates usage of Record in different places(Operation parameters, return type or both).", + "Operations": [ + { + "$id": "18", + "Name": "input", + "ResourceName": "Usage", + "Accessibility": "public", + "Parameters": [ + { + "$id": "19", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "20", + "kind": "constant", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "22", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "23", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/usage/input", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Usage.input", + "Decorators": [] + }, + { + "$id": "24", + "Name": "output", + "ResourceName": "Usage", + "Accessibility": "public", + "Parameters": [ + { + "$id": "25", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "26", + "kind": "constant", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "28", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "7" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/model/usage/output", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Usage.output", + "Decorators": [] + }, + { + "$id": "29", + "Name": "inputAndOutput", + "ResourceName": "Usage", + "Accessibility": "public", + "Parameters": [ + { + "$id": "30", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "31", + "kind": "constant", + "valueType": { + "$id": "32", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "33", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "34", + "kind": "constant", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "36", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "37", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "12" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/usage/input-output", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Usage.inputAndOutput", + "Decorators": [] + } + ], + "Protocol": { + "$id": "38" + }, + "Parameters": [ + { + "$id": "39", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "40", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "41", + "Type": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Configuration.json new file mode 100644 index 000000000000..e4f6a2ec282d --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Model.Visibility", + "library-name": "Type.Model.Visibility" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Type.Model.Visibility.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Type.Model.Visibility.sln new file mode 100644 index 000000000000..a3c7583f5254 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/Type.Model.Visibility.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Model.Visibility", "src\_Type.Model.Visibility.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..bc2ca640942e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Visibility +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..3d8765afc8fd --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Visibility +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..5548fff78295 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Visibility +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..7916a4bcd475 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Model.Visibility +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.Serialization.cs new file mode 100644 index 000000000000..275c5deeb2d1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Visibility.Models +{ + public partial class ReadOnlyModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ReadOnlyModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ReadOnlyModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ReadOnlyModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ReadOnlyModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(ReadOnlyModel readOnlyModel) => throw null; + + public static explicit operator ReadOnlyModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.cs new file mode 100644 index 000000000000..92b8c1c84537 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/ReadOnlyModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Visibility.Models +{ + public partial class ReadOnlyModel + { + public ReadOnlyModel() => throw null; + + public IReadOnlyList OptionalNullableIntList => throw null; + + public IReadOnlyDictionary OptionalStringRecord => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.Serialization.cs new file mode 100644 index 000000000000..626be589f55e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Model.Visibility.Models +{ + public partial class VisibilityModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + VisibilityModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual VisibilityModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + VisibilityModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual VisibilityModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(VisibilityModel visibilityModel) => throw null; + + public static explicit operator VisibilityModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.cs new file mode 100644 index 000000000000..750a9ce9b757 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/Models/VisibilityModel.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Visibility.Models +{ + public partial class VisibilityModel + { + public VisibilityModel(int queryProp, IEnumerable createProp, IEnumerable updateProp, bool deleteProp) => throw null; + + public string ReadProp => throw null; + + public int QueryProp + { + get => throw null; + set => throw null; + } + + public IList CreateProp => throw null; + + public IList UpdateProp => throw null; + + public bool DeleteProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/TypeModelVisibilityModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/TypeModelVisibilityModelFactory.cs new file mode 100644 index 000000000000..dc1866cc5176 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/TypeModelVisibilityModelFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Model.Visibility.Models +{ + public static partial class TypeModelVisibilityModelFactory + { + public static VisibilityModel VisibilityModel(string readProp = default, int queryProp = default, IEnumerable createProp = default, IEnumerable updateProp = default, bool deleteProp = default) => throw null; + + public static ReadOnlyModel ReadOnlyModel(IEnumerable optionalNullableIntList = default, IReadOnlyDictionary optionalStringRecord = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs new file mode 100644 index 000000000000..4b9f5bfe95ca --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Model.Visibility.Models; + +namespace _Type.Model.Visibility +{ + public partial class VisibilityClient + { + public VisibilityClient() : this(new Uri("http://localhost:3000"), new VisibilityClientOptions()) => throw null; + + public VisibilityClient(Uri endpoint, VisibilityClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task GetModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response GetModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response HeadModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task HeadModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response HeadModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task HeadModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PutModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PostModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PostModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PostModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response DeleteModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task DeleteModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response DeleteModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Response PutReadOnlyModel(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PutReadOnlyModelAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PutReadOnlyModel(ReadOnlyModel input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> PutReadOnlyModelAsync(ReadOnlyModel input, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs new file mode 100644 index 000000000000..3fb764998dd5 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Model.Visibility +{ + public partial class VisibilityClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Type.Model.Visibility.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Type.Model.Visibility.csproj new file mode 100644 index 000000000000..2c50f78d8180 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Type.Model.Visibility.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Model.Visibility client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Model.Visibility + 1.0.0-beta.1 + _Type.Model.Visibility + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json new file mode 100644 index 000000000000..8168adc94069 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/tspCodeModel.json @@ -0,0 +1,904 @@ +{ + "$id": "1", + "Name": "Type.Model.Visibility", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "VisibilityModel", + "clientNamespace": "Type.Model.Visibility", + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel", + "usage": "Input,Output,Json", + "doc": "Output model with visibility properties.", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "readProp", + "serializedName": "readProp", + "doc": "Required string, illustrating a readonly property.", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel.readProp", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "readProp" + } + } + }, + { + "$id": "7", + "kind": "property", + "name": "queryProp", + "serializedName": "queryProp", + "doc": "Required int32, illustrating a query property.", + "type": { + "$id": "8", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel.queryProp", + "serializationOptions": { + "$id": "9", + "json": { + "$id": "10", + "name": "queryProp" + } + } + }, + { + "$id": "11", + "kind": "property", + "name": "createProp", + "serializedName": "createProp", + "doc": "Required string[], illustrating a create property.", + "type": { + "$id": "12", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel.createProp", + "serializationOptions": { + "$id": "14", + "json": { + "$id": "15", + "name": "createProp" + } + } + }, + { + "$id": "16", + "kind": "property", + "name": "updateProp", + "serializedName": "updateProp", + "doc": "Required int32[], illustrating a update property.", + "type": { + "$id": "17", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "18", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel.updateProp", + "serializationOptions": { + "$id": "19", + "json": { + "$id": "20", + "name": "updateProp" + } + } + }, + { + "$id": "21", + "kind": "property", + "name": "deleteProp", + "serializedName": "deleteProp", + "doc": "Required bool, illustrating a delete property.", + "type": { + "$id": "22", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.VisibilityModel.deleteProp", + "serializationOptions": { + "$id": "23", + "json": { + "$id": "24", + "name": "deleteProp" + } + } + } + ] + }, + { + "$id": "25", + "kind": "model", + "name": "ReadOnlyModel", + "clientNamespace": "Type.Model.Visibility", + "crossLanguageDefinitionId": "Type.Model.Visibility.ReadOnlyModel", + "usage": "Input,Output,Json", + "doc": "RoundTrip model with readonly optional properties.", + "decorators": [], + "properties": [ + { + "$id": "26", + "kind": "property", + "name": "optionalNullableIntList", + "serializedName": "optionalNullableIntList", + "doc": "Optional readonly nullable int list.", + "type": { + "$id": "27", + "kind": "nullable", + "type": { + "$id": "28", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "29", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.ReadOnlyModel.optionalNullableIntList", + "serializationOptions": { + "$id": "30", + "json": { + "$id": "31", + "name": "optionalNullableIntList" + } + } + }, + { + "$id": "32", + "kind": "property", + "name": "optionalStringRecord", + "serializedName": "optionalStringRecord", + "doc": "Optional readonly string dictionary.", + "type": { + "$id": "33", + "kind": "dict", + "keyType": { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Model.Visibility.ReadOnlyModel.optionalStringRecord", + "serializationOptions": { + "$id": "36", + "json": { + "$id": "37", + "name": "optionalStringRecord" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "38", + "Name": "VisibilityClient", + "ClientNamespace": "Type.Model.Visibility", + "Doc": "Illustrates models with visibility properties.", + "Operations": [ + { + "$id": "39", + "Name": "getModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "40", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "41", + "kind": "constant", + "valueType": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "43", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "44", + "kind": "constant", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "46", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "47", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.getModel", + "Decorators": [] + }, + { + "$id": "48", + "Name": "headModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "49", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "50", + "kind": "constant", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "52", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "53", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.headModel", + "Decorators": [] + }, + { + "$id": "54", + "Name": "putModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "55", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "56", + "kind": "constant", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "58", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "59", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.putModel", + "Decorators": [] + }, + { + "$id": "60", + "Name": "patchModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "61", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "62", + "kind": "constant", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "64", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "65", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Model.Visibility.patchModel", + "Decorators": [] + }, + { + "$id": "66", + "Name": "postModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "67", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "68", + "kind": "constant", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "70", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "71", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.postModel", + "Decorators": [] + }, + { + "$id": "72", + "Name": "deleteModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "73", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "74", + "kind": "constant", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "76", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "77", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.deleteModel", + "Decorators": [] + }, + { + "$id": "78", + "Name": "putReadOnlyModel", + "ResourceName": "Visibility", + "Accessibility": "public", + "Parameters": [ + { + "$id": "79", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "80", + "kind": "constant", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "82", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "83", + "kind": "constant", + "valueType": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "85", + "Name": "input", + "NameInRequest": "input", + "Type": { + "$ref": "25" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "86", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "25" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/model/visibility/readonlyroundtrip", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Model.Visibility.putReadOnlyModel", + "Decorators": [] + } + ], + "Protocol": { + "$id": "87" + }, + "Parameters": [ + { + "$id": "88", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "89", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "90", + "Type": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Configuration.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Configuration.json new file mode 100644 index 000000000000..8c8ab1dc016b --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Configuration.json @@ -0,0 +1,5 @@ +{ + "output-folder": ".", + "namespace": "Type.Property.Nullable", + "library-name": "Type.Property.Nullable" +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Type.Property.Nullable.sln b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Type.Property.Nullable.sln new file mode 100644 index 000000000000..dbbe04b9023a --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/Type.Property.Nullable.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35201.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type.Property.Nullable", "src\_Type.Property.Nullable.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs new file mode 100644 index 000000000000..3fa7adfcd8f3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class Bytes + { + protected Bytes() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs new file mode 100644 index 000000000000..43669b6cc0e6 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class CollectionsByte + { + protected CollectionsByte() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs new file mode 100644 index 000000000000..c923ad2b2e63 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class CollectionsModel + { + protected CollectionsModel() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs new file mode 100644 index 000000000000..2178b15852af --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class CollectionsString + { + protected CollectionsString() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs new file mode 100644 index 000000000000..78951777dbb8 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class Datetime + { + protected Datetime() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs new file mode 100644 index 000000000000..68b360292965 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class Duration + { + protected Duration() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenMemberAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..920bc1c91518 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSerializationAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..13980732eb66 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSuppressAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..17f6f33c5fe4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenTypeAttribute.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..d31c97ff49c1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.Serialization.cs new file mode 100644 index 000000000000..e94dd9b4eefb --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class BytesProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + BytesProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual BytesProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BytesProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BytesProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(BytesProperty bytesProperty) => throw null; + + public static explicit operator BytesProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.cs new file mode 100644 index 000000000000..80247fb05267 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/BytesProperty.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable.Models +{ + public partial class BytesProperty + { + public BytesProperty(string requiredProperty, BinaryData nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public BinaryData NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.Serialization.cs new file mode 100644 index 000000000000..2f1e5cf9ff12 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsByteProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + CollectionsByteProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsByteProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + CollectionsByteProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsByteProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(CollectionsByteProperty collectionsByteProperty) => throw null; + + public static explicit operator CollectionsByteProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.cs new file mode 100644 index 000000000000..fe960909269c --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsByteProperty.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsByteProperty + { + public CollectionsByteProperty(string requiredProperty, IEnumerable nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public IList NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.Serialization.cs new file mode 100644 index 000000000000..50eb1f8bc515 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsModelProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + CollectionsModelProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsModelProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + CollectionsModelProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsModelProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(CollectionsModelProperty collectionsModelProperty) => throw null; + + public static explicit operator CollectionsModelProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.cs new file mode 100644 index 000000000000..c4a01b96cf7e --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsModelProperty.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsModelProperty + { + public CollectionsModelProperty(string requiredProperty, IEnumerable nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public IList NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.Serialization.cs new file mode 100644 index 000000000000..a1f4d9321dc3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsStringProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + CollectionsStringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsStringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + CollectionsStringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual CollectionsStringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(CollectionsStringProperty collectionsStringProperty) => throw null; + + public static explicit operator CollectionsStringProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.cs new file mode 100644 index 000000000000..90ed88758083 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/CollectionsStringProperty.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace _Type.Property.Nullable.Models +{ + public partial class CollectionsStringProperty + { + public CollectionsStringProperty(string requiredProperty, IEnumerable nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public IList NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.Serialization.cs new file mode 100644 index 000000000000..cc6e9378b211 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class DatetimeProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + DatetimeProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual DatetimeProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + DatetimeProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual DatetimeProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(DatetimeProperty datetimeProperty) => throw null; + + public static explicit operator DatetimeProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.cs new file mode 100644 index 000000000000..905445de3bc1 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DatetimeProperty.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable.Models +{ + public partial class DatetimeProperty + { + public DatetimeProperty(string requiredProperty, DateTimeOffset? nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public DateTimeOffset? NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.Serialization.cs new file mode 100644 index 000000000000..e31f33a65276 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class DurationProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + DurationProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual DurationProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + DurationProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual DurationProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(DurationProperty durationProperty) => throw null; + + public static explicit operator DurationProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.cs new file mode 100644 index 000000000000..3878abc76067 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/DurationProperty.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace _Type.Property.Nullable.Models +{ + public partial class DurationProperty + { + public DurationProperty(string requiredProperty, TimeSpan? nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public TimeSpan? NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.Serialization.cs new file mode 100644 index 000000000000..1cc461618da4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class InnerModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + InnerModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual InnerModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + InnerModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual InnerModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(InnerModel innerModel) => throw null; + + public static explicit operator InnerModel(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.cs new file mode 100644 index 000000000000..85769f3f1f54 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/InnerModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Property.Nullable.Models +{ + public partial class InnerModel + { + public InnerModel(string @property) => throw null; + + public string Property + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.Serialization.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.Serialization.cs new file mode 100644 index 000000000000..6e42d88ecb85 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace _Type.Property.Nullable.Models +{ + public partial class StringProperty : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + StringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual StringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + StringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual StringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + /// The to serialize into . + public static implicit operator RequestContent(StringProperty stringProperty) => throw null; + + public static explicit operator StringProperty(Response result) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.cs new file mode 100644 index 000000000000..739cc4bcd6fa --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Models/StringProperty.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace _Type.Property.Nullable.Models +{ + public partial class StringProperty + { + public StringProperty(string requiredProperty, string nullableProperty) => throw null; + + public string RequiredProperty + { + get => throw null; + set => throw null; + } + + public string NullableProperty + { + get => throw null; + set => throw null; + } + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs new file mode 100644 index 000000000000..d729f5a38434 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Pipeline; + +namespace _Type.Property.Nullable +{ + public partial class NullableClient + { + public NullableClient() : this(new Uri("http://localhost:3000"), new NullableClientOptions()) => throw null; + + public NullableClient(Uri endpoint, NullableClientOptions options) => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual String GetStringClient() => throw null; + + public virtual Bytes GetBytesClient() => throw null; + + public virtual Datetime GetDatetimeClient() => throw null; + + public virtual Duration GetDurationClient() => throw null; + + public virtual CollectionsByte GetCollectionsByteClient() => throw null; + + public virtual CollectionsModel GetCollectionsModelClient() => throw null; + + public virtual CollectionsString GetCollectionsStringClient() => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs new file mode 100644 index 000000000000..b1e022537b12 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace _Type.Property.Nullable +{ + public partial class NullableClientOptions : ClientOptions + { + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs new file mode 100644 index 000000000000..868902fb9bc3 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using _Type.Property.Nullable.Models; + +namespace _Type.Property.Nullable +{ + public partial class String + { + protected String() => throw null; + + public HttpPipeline Pipeline => throw null; + + public virtual Response GetNonNull(RequestContext context) => throw null; + + public virtual Task GetNonNullAsync(RequestContext context) => throw null; + + public virtual Response GetNonNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response GetNull(RequestContext context) => throw null; + + public virtual Task GetNullAsync(RequestContext context) => throw null; + + public virtual Response GetNull(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual Response PatchNonNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNonNullAsync(RequestContent content, RequestContext context = null) => throw null; + + public virtual Response PatchNull(RequestContent content, RequestContext context = null) => throw null; + + public virtual Task PatchNullAsync(RequestContent content, RequestContext context = null) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/TypePropertyNullableModelFactory.cs b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/TypePropertyNullableModelFactory.cs new file mode 100644 index 000000000000..886d45eb9730 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/TypePropertyNullableModelFactory.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace _Type.Property.Nullable.Models +{ + public static partial class TypePropertyNullableModelFactory + { + public static CollectionsStringProperty CollectionsStringProperty(string requiredProperty = default, IEnumerable nullableProperty = default) => throw null; + + public static CollectionsModelProperty CollectionsModelProperty(string requiredProperty = default, IEnumerable nullableProperty = default) => throw null; + + public static InnerModel InnerModel(string @property = default) => throw null; + + public static CollectionsByteProperty CollectionsByteProperty(string requiredProperty = default, IEnumerable nullableProperty = default) => throw null; + + public static DurationProperty DurationProperty(string requiredProperty = default, TimeSpan? nullableProperty = default) => throw null; + + public static DatetimeProperty DatetimeProperty(string requiredProperty = default, DateTimeOffset? nullableProperty = default) => throw null; + + public static BytesProperty BytesProperty(string requiredProperty = default, BinaryData nullableProperty = default) => throw null; + + public static StringProperty StringProperty(string requiredProperty = default, string nullableProperty = default) => throw null; + } +} diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Type.Property.Nullable.csproj b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Type.Property.Nullable.csproj new file mode 100644 index 000000000000..dd4f46dd9f05 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Type.Property.Nullable.csproj @@ -0,0 +1,19 @@ + + + This is the _Type.Property.Nullable client library for developing .NET applications with rich experience. + SDK Code Generation _Type.Property.Nullable + 1.0.0-beta.1 + _Type.Property.Nullable + true + + + + + + + + + + + + diff --git a/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json new file mode 100644 index 000000000000..d42026ed90d4 --- /dev/null +++ b/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/tspCodeModel.json @@ -0,0 +1,2886 @@ +{ + "$id": "1", + "Name": "Type.Property.Nullable", + "ApiVersions": [], + "Enums": [], + "Models": [ + { + "$id": "2", + "kind": "model", + "name": "CollectionsStringProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsStringProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Model with collection string properties", + "decorators": [], + "properties": [ + { + "$id": "3", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsStringProperty.requiredProperty", + "serializationOptions": { + "$id": "5", + "json": { + "$id": "6", + "name": "requiredProperty" + } + } + }, + { + "$id": "7", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "8", + "kind": "nullable", + "type": { + "$id": "9", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsStringProperty.nullableProperty", + "serializationOptions": { + "$id": "11", + "json": { + "$id": "12", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$id": "13", + "kind": "model", + "name": "CollectionsModelProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModelProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Model with collection models properties", + "decorators": [], + "properties": [ + { + "$id": "14", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModelProperty.requiredProperty", + "serializationOptions": { + "$id": "16", + "json": { + "$id": "17", + "name": "requiredProperty" + } + } + }, + { + "$id": "18", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "19", + "kind": "nullable", + "type": { + "$id": "20", + "kind": "array", + "name": "ArrayInnerModel", + "valueType": { + "$id": "21", + "kind": "model", + "name": "InnerModel", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.InnerModel", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Inner model used in collections model property", + "decorators": [], + "properties": [ + { + "$id": "22", + "kind": "property", + "name": "property", + "serializedName": "property", + "doc": "Inner model property", + "type": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.InnerModel.property", + "serializationOptions": { + "$id": "24", + "json": { + "$id": "25", + "name": "property" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModelProperty.nullableProperty", + "serializationOptions": { + "$id": "26", + "json": { + "$id": "27", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$ref": "21" + }, + { + "$id": "28", + "kind": "model", + "name": "CollectionsByteProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByteProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Model with collection bytes properties", + "decorators": [], + "properties": [ + { + "$id": "29", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByteProperty.requiredProperty", + "serializationOptions": { + "$id": "31", + "json": { + "$id": "32", + "name": "requiredProperty" + } + } + }, + { + "$id": "33", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "34", + "kind": "nullable", + "type": { + "$id": "35", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "36", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByteProperty.nullableProperty", + "serializationOptions": { + "$id": "37", + "json": { + "$id": "38", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$id": "39", + "kind": "model", + "name": "DurationProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.DurationProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Model with a duration property", + "decorators": [], + "properties": [ + { + "$id": "40", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.DurationProperty.requiredProperty", + "serializationOptions": { + "$id": "42", + "json": { + "$id": "43", + "name": "requiredProperty" + } + } + }, + { + "$id": "44", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "45", + "kind": "nullable", + "type": { + "$id": "46", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.DurationProperty.nullableProperty", + "serializationOptions": { + "$id": "48", + "json": { + "$id": "49", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$id": "50", + "kind": "model", + "name": "DatetimeProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.DatetimeProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Model with a datetime property", + "decorators": [], + "properties": [ + { + "$id": "51", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "52", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.DatetimeProperty.requiredProperty", + "serializationOptions": { + "$id": "53", + "json": { + "$id": "54", + "name": "requiredProperty" + } + } + }, + { + "$id": "55", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "56", + "kind": "nullable", + "type": { + "$id": "57", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "58", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.DatetimeProperty.nullableProperty", + "serializationOptions": { + "$id": "59", + "json": { + "$id": "60", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$id": "61", + "kind": "model", + "name": "BytesProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.BytesProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Template type for testing models with nullable property. Pass in the type of the property you are looking for", + "decorators": [], + "properties": [ + { + "$id": "62", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.BytesProperty.requiredProperty", + "serializationOptions": { + "$id": "64", + "json": { + "$id": "65", + "name": "requiredProperty" + } + } + }, + { + "$id": "66", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "67", + "kind": "nullable", + "type": { + "$id": "68", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.BytesProperty.nullableProperty", + "serializationOptions": { + "$id": "69", + "json": { + "$id": "70", + "name": "nullableProperty" + } + } + } + ] + }, + { + "$id": "71", + "kind": "model", + "name": "StringProperty", + "clientNamespace": "Type.Property.Nullable", + "crossLanguageDefinitionId": "Type.Property.Nullable.StringProperty", + "usage": "Input,Output,JsonMergePatch,Json", + "doc": "Template type for testing models with nullable property. Pass in the type of the property you are looking for", + "decorators": [], + "properties": [ + { + "$id": "72", + "kind": "property", + "name": "requiredProperty", + "serializedName": "requiredProperty", + "doc": "Required property", + "type": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.StringProperty.requiredProperty", + "serializationOptions": { + "$id": "74", + "json": { + "$id": "75", + "name": "requiredProperty" + } + } + }, + { + "$id": "76", + "kind": "property", + "name": "nullableProperty", + "serializedName": "nullableProperty", + "doc": "Property", + "type": { + "$id": "77", + "kind": "nullable", + "type": { + "$id": "78", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "clientNamespace": "" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Type.Property.Nullable.StringProperty.nullableProperty", + "serializationOptions": { + "$id": "79", + "json": { + "$id": "80", + "name": "nullableProperty" + } + } + } + ] + } + ], + "Clients": [ + { + "$id": "81", + "Name": "NullableClient", + "ClientNamespace": "Type.Property.Nullable", + "Doc": "Illustrates models with nullable properties.", + "Operations": [], + "Protocol": { + "$id": "82" + }, + "Parameters": [ + { + "$id": "83", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "84", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "85", + "Type": { + "$id": "86", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "87", + "Name": "String", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "88", + "Name": "getNonNull", + "ResourceName": "String", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "89", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "90", + "kind": "constant", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "92", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "71" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/string/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.String.getNonNull", + "Decorators": [] + }, + { + "$id": "93", + "Name": "getNull", + "ResourceName": "String", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "94", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "95", + "kind": "constant", + "valueType": { + "$id": "96", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "97", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "71" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/string/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.String.getNull", + "Decorators": [] + }, + { + "$id": "98", + "Name": "patchNonNull", + "ResourceName": "String", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "99", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "100", + "kind": "constant", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "102", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "71" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "103", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/string/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.String.patchNonNull", + "Decorators": [] + }, + { + "$id": "104", + "Name": "patchNull", + "ResourceName": "String", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "105", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "106", + "kind": "constant", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "108", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "71" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "109", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/string/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.String.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "110" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "111", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "112", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "113", + "Type": { + "$id": "114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "115", + "Name": "Bytes", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "116", + "Name": "getNonNull", + "ResourceName": "Bytes", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "117", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "118", + "kind": "constant", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "120", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "61" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/bytes/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Bytes.getNonNull", + "Decorators": [] + }, + { + "$id": "121", + "Name": "getNull", + "ResourceName": "Bytes", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "122", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "123", + "kind": "constant", + "valueType": { + "$id": "124", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "125", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "61" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/bytes/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Bytes.getNull", + "Decorators": [] + }, + { + "$id": "126", + "Name": "patchNonNull", + "ResourceName": "Bytes", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "127", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "128", + "kind": "constant", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "130", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "61" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "131", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/bytes/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Bytes.patchNonNull", + "Decorators": [] + }, + { + "$id": "132", + "Name": "patchNull", + "ResourceName": "Bytes", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "133", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "134", + "kind": "constant", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "136", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "61" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "137", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/bytes/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Bytes.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "138" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "139", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "140", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "141", + "Type": { + "$id": "142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "143", + "Name": "Datetime", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "144", + "Name": "getNonNull", + "ResourceName": "Datetime", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "145", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "146", + "kind": "constant", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "148", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "50" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/datetime/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Datetime.getNonNull", + "Decorators": [] + }, + { + "$id": "149", + "Name": "getNull", + "ResourceName": "Datetime", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "150", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "151", + "kind": "constant", + "valueType": { + "$id": "152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "153", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "50" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/datetime/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Datetime.getNull", + "Decorators": [] + }, + { + "$id": "154", + "Name": "patchNonNull", + "ResourceName": "Datetime", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "155", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "156", + "kind": "constant", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "158", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "50" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "159", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/datetime/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Datetime.patchNonNull", + "Decorators": [] + }, + { + "$id": "160", + "Name": "patchNull", + "ResourceName": "Datetime", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "161", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "162", + "kind": "constant", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "164", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "50" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "165", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/datetime/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Datetime.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "166" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "167", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "168", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "169", + "Type": { + "$id": "170", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "171", + "Name": "Duration", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "172", + "Name": "getNonNull", + "ResourceName": "Duration", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "173", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "174", + "kind": "constant", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "176", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "39" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/duration/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Duration.getNonNull", + "Decorators": [] + }, + { + "$id": "177", + "Name": "getNull", + "ResourceName": "Duration", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "178", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "179", + "kind": "constant", + "valueType": { + "$id": "180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "181", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "39" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/duration/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Duration.getNull", + "Decorators": [] + }, + { + "$id": "182", + "Name": "patchNonNull", + "ResourceName": "Duration", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "183", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "184", + "kind": "constant", + "valueType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "186", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "39" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "187", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/duration/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Duration.patchNonNull", + "Decorators": [] + }, + { + "$id": "188", + "Name": "patchNull", + "ResourceName": "Duration", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "189", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "190", + "kind": "constant", + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "192", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "39" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "193", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/duration/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.Duration.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "194" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "195", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "196", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "197", + "Type": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "199", + "Name": "CollectionsByte", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "200", + "Name": "getNonNull", + "ResourceName": "CollectionsByte", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "201", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "202", + "kind": "constant", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "204", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "28" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/bytes/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByte.getNonNull", + "Decorators": [] + }, + { + "$id": "205", + "Name": "getNull", + "ResourceName": "CollectionsByte", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "206", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "207", + "kind": "constant", + "valueType": { + "$id": "208", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "209", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "28" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/bytes/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByte.getNull", + "Decorators": [] + }, + { + "$id": "210", + "Name": "patchNonNull", + "ResourceName": "CollectionsByte", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "211", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "212", + "kind": "constant", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "214", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "28" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "215", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/bytes/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByte.patchNonNull", + "Decorators": [] + }, + { + "$id": "216", + "Name": "patchNull", + "ResourceName": "CollectionsByte", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "217", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "218", + "kind": "constant", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "220", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "28" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "221", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/bytes/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsByte.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "222" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "223", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "224", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "225", + "Type": { + "$id": "226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "227", + "Name": "CollectionsModel", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "228", + "Name": "getNonNull", + "ResourceName": "CollectionsModel", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "229", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "230", + "kind": "constant", + "valueType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "232", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "13" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/model/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModel.getNonNull", + "Decorators": [] + }, + { + "$id": "233", + "Name": "getNull", + "ResourceName": "CollectionsModel", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "234", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "235", + "kind": "constant", + "valueType": { + "$id": "236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "237", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "13" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/model/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModel.getNull", + "Decorators": [] + }, + { + "$id": "238", + "Name": "patchNonNull", + "ResourceName": "CollectionsModel", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "239", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "240", + "kind": "constant", + "valueType": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "242", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "13" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "243", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/model/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModel.patchNonNull", + "Decorators": [] + }, + { + "$id": "244", + "Name": "patchNull", + "ResourceName": "CollectionsModel", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "245", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "246", + "kind": "constant", + "valueType": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "248", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "13" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "249", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/model/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsModel.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "250" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "251", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "252", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "253", + "Type": { + "$id": "254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "255", + "Name": "CollectionsString", + "ClientNamespace": "Type.Property.Nullable", + "Operations": [ + { + "$id": "256", + "Name": "getNonNull", + "ResourceName": "CollectionsString", + "Doc": "Get models that will return all properties in the model", + "Accessibility": "public", + "Parameters": [ + { + "$id": "257", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "258", + "kind": "constant", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "260", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/string/non-null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsString.getNonNull", + "Decorators": [] + }, + { + "$id": "261", + "Name": "getNull", + "ResourceName": "CollectionsString", + "Doc": "Get models that will return the default object", + "Accessibility": "public", + "Parameters": [ + { + "$id": "262", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "263", + "kind": "constant", + "valueType": { + "$id": "264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "265", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "2" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/string/null", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsString.getNull", + "Decorators": [] + }, + { + "$id": "266", + "Name": "patchNonNull", + "ResourceName": "CollectionsString", + "Doc": "Put a body with all properties present.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "267", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "268", + "kind": "constant", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "270", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "271", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/string/non-null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsString.patchNonNull", + "Decorators": [] + }, + { + "$id": "272", + "Name": "patchNull", + "ResourceName": "CollectionsString", + "Doc": "Put a body with default properties.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "273", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "content-type is application/merge-patch+json", + "Type": { + "$id": "274", + "kind": "constant", + "valueType": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "276", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "2" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "277", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/type/property/nullable/collections/string/null", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Type.Property.Nullable.CollectionsString.patchNull", + "Decorators": [] + } + ], + "Protocol": { + "$id": "278" + }, + "Parent": "NullableClient", + "Parameters": [ + { + "$id": "279", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "280", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "281", + "Type": { + "$id": "282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/eng/packages/http-client-csharp/package-lock.json b/eng/packages/http-client-csharp/package-lock.json index e6bb5e8acced..109cad6cf5fe 100644 --- a/eng/packages/http-client-csharp/package-lock.json +++ b/eng/packages/http-client-csharp/package-lock.json @@ -8,25 +8,27 @@ "name": "@azure-typespec/http-client-csharp", "version": "1.0.0", "dependencies": { - "@typespec/http-client-csharp": "0.1.9-alpha.20241219.2" + "@typespec/http-client-csharp": "0.1.9-alpha.20250210.4" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.49.0", - "@azure-tools/typespec-azure-core": "0.49.0", - "@azure-tools/typespec-azure-resource-manager": "0.49.0", - "@azure-tools/typespec-azure-rulesets": "0.49.0", - "@azure-tools/typespec-client-generator-core": "0.49.0", + "@azure-tools/azure-http-specs": "0.1.0-alpha.5", + "@azure-tools/typespec-autorest": "0.50.0", + "@azure-tools/typespec-azure-core": "0.50.0", + "@azure-tools/typespec-azure-resource-manager": "0.50.0", + "@azure-tools/typespec-azure-rulesets": "0.50.0", + "@azure-tools/typespec-client-generator-core": "0.50.2", "@eslint/js": "^9.2.0", "@types/node": "~22.7.5", "@types/prettier": "^2.6.3", - "@typespec/compiler": "0.63.0", - "@typespec/http": "0.63.0", - "@typespec/json-schema": "0.63.0", - "@typespec/library-linter": "0.63.0", - "@typespec/openapi": "0.63.0", - "@typespec/rest": "0.63.0", - "@typespec/versioning": "0.63.0", - "@typespec/xml": "0.63.0", + "@typespec/compiler": "0.64.0", + "@typespec/http": "0.64.0", + "@typespec/http-specs": "0.1.0-alpha.7", + "@typespec/json-schema": "0.64.0", + "@typespec/library-linter": "0.64.0", + "@typespec/openapi": "0.64.0", + "@typespec/rest": "0.64.0", + "@typespec/versioning": "0.64.0", + "@typespec/xml": "0.64.0", "@vitest/coverage-v8": "^1.4.0", "@vitest/ui": "^1.4.0", "c8": "^9.1.0", @@ -53,46 +55,64 @@ "node": ">=6.0.0" } }, + "node_modules/@azure-tools/azure-http-specs": { + "version": "0.1.0-alpha.5", + "resolved": "https://registry.npmjs.org/@azure-tools/azure-http-specs/-/azure-http-specs-0.1.0-alpha.5.tgz", + "integrity": "sha512-U4/rArTPuU5endAO68eY3fx3yqaS7rZNn+/kGmJUV3qPmGDxRPfMes6RJ7D98bfdpD2k60wufrhk5REbqnhhDA==", + "dev": true, + "dependencies": { + "@typespec/spec-api": "~0.1.0-alpha.0", + "@typespec/spector": "~0.1.0-alpha.6" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.50.0", + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/versioning": "~0.64.0", + "@typespec/xml": "~0.64.0" + } + }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.49.0.tgz", - "integrity": "sha512-stwfhmEc3yPeXbM8yfLKVCtaX5mR0H+sL74Xy/eMdEWoJgiE3aJxkgRWESu/7/vo99vugzo/HRwIEO5ELnyfRg==", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.50.0.tgz", + "integrity": "sha512-CYzqN11NGU2HNJcycph7HCpjQoOR+XzyySDi6Z6rsXhZa/XTPDYJtmGHNVHXYGgvxJPxPJ9jm13DiLf/ReJnSA==", "dev": true, - "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.49.0", - "@azure-tools/typespec-azure-resource-manager": "~0.49.0", - "@azure-tools/typespec-client-generator-core": "~0.49.0", - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0", - "@typespec/openapi": "~0.63.0", - "@typespec/rest": "~0.63.0", - "@typespec/versioning": "~0.63.0" + "@azure-tools/typespec-azure-core": "~0.50.0", + "@azure-tools/typespec-azure-resource-manager": "~0.50.0", + "@azure-tools/typespec-client-generator-core": "~0.50.0", + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/openapi": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/versioning": "~0.64.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.49.0.tgz", - "integrity": "sha512-hNKy+aePmPkB1brHQkO1tsJXqXPzt/9ehy10dv0rKdp9xq5dE3yBctHF5Aj3Nr8kr8GRG5z4KYpYPbV5guoT5w==", - "license": "MIT", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.50.0.tgz", + "integrity": "sha512-6kUhWNQc4Btgx7rIbx3dubBLst73qv04dGWg0yNoVi86iIXy+8wr4ee6pgk+niMsZDeHEBEWeeLy9VwCg3MgTg==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0", - "@typespec/rest": "~0.63.0" + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/rest": "~0.64.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.49.0.tgz", - "integrity": "sha512-1xWuG8OBJDykYM6BFD2owV9WH+oC32zt7XteXA0T4nH2T+D+sEFKppkCOMtIjX7ENBAlecmbdwgSNTZYQf4vaw==", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.50.0.tgz", + "integrity": "sha512-ekLAyPyy9eMMqdi3pj3g+iw9NNiK6ObDIU/W/bwSBSPwN2Po9d46fb65vcsjPeEkBceeRIPP6p54QtG9JYhSfg==", "dev": true, - "license": "MIT", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -101,34 +121,33 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.49.0", - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0", - "@typespec/openapi": "~0.63.0", - "@typespec/rest": "~0.63.0", - "@typespec/versioning": "~0.63.0" + "@azure-tools/typespec-azure-core": "~0.50.0", + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/openapi": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/versioning": "~0.64.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.49.0.tgz", - "integrity": "sha512-qKynK3lp+eqlt6QPGFSptrt9uqJUfeuv6yVXYDuaX1Jqu7tbTAgGf0HtN8mqPzfu3eAb84bdq6VgNspxyXLDOg==", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.50.0.tgz", + "integrity": "sha512-b2YjhaUqPxk53eswZKPzK1IzTJJe/AD+Yi/G15+fiar7oozQJtZpe7ysrSsknzKEoy92iiknsIVa5giRie0ATg==", "dev": true, - "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.49.0", - "@azure-tools/typespec-azure-resource-manager": "~0.49.0", - "@azure-tools/typespec-client-generator-core": "~0.49.0", - "@typespec/compiler": "~0.63.0" + "@azure-tools/typespec-azure-core": "~0.50.0", + "@azure-tools/typespec-azure-resource-manager": "~0.50.0", + "@azure-tools/typespec-client-generator-core": "~0.50.0", + "@typespec/compiler": "~0.64.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.49.0.tgz", - "integrity": "sha512-inFLRIeTU0mQg4PT19O3YwT/4YODLuTgIsXuhKDdG/sEsx8PG8AEFTabtnZJ0w3Lc4xuxKFJrzZ2ZH2iiAAbig==", + "version": "0.50.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.50.2.tgz", + "integrity": "sha512-xSyJ5OWqu9BToUoQrmoN6a9pxHpTUqDEyc5pmhRwzeuz3zOIvFs2DFKimE2wqVmhFTYg6LTVqle/UU4sr/vdyQ==", "license": "MIT", "dependencies": { "change-case": "~5.4.4", @@ -139,12 +158,335 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.49.0", - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0", - "@typespec/openapi": "~0.63.0", - "@typespec/rest": "~0.63.0", - "@typespec/versioning": "~0.63.0" + "@azure-tools/typespec-azure-core": "~0.50.0", + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/openapi": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/versioning": "~0.64.0", + "@typespec/xml": "~0.64.0" + } + }, + "node_modules/@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "dev": true, + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure/core-auth": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.9.0.tgz", + "integrity": "sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-client": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.9.2.tgz", + "integrity": "sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.4.0", + "@azure/core-rest-pipeline": "^1.9.1", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.6.1", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-client/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-http-compat": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.1.2.tgz", + "integrity": "sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-client": "^1.3.0", + "@azure/core-rest-pipeline": "^1.3.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-lro": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz", + "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.2.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-lro/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-paging": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz", + "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.18.2.tgz", + "integrity": "sha512-IkTf/DWKyCklEtN/WYW3lqEsIaUDshlzWRlZNNwSYtFcCBQz++OtOjxNpm8rr1VcbMS6RpjybQa3u6B6nG0zNw==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.8.0", + "@azure/core-tracing": "^1.0.1", + "@azure/core-util": "^1.11.0", + "@azure/logger": "^1.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-tracing": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.2.0.tgz", + "integrity": "sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-util": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.11.0.tgz", + "integrity": "sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-xml": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.4.4.tgz", + "integrity": "sha512-J4FYAqakGXcbfeZjwjMzjNcpcH4E+JtEBv+xcV1yL0Ydn/6wbQfeFKTCHh9wttAi0lmajHw7yBbHPRG+YHckZQ==", + "dev": true, + "dependencies": { + "fast-xml-parser": "^4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/identity": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.4.1.tgz", + "integrity": "sha512-DwnG4cKFEM7S3T+9u05NstXU/HN0dk45kPOinUyNKsn5VWwpXd9sbPKEg6kgJzGbm1lMuhx9o31PVbCtM5sfBA==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.5.0", + "@azure/core-client": "^1.9.2", + "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.3.0", + "@azure/logger": "^1.0.0", + "@azure/msal-browser": "^3.14.0", + "@azure/msal-node": "^2.9.2", + "events": "^3.0.0", + "jws": "^4.0.0", + "open": "^8.0.0", + "stoppable": "^1.1.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.4.tgz", + "integrity": "sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/msal-browser": { + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.28.1.tgz", + "integrity": "sha512-OHHEWMB5+Zrix8yKvLVzU3rKDFvh7SOzAzXfICD7YgUXLxfHpTPX2pzOotrri1kskwhHqIj4a5LvhZlIqE7C7g==", + "dev": true, + "dependencies": { + "@azure/msal-common": "14.16.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-common": { + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/msal-node": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", + "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", + "dev": true, + "dependencies": { + "@azure/msal-common": "14.16.0", + "jsonwebtoken": "^9.0.0", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@azure/storage-blob": { + "version": "12.25.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.25.0.tgz", + "integrity": "sha512-oodouhA3nCCIh843tMMbxty3WqfNT+Vgzj3Xo5jqR9UPnzq3d7mzLjlHAYz7lW+b4km3SIgz+NAgztvhm7Z6kQ==", + "dev": true, + "dependencies": { + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.4.0", + "@azure/core-client": "^1.6.2", + "@azure/core-http-compat": "^2.0.0", + "@azure/core-lro": "^2.2.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-rest-pipeline": "^1.10.1", + "@azure/core-tracing": "^1.1.2", + "@azure/core-util": "^1.6.1", + "@azure/core-xml": "^1.4.3", + "@azure/logger": "^1.0.0", + "events": "^3.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@babel/code-frame": { @@ -229,6 +571,26 @@ "dev": true, "license": "MIT" }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "dev": true, + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1231,12 +1593,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true + }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "version": "22.7.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.9.tgz", + "integrity": "sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==", "dev": true, - "license": "MIT", "dependencies": { "undici-types": "~6.19.2" } @@ -1248,6 +1615,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.18.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", @@ -1499,10 +1872,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz", - "integrity": "sha512-cC3YniwbFghn1fASX3r1IgNjMrwaY4gmzznkHT4f/NxE+HK4XoXWn4EG7287QgVMCaHUykzJCIfW9k7kIleW5A==", - "license": "MIT", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.64.0.tgz", + "integrity": "sha512-LnQGlQMWyqvhGg4Z9iyr5qSBTjI9zd49sodbEJbLafrxbj9pbHyjfSFbvt60gVbfuNvLErsdXvZiqqXV5nZdmQ==", "dependencies": { "@babel/code-frame": "~7.25.7", "ajv": "~8.17.1", @@ -1543,16 +1915,15 @@ } }, "node_modules/@typespec/http": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.63.0.tgz", - "integrity": "sha512-SYVbBmLPAPdWZfdMs0QlbpTnFREDnkINu2FR+0kRX12qzbRgpRbLsdhg59qx4TfKoh4IAPgSV+Fq84w7BWGsyQ==", - "license": "MIT", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.64.0.tgz", + "integrity": "sha512-vyyZP3Woo7or/2Oiq1fH+R0X/4WOBDjAlGsb9tLQzswfQHp710kNfiecA10y9gDC/9h+PjKsTElS1RcRRanpwA==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0", - "@typespec/streams": "~0.63.0" + "@typespec/compiler": "~0.64.0", + "@typespec/streams": "~0.64.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -1561,29 +1932,53 @@ } }, "node_modules/@typespec/http-client-csharp": { - "version": "0.1.9-alpha.20241219.2", - "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20241219.2.tgz", - "integrity": "sha512-Z6lYmYoLkvQM0Is0DsfSDT7C7fxCoTLgk0AtpHhWwT56iV49kWGyIihfHULPEnhuznkPNrL5NJf2pd2HLEW5SQ==", + "version": "0.1.9-alpha.20250210.4", + "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20250210.4.tgz", + "integrity": "sha512-40I8S6zFVgwTh0huhzPBMpPz3IcyIcHF6kQqXZtWtx2tsPA6UClO1xWxmeIpRs5UMzGjuVgUKH7hYgbU3R2eRg==", "license": "MIT", "dependencies": { + "@typespec/http-client-csharp": "file:", "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", - "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", - "@typespec/compiler": ">=0.63.0 <1.0.0 || ~0.64.0-0", - "@typespec/http": ">=0.63.0 <1.0.0 || ~0.64.0-0", - "@typespec/openapi": ">=0.63.0 <1.0.0 || ~0.64.0-0", - "@typespec/rest": ">=0.63.0 <1.0.0 || ~0.64.0-0", - "@typespec/versioning": ">=0.63.0 <1.0.0 || ~0.64.0-0" + "@azure-tools/typespec-azure-core": ">=0.50.0 <1.0.0 || ~0.51.0-0", + "@azure-tools/typespec-client-generator-core": ">=0.50.0 <1.0.0 || ~0.51.0-0", + "@typespec/compiler": ">=0.64.0 <1.0.0 || ~0.65.0-0", + "@typespec/http": ">=0.64.0 <1.0.0 || ~0.65.0-0", + "@typespec/openapi": ">=0.64.0 <1.0.0 || ~0.65.0-0", + "@typespec/rest": ">=0.64.0 <1.0.0 || ~0.65.0-0", + "@typespec/versioning": ">=0.64.0 <1.0.0 || ~0.65.0-0" + } + }, + "node_modules/@typespec/http-client-csharp/node_modules/@typespec/http-client-csharp": { + "resolved": "node_modules/@typespec/http-client-csharp", + "link": true + }, + "node_modules/@typespec/http-specs": { + "version": "0.1.0-alpha.7", + "resolved": "https://registry.npmjs.org/@typespec/http-specs/-/http-specs-0.1.0-alpha.7.tgz", + "integrity": "sha512-FvaWiGcWPzAzPrxpZ+gkJAue99GY1mC3BSU2j1Ujy7ikECGcuQTHLwmi9xjKzS4EdZe8ZggSx6bFHm74yxtNdQ==", + "dev": true, + "dependencies": { + "@typespec/spec-api": "~0.1.0-alpha.0", + "@typespec/spector": "~0.1.0-alpha.6" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/versioning": "~0.64.0", + "@typespec/xml": "~0.64.0" } }, "node_modules/@typespec/json-schema": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-0.63.0.tgz", - "integrity": "sha512-jGRXxUxdrwW/XzvaDqyt5mS/V1iBnrDaHUMRIkrFLCwzgll/NenquLI/nopihzLFXK78MfFYuHg4DEPYY5PdFw==", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-0.64.0.tgz", + "integrity": "sha512-71E1c58xbHWYSli1Um2U3SQUANPoTp+p87xiH1h64NLlLHMMgFofiQcIb9v1H9tw0YBNB6ELz/zyFGJpZcM3bA==", "dev": true, - "license": "MIT", "dependencies": { "yaml": "~2.5.1" }, @@ -1591,110 +1986,210 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0" + "@typespec/compiler": "~0.64.0" } }, "node_modules/@typespec/library-linter": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.63.0.tgz", - "integrity": "sha512-j4zIhe1duQtNk43C8ex8w9LX3N/KnnILQDnwcKu1A8P3US+QUBcl/XJiiOFf7Cq7HnECAmnpYsfABFavkHeDGg==", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.64.0.tgz", + "integrity": "sha512-Kz1RMN7h7gEXe6nsVcy0t0kSI/1cyflP6Y4At2UzA3DIer4zS+Q3ulzPX8QavTbLH34y8g/sdZvtEoxVKBK7pA==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0" + "@typespec/compiler": "~0.64.0" } }, "node_modules/@typespec/openapi": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.63.0.tgz", - "integrity": "sha512-/KzR60mj3P/LnNWd/QfH0KTN/If4+mjrsWNSB7/uab6c8Qu/lNsGlZDkmWq4EFiwBR7VmpdFz9FP7d/m3O+tGw==", - "license": "MIT", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.64.0.tgz", + "integrity": "sha512-C4sPdj86ejsNkpmEaAMMqQR+0kq4Ayp4sPKvj4OTtawLXacXKzZ9NYng2jrguO6WbLr5f3NyRZKi7Ys2suT27A==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0" + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0" } }, "node_modules/@typespec/rest": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.63.0.tgz", - "integrity": "sha512-HftzMjSDHAYX+ILE9C6pFS4oAq7oBHMCtpA8QgSFPDF4V5a8l1k2K8c4x1B+7yl+GkREmIdtpc6S0xZm2G7hXg==", - "license": "MIT", + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.64.0.tgz", + "integrity": "sha512-7+oUajQzOkZPTMtRiGp6hzTTmy7mRaxOYqxIPgDhYyr9I6oQPLAcBsYhFNk/ulcqld/ApaV5ycXaOlK41REOyQ==", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.63.0", - "@typespec/http": "~0.63.0" + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0" } }, - "node_modules/@typespec/versioning": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.63.0.tgz", - "integrity": "sha512-BPvmPL+g20yEmSA8XRfbIHdToNOjssq4QfwOU6D7kKLLXnZHFb1hmuwW0tf0Wa/lYgoaUC60ONAeoXgNT1ZOIQ==", - "license": "MIT", + "node_modules/@typespec/spec-api": { + "version": "0.1.0-alpha.0", + "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.0.tgz", + "integrity": "sha512-SgWSt5mnl9bbc+C9toMzh4i8RESWcAfMg/Wyq+3oY+0EcKlmDYNWgDhQi/Eh8bA4zyMoymj48hcEzD97E1ERtQ==", + "dev": true, + "dependencies": { + "body-parser": "^1.20.3", + "deep-equal": "^2.2.0", + "express": "^4.21.1", + "express-promise-router": "^4.1.1", + "morgan": "^1.10.0", + "multer": "^1.4.5-lts.1", + "picocolors": "~1.1.0", + "prettier": "~3.3.3", + "winston": "^3.15.0", + "xml2js": "^0.6.2", + "yargs": "~17.7.2" + }, "engines": { "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.63.0" } }, - "node_modules/@typespec/xml": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.63.0.tgz", - "integrity": "sha512-2aQxWWqc5f4OTmC2nNafHi+ppr8GqwwMXx/2DnNjeshZF/JD0FNCYH8gV4gFZe7mfRfB9bAxNkcKj2AF01ntqA==", + "node_modules/@typespec/spec-api/node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, - "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, "engines": { - "node": ">=18.0.0" + "node": ">=14" }, - "peerDependencies": { - "@typespec/compiler": "~0.63.0" + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "node_modules/@typespec/spec-coverage-sdk": { + "version": "0.1.0-alpha.2", + "resolved": "https://registry.npmjs.org/@typespec/spec-coverage-sdk/-/spec-coverage-sdk-0.1.0-alpha.2.tgz", + "integrity": "sha512-bdU5K6jZ12+wEH4b7I7aiytIJu2M+tAigoxxc9Tz7UrucbA5PZqgO+uFoqMKRYcmNjwC4EmvEIVmyzNEKUzUmA==", "dev": true, - "license": "MIT", "dependencies": { - "@ampproject/remapping": "^2.2.1", - "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" + "@azure/identity": "~4.4.1", + "@azure/storage-blob": "~12.25.0", + "@types/node": "~22.7.9" }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "vitest": "1.6.0" + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@vitest/expect": { - "version": "1.6.0", + "node_modules/@typespec/spector": { + "version": "0.1.0-alpha.6", + "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.6.tgz", + "integrity": "sha512-5ILBGSa77hxYMu1BedtISYrQxk8sqKZSUvzUlBas048hOgy/Rsqh7lkZo8hG7oRwBWbKLYYKxm+srQ7pCmzRUA==", + "dev": true, + "dependencies": { + "@azure/identity": "~4.4.1", + "@types/js-yaml": "^4.0.5", + "@typespec/compiler": "~0.64.0", + "@typespec/http": "~0.64.0", + "@typespec/rest": "~0.64.0", + "@typespec/spec-api": "~0.1.0-alpha.0", + "@typespec/spec-coverage-sdk": "~0.1.0-alpha.2", + "@typespec/versioning": "~0.64.0", + "ajv": "~8.17.1", + "axios": "^1.7.5", + "body-parser": "^1.20.3", + "deep-equal": "^2.2.0", + "express": "^4.21.1", + "express-promise-router": "^4.1.1", + "form-data": "^4.0.1", + "globby": "~14.0.2", + "jackspeak": "4.0.2", + "js-yaml": "^4.1.0", + "morgan": "^1.10.0", + "multer": "^1.4.5-lts.1", + "node-fetch": "^3.3.1", + "picocolors": "~1.1.1", + "source-map-support": "~0.5.21", + "winston": "^3.15.0", + "xml2js": "^0.6.2", + "yargs": "~17.7.2" + }, + "bin": { + "tsp-spector": "cmd/cli.mjs" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@typespec/spector/node_modules/jackspeak": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", + "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typespec/versioning": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.64.0.tgz", + "integrity": "sha512-GtmuE7UwVYuVwgSpbSWzZB5UO6O/f/o1NqjLStctF8zkv2/5s+RbeqRyamjDuUyhMrIwqw+TMXtAnMXpSHlB8A==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.64.0" + } + }, + "node_modules/@typespec/xml": { + "version": "0.64.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.64.0.tgz", + "integrity": "sha512-Sk+5S2C4YK+fqSadAlzRBSZbhvtDtxLQUS+vrYgiqzVS1F61nUmP7gQGUj+Kps7ncZSppPZystWJJnF7K34UJg==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.64.0" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@vitest/coverage-v8": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "1.6.0" + } + }, + "node_modules/@vitest/expect": { + "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, @@ -1818,6 +2313,19 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -1854,6 +2362,15 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", @@ -1890,6 +2407,12 @@ "node": ">=4" } }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "dev": true + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1897,6 +2420,28 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -1917,6 +2462,44 @@ "node": "*" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios": { + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1924,6 +2507,57 @@ "dev": true, "license": "MIT" }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1947,6 +2581,39 @@ "node": ">=8" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dev": true + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/c8": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/c8/-/c8-9.1.0.tgz", @@ -1983,6 +2650,53 @@ "node": ">=8" } }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2058,6 +2772,16 @@ "node": ">=12" } }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -2071,6 +2795,38 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "dev": true, + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2078,6 +2834,51 @@ "dev": true, "license": "MIT" }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/confbox": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", @@ -2085,6 +2886,47 @@ "dev": true, "license": "MIT" }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -2092,6 +2934,21 @@ "dev": true, "license": "MIT" }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, "node_modules/copyfiles": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", @@ -2175,6 +3032,15 @@ "node": ">= 8" } }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -2203,15 +3069,124 @@ "type-detect": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=6" + } + }, + "node_modules/deep-equal": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deep-equal/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, - "license": "MIT" + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, "node_modules/diff-sequences": { "version": "29.6.3", @@ -2259,6 +3234,20 @@ "node": ">=6.0.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2266,12 +3255,98 @@ "dev": true, "license": "MIT" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -2320,6 +3395,12 @@ "node": ">=6" } }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2612,6 +3693,24 @@ "node": ">=0.10.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -2636,6 +3735,110 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-promise-router": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/express-promise-router/-/express-promise-router-4.1.1.tgz", + "integrity": "sha512-Lkvcy/ZGrBhzkl3y7uYBHLMtLI4D6XQ2kiFg9dq7fbktBch5gjqJ0+KovX0cvCAvTJw92raWunRLM/OM+5l4fA==", + "dev": true, + "dependencies": { + "is-promise": "^4.0.0", + "lodash.flattendeep": "^4.0.0", + "methods": "^1.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/express": "^4.0.0", + "express": "^4.0.0" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2690,6 +3893,28 @@ "integrity": "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==", "license": "MIT" }, + "node_modules/fast-xml-parser": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -2699,6 +3924,35 @@ "reusify": "^1.0.4" } }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", + "dev": true + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -2731,6 +3985,39 @@ "node": ">=8" } }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2787,6 +4074,41 @@ "dev": true, "license": "ISC" }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", @@ -2804,6 +4126,50 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2826,6 +4192,24 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2845,6 +4229,43 @@ "node": "*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", @@ -2929,6 +4350,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -2936,12 +4369,75 @@ "dev": true, "license": "MIT" }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { - "node": ">=4" + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/html-escaper": { @@ -2951,6 +4447,48 @@ "dev": true, "license": "MIT" }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -2961,6 +4499,18 @@ "node": ">=16.17.0" } }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3016,6 +4566,142 @@ "dev": true, "license": "ISC" }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", + "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3046,6 +4732,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3055,6 +4753,22 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -3065,6 +4779,57 @@ "node": ">=8" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "dev": true + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3078,6 +4843,79 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -3229,6 +5067,70 @@ "dev": true, "license": "MIT" }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dev": true, + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dev": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dev": true, + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dev": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dev": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -3248,6 +5150,12 @@ "node": ">=6" } }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "dev": true + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -3295,6 +5203,48 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "dev": true + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "dev": true + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "dev": true + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -3302,6 +5252,29 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dev": true + }, + "node_modules/logform": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", + "dev": true, + "dependencies": { + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -3357,6 +5330,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -3370,7 +5370,16 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "license": "MIT", "engines": { - "node": ">= 8" + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "engines": { + "node": ">= 0.6" } }, "node_modules/micromatch": { @@ -3386,6 +5395,39 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -3412,6 +5454,15 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -3448,6 +5499,49 @@ "ufo": "^1.5.4" } }, + "node_modules/morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dev": true, + "dependencies": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/morgan/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/morgan/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -3465,6 +5559,36 @@ "dev": true, "license": "MIT" }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "dev": true, + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/multer/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", @@ -3500,6 +5624,52 @@ "dev": true, "license": "MIT" }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -3540,6 +5710,93 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3550,6 +5807,15 @@ "wrappy": "1" } }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dev": true, + "dependencies": { + "fn.name": "1.x.x" + } + }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -3566,6 +5832,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -3636,6 +5919,15 @@ "node": ">=6" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3683,6 +5975,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "dev": true + }, "node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -3751,6 +6049,15 @@ "node": ">=4" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { "version": "8.4.47", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", @@ -3854,6 +6161,25 @@ "node": ">= 6" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3864,6 +6190,21 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -3884,6 +6225,30 @@ ], "license": "MIT" }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -3904,6 +6269,26 @@ "string_decoder": "~0.10.x" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4064,25 +6449,164 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "dev": true + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=10" + "node": ">= 0.4" } }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4106,6 +6630,78 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -4126,6 +6722,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, "node_modules/sirv": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", @@ -4159,6 +6764,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -4169,6 +6783,25 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -4176,6 +6809,15 @@ "dev": true, "license": "MIT" }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", @@ -4183,6 +6825,38 @@ "dev": true, "license": "MIT" }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stoppable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "dev": true, + "engines": { + "node": ">=4", + "npm": ">=6" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -4292,6 +6966,12 @@ "dev": true, "license": "MIT" }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "dev": true + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -4333,6 +7013,12 @@ "node": ">=8" } }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4433,6 +7119,15 @@ "node": ">=8.0" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/totalist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", @@ -4443,6 +7138,15 @@ "node": ">=6" } }, + "node_modules/triple-beam": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "dev": true, + "engines": { + "node": ">= 14.0.0" + } + }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -4456,6 +7160,12 @@ "typescript": ">=4.2.0" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4492,6 +7202,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true + }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", @@ -4559,6 +7288,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", @@ -4586,6 +7324,24 @@ "dev": true, "license": "MIT" }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -4601,6 +7357,15 @@ "node": ">=10.12.0" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vite": { "version": "5.4.8", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", @@ -4793,6 +7558,15 @@ "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", "license": "MIT" }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4809,6 +7583,63 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -4826,6 +7657,140 @@ "node": ">=8" } }, + "node_modules/winston": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", + "dev": true, + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.7.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.9.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", + "dev": true, + "dependencies": { + "logform": "^2.7.0", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/winston-transport/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/winston-transport/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/winston/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/winston/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/winston/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/winston/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -4948,6 +7913,28 @@ "dev": true, "license": "ISC" }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/eng/packages/http-client-csharp/package.json b/eng/packages/http-client-csharp/package.json index 7cff249301f8..3990b8e00490 100644 --- a/eng/packages/http-client-csharp/package.json +++ b/eng/packages/http-client-csharp/package.json @@ -9,7 +9,7 @@ "scripts": { "clean": "rimraf ./dist ./emitter/temp && dotnet clean ./generator", "build:emitter": "tsc -p ./emitter/tsconfig.build.json", - "build:generator": "dotnet build ./generator && copyfiles -u 5 ./node_modules/@typespec/http-client-csharp/dist/generator/Microsoft.Generator.CSharp.runtimeconfig.json ./dist/generator", + "build:generator": "dotnet build ./generator", "build": "npm run build:emitter && npm run build:generator", "test:emitter": "vitest run -c ./emitter/vitest.config.ts --passWithNoTests", "test:generator": "dotnet test ./generator --logger \"trx;LogFileName=debug.trx\"", @@ -23,22 +23,24 @@ "dist/**" ], "dependencies": { - "@typespec/http-client-csharp": "0.1.9-alpha.20241219.2" + "@typespec/http-client-csharp": "0.1.9-alpha.20250210.4" }, "devDependencies": { - "@azure-tools/typespec-azure-core": "0.49.0", - "@azure-tools/typespec-client-generator-core": "0.49.0", - "@azure-tools/typespec-azure-resource-manager": "0.49.0", - "@azure-tools/typespec-azure-rulesets": "0.49.0", - "@azure-tools/typespec-autorest": "0.49.0", - "@typespec/compiler": "0.63.0", - "@typespec/http": "0.63.0", - "@typespec/json-schema": "0.63.0", - "@typespec/library-linter": "0.63.0", - "@typespec/openapi": "0.63.0", - "@typespec/rest": "0.63.0", - "@typespec/versioning": "0.63.0", - "@typespec/xml": "0.63.0", + "@typespec/http-specs": "0.1.0-alpha.7", + "@azure-tools/azure-http-specs": "0.1.0-alpha.5", + "@azure-tools/typespec-azure-core": "0.50.0", + "@azure-tools/typespec-client-generator-core": "0.50.2", + "@azure-tools/typespec-azure-resource-manager": "0.50.0", + "@azure-tools/typespec-azure-rulesets": "0.50.0", + "@azure-tools/typespec-autorest": "0.50.0", + "@typespec/compiler": "0.64.0", + "@typespec/http": "0.64.0", + "@typespec/json-schema": "0.64.0", + "@typespec/library-linter": "0.64.0", + "@typespec/openapi": "0.64.0", + "@typespec/rest": "0.64.0", + "@typespec/versioning": "0.64.0", + "@typespec/xml": "0.64.0", "@types/node": "~22.7.5", "@types/prettier": "^2.6.3", "@vitest/coverage-v8": "^1.4.0", diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 22a7b2f3e4f0..de331e5d5f83 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -49,6 +49,12 @@ jobs: # Add a default so the job doesn't fail when the matrix is empty container: $[ variables['Container'] ] + variables: + ${{ if eq(parameters.ServiceDirectory, 'auto') }}: + ServiceDirectory: '*' + ${{ else }}: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + templateContext: outputs: - output: pipelineArtifact @@ -72,7 +78,9 @@ jobs: - ${{ if not(contains(variables['Build.DefinitionName'], '-pr - ')) }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: - ${{ if eq(parameters.ProjectListOverrideFilePropertyName, '') }}: + # we only need to checkout all sdk directories for All PR builds OR the + # deprecating AdditionalDependency leg of the core/resource builds. ProjectListOverrideFilePropertyName will be set in the latter case. + ${{ if and(ne(parameters.ServiceDirectory, 'auto'), eq(parameters.ProjectListOverrideFilePropertyName, '')) }}: Paths: - "/*" - "!SessionRecords" @@ -82,42 +90,72 @@ jobs: - "/*" - "!SessionRecords" - "/sdk/*/**/SessionRecords/*" + - ${{ if ne(parameters.ProjectListOverrideFilePropertyName, '') }}: - task: DownloadPipelineArtifact@2 inputs: artifact: DependencyTestProjectReferences patterns: "**/$(${{ parameters.ProjectListOverrideFilePropertyName }})" path: $(Build.SourcesDirectory) + - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}: + - task: DownloadPipelineArtifact@2 + inputs: + artifact: TestPackagesArtifact + path: $(Build.SourcesDirectory)/PackageInfo + - pwsh: | $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' + - pwsh: | Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" displayName: 'Configure Kestrel Environment Variables' + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml parameters: AgentImage: ${{ parameters.OSName }} + - ${{ each step in parameters.TestSetupSteps }}: - ${{ each pair in step }}: ${{ pair.key }}: ${{ pair.value }} + + # this section is only included when invoking with a dynamic set of packages (EG net - pullrequest) + - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}: + - template: /eng/pipelines/templates/steps/set-artifact-packages.yml + parameters: + PackageInfo: '$(Build.SourcesDirectory)/PackageInfo' + + - pwsh: | + if ("$(ProjectNames)" -like "*storage*") { + &"$(Build.SourcesDirectory)/eng/scripts/Install-Azurite.ps1" -AzuriteLocation "$(AzuriteLocation)" -AzuriteVersion "$(AzuriteVersion)" + } + displayName: Install Azurite If Necessary + condition: ne(variables['ProjectNames'], '') + - template: /eng/pipelines/templates/steps/install-dotnet.yml parameters: NuGetCacheKey: Test + + # ProjectListOverrideFile is set by the customization within dependency.tests.yml + # OR it is set by the PR built to target a set of packages outside of a single target service directory. + # if it is unset, then we are in a traditional service directory build. - pwsh: | - if ("${{ parameters.ProjectListOverrideFilePropertyName }}" -ne '') { - Write-Host "##vso[task.setvariable variable=ProjectListOverrideFileName]$(${{ parameters.ProjectListOverrideFilePropertyName }})" - Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)\sdk\**\coverage.cobertura.xml" + if ($env:PROJECTLISTOVERRIDEFILE) { + Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)/sdk/**/coverage.cobertura.xml" } else { - Write-Host "##vso[task.setvariable variable=ProjectListOverrideFileName]" - Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\**\coverage.cobertura.xml" + # we aren't running in net - pullrequest, so we need to ensure the value is set to empty string + Write-Host "##vso[task.setvariable variable=ProjectListOverrideFile]" + Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)/sdk/$(ServiceDirectory)/**/coverage.cobertura.xml" } displayName: Set variable for the project list file and coverage directory + - template: /eng/pipelines/templates/steps/dotnet-diagnostics.yml parameters: LogFilePath: $(Build.ArtifactStagingDirectory)/test.binlog + - script: >- dotnet test eng/service.proj --filter "(TestCategory!=Manually) & (TestCategory!=Live) & ($(AdditionalTestFilters))" @@ -125,16 +163,19 @@ jobs: --logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal" --blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TestTimeoutInMinutes}}minutes /p:SDKType=${{ parameters.SDKType }} - /p:ServiceDirectory=${{ parameters.ServiceDirectory }} + /p:ServiceDirectory=$(ServiceDirectory) /p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:RunApiCompat=false /p:InheritDocEnabled=false /p:Configuration=$(BuildConfiguration) /p:CollectCoverage=$(CollectCoverage) /p:EnableSourceLink=false - /p:ProjectListOverrideFile=$(ProjectListOverrideFileName) + /p:ProjectListOverrideFile=$(ProjectListOverrideFile) + /p:EnableOverrideExclusions=true + /p:RemoveTrack1Projects=true $(AdditionalTestArguments) $(DiagnosticArguments) displayName: "Build & Test ($(TestTargetFramework))" + - task: PublishTestResults@2 condition: always() displayName: "Publish Results ($(TestTargetFramework))" @@ -144,18 +185,17 @@ jobs: testResultsFormat: "VSTest" mergeTestResults: true - template: /eng/pipelines/templates/steps/upload-dumps.yml - - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 + - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 condition: and(succeededOrFailed(), eq(variables['CollectCoverage'], 'true'), eq(variables['coverage.collected'], 'true')) displayName: Generate Code Coverage Reports inputs: reports: $(CodeCoverageFilePattern) - targetdir: $(Build.ArtifactStagingDirectory)\coverage + targetdir: $(Build.ArtifactStagingDirectory)/coverage reporttypes: Cobertura - filefilters: +$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\** + filefilters: +$(Build.SourcesDirectory)/sdk/$(ServiceDirectory)/** verbosity: Verbose - task: PublishCodeCoverageResults@2 condition: and(succeededOrFailed(), eq(variables['CollectCoverage'], 'true'), eq(variables['coverage.collected'], 'true')) displayName: Publish Code Coverage Reports inputs: summaryFileLocation: $(Build.ArtifactStagingDirectory)\coverage\Cobertura.xml - diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 9e0c494dfe35..4b6f2f88e552 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -82,9 +82,20 @@ jobs: - pwsh: | echo "##vso[task.setvariable variable=SkipDevBuildNumber]true" displayName: "Set SkipDevBuildNumber env variable" + + # run this before setting SetDevVersion to true, so that versioning properties will be non-dev always + - template: /eng/common/pipelines/templates/steps/save-package-properties.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + - template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml + + - template: /eng/pipelines/templates/steps/set-artifact-packages.yml parameters: - ServiceDirectory: ${{parameters.ServiceDirectory}} + PackageInfo: '$(Build.ArtifactStagingDirectory)/PackageInfo' + Artifacts: ${{ parameters.Artifacts }} + IncludeIndirect: false + - pwsh: | # Reset SkipDevBuildNumber as empty $skipDevBuildNumber = "" @@ -99,36 +110,66 @@ jobs: $versioningProperties = "/p:OfficialBuildId=$(OfficialBuildId) /p:SkipDevBuildNumber=$skipDevBuildNumber"; echo "##vso[task.setvariable variable=VersioningProperties]$versioningProperties" displayName: "Setup .NET specific versioning properties" + - task: UsePythonVersion@0 displayName: 'Use Python 3.11' inputs: versionSpec: '3.11' + - template: /eng/pipelines/templates/steps/dotnet-diagnostics.yml parameters: LogFilePath: $(Build.ArtifactStagingDirectory)/pack.binlog - - script: >- - dotnet pack eng/service.proj -warnaserror - /p:ValidateRunApiCompat=true - /p:SDKType=${{ parameters.SDKType }} - /p:ServiceDirectory=${{ parameters.ServiceDirectory }} - /p:IncludeTests=false - /p:PublicSign=false $(VersioningProperties) - /p:Configuration=$(BuildConfiguration) - /p:CommitSHA=$(Build.SourceVersion) - /p:ArtifactsPackagesDir=$(Build.ArtifactStagingDirectory) - $(DiagnosticArguments) - displayName: "Build and Package" - - task: Powershell@2 - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1 - arguments: > - -ServiceDirectory ${{parameters.ServiceDirectory}} - -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo - -AddDevVersion:$$(SetDevVersion) - pwsh: true - workingDirectory: $(Pipeline.Workspace) - displayName: Update package properties with dev version + # only use the project list override file if the service directory is not auto + - ${{ if eq(parameters.ServiceDirectory, 'auto') }}: + - pwsh: | + if (!"$(ProjectNames)") { + Write-Host "No packages to build." + exit 0 + } + dotnet pack eng/service.proj -warnaserror ` + /p:ValidateRunApiCompat=true ` + /p:SDKType=${{ parameters.SDKType }} ` + /p:IncludeTests=false ` + /p:PublicSign=false $(VersioningProperties) ` + /p:Configuration=$(BuildConfiguration) ` + /p:CommitSHA=$(Build.SourceVersion) ` + /p:ArtifactsPackagesDir=$(Build.ArtifactStagingDirectory) ` + /p:ServiceDirectory=* ` + /p:ProjectListOverrideFile=$(ProjectListOverrideFile) ` + /p:IncludePerf=false ` + /p:IncludeStress=false ` + /p:EnableOverrideExclusions=true ` + $(DiagnosticArguments) + displayName: "Build and Package for PR" + - ${{ else }}: + - pwsh: | + if (Test-Path "$(ProjectListOverrideFile)") { + Write-Host "Clearing $(ProjectListOverrideFile)" + rm "$(ProjectListOverrideFile)" + Write-Host "##vso[task.setvariable variable=ProjectListOverrideFile;]" + } + displayName: Cleanup Props File + + - script: >- + dotnet pack eng/service.proj -warnaserror + /p:ValidateRunApiCompat=true + /p:SDKType=${{ parameters.SDKType }} + /p:ServiceDirectory=${{ parameters.ServiceDirectory }} + /p:IncludeTests=false + /p:PublicSign=false $(VersioningProperties) + /p:Configuration=$(BuildConfiguration) + /p:CommitSHA=$(Build.SourceVersion) + /p:ArtifactsPackagesDir=$(Build.ArtifactStagingDirectory) + /p:ProjectListOverrideFile=$(ProjectListOverrideFile) + $(DiagnosticArguments) + displayName: "Build and Package Service Directory" + + # save package properties again, this time honoring the dev version number + - ${{ if ne(parameters.ServiceDirectory, 'auto') }}: + - template: /eng/common/pipelines/templates/steps/save-package-properties.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} - task: Powershell@2 inputs: @@ -140,6 +181,7 @@ jobs: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Update package properties with namespaces + condition: and(succeeded(), ne(variables['ProjectNames'], '')) - template: ../steps/archetype-sdk-docs.yml parameters: @@ -147,6 +189,7 @@ jobs: Artifacts: ${{parameters.Artifacts}} DocGenerationDir: "$(Build.SourcesDirectory)/doc/ApiDocGeneration" LibType: 'client' + PackageInfoFolder: '$(Build.ArtifactStagingDirectory)/PackageInfo' - ${{ if eq(parameters.CheckAOTCompat, 'true') }}: - template: /eng/pipelines/templates/steps/aot-compatibility.yml @@ -202,13 +245,24 @@ jobs: - template: /eng/common/pipelines/templates/steps/cache-ps-modules.yml - - template: /eng/common/pipelines/templates/steps/verify-samples.yml + - template: /eng/common/pipelines/templates/steps/save-package-properties.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} - - template: /eng/common/pipelines/templates/steps/verify-readme.yml + - template: /eng/pipelines/templates/steps/set-artifact-packages.yml parameters: - ScanPath: $(Build.SourcesDirectory)/sdk/${{ parameters.ServiceDirectory }} + PackageInfo: '$(Build.ArtifactStagingDirectory)/PackageInfo' + Artifacts: ${{ parameters.Artifacts }} + IncludeIndirect: false + + - template: /eng/common/pipelines/templates/steps/verify-samples.yml + parameters: + ServiceDirectories: "$(ChangedServices)" + + - template: /eng/common/pipelines/templates/steps/verify-readmes.yml + parameters: + PackagePropertiesFolder: '$(Build.ArtifactStagingDirectory)/PackageInfo' + IncludeIndirect: false - task: NodeTool@0 inputs: @@ -225,36 +279,62 @@ jobs: arguments: 'restore' workingDirectory: '$(Agent.BuildDirectory)' - - task: PowerShell@2 - displayName: "Verify generated code" + - pwsh: | + $failed = $false + if ("$(ProjectNames)") { + $serviceDirectories = "$(ChangedServices)" -split "," + $ScanPaths = @() + foreach ($ServiceDirectory in $serviceDirectories) { + ./eng/scripts/CodeChecks.ps1 ` + -ServiceDirectory $ServiceDirectory ` + -SDKType ${{ parameters.SDKType }} ` + -SpellCheckPublicApiSurface ` + + if ($LASTEXITCODE -ne 0) { + $failed = $true + } + } + + if ($failed) { + exit 1 + } + } + else { + Write-Host "No services were directly changed. Skipping code checks." + } + displayName: Verify Generated Code env: EnableSourceLink: false - inputs: - filePath: "eng/scripts/CodeChecks.ps1" - arguments: > - -ServiceDirectory ${{ parameters.ServiceDirectory }} - -SDKType ${{ parameters.SDKType }} - -SpellCheckPublicApiSurface - pwsh: true - failOnStderr: false - template: /eng/pipelines/templates/steps/dotnet-diagnostics.yml parameters: LogFilePath: $(Build.ArtifactStagingDirectory)/rebuild.binlog - - script: >- - dotnet build eng/service.proj -warnaserror - /t:rebuild - /p:DebugType=none - /p:SDKType=${{ parameters.SDKType }} - /p:ServiceDirectory=${{ parameters.ServiceDirectory }} - /p:IncludePerf=false - /p:IncludeStress=false - /p:PublicSign=false - /p:Configuration=$(BuildConfiguration) - /p:EnableSourceLink=false - /p:BuildSnippets=true - $(DiagnosticArguments) + # todo, refactor to using the projectlistoverridefile + - pwsh: | + $failed = $false + if ("$(ProjectNames)") { + $services = "$(ChangedServices)" -split "," + + foreach ($service in $services) { + Write-Host "building $service" + dotnet build eng/service.proj -warnaserror ` + /t:rebuild ` + /p:DebugType=none ` + /p:SDKType=${{ parameters.SDKType }} ` + /p:ServiceDirectory=$service ` + /p:IncludePerf=false ` + /p:IncludeStress=false ` + /p:PublicSign=false ` + /p:Configuration=$(BuildConfiguration) ` + /p:EnableSourceLink=false ` + /p:BuildSnippets=true ` + $(DiagnosticArguments) + } + } + else { + Write-Host "No services were directly changed. Skipping snippet build." + } displayName: Build snippets condition: and(succeeded(), eq(${{ parameters.BuildSnippets }}, true)) @@ -305,44 +385,78 @@ jobs: MatrixReplace: ${{ parameters.MatrixReplace }} CloudConfig: Cloud: public + ${{ if eq(parameters.ServiceDirectory, 'auto') }}: + SparseCheckoutPaths: + - "/*" + - "!SessionRecords" + EnablePRGeneration: true + PRMatrixSetting: ProjectNames + PRJobBatchSize: 20 + PRMatrixIndirectFilters: + - 'AdditionalTestArguments=.*true' + - 'Pool=.*LinuxPool$' + PreGenerationSteps: + - script: | + echo "##vso[task.setvariable variable=DISCOVER_DEPENDENT_PACKAGES]1" + displayName: Enable AdditionalDependency Calculation + + - template: /eng/common/pipelines/templates/steps/save-package-properties.yml + parameters: + ServiceDirectory: ${{parameters.ServiceDirectory}} + PackageInfoDirectory: $(Build.ArtifactStagingDirectory)/PackageInfoPublishing + + # when we publish the packageinfo as an artifact, it actually cleans up the original files. Since we need them during matrix generation steps + # that will execute directly after the pregeneration steps here, we output them to a publishing directory, copy from there into the target PackageInfoDirectory, + # and then publish the originals + - pwsh: | + mkdir "$(Build.ArtifactStagingDirectory)/PackageInfo" + Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)/PackageInfoPublishing" -File ` + | Copy-Item -Destination "$(Build.ArtifactStagingDirectory)/PackageInfo/$($_.Name)" -Force + displayName: Copy ArtifactInfo from Publishing Directory + + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactName: 'TestPackagesArtifact' + ArtifactPath: '$(Build.ArtifactStagingDirectory)/PackageInfoPublishing' + AdditionalParameters: SDKType: ${{ parameters.SDKType }} ServiceDirectory: ${{ parameters.ServiceDirectory }} TestSetupSteps: ${{ parameters.TestSetupSteps }} TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} - - ${{ if ne(parameters.TestDependsOnDependency, 'not-specified') }}: - - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml - parameters: - GenerateJobName: generate_target_dependencies_test_matrix - JobTemplatePath: /eng/pipelines/templates/jobs/ci.tests.yml - MatrixConfigs: ${{ parameters.MatrixConfigs }} - MatrixFilters: ${{ parameters.MatrixFilters }} - MatrixReplace: - # Force UseProjectReferenceToAzureClients option to always be true because we only want to test with ProjectReference for dependency tests - - AdditionalTestArguments=\/p:UseProjectReferenceToAzureClients\=false/\/p:UseProjectReferenceToAzureClients\=true - - ${{ each matrixReplace in parameters.MatrixReplace }}: - - ${{ matrixReplace }} - CloudConfig: - Cloud: public - SparseCheckoutPaths: - - /* - - '!/sdk/*/**/SessionRecords/*' - PreGenerationSteps: - - ${{ each config in parameters.MatrixConfigs }}: - - template: /eng/pipelines/templates/steps/dependency.tests.yml - parameters: - TestDependsOnDependency: ${{ parameters.TestDependsOnDependency }} - # The value for ProjectListOverrideFilePropertyName should be the same as AdditionalParameters ProjectListOverrideFilePropertyName below - ProjectListOverrideFilePropertyName: 'ProjectListOverrideFile' - ProjectFilesOutputFolder: $(Build.ArtifactStagingDirectory) - ExcludeTargetTestProjects: true - ServiceDirectory: ${{ parameters.ServiceDirectory }} - MatrixConfigsFile: ${{ config.Path }} - AdditionalParameters: - SDKType: ${{ parameters.SDKType }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - TestSetupSteps: ${{ parameters.TestSetupSteps }} - TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} - # The value for ProjectListOverrideFilePropertyName should be the same as dependency.tests.yml parameter ProjectListOverrideFilePropertyName - ProjectListOverrideFilePropertyName: 'ProjectListOverrideFile' + - ${{ if ne(parameters.TestDependsOnDependency, 'not-specified') }}: + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml + parameters: + GenerateJobName: generate_target_dependencies_test_matrix + JobTemplatePath: /eng/pipelines/templates/jobs/ci.tests.yml + MatrixConfigs: ${{ parameters.MatrixConfigs }} + MatrixFilters: ${{ parameters.MatrixFilters }} + MatrixReplace: + # Force UseProjectReferenceToAzureClients option to always be true because we only want to test with ProjectReference for dependency tests + - AdditionalTestArguments=\/p:UseProjectReferenceToAzureClients\=false/\/p:UseProjectReferenceToAzureClients\=true + - ${{ each matrixReplace in parameters.MatrixReplace }}: + - ${{ matrixReplace }} + CloudConfig: + Cloud: public + SparseCheckoutPaths: + - /* + - '!/sdk/*/**/SessionRecords/*' + PreGenerationSteps: + - ${{ each config in parameters.MatrixConfigs }}: + - template: /eng/pipelines/templates/steps/dependency.tests.yml + parameters: + TestDependsOnDependency: ${{ parameters.TestDependsOnDependency }} + # The value for ProjectListOverrideFilePropertyName should be the same as AdditionalParameters ProjectListOverrideFilePropertyName below + ProjectListOverrideFilePropertyName: 'ProjectListOverrideFile' + ProjectFilesOutputFolder: $(Build.ArtifactStagingDirectory) + ExcludeTargetTestProjects: true + ServiceDirectory: ${{ parameters.ServiceDirectory }} + MatrixConfigsFile: ${{ config.Path }} + AdditionalParameters: + SDKType: ${{ parameters.SDKType }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + TestSetupSteps: ${{ parameters.TestSetupSteps }} + TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} + # The value for ProjectListOverrideFilePropertyName should be the same as dependency.tests.yml parameter ProjectListOverrideFilePropertyName + ProjectListOverrideFilePropertyName: 'ProjectListOverrideFile' diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 89b1cf1f6c8a..756d9f221863 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -59,7 +59,8 @@ "SupportsRecording": true, "CollectCoverage": true } - } + }, + "AdditionalTestArguments": "/p:UseProjectReferenceToAzureClients=false" } ] } diff --git a/eng/pipelines/templates/steps/archetype-sdk-docs.yml b/eng/pipelines/templates/steps/archetype-sdk-docs.yml index 9a67b36e7d80..882a0f89a79d 100644 --- a/eng/pipelines/templates/steps/archetype-sdk-docs.yml +++ b/eng/pipelines/templates/steps/archetype-sdk-docs.yml @@ -1,3 +1,19 @@ +parameters: + - name: Artifacts + type: object + default: [] + - name: ServiceDirectory + type: string + - name: DocGenerationDir + type: string + default: "$(Build.SourcesDirectory)/doc/ApiDocGeneration" + - name: LibType + type: string + default: client + - name: PackageInfoFolder + type: string + + steps: - task: PowerShell@2 displayName: Download and Extract Required Software @@ -23,3 +39,42 @@ steps: -DocGenDir ${{parameters.DocGenerationDir}} -ArtifactStagingDirectory '$(Build.ArtifactStagingDirectory)' -verbose + + # artifacts will only be blank if the template is called with no Artifact parameter, + # which should only happen in the case of a PR build. In this case we locate all that were directly + # changed and build their docs. + - ${{ if not(parameters.Artifacts) }}: + - pwsh: | + $failedBuild = $false + + $targetedPackages = Get-ChildItem -Recurse "${{ parameters.PackageInfoFolder }}" *.json + | ForEach-Object { Get-Content -Raw _ | ConvertFrom-Json } + | Where-Object { $_.IncludedForValidation -ne $true } + + if ($targetedPackages) { + foreach($pkg in $targetedPackages) { + $artifactDirectory = ($pkg.DirectoryPath -split '\\|/')[-1] + + &"$(Build.SourcesDirectory)/doc/ApiDocGeneration/Generate-Api-Docs.ps1" ` + -ArtifactName '$($pkg.name)' ` + -ServiceDirectory '$($pkg.ServiceDirectory)' ` + -ArtifactsDirectoryName '$artifactDirectory' ` + -RepoRoot $(Build.SourcesDirectory) ` + -BinDirectory $(Build.BinariesDirectory) ` + -DocGenDir ${{parameters.DocGenerationDir}} ` + -ArtifactStagingDirectory '$(Build.ArtifactStagingDirectory)' ` + -verbose + + if ($LASTEXITCODE -ne 0) { + $failedBuild = $true + } + } + } + else { + Write-Host "No directly targeted packages found. Skipping doc generation." + } + + if ($failedBuild) { + exit 1 + } + displayName: Generate Docs for Pull Request diff --git a/eng/pipelines/templates/steps/dependency.tests.yml b/eng/pipelines/templates/steps/dependency.tests.yml index 376ac01b6fa5..d08577d077a3 100644 --- a/eng/pipelines/templates/steps/dependency.tests.yml +++ b/eng/pipelines/templates/steps/dependency.tests.yml @@ -27,6 +27,7 @@ steps: - template: /eng/pipelines/templates/steps/install-dotnet.yml parameters: EnableNuGetCache: false + - pwsh: | dotnet build /t:ProjectDependsOn ./eng/service.proj ` /p:TestDependsOnDependency="${{parameters.TestDependsOnDependency}}" ` diff --git a/eng/pipelines/templates/steps/set-artifact-packages.yml b/eng/pipelines/templates/steps/set-artifact-packages.yml new file mode 100644 index 000000000000..58d1b976be0d --- /dev/null +++ b/eng/pipelines/templates/steps/set-artifact-packages.yml @@ -0,0 +1,51 @@ +parameters: + PackageInfo: '' + Artifacts: [] + IncludeIndirect: true +steps: + # Package-Properties folder contains the package properties for all discovered packages that were either A) affected by the PR or + # B) explicitly present in the service directory. This repo splits the builds into two categories: "mgmt" and "dataplane". While + # a given directory may contain both, there will be a separate build definition to release the management packages. Due to this + # we need to artificially filter the packages to ensure that only the packages targeted for THAT ci.yml are built. + # When we merge the PR adding net - pullrequest, this code will also merge, meaning the public - - ci builds will still operate + # EXACTLY the same as they did before the pipelinev3 change. This is important to ensure that we don't accidentally build the wrong packages + # while in the integration period. After we disable all the public `net - - ci` builds, only the `net - pullrequest` build WONT provide + # an artifact list, which will allow the expand/contract. Meanwhile the internal builds will continue to provide the artifact list from their + # individual ci.yml and ci.mgmt.yml files. + - pwsh: | + $artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json + $includeIndirect = $${{ parameters.IncludeIndirect }} + $knownArtifacts = @() + if ($artifacts) { + $knownArtifacts = $artifacts | ForEach-Object { $_.name } + } + + $packageProperties = Get-ChildItem -Recurse "${{ parameters.PackageInfo }}" *.json ` + | Where-Object { if($knownArtifacts) { $knownArtifacts -contains $_.Name.Replace(".json", "") } else { $true } } + + if (-not $includeIndirect) { + $packageProperties = $packageProperties | Where-Object { (Get-Content -Raw $_ | ConvertFrom-Json).IncludedForValidation -eq $false } + } + + $pkgNames = $packageProperties | ForEach-Object { $_.Name.Replace(".json", "") } + + $setting = $pkgNames -join "," + Write-Host "Setting ProjectNames to: `n$setting" + Write-Host "##vso[task.setvariable variable=ProjectNames;]$setting" + + if (!$pkgNames) { + Write-Host "No packages were identified for this build." + } + displayName: Resolve Targeted Packages + condition: eq(variables['ProjectNames'], '') + + # this script sets $(ChangedServices) and populates a props file with the targeted set of projects + # for the build. This file is set to variable $(ProjectListOverrideFile). + - pwsh: | + ./eng/scripts/splittestdependencies/set-artifact-packages.ps1 ` + -ProjectNames "$(ProjectNames)" ` + -PackageInfoFolder "${{ parameters.PackageInfo }}" ` + -OutputPath $(Build.SourcesDirectory)/projlist + displayName: Resolve Service and Project List + condition: ne(variables['ProjectNames'], '') + diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index 25aaecd6e41f..e11db6a426c9 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -12,6 +12,8 @@ variables: CollectCoverage: false NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages/ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + AzuriteLocation: $(Pipeline.Workspace)/.storage/azurite + AzuriteVersion: 3.11.0 DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: 1 Codeql.SkipTaskAutoInjection: true diff --git a/eng/scripts/Install-Azurite.ps1 b/eng/scripts/Install-Azurite.ps1 new file mode 100644 index 000000000000..a1e1d76d9088 --- /dev/null +++ b/eng/scripts/Install-Azurite.ps1 @@ -0,0 +1,23 @@ +<# +.DESCRIPTION + +This script installs Azurite using npm to a specific location. It does not utilize the caching mechanism provided by azure devops. + +#> +param ( + [Parameter(Mandatory = $true)] + [string]$AzuriteLocation, + [Parameter(Mandatory = $true)] + [string]$AzuriteVersion +) + +npm install --prefix $AzuriteLocation azurite@$AzuriteVersion + +if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to install Azurite." + exit $LASTEXITCODE +} + +if ($env:TF_BUILD -or $env:CI) { + Write-Output "##vso[task.setvariable variable=Azure.Azurite.Location]$AzuriteLocation" +} \ No newline at end of file diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 59714476f2e2..d2e16ff54924 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -9,6 +9,31 @@ $PackageRepositoryUri = "https://www.nuget.org/packages" . "$PSScriptRoot/docs/Docs-ToC.ps1" +$DependencyCalculationPackages = @( + "Azure.Core", + "Azure.ResourceManager" +) + +function processTestProject($projPath) { + $cleanPath = $projPath -replace "^\$\(RepoRoot\)", "" + + # Split the path into segments + $pathSegments = $cleanPath -split "[\\/]" + + # Find the index of the 'tests' directory + $testsIndex = $pathSegments.IndexOf("tests") + + if ($testsIndex -gt 0) { + # Reconstruct the path up to the directory just above 'tests' + $parentDirectory = ($pathSegments[0..($testsIndex - 1)] -join [System.IO.Path]::DirectorySeparatorChar) + return $parentDirectory + } else { + Write-Error "Unable to retrieve a package directory for this this test project: $projPath" + # If 'tests' is not found, return the original path (optional behavior) + $_ + } +} + function Get-AllPackageInfoFromRepo($serviceDirectory) { $allPackageProps = @() @@ -18,6 +43,7 @@ function Get-AllPackageInfoFromRepo($serviceDirectory) $ServiceProj = Join-Path -Path $EngDir -ChildPath "service.proj" Write-Host "Get-AllPackageInfoFromRepo::Executing msbuild" Write-Host "dotnet msbuild /nologo /t:GetPackageInfo $ServiceProj /p:ServiceDirectory=$serviceDirectory /p:AddDevVersion=$shouldAddDevVersion" + $msbuildOutput = dotnet msbuild ` /nologo ` /t:GetPackageInfo ` @@ -42,6 +68,53 @@ function Get-AllPackageInfoFromRepo($serviceDirectory) $pkgProp.SdkType = $sdkType $pkgProp.IsNewSdk = ($isNewSdk -eq 'true') $pkgProp.ArtifactName = $pkgName + $pkgProp.IncludedForValidation = $false + $pkgProp.DirectoryPath = ($pkgProp.DirectoryPath) + + if ($pkgProp.Name -in $DependencyCalculationPackages -and $env:DISCOVER_DEPENDENT_PACKAGES) { + Write-Host "Calculating dependencies for $($pkgProp.Name)" + $outputFilePath = Join-Path $RepoRoot "$($pkgProp.Name)_dependencylist.txt" + $buildOutputPath = Join-Path $RepoRoot "$($pkgProp.Name)_dependencylistoutput.txt" + + if (!(Test-Path $outputFilePath)) { + try { + $command = "dotnet build /t:ProjectDependsOn ./eng/service.proj /p:TestDependsOnDependency=`"$($pkgProp.Name)`" /p:IncludeSrc=false " + + "/p:IncludeStress=false /p:IncludeSamples=false /p:IncludePerf=false /p:RunApiCompat=false /p:InheritDocEnabled=false /p:BuildProjectReferences=false" + + " /p:OutputProjectFilePath=`"$outputFilePath`" > $buildOutputPath 2>&1" + + Invoke-LoggedCommand $command | Out-Null + } + catch { + Write-Host "Failed calculating dependencies for $($pkgProp.Name). Exit code $LASTEXITCODE." + Write-Host "Dumping erroring build output." + Write-Host (Get-Content -Raw $buildOutputPath) + continue + } + } + + $pkgRelPath = $pkgProp.DirectoryPath.Replace($RepoRoot, "").TrimStart("\/") + + if (Test-Path $outputFilePath) { + $dependentProjects = Get-Content $outputFilePath + $testPackages = @{} + + foreach ($projectLine in $dependentProjects) { + $testPackage = processTestProject($projectLine) + if ($testPackage -and $testPackage -ne $pkgRelPath) { + if ($testPackages[$testPackage]) { + $testPackages[$testPackage] += 1 + } + else { + $testPackages[$testPackage] = 1 + } + } + } + + $pkgProp.AdditionalValidationPackages = $testPackages.Keys + + Write-Host "Cleaning up $outputFilePath." + } + } $allPackageProps += $pkgProp } @@ -49,6 +122,128 @@ function Get-AllPackageInfoFromRepo($serviceDirectory) return $allPackageProps } +<# +.DESCRIPTION +This function governs the logic for determining which packages should be included for validation in net - pullrequest +when the PR contains changes to files outside of package directories. + +.PARAMETER LocatedPackages +The set of packages that have been directly changed in the PR. + +.PARAMETER diffObj +The diff object that contains the set of changed and deleted files in the PR. + +.PARAMETER AllPkgProps +The entire set of package properties for the repository. + +#> +function Get-dotnet-AdditionalValidationPackagesFromPackageSet { + param( + [Parameter(Mandatory=$true)] + $LocatedPackages, + [Parameter(Mandatory=$true)] + $diffObj, + [Parameter(Mandatory=$true)] + $AllPkgProps + ) + $additionalValidationPackages = @() + $uniqueResultSet = @() + function isOther($fileName) { + $startsWithPrefixes = @(".config", ".devcontainer", ".github", ".vscode", "common", "doc", "eng", "samples") + + $startsWith = $false + foreach ($prefix in $startsWithPrefixes) { + if ($fileName.StartsWith($prefix)) { + $startsWith = $true + } + } + + return $startsWith + } + + # ensure we observe deleted files too + $targetedFiles = @($diffObj.ChangedFiles + $diffObj.DeletedFiles) + + # The targetedFiles needs to filter out anything in the ExcludePaths + # otherwise it'll end up processing things below that it shouldn't be. + foreach ($excludePath in $diffObj.ExcludePaths) { + $targetedFiles = $targetedFiles | Where-Object { -not $_.StartsWith($excludePath) } + } + + # this section will identify + # - any service-level changes + # - any shared package changes that should be treated as a service-level change. EG changes to Azure.Storage.Shared. + # and add all packages within that service to the validation set. these will be treated as "directly" changed packages. + $changedServices = @() + if ($targetedFiles) { + foreach($file in $targetedFiles) { + $pathComponents = $file -split "/" + # handle changes only in sdk//. + if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") { + if (-not $changedServices.Contains($pathComponents[1])) { + $changedServices += $pathComponents[1] + } + } + + # handle any changes under sdk/. + if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") { + if (-not $changedServices.Contains("template")) { + $changedServices += "template" + } + } + + # changes to a Azure.*.Shared within a service directory should include all packages within that service directory + if ($file.Replace('\', '/') -match ".*sdk/.*/.*\.Shared/.*") { + if (-not $changedServices.Contains($pathComponents[1])) { + $changedServices += $pathComponents[1] + } + } + } + foreach ($changedService in $changedServices) { + $additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService } + + foreach ($pkg in $additionalPackages) { + if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) { + # notice the lack of setting IncludedForValidation to true. This is because these "changed services" + # are specifically where a file within the service, but not an individual package within that service has changed. + # we want this package to be fully validated + $uniqueResultSet += $pkg + } + } + } + } + + # handle any changes to files that are not within a package directory + $othersChanged = @() + if ($targetedFiles) { + $othersChanged = $targetedFiles | Where-Object { isOther($_) } + } + + if ($othersChanged) { + $additionalPackages = @( + "Azure.Template" + ) | ForEach-Object { $me=$_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 } + + $additionalValidationPackages += $additionalPackages + } + + # walk the packages added purely for validation, if they haven't been added yet, add them + # these packages aren't considered "directly" changed, so we will set IncludedForValidation to true for them + foreach ($pkg in $additionalValidationPackages) { + if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) { + $pkg.IncludedForValidation = $true + $uniqueResultSet += $pkg + } + } + + Write-Host "Returning additional packages for validation: $($uniqueResultSet.Count)" + foreach ($pkg in $uniqueResultSet) { + Write-Host " - $($pkg.Name)" + } + + return $uniqueResultSet +} + # Returns the nuget publish status of a package id and version. function IsNugetPackageVersionPublished ($pkgId, $pkgVersion) { diff --git a/eng/scripts/Save-Package-Namespaces-Property.ps1 b/eng/scripts/Save-Package-Namespaces-Property.ps1 index c07f5b1b5c4b..4e28cf926080 100644 --- a/eng/scripts/Save-Package-Namespaces-Property.ps1 +++ b/eng/scripts/Save-Package-Namespaces-Property.ps1 @@ -46,7 +46,9 @@ if (-not (Test-Path -Path $repoRoot)) { exit 1 } # Get all of the packageInfo files -$packageInfoFiles = Get-ChildItem -Path $packageInfoDirectory -Filter *.json +$packageInfoFiles = Get-ChildItem -Path $packageInfoDirectory -Filter *.json ` + | Where-Object { (Get-Content -Raw $_ | ConvertFrom-Json).IncludedForValidation -eq $false } + if ($packageInfoFiles.Length -eq 0) { LogWarning "packageInfoDirectory '$packageInfoDirectory' does not contain any json files. Please ensure that the packageInfo files were generated prior to running this." exit 0 diff --git a/eng/scripts/automation/GenerateAndBuildLib.ps1 b/eng/scripts/automation/GenerateAndBuildLib.ps1 index 3753b58f8833..bc296d339f0a 100644 --- a/eng/scripts/automation/GenerateAndBuildLib.ps1 +++ b/eng/scripts/automation/GenerateAndBuildLib.ps1 @@ -220,10 +220,10 @@ function RegisterMgmtSDKToMgmtCoreClient () { <# .SYNOPSIS Prepare the SDK pacakge for data-plane. -If it does not exist, create SDK package via dotnet template, or update the autorest.md if it already exists. +Update the autorest.md. #> -function New-DataPlanePackageFolder() { +function Update-DataPlanePackageFolder() { param( [string]$service, [string]$namespace, @@ -263,61 +263,9 @@ function New-DataPlanePackageFolder() { CreateOrUpdateAutorestConfigFile -autorestFilePath $file -namespace $namespace -inputfile "$inputfile" -readme "$readme" -autorestConfigYaml "$autorestConfigYaml" Update-CIYmlFile -ciFilePath $ciymlFilePath -artifact $namespace } else { - Write-Host "Path doesn't exist. create template." - if ($inputfile -eq "" -And $readme -eq "") { - Throw "[ERROR] Input file should not be empty. Please provide a valid input file or readme file." - } - dotnet new -i $sdkPath/sdk/template - Write-Host "Create project folder $projectFolder" - if (Test-Path -Path $projectFolder) { - Remove-Item -Path $projectFolder -ItemType Directory - } - - Push-Location $serviceFolder - $namespaceArray = $namespace.Split(".") - if ( $namespaceArray.Count -lt 3) { - Throw "[ERROR] Invalid namespace name provided: $namespace. Please provide valid namespace." - } - - $endIndex = $namespaceArray.Count - 2 - $clientName = $namespaceArray[-1] - $groupName = $namespaceArray[1..$endIndex] -join "." - $dotnetNewCmd = "dotnet new azsdkdpg --name $namespace --clientName $clientName --groupName $groupName --serviceDirectory $service --force" - if ($inputfile -ne "") { - $dotnetNewCmd = $dotnetNewCmd + " --swagger '$inputfile'" - } - if ($securityScope -ne "") { - $dotnetNewCmd = $dotnetNewCmd + " --securityScopes $securityScope"; - } - - if ($securityHeaderName -ne "") { - $dotnetNewCmd = $dotnetNewCmd + " --securityHeaderName $securityHeaderName"; - } - - if (Test-Path -Path $ciymlFilePath) { - Write-Host "ci.yml already exists. update it to include the new serviceDirectory." - Update-CIYmlFile -ciFilePath $ciymlFilePath -artifact $namespace - - $dotnetNewCmd = $dotnetNewCmd + " --includeCI false" - } - # dotnet new azsdkdpg --name $namespace --clientName $clientName --groupName $groupName --serviceDirectory $service --swagger $inputfile --securityScopes $securityScope --securityHeaderName $securityHeaderName --includeCI true --force - Write-Host "Invoke dotnet new command: $dotnetNewCmd" - Invoke-Expression $dotnetNewCmd - - $file = (Join-Path $projectFolder "src" $AUTOREST_CONFIG_FILE) - Write-Host "Updating configuration file: $file" - CreateOrUpdateAutorestConfigFile -autorestFilePath $file -namespace $namespace -readme "$readme" -autorestConfigYaml "$autorestConfigYaml" - Pop-Location - - $projFile = (Join-Path $projectFolder "src" "$namespace.csproj") - (Get-Content $projFile) -replace "*.*.*-*.*", "1.0.0-beta.1" | Set-Content $projFile - # dotnet sln - Push-Location $projectFolder - dotnet sln remove src/$namespace.csproj - dotnet sln add src/$namespace.csproj - dotnet sln remove tests/$namespace.Tests.csproj - dotnet sln add tests/$namespace.Tests.csproj - Pop-Location + Write-Error "Project directory doesn't exist. It is a new .NET SDK." + Write-Error "We will not support onboard a new SDK from swagger. Please contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + exit 1 } Push-Location $sdkPath @@ -338,10 +286,10 @@ function New-DataPlanePackageFolder() { <# .SYNOPSIS Prepare the SDK pacakge for mangement-plane. -If it does not exist, create SDK package via dotnet template, or update the autorest.md if it already exists. +Update the autorest.md. #> -function New-MgmtPackageFolder() { +function Update-MgmtPackageFolder() { param( [string]$service = "", [string]$packageName = "", @@ -364,19 +312,9 @@ function New-MgmtPackageFolder() { $mgmtPackageName = $folderinfo.Name $projectFolder = "$sdkPath/sdk/$packageName/$mgmtPackageName" } else { - Write-Host "Path doesn't exist. create template." - dotnet new -i $sdkPath/eng/templates/Azure.ResourceManager.Template - $CaptizedPackageName = [System.Globalization.CultureInfo]::InvariantCulture.TextInfo.ToTitleCase($packageName) - $mgmtPackageName = "Azure.ResourceManager.$CaptizedPackageName" - $projectFolder="$sdkPath/sdk/$packageName/Azure.ResourceManager.$CaptizedPackageName" - Write-Host "Create project folder $projectFolder" - New-Item -Path $projectFolder -ItemType Directory - Push-Location $projectFolder - dotnet new azuremgmt --provider $packageName --includeCI true --force - Pop-Location - - $packagesPath = Join-Path $sdkPath "sdk" - RegisterMgmtSDKToMgmtCoreClient -packagesPath $packagesPath + Write-Error "Project directory doesn't exist. It is a new .NET SDK." + Write-Error "We will not support onboard a new service SDK from swagger. Please contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + exit 1 } # update the readme path. @@ -632,20 +570,28 @@ function Invoke-GenerateAndBuildSDK () { if ( $serviceType -eq "resource-manager" ) { Write-Host "Generate resource-manager SDK client library." $package = $service - if ($packageNameHash[$service] -ne "") { + if ($null -ne $packageNameHash[$service] -and $packageNameHash[$service] -ne "") { $package = $packageNameHash[$service] + Write-Host "rename package name to $package" } - New-MgmtPackageFolder -service $service -packageName $package -sdkPath $sdkRootPath -commitid $commitid -readme $readmeFile -outputJsonFile $newpackageoutput - if ( !$?) { - Write-Host "[ERROR] Failed to create sdk project folder.service:$service,package:$package," - Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile.exit code: $?." - Write-Host "[ERROR] Please review the detail errors for potential fixes." - Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + $projectFolder = (Join-Path $sdkRootPath "sdk" $package "Azure.ResourceManager.*") + if (Test-Path -Path $projectFolder) { + Update-MgmtPackageFolder -service $service -packageName $package -sdkPath $sdkRootPath -commitid $commitid -readme $readmeFile -outputJsonFile $newpackageoutput + if ( !$?) { + Write-Host "[ERROR] Failed to create sdk project folder.service:$service,package:$package," + Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile.exit code: $?." + Write-Host "[ERROR] Please review the detail errors for potential fixes." + Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + exit 1 + } + $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json + $packagesToGen = $packagesToGen + @($newPackageOutputJson) + Remove-Item $newPackageOutput + } else { + Write-Host "Path doesn't exist. create template." + Write-Error "[ERROR] The service $service is not onboarded yet. We will not support onboard a new service from swagger. Please contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." exit 1 } - $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json - $packagesToGen = $packagesToGen + @($newPackageOutputJson) - Remove-Item $newPackageOutput } else { Write-Host "Generate data-plane SDK client library." $namespace = "" @@ -668,17 +614,25 @@ function Invoke-GenerateAndBuildSDK () { $namespace = $directories[-1]; } - New-DataPlanePackageFolder -service $service -namespace $namespace -sdkPath $sdkRootPath -readme $readmeFile -autorestConfigYaml "$autorestConfigYaml" -outputJsonFile $newpackageoutput - if ( !$? ) { - Write-Host "[ERROR] Failed to create sdk project folder.service:$service,namespace:$namespace," - Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile,autorestConfigYaml:$autorestConfigYaml.exit code: $?." - Write-Host "[ERROR] Please review the detail errors for potential fixes." - Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + $projectFolder=(Join-Path $sdkRootPath "sdk" $service $namespace) + if (Test-Path -Path $projectFolder) { + Write-Host "Path exists!" + Update-DataPlanePackageFolder -service $service -namespace $namespace -sdkPath $sdkRootPath -readme $readmeFile -autorestConfigYaml "$autorestConfigYaml" -outputJsonFile $newpackageoutput + if ( !$? ) { + Write-Host "[ERROR] Failed to create sdk project folder.service:$service,namespace:$namespace," + Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile,autorestConfigYaml:$autorestConfigYaml.exit code: $?." + Write-Host "[ERROR] Please review the detail errors for potential fixes." + Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + exit 1 + } + $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json + $packagesToGen = $packagesToGen + @($newPackageOutputJson) + Remove-Item $newPackageOutput + } else { + Write-Host "SDK project folder doesn't exist." + Write-Error "[ERROR] The service $service is not onboarded yet. We will not support onboard a new service from swagger. Please contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." exit 1 } - $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json - $packagesToGen = $packagesToGen + @($newPackageOutputJson) - Remove-Item $newPackageOutput } else { # handle scenaro: multiple SDK packages one md file. # npx autorest --version=3.8.4 --csharp $readmeFile --csharp-sdks-folder=$sdkRootPath --skip-csproj --clear-output-folder=true @@ -697,17 +651,25 @@ function Invoke-GenerateAndBuildSDK () { if (Test-Path -Path $autorestFilePath) { $fileContent = Get-Content $autorestFilePath -Raw if ($fileContent -match $regexForMatch) { - New-DataPlanePackageFolder -service $service -namespace $folder -sdkPath $sdkRootPath -readme $readmeFile -outputJsonFile $newpackageoutput - if ( !$? ) { - Write-Host "[ERROR] Failed to create sdk project folder.service:$service,namespace:$folder," - Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile. exit code: $?." - Write-Host "[ERROR] Please review the detail errors for potential fixes." - Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + $projectFolder=(Join-Path $sdkRootPath "sdk" $service $folder) + if (Test-Path -Path $projectFolder) { + Write-Host "Path exists!" + Update-DataPlanePackageFolder -service $service -namespace $folder -sdkPath $sdkRootPath -readme $readmeFile -outputJsonFile $newpackageoutput + if ( !$? ) { + Write-Host "[ERROR] Failed to create sdk project folder.service:$service,namespace:$folder," + Write-Host "[ERROR] sdkPath:$sdkRootPath,readme:$readmeFile. exit code: $?." + Write-Host "[ERROR] Please review the detail errors for potential fixes." + Write-Host "[ERROR] If the issue persists, contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." + exit 1 + } + $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json + $packagesToGen = $packagesToGen + @($newPackageOutputJson) + Remove-Item $newPackageOutput + } else { + Write-Host "SDK project folder doesn't exist." + Write-Error "[ERROR] The service $service is not onboarded yet. We will not support onboard a new service from swagger. Please contact the DotNet language support channel at $DotNetSupportChannelLink and include this spec pull request." exit 1 } - $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json - $packagesToGen = $packagesToGen + @($newPackageOutputJson) - Remove-Item $newPackageOutput } } } @@ -912,10 +874,10 @@ function GeneratePackage() language=".Net"; changelog=$changelog; } - + if ($null -ne $installInstructions) { $packageDetails['installInstructions'] = $installInstructions - } + } $generatedSDKPackages.Add($packageDetails) } function UpdateExistingSDKByInputFiles() diff --git a/eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 b/eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 index a3f14e390704..7325b948f881 100644 --- a/eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 +++ b/eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 @@ -51,7 +51,7 @@ param ( $sdkPath = Resolve-Path $sdkPath # Generate dataplane library $outputJsonFile = "newpackageoutput.json" -New-DataPlanePackageFolder -service $service -namespace $namespace -sdkPath $sdkPath -inputfiles $inputfiles -readme $readme -securityScope $securityScope -securityHeaderName $securityHeaderName -AUTOREST_CONFIG_FILE $AUTOREST_CONFIG_FILE -outputJsonFile $outputJsonFile +Update-DataPlanePackageFolder -service $service -namespace $namespace -sdkPath $sdkPath -inputfiles $inputfiles -readme $readme -securityScope $securityScope -securityHeaderName $securityHeaderName -AUTOREST_CONFIG_FILE $AUTOREST_CONFIG_FILE -outputJsonFile $outputJsonFile if ( $? -ne $True) { Write-Error "Failed to create sdk project folder. exit code: $?" exit 1 diff --git a/eng/scripts/ci.yml b/eng/scripts/ci.yml index 399b42ffc284..65893026b4d6 100644 --- a/eng/scripts/ci.yml +++ b/eng/scripts/ci.yml @@ -1,4 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +# Excludes eng/scripts/typespec as these are only used in the eng/packages/http-client-csharp/ci.yml pipeline. + trigger: branches: include: @@ -9,6 +11,8 @@ trigger: paths: include: - eng/scripts/* + exclude: + - eng/scripts/typespec pr: branches: @@ -20,6 +24,8 @@ pr: paths: include: - eng/scripts/* + exclude: + - eng/scripts/typespec extends: template: /eng/common/pipelines/templates/stages/archetype-sdk-tool-pwsh.yml diff --git a/eng/scripts/splittestdependencies/set-artifact-packages.ps1 b/eng/scripts/splittestdependencies/set-artifact-packages.ps1 new file mode 100644 index 000000000000..69341952df79 --- /dev/null +++ b/eng/scripts/splittestdependencies/set-artifact-packages.ps1 @@ -0,0 +1,41 @@ +param ( + [string] $ProjectNames, + [string] $OutputPath, + [string] $PackageInfoFolder +) + +. $PSScriptRoot/generate-dependency-functions.ps1 + +$RepoRoot = Resolve-Path (Join-Path "$PSScriptRoot" ".." ".." "..") + +# set changed services given the set of changed packages, this will mean that +# ChangedServices will be appropriate for the batched set of packages if that is indeed how +# we set the targeted artifacts +$packageProperties = Get-ChildItem -Recurse "$PackageInfoFolder" *.json ` +| Foreach-Object { Get-Content -Raw -Path $_.FullName | ConvertFrom-Json } + +$packageSet = "$ProjectNames" -split "," + +$changedServicesArray = $packageProperties | Where-Object { $packageSet -contains $_.ArtifactName } +| ForEach-Object { $_.ServiceDirectory } | Get-Unique +$changedServices = $changedServicesArray -join "," + +$changedProjects = $packageProperties | Where-Object { $packageSet -contains $_.ArtifactName } +| ForEach-Object { "$($_.DirectoryPath)/**/*.csproj"; } + +$projectsForGeneration = ($changedProjects | ForEach-Object { "`$(RepoRoot)$_" } | Sort-Object) +$projectGroups = @() +$projectGroups += ,$projectsForGeneration + +# todo: refactor write-test-dependency-group to take in a list of project files only and generate a single project file +$outputFile = (Write-Test-Dependency-Group-To-Files -ProjectFileConfigName "packages" -ProjectGroups $projectGroups -MatrixOutputFolder $OutputPath)[0] + +# debug, will remove +Get-ChildItem -Recurse $OutputPath | ForEach-Object { Write-Host "Dumping $($_.FullName)"; Get-Content -Raw -Path $_.FullName | Write-Host } + +# the projectlistoverride file must be provided as a relative path +$relativeOutputPath = [System.IO.Path]::GetRelativePath($RepoRoot, "$OutputPath/$outputFile") + +Write-Host "##vso[task.setvariable variable=ProjectListOverrideFile;]$relativeOutputPath" +Write-Host "##vso[task.setvariable variable=ChangedServices;]$changedServices" +Write-Host "This run is targeting: $ProjectNames in [$changedServices]" \ No newline at end of file diff --git a/eng/scripts/typespec/Generate-Code.ps1 b/eng/scripts/typespec/Generate-Code.ps1 index cef6d100e844..aa48e603e7d0 100644 --- a/eng/scripts/typespec/Generate-Code.ps1 +++ b/eng/scripts/typespec/Generate-Code.ps1 @@ -21,6 +21,7 @@ function Get-TspCommand { } $command += " --option @azure-typespec/http-client-csharp.emitter-output-dir=$generationDir" $command += " --option @azure-typespec/http-client-csharp.save-inputs=true" + $command += " --option @azure-typespec/http-client-csharp.new-project=true" return $command } diff --git a/eng/scripts/typespec/Get-Spector-Coverage.ps1 b/eng/scripts/typespec/Get-Spector-Coverage.ps1 new file mode 100644 index 000000000000..f2f4f119e3d2 --- /dev/null +++ b/eng/scripts/typespec/Get-Spector-Coverage.ps1 @@ -0,0 +1,99 @@ +#Requires -Version 7.0 + +Import-Module "$PSScriptRoot\Generation.psm1" -DisableNameChecking -Force; +Import-Module "$PSScriptRoot\Spector-Helper.psm1" -DisableNameChecking -Force; + +$packageRoot = Resolve-Path (Join-Path $PSScriptRoot '..' '..') + +Refresh-Build + +$specsDirectory = Join-Path $packageRoot 'node_modules' '@typespec' 'http-specs' 'specs' +$azureSpecsDirectory = Join-Path $packageRoot 'node_modules' '@azure-tools' 'azure-http-specs' 'specs' +$spectorRoot = Join-Path $packageRoot 'generator' 'TestProjects' 'Spector' 'http' +$directories = Get-ChildItem -Path "$spectorRoot" -Directory -Recurse +$spectorCsproj = Join-Path $packageRoot 'generator' 'TestProjects' 'Spector.Tests' 'TestProjects.Spector.Tests.csproj' + +$coverageDir = Join-Path $packageRoot 'generator' 'artifacts' 'coverage' + +if (-not (Test-Path $coverageDir)) { + New-Item -ItemType Directory -Path $coverageDir | Out-Null +} + +# generate all +foreach ($directory in $directories) { + if (-not (IsGenerated $directory.FullName)) { + continue + } + + $outputDir = $directory.FullName.Substring(0, $directory.FullName.IndexOf("src") - 1) + $subPath = $outputDir.Substring($spectorRoot.Length + 1) + + Write-Host "Regenerating $subPath" -ForegroundColor Cyan + + $specFile = Join-Path $specsDirectory $subPath "client.tsp" + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $specsDirectory $subPath "main.tsp" + } + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $azureSpecsDirectory $subPath "client.tsp" + } + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $azureSpecsDirectory $subPath "main.tsp" + } + + if ($subPath.Contains("versioning")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Versioning ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + continue + } + + if ($subPath.Contains("srv-driven")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Srv-Driven ($(Join-Path $azureSpecsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + continue + } + + $command = Get-TspCommand $specFile $outputDir + Invoke $command + # exit if the generation failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } +} + +# test all +Write-Host "Generating Spector coverage" -ForegroundColor Cyan +$command = "dotnet test $spectorCsproj" +Invoke $command +# exit if the testing failed +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +# restore all +foreach ($directory in $directories) { + if (-not (IsGenerated $directory.FullName)) { + continue + } + + $outputDir = $directory.FullName.Substring(0, $directory.FullName.IndexOf("src") - 1) + $subPath = $outputDir.Substring($spectorRoot.Length + 1) + + Write-Host "Restoring $subPath" -ForegroundColor Cyan + $command = "git clean -xfd $outputDir" + Invoke $command + # exit if the restore failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $command = "git restore $outputDir" + Invoke $command + # exit if the restore failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } +} diff --git a/eng/scripts/typespec/Spector-Helper.psm1 b/eng/scripts/typespec/Spector-Helper.psm1 new file mode 100644 index 000000000000..d10541e0850e --- /dev/null +++ b/eng/scripts/typespec/Spector-Helper.psm1 @@ -0,0 +1,45 @@ +$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..') + +function IsGenerated { + param ( + [string]$dir + ) + + if (-not ($dir.EndsWith("Generated"))) { + return $false + } + + $csFiles = Get-ChildItem -Path $dir -Filter *.cs -File + return $csFiles.Count -gt 0 +} + +function Capitalize-FirstLetter { + param ( + [string]$inputString + ) + + if ([string]::IsNullOrEmpty($inputString)) { + return $inputString + } + + $firstChar = $inputString[0].ToString().ToUpper() + $restOfString = $inputString.Substring(1) + + return $firstChar + $restOfString +} + +function Get-Namespace { + param ( + [string]$dir + ) + + $words = $dir.Split('-') + $namespace = "" + foreach ($word in $words) { + $namespace += Capitalize-FirstLetter $word + } + return $namespace +} + +Export-ModuleMember -Function "IsGenerated" +Export-ModuleMember -Function "Get-Namespace" diff --git a/eng/scripts/typespec/Test-Emitter.ps1 b/eng/scripts/typespec/Test-Emitter.ps1 index 2ff6f2432266..677f915bcdf0 100644 --- a/eng/scripts/typespec/Test-Emitter.ps1 +++ b/eng/scripts/typespec/Test-Emitter.ps1 @@ -20,39 +20,50 @@ try { if ($UnitTests) { # test the emitter Invoke-LoggedCommand "npm run prettier" -GroupOutput -ErrorAction Continue - if($LastExitCode) - { + if ($LastExitCode) { $errors += "Prettier failed" } Invoke-LoggedCommand "npm run lint" -GroupOutput -ErrorAction Continue - if($LastExitCode) - { + if ($LastExitCode) { $errors += "Lint failed" } Invoke-LoggedCommand "npm run build:generator" -GroupOutput Invoke-LoggedCommand "npm run test:generator" -GroupOutput -ErrorAction Continue - if($LastExitCode) - { + if ($LastExitCode) { $errors += "Genereator tests failed" } Invoke-LoggedCommand "npm run build:emitter" -GroupOutput Invoke-LoggedCommand "npm run test:emitter" -GroupOutput -ErrorAction Continue - if($LastExitCode) - { + if ($LastExitCode) { $errors += "Emitter tests failed" } $testResultsFile = "$packageRoot/generator/Azure.Generator/test/TestResults/debug.trx" # copy test results to the artifacts directory - if(Test-Path $testResultsFile) - { + if (Test-Path $testResultsFile) { + New-Item -ItemType Directory -Force -Path $testResultsPath | Out-Null + Copy-Item -Path $testResultsFile -Destination $testResultsPath -Force + } + else { + LogWarning "No test results file found at $testResultsFile" + } + + Invoke-LoggedCommand "$packageRoot/eng/scripts/Get-Spector-Coverage.ps1" -GroupOutput + + $testResultsFile = "$packageRoot/generator/artifacts/coverage/tsp-spector-coverage-azure.json" + + # copy test results to the artifacts directory + if (Test-Path $testResultsFile) { New-Item -ItemType Directory -Force -Path $testResultsPath | Out-Null Copy-Item -Path $testResultsFile -Destination $testResultsPath -Force } + else { + LogWarning "No test results file found at $testResultsFile" + } } if ($GenerationChecks) { diff --git a/eng/scripts/typespec/Test-Spector.ps1 b/eng/scripts/typespec/Test-Spector.ps1 new file mode 100644 index 000000000000..649781563307 --- /dev/null +++ b/eng/scripts/typespec/Test-Spector.ps1 @@ -0,0 +1,110 @@ +#Requires -Version 7.0 + +param($filter) + +Import-Module "$PSScriptRoot\Generation.psm1" -DisableNameChecking -Force; +Import-Module "$PSScriptRoot\Spector-Helper.psm1" -DisableNameChecking -Force; + +$packageRoot = Resolve-Path (Join-Path $PSScriptRoot '..' '..') + +Refresh-Build + +$specsDirectory = Join-Path $packageRoot 'node_modules' '@typespec' 'http-specs' 'specs' +$azureSpecsDirectory = Join-Path $packageRoot 'node_modules' '@azure-tools' 'azure-http-specs' 'specs' +$spectorRoot = Join-Path $packageRoot 'generator' 'TestProjects' 'Spector' +$spectorRootHttp = Join-Path $spectorRoot 'http' +$directories = Get-ChildItem -Path "$spectorRootHttp" -Directory -Recurse +$spectorCsproj = Join-Path $packageRoot 'generator' 'TestProjects' 'Spector.Tests' 'TestProjects.Spector.Tests.csproj' + +$coverageDir = Join-Path $packageRoot 'generator' 'artifacts' 'coverage' + +if (-not (Test-Path $coverageDir)) { + New-Item -ItemType Directory -Path $coverageDir | Out-Null +} + +foreach ($directory in $directories) { + if (-not (IsGenerated $directory.FullName)) { + continue + } + + $outputDir = $directory.FullName.Substring(0, $directory.FullName.IndexOf("src") - 1) + $subPath = $outputDir.Substring($spectorRootHttp.Length + 1) + $folders = $subPath.Split([System.IO.Path]::DirectorySeparatorChar) + + if (-not (Compare-Paths $subPath $filter)) { + continue + } + + $testPath = Join-Path "$spectorRoot.Tests" "Http" + $testFilter = "TestProjects.Spector.Tests.Http" + foreach ($folder in $folders) { + $segment = "$(Get-Namespace $folder)" + + # the test directory names match the test namespace names, but the source directory names will not have the leading underscore + # so check to see if the filter should contain a leading underscore by comparing with the test directory + if (-not (Test-Path (Join-Path $testPath $segment))) { + $testFilter += "._$segment" + $testPath = Join-Path $testPath "_$segment" + } + else{ + $testFilter += ".$segment" + $testPath = Join-Path $testPath $segment + } + } + + Write-Host "Regenerating $subPath" -ForegroundColor Cyan + + $specFile = Join-Path $specsDirectory $subPath "client.tsp" + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $specsDirectory $subPath "main.tsp" + } + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $azureSpecsDirectory $subPath "client.tsp" + } + if (-not (Test-Path $specFile)) { + $specFile = Join-Path $azureSpecsDirectory $subPath "main.tsp" + } + + if ($subPath.Contains("versioning")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Versioning ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + } + elseif ($subPath.Contains("srv-driven")) { + if ($subPath.Contains("v1")) { + Generate-Srv-Driven ($(Join-Path $azureSpecsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + } + else { + $command = Get-TspCommand $specFile $outputDir + Invoke $command + } + + # exit if the generation failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + Write-Host "Testing $subPath" -ForegroundColor Cyan + $command = "dotnet test $spectorCsproj --filter `"FullyQualifiedName~$testFilter`"" + Invoke $command + # exit if the testing failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + Write-Host "Restoring $subPath" -ForegroundColor Cyan + $command = "git clean -xfd $outputDir" + Invoke $command + # exit if the restore failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $command = "git restore $outputDir" + Invoke $command + # exit if the restore failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } +} diff --git a/eng/service.proj b/eng/service.proj index 7fcd0b393c0e..a99888cb2cbb 100644 --- a/eng/service.proj +++ b/eng/service.proj @@ -13,34 +13,37 @@ false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -58,12 +61,31 @@ - - + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/iothub-connect-to-eventhubs/README.md b/samples/iothub-connect-to-eventhubs/README.md index d6d762656bf6..9c4a028d23b9 100755 --- a/samples/iothub-connect-to-eventhubs/README.md +++ b/samples/iothub-connect-to-eventhubs/README.md @@ -35,5 +35,3 @@ To quickly create the needed IoT Hub resource in Azure and to receive a connecti - [What is Azure IoT Hub?](https://docs.microsoft.com/azure/iot-hub/about-iot-hub) - [IoT Hub - Endpoints documentation](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-endpoints) - [IoT Hub - Read device-to-cloud messages from the built-in endpoint](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-read-builtin) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsamples%2F%2Fiothub-connect-to-eventhubs%2FREADME.png) diff --git a/sdk/agrifood/Azure.Verticals.AgriFood.Farming/README.md b/sdk/agrifood/Azure.Verticals.AgriFood.Farming/README.md index 05f58dad5b5c..0f6d6a737432 100644 --- a/sdk/agrifood/Azure.Verticals.AgriFood.Farming/README.md +++ b/sdk/agrifood/Azure.Verticals.AgriFood.Farming/README.md @@ -137,5 +137,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fagrifood%2FAzure.Verticals.AgriFood.Farming%2FREADME.png) diff --git a/sdk/ai/Azure.AI.Inference/CHANGELOG.md b/sdk/ai/Azure.AI.Inference/CHANGELOG.md index b68dfcf6df37..5d0798b1f3e4 100644 --- a/sdk/ai/Azure.AI.Inference/CHANGELOG.md +++ b/sdk/ai/Azure.AI.Inference/CHANGELOG.md @@ -4,13 +4,18 @@ ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. +- Added new `ImageEmbeddingsClient`, to provide support for generating embeddings with model input. See sample for more information. +- Added support for Chat Completions with audio input, for supported models. +- Added support for Chat Completions with structured output. +- Added support for providing a "Developer" message to models which support it. ### Breaking Changes +- `ChatCompletionsResponseFormatJSON` has been renamed to `ChatCompletionsResponseFormatJsonObject`. + ### Bugs Fixed -### Other Changes +- Fixed an issue where `usage` wasn't being properly included in chat responses. ## 1.0.0-beta.2 (2024-10-24) diff --git a/sdk/ai/Azure.AI.Inference/README.md b/sdk/ai/Azure.AI.Inference/README.md index 524d8e438f82..f2ff479b219b 100644 --- a/sdk/ai/Azure.AI.Inference/README.md +++ b/sdk/ai/Azure.AI.Inference/README.md @@ -25,7 +25,7 @@ With some minor adjustments, this client library can also be configured to do in * An [Azure subscription](https://azure.microsoft.com/free). * An [AI Model from the catalog](https://ai.azure.com/explore/models) deployed through Azure AI Foundry. * To construct the client library, you will need to pass in the endpoint URL. The endpoint URL has the form `https://your-host-name.your-azure-region.inference.ai.azure.com`, where `your-host-name` is your unique model deployment host name and `your-azure-region` is the Azure region where the model is deployed (e.g. `eastus2`). -* Depending on your model deployment and authentication preference, you either need a key to authenticate against the service, or Entra ID credentials. The key is a 32-character string. +* Depending on your model deployment and authentication preference, you either need a key to authenticate against the service, or Entra ID credentials. ### Install the package @@ -461,5 +461,3 @@ additional questions or comments. [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/ai/Azure.AI.Inference/README.png) diff --git a/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.net8.0.cs b/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.net8.0.cs index d2c3a2519435..4a62728365d5 100644 --- a/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.net8.0.cs +++ b/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.net8.0.cs @@ -7,6 +7,7 @@ public static partial class AIInferenceModelFactory public static Azure.AI.Inference.ChatCompletionsToolCall ChatCompletionsToolCall(string id = null, Azure.AI.Inference.ChatCompletionsToolCallType type = default(Azure.AI.Inference.ChatCompletionsToolCallType), Azure.AI.Inference.FunctionCall function = null) { throw null; } public static Azure.AI.Inference.ChatCompletionsToolDefinition ChatCompletionsToolDefinition(Azure.AI.Inference.ChatCompletionsToolDefinitionType type = default(Azure.AI.Inference.ChatCompletionsToolDefinitionType), Azure.AI.Inference.FunctionDefinition function = null) { throw null; } public static Azure.AI.Inference.ChatMessageTextContentItem ChatMessageTextContentItem(string text = null) { throw null; } + public static Azure.AI.Inference.ChatRequestDeveloperMessage ChatRequestDeveloperMessage(string content = null) { throw null; } public static Azure.AI.Inference.ChatRequestSystemMessage ChatRequestSystemMessage(string content = null) { throw null; } public static Azure.AI.Inference.ChatRequestToolMessage ChatRequestToolMessage(string content = null, string toolCallId = null) { throw null; } public static Azure.AI.Inference.ChatResponseMessage ChatResponseMessage(Azure.AI.Inference.ChatRole role = default(Azure.AI.Inference.ChatRole), string content = null, System.Collections.Generic.IEnumerable toolCalls = null) { throw null; } @@ -14,12 +15,31 @@ public static partial class AIInferenceModelFactory public static Azure.AI.Inference.EmbeddingItem EmbeddingItem(System.BinaryData embedding = null, int index = 0) { throw null; } public static Azure.AI.Inference.EmbeddingsResult EmbeddingsResult(string id = null, System.Collections.Generic.IEnumerable data = null, Azure.AI.Inference.EmbeddingsUsage usage = null, string model = null) { throw null; } public static Azure.AI.Inference.EmbeddingsUsage EmbeddingsUsage(int promptTokens = 0, int totalTokens = 0) { throw null; } + public static Azure.AI.Inference.ImageEmbeddingInput ImageEmbeddingInput(string image = null, string text = null) { throw null; } public static Azure.AI.Inference.ModelInfo ModelInfo(string modelName = null, Azure.AI.Inference.ModelType modelType = default(Azure.AI.Inference.ModelType), string modelProviderName = null) { throw null; } public static Azure.AI.Inference.StreamingChatChoiceUpdate StreamingChatChoiceUpdate(int index = 0, Azure.AI.Inference.CompletionsFinishReason? finishReason = default(Azure.AI.Inference.CompletionsFinishReason?), Azure.AI.Inference.StreamingChatResponseMessageUpdate delta = null) { throw null; } - public static Azure.AI.Inference.StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), string model = null, Azure.AI.Inference.CompletionsUsage usage = null, System.Collections.Generic.IEnumerable choices = null) { throw null; } + public static Azure.AI.Inference.StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), string model = null, System.Collections.Generic.IEnumerable choices = null, Azure.AI.Inference.CompletionsUsage usage = null) { throw null; } public static Azure.AI.Inference.StreamingChatResponseMessageUpdate StreamingChatResponseMessageUpdate(Azure.AI.Inference.ChatRole? role = default(Azure.AI.Inference.ChatRole?), string content = null, System.Collections.Generic.IEnumerable toolCalls = null) { throw null; } public static Azure.AI.Inference.StreamingChatResponseToolCallUpdate StreamingChatResponseToolCallUpdate(string id = null, Azure.AI.Inference.FunctionCall function = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AudioContentFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AudioContentFormat(string value) { throw null; } + public static Azure.AI.Inference.AudioContentFormat Mp3 { get { throw null; } } + public static Azure.AI.Inference.AudioContentFormat Wav { get { throw null; } } + public bool Equals(Azure.AI.Inference.AudioContentFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.AI.Inference.AudioContentFormat left, Azure.AI.Inference.AudioContentFormat right) { throw null; } + public static implicit operator Azure.AI.Inference.AudioContentFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.Inference.AudioContentFormat left, Azure.AI.Inference.AudioContentFormat right) { throw null; } + public override string ToString() { throw null; } + } public partial class AzureAIInferenceClientOptions : Azure.Core.ClientOptions { public AzureAIInferenceClientOptions(Azure.AI.Inference.AzureAIInferenceClientOptions.ServiceVersion version = Azure.AI.Inference.AzureAIInferenceClientOptions.ServiceVersion.V2024_05_01_Preview) { } @@ -144,6 +164,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public abstract partial class ChatCompletionsResponseFormat : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatCompletionsResponseFormat() { } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateJsonFormat() { throw null; } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateJsonFormat(string jsonSchemaFormatName, System.Collections.Generic.IDictionary jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = default(bool?)) { throw null; } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateTextFormat() { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Inference.ChatCompletionsResponseFormat System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -151,15 +174,15 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChatCompletionsResponseFormatJSON : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChatCompletionsResponseFormatJsonObject : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ChatCompletionsResponseFormatJSON() { } + public ChatCompletionsResponseFormatJsonObject() { } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Inference.ChatCompletionsResponseFormatJSON System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Inference.ChatCompletionsResponseFormatJSON System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ChatCompletionsResponseFormatText : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -265,6 +288,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.AI.Inference.ChatCompletionsToolDefinitionType left, Azure.AI.Inference.ChatCompletionsToolDefinitionType right) { throw null; } public override string ToString() { throw null; } } + public partial class ChatMessageAudioContentItem : Azure.AI.Inference.ChatMessageContentItem, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatMessageAudioContentItem(System.BinaryData bytes, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(System.IO.Stream stream, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(string audioFilePath, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(System.Uri audioUri) { } + Azure.AI.Inference.ChatMessageAudioContentItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatMessageAudioContentItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public abstract partial class ChatMessageContentItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatMessageContentItem() { } @@ -307,6 +342,19 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.AI.Inference.ChatMessageImageDetailLevel left, Azure.AI.Inference.ChatMessageImageDetailLevel right) { throw null; } public override string ToString() { throw null; } } + public partial class ChatMessageInputAudio : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatMessageInputAudio(string data, Azure.AI.Inference.AudioContentFormat format) { } + public string Data { get { throw null; } } + public Azure.AI.Inference.AudioContentFormat Format { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public static Azure.AI.Inference.ChatMessageInputAudio Load(string path, Azure.AI.Inference.AudioContentFormat format) { throw null; } + Azure.AI.Inference.ChatMessageInputAudio System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatMessageInputAudio System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ChatMessageTextContentItem : Azure.AI.Inference.ChatMessageContentItem, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ChatMessageTextContentItem(string text) { } @@ -333,6 +381,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ChatRequestDeveloperMessage : Azure.AI.Inference.ChatRequestMessage, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatRequestDeveloperMessage(string content) { } + public string Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatRequestDeveloperMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatRequestDeveloperMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public abstract partial class ChatRequestMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatRequestMessage() { } @@ -356,8 +415,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class ChatRequestToolMessage : Azure.AI.Inference.ChatRequestMessage, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { + public ChatRequestToolMessage(string toolCallId) { } public ChatRequestToolMessage(string content, string toolCallId) { } - public string Content { get { throw null; } } + public string Content { get { throw null; } set { } } public string ToolCallId { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Inference.ChatRequestToolMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -400,6 +460,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ChatRole(string value) { throw null; } public static Azure.AI.Inference.ChatRole Assistant { get { throw null; } } + public static Azure.AI.Inference.ChatRole Developer { get { throw null; } } public static Azure.AI.Inference.ChatRole System { get { throw null; } } public static Azure.AI.Inference.ChatRole Tool { get { throw null; } } public static Azure.AI.Inference.ChatRole User { get { throw null; } } @@ -558,25 +619,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ExtraParameters : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ExtraParameters(string value) { throw null; } - public static Azure.AI.Inference.ExtraParameters Drop { get { throw null; } } - public static Azure.AI.Inference.ExtraParameters Error { get { throw null; } } - public static Azure.AI.Inference.ExtraParameters PassThrough { get { throw null; } } - public bool Equals(Azure.AI.Inference.ExtraParameters other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.Inference.ExtraParameters left, Azure.AI.Inference.ExtraParameters right) { throw null; } - public static implicit operator Azure.AI.Inference.ExtraParameters (string value) { throw null; } - public static bool operator !=(Azure.AI.Inference.ExtraParameters left, Azure.AI.Inference.ExtraParameters right) { throw null; } - public override string ToString() { throw null; } - } public partial class FunctionCall : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public FunctionCall(string name, string arguments) { } @@ -606,6 +648,50 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageEmbeddingInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageEmbeddingInput(string image) { } + public string Image { get { throw null; } } + public string Text { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public static Azure.AI.Inference.ImageEmbeddingInput Load(string imageFilePath, string imageFormat, string text = null) { throw null; } + Azure.AI.Inference.ImageEmbeddingInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImageEmbeddingsClient + { + protected ImageEmbeddingsClient() { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Inference.AzureAIInferenceClientOptions options) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Inference.AzureAIInferenceClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Embed(Azure.AI.Inference.ImageEmbeddingsOptions imageEmbeddingsOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EmbedAsync(Azure.AI.Inference.ImageEmbeddingsOptions imageEmbeddingsOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetModelInfo(Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelInfoAsync(Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImageEmbeddingsOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageEmbeddingsOptions(System.Collections.Generic.IEnumerable input) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public int? Dimensions { get { throw null; } set { } } + public Azure.AI.Inference.EmbeddingEncodingFormat? EncodingFormat { get { throw null; } set { } } + public System.Collections.Generic.IList Input { get { throw null; } } + public Azure.AI.Inference.EmbeddingInputType? InputType { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingsOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingsOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ModelInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ModelInfo() { } @@ -626,7 +712,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ModelType(string value) { throw null; } public static Azure.AI.Inference.ModelType AudioGeneration { get { throw null; } } - public static Azure.AI.Inference.ModelType Chat { get { throw null; } } + public static Azure.AI.Inference.ModelType ChatCompletion { get { throw null; } } public static Azure.AI.Inference.ModelType Embeddings { get { throw null; } } public static Azure.AI.Inference.ModelType ImageEmbeddings { get { throw null; } } public static Azure.AI.Inference.ModelType ImageGeneration { get { throw null; } } @@ -731,5 +817,8 @@ public static partial class AIInferenceClientBuilderExtensions public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } } } diff --git a/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.netstandard2.0.cs b/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.netstandard2.0.cs index d2c3a2519435..4a62728365d5 100644 --- a/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.netstandard2.0.cs +++ b/sdk/ai/Azure.AI.Inference/api/Azure.AI.Inference.netstandard2.0.cs @@ -7,6 +7,7 @@ public static partial class AIInferenceModelFactory public static Azure.AI.Inference.ChatCompletionsToolCall ChatCompletionsToolCall(string id = null, Azure.AI.Inference.ChatCompletionsToolCallType type = default(Azure.AI.Inference.ChatCompletionsToolCallType), Azure.AI.Inference.FunctionCall function = null) { throw null; } public static Azure.AI.Inference.ChatCompletionsToolDefinition ChatCompletionsToolDefinition(Azure.AI.Inference.ChatCompletionsToolDefinitionType type = default(Azure.AI.Inference.ChatCompletionsToolDefinitionType), Azure.AI.Inference.FunctionDefinition function = null) { throw null; } public static Azure.AI.Inference.ChatMessageTextContentItem ChatMessageTextContentItem(string text = null) { throw null; } + public static Azure.AI.Inference.ChatRequestDeveloperMessage ChatRequestDeveloperMessage(string content = null) { throw null; } public static Azure.AI.Inference.ChatRequestSystemMessage ChatRequestSystemMessage(string content = null) { throw null; } public static Azure.AI.Inference.ChatRequestToolMessage ChatRequestToolMessage(string content = null, string toolCallId = null) { throw null; } public static Azure.AI.Inference.ChatResponseMessage ChatResponseMessage(Azure.AI.Inference.ChatRole role = default(Azure.AI.Inference.ChatRole), string content = null, System.Collections.Generic.IEnumerable toolCalls = null) { throw null; } @@ -14,12 +15,31 @@ public static partial class AIInferenceModelFactory public static Azure.AI.Inference.EmbeddingItem EmbeddingItem(System.BinaryData embedding = null, int index = 0) { throw null; } public static Azure.AI.Inference.EmbeddingsResult EmbeddingsResult(string id = null, System.Collections.Generic.IEnumerable data = null, Azure.AI.Inference.EmbeddingsUsage usage = null, string model = null) { throw null; } public static Azure.AI.Inference.EmbeddingsUsage EmbeddingsUsage(int promptTokens = 0, int totalTokens = 0) { throw null; } + public static Azure.AI.Inference.ImageEmbeddingInput ImageEmbeddingInput(string image = null, string text = null) { throw null; } public static Azure.AI.Inference.ModelInfo ModelInfo(string modelName = null, Azure.AI.Inference.ModelType modelType = default(Azure.AI.Inference.ModelType), string modelProviderName = null) { throw null; } public static Azure.AI.Inference.StreamingChatChoiceUpdate StreamingChatChoiceUpdate(int index = 0, Azure.AI.Inference.CompletionsFinishReason? finishReason = default(Azure.AI.Inference.CompletionsFinishReason?), Azure.AI.Inference.StreamingChatResponseMessageUpdate delta = null) { throw null; } - public static Azure.AI.Inference.StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), string model = null, Azure.AI.Inference.CompletionsUsage usage = null, System.Collections.Generic.IEnumerable choices = null) { throw null; } + public static Azure.AI.Inference.StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), string model = null, System.Collections.Generic.IEnumerable choices = null, Azure.AI.Inference.CompletionsUsage usage = null) { throw null; } public static Azure.AI.Inference.StreamingChatResponseMessageUpdate StreamingChatResponseMessageUpdate(Azure.AI.Inference.ChatRole? role = default(Azure.AI.Inference.ChatRole?), string content = null, System.Collections.Generic.IEnumerable toolCalls = null) { throw null; } public static Azure.AI.Inference.StreamingChatResponseToolCallUpdate StreamingChatResponseToolCallUpdate(string id = null, Azure.AI.Inference.FunctionCall function = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AudioContentFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AudioContentFormat(string value) { throw null; } + public static Azure.AI.Inference.AudioContentFormat Mp3 { get { throw null; } } + public static Azure.AI.Inference.AudioContentFormat Wav { get { throw null; } } + public bool Equals(Azure.AI.Inference.AudioContentFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.AI.Inference.AudioContentFormat left, Azure.AI.Inference.AudioContentFormat right) { throw null; } + public static implicit operator Azure.AI.Inference.AudioContentFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.Inference.AudioContentFormat left, Azure.AI.Inference.AudioContentFormat right) { throw null; } + public override string ToString() { throw null; } + } public partial class AzureAIInferenceClientOptions : Azure.Core.ClientOptions { public AzureAIInferenceClientOptions(Azure.AI.Inference.AzureAIInferenceClientOptions.ServiceVersion version = Azure.AI.Inference.AzureAIInferenceClientOptions.ServiceVersion.V2024_05_01_Preview) { } @@ -144,6 +164,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public abstract partial class ChatCompletionsResponseFormat : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatCompletionsResponseFormat() { } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateJsonFormat() { throw null; } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateJsonFormat(string jsonSchemaFormatName, System.Collections.Generic.IDictionary jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = default(bool?)) { throw null; } + public static Azure.AI.Inference.ChatCompletionsResponseFormat CreateTextFormat() { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Inference.ChatCompletionsResponseFormat System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -151,15 +174,15 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChatCompletionsResponseFormatJSON : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChatCompletionsResponseFormatJsonObject : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ChatCompletionsResponseFormatJSON() { } + public ChatCompletionsResponseFormatJsonObject() { } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Inference.ChatCompletionsResponseFormatJSON System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.Inference.ChatCompletionsResponseFormatJSON System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ChatCompletionsResponseFormatText : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -265,6 +288,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.AI.Inference.ChatCompletionsToolDefinitionType left, Azure.AI.Inference.ChatCompletionsToolDefinitionType right) { throw null; } public override string ToString() { throw null; } } + public partial class ChatMessageAudioContentItem : Azure.AI.Inference.ChatMessageContentItem, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatMessageAudioContentItem(System.BinaryData bytes, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(System.IO.Stream stream, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(string audioFilePath, Azure.AI.Inference.AudioContentFormat audioFormat) { } + public ChatMessageAudioContentItem(System.Uri audioUri) { } + Azure.AI.Inference.ChatMessageAudioContentItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatMessageAudioContentItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public abstract partial class ChatMessageContentItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatMessageContentItem() { } @@ -307,6 +342,19 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.AI.Inference.ChatMessageImageDetailLevel left, Azure.AI.Inference.ChatMessageImageDetailLevel right) { throw null; } public override string ToString() { throw null; } } + public partial class ChatMessageInputAudio : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatMessageInputAudio(string data, Azure.AI.Inference.AudioContentFormat format) { } + public string Data { get { throw null; } } + public Azure.AI.Inference.AudioContentFormat Format { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public static Azure.AI.Inference.ChatMessageInputAudio Load(string path, Azure.AI.Inference.AudioContentFormat format) { throw null; } + Azure.AI.Inference.ChatMessageInputAudio System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatMessageInputAudio System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ChatMessageTextContentItem : Azure.AI.Inference.ChatMessageContentItem, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ChatMessageTextContentItem(string text) { } @@ -333,6 +381,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ChatRequestDeveloperMessage : Azure.AI.Inference.ChatRequestMessage, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ChatRequestDeveloperMessage(string content) { } + public string Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatRequestDeveloperMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ChatRequestDeveloperMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public abstract partial class ChatRequestMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChatRequestMessage() { } @@ -356,8 +415,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class ChatRequestToolMessage : Azure.AI.Inference.ChatRequestMessage, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { + public ChatRequestToolMessage(string toolCallId) { } public ChatRequestToolMessage(string content, string toolCallId) { } - public string Content { get { throw null; } } + public string Content { get { throw null; } set { } } public string ToolCallId { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Inference.ChatRequestToolMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -400,6 +460,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ChatRole(string value) { throw null; } public static Azure.AI.Inference.ChatRole Assistant { get { throw null; } } + public static Azure.AI.Inference.ChatRole Developer { get { throw null; } } public static Azure.AI.Inference.ChatRole System { get { throw null; } } public static Azure.AI.Inference.ChatRole Tool { get { throw null; } } public static Azure.AI.Inference.ChatRole User { get { throw null; } } @@ -558,25 +619,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ExtraParameters : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ExtraParameters(string value) { throw null; } - public static Azure.AI.Inference.ExtraParameters Drop { get { throw null; } } - public static Azure.AI.Inference.ExtraParameters Error { get { throw null; } } - public static Azure.AI.Inference.ExtraParameters PassThrough { get { throw null; } } - public bool Equals(Azure.AI.Inference.ExtraParameters other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.Inference.ExtraParameters left, Azure.AI.Inference.ExtraParameters right) { throw null; } - public static implicit operator Azure.AI.Inference.ExtraParameters (string value) { throw null; } - public static bool operator !=(Azure.AI.Inference.ExtraParameters left, Azure.AI.Inference.ExtraParameters right) { throw null; } - public override string ToString() { throw null; } - } public partial class FunctionCall : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public FunctionCall(string name, string arguments) { } @@ -606,6 +648,50 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageEmbeddingInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageEmbeddingInput(string image) { } + public string Image { get { throw null; } } + public string Text { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public static Azure.AI.Inference.ImageEmbeddingInput Load(string imageFilePath, string imageFormat, string text = null) { throw null; } + Azure.AI.Inference.ImageEmbeddingInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImageEmbeddingsClient + { + protected ImageEmbeddingsClient() { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Inference.AzureAIInferenceClientOptions options) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ImageEmbeddingsClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Inference.AzureAIInferenceClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Embed(Azure.AI.Inference.ImageEmbeddingsOptions imageEmbeddingsOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EmbedAsync(Azure.AI.Inference.ImageEmbeddingsOptions imageEmbeddingsOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetModelInfo(Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelInfoAsync(Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImageEmbeddingsOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageEmbeddingsOptions(System.Collections.Generic.IEnumerable input) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public int? Dimensions { get { throw null; } set { } } + public Azure.AI.Inference.EmbeddingEncodingFormat? EncodingFormat { get { throw null; } set { } } + public System.Collections.Generic.IList Input { get { throw null; } } + public Azure.AI.Inference.EmbeddingInputType? InputType { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingsOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Inference.ImageEmbeddingsOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ModelInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ModelInfo() { } @@ -626,7 +712,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ModelType(string value) { throw null; } public static Azure.AI.Inference.ModelType AudioGeneration { get { throw null; } } - public static Azure.AI.Inference.ModelType Chat { get { throw null; } } + public static Azure.AI.Inference.ModelType ChatCompletion { get { throw null; } } public static Azure.AI.Inference.ModelType Embeddings { get { throw null; } } public static Azure.AI.Inference.ModelType ImageEmbeddings { get { throw null; } } public static Azure.AI.Inference.ModelType ImageGeneration { get { throw null; } } @@ -731,5 +817,8 @@ public static partial class AIInferenceClientBuilderExtensions public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } public static Azure.Core.Extensions.IAzureClientBuilder AddEmbeddingsClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } } } diff --git a/sdk/ai/Azure.AI.Inference/assets.json b/sdk/ai/Azure.AI.Inference/assets.json index f41193522b64..99794a1ffce6 100644 --- a/sdk/ai/Azure.AI.Inference/assets.json +++ b/sdk/ai/Azure.AI.Inference/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/ai/Azure.AI.Inference", - "Tag": "net/ai/Azure.AI.Inference_4a960298fb" + "Tag": "net/ai/Azure.AI.Inference_bda2b3e222" } diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample10_EmbeddingsWithAoai.md b/sdk/ai/Azure.AI.Inference/samples/Sample10_EmbeddingsWithAoai.md index 62bf2db7a29a..9db2a834c675 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample10_EmbeddingsWithAoai.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample10_EmbeddingsWithAoai.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_OPENAI_EMBEDDINGS_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_OPENAI_EMBEDDINGS_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_OPENAI_EMBEDDINGS_KEY - Your model key. Keep it secret. In order to target AOAI, the auth key must currently be provided as a separate header. This can be done by creating a `HttpPipelinePolicy` like below: diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample11_ImageEmbeddings.md b/sdk/ai/Azure.AI.Inference/samples/Sample11_ImageEmbeddings.md new file mode 100644 index 000000000000..391aa5b6083c --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/samples/Sample11_ImageEmbeddings.md @@ -0,0 +1,80 @@ +# Simple Embeddings + +This sample demonstrates how to get embeddings for a provided image. Here we use the service default of returning embeddings as a list of floating point values. + +This sample assumes the AI model is hosted on a Serverless API or Managed Compute endpoint. For GitHub Models or Azure OpenAI endpoints, the client constructor needs to be modified. See package documentation for details. + +## Usage + +Set these two environment variables before running the sample: + +1. AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. + +2. AZURE_AI_IMAGE_EMBEDDINGS_KEY - Your model key. Keep it secret. + +```C# Snippet:Azure_AI_Inference_BasicImageEmbedding +var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT")); +var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_KEY")); + +var client = new ImageEmbeddingsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + +List input = new List +{ + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +}; + +var requestOptions = new ImageEmbeddingsOptions(input); + +Response response = client.Embed(requestOptions); +foreach (EmbeddingItem item in response.Value.Data) +{ + List embedding = item.Embedding.ToObjectFromJson>(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{string.Join(", ", embedding)}>"); +} +``` + +An `async` option is also available. + +```C# Snippet:Azure_AI_Inference_BasicImageEmbeddingAsync +var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT")); +var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_KEY")); + +var client = new ImageEmbeddingsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + +List input = new List +{ + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +}; + +var requestOptions = new ImageEmbeddingsOptions(input); + +Response response = await client.EmbedAsync(requestOptions); +foreach (EmbeddingItem item in response.Value.Data) +{ + List embedding = item.Embedding.ToObjectFromJson>(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{string.Join(", ", embedding)}>"); +} +``` + +### Alternative Response Type + +It is also possible to request embeddings as base64 encoded strings, instead of the service default of lists of floats. + +```C# Snippet:Azure_AI_Inference_Base64ImageEmbedding +List input = new List +{ + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +}; + +var requestOptions = new ImageEmbeddingsOptions(input) +{ + EncodingFormat = EmbeddingEncodingFormat.Base64, +}; + +Response response = client.Embed(requestOptions); +foreach (EmbeddingItem item in response.Value.Data) +{ + string embedding = item.Embedding.ToObjectFromJson(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{embedding}>"); +} +``` diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample12_ChatCompletionsWithAudio.md b/sdk/ai/Azure.AI.Inference/samples/Sample12_ChatCompletionsWithAudio.md new file mode 100644 index 000000000000..46053ca9a963 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/samples/Sample12_ChatCompletionsWithAudio.md @@ -0,0 +1,68 @@ +# Chat Completions with Audio Input + +This sample demonstrates how to get a chat completions response from the service using a synchronous call. It shows different ways to include audio in the input chat messages. + +This sample will only work on AI models that support audio input. + +## Usage + +Set these two environment variables before running the sample: + +1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. + +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. + +An audio input can be provided using a URI pointer to an audio file: + +```C# Snippet:Azure_AI_Inference_AudioUrlInput +var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); +var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); + +var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + +var requestOptions = new ChatCompletionsOptions() +{ + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Translate this audio for me"), + new ChatMessageAudioContentItem(new Uri("https://example.com/audio.mp3"))), + }, +}; + +Response response = client.Complete(requestOptions); +System.Console.WriteLine(response.Value.Content); +``` + +Alternatively, you can provide a pointer to a file on disk: + +```C# Snippet:Azure_AI_Inference_AudioDataFileInput +var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); +var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); + +ChatMessageAudioContentItem audioContentItem = new ChatMessageAudioContentItem("sample_audio.mp3", AudioContentFormat.Mp3); + +var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + +var requestOptions = new ChatCompletionsOptions() +{ + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Translate this audio for me"), + new ChatMessageAudioContentItem(new Uri("https://example.com/audio.mp3"))), + }, +}; + +Response response = client.Complete(requestOptions); +System.Console.WriteLine(response.Value.Content); +``` + +Either method supports an `async` option, with the only difference being how the client is invoked: + +```C# Snippet:Azure_AI_Inference_AudioInputAsync +Response response = await client.CompleteAsync(requestOptions); +System.Console.WriteLine(response.Value.Content); +``` diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample13_ChatCompletionsWithStructuredOutputs.md b/sdk/ai/Azure.AI.Inference/samples/Sample13_ChatCompletionsWithStructuredOutputs.md new file mode 100644 index 000000000000..d28f7f854c61 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/samples/Sample13_ChatCompletionsWithStructuredOutputs.md @@ -0,0 +1,148 @@ +# Chat Completions with JSON Structured Output + +This sample demonstrates how to get a chat completions response with the output structured to match a provided JSON format. + +## Usage + +Set these two environment variables before running the sample: + +1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. + +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret, keep it safe. + +In order to instruct the model that you want the output to follow a specific structure, you need to build out the JSON schema that you want the model to use. The schema is then given a name and passed to the `ChatCompletionsResponseFormat.CreateJsonFormat` method, which can then be provided to the `ResponseFormat` property of the request options object. + +```C# Snippet:Azure_AI_Inference_SampleStructuredOutput +var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); +var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); + +var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + +var messages = new List() +{ + new ChatRequestSystemMessage("You are a helpful assistant."), + new ChatRequestUserMessage("Please give me directions and ingredients to bake a chocolate cake."), +}; + +var requestOptions = new ChatCompletionsOptions(messages); + +Dictionary jsonSchema = new Dictionary +{ + { "type", BinaryData.FromString("\"object\"") }, + { "properties", BinaryData.FromString(""" + { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "directions": { + "type": "string" + } + } + } + }, + "prep_time": { + "type": "string" + }, + "bake_time": { + "type": "string" + } + } + """) }, + { "required", BinaryData.FromString("[\"ingredients\", \"steps\", \"bake_time\"]") }, + { "additionalProperties", BinaryData.FromString("false") } +}; + +requestOptions.ResponseFormat = ChatCompletionsResponseFormat.CreateJsonFormat("cakeBakingDirections", jsonSchema); + +Response response = client.Complete(requestOptions); +``` + +When the response is returned, it can then be parsed into the expected JSON format. + +```C# Snippet:Azure_AI_Inference_SampleStructuredOutputParseJson +using JsonDocument structuredJson = JsonDocument.Parse(result.Content); +structuredJson.RootElement.TryGetProperty("ingredients", out var ingredients); +structuredJson.RootElement.TryGetProperty("steps", out var steps); +structuredJson.RootElement.TryGetProperty("bake_time", out var bakeTime); +``` + +Printing the output to the console can also show that the output met the expected structure which was requested. + +```C# Snippet:Azure_AI_Inference_SampleStructuredOutputPrintOutput +var options = new JsonSerializerOptions +{ + WriteIndented = true +}; +Console.WriteLine($"Ingredients: {System.Text.Json.JsonSerializer.Serialize(ingredients, options)}"); +Console.WriteLine($"Steps: {System.Text.Json.JsonSerializer.Serialize(steps, options)}"); +Console.WriteLine($"Bake time: {System.Text.Json.JsonSerializer.Serialize(bakeTime, options)}"); +``` + +```Text +Ingredients: [ + "2 cups of all-purpose flour", + "2 cups of sugar", + "3/4 cup of unsweetened cocoa powder", + "2 teaspoons of baking powder", + "1 1/2 teaspoons of baking soda", + "1 teaspoon of salt", + "1 teaspoon of instant coffee powder (optional, for enhancing chocolate flavor)", + "1 cup of milk", + "1/2 cup of vegetable oil", + "2 large eggs", + "2 teaspoons of vanilla extract", + "1 cup of boiling water" +] +Steps: [ + { + "ingredients": [ + "all-purpose flour", + "sugar", + "unsweetened cocoa powder", + "baking powder", + "baking soda", + "salt", + "instant coffee powder if using" + ], + "directions": "Preheat your oven to 350°F (177°C) and grease and lightly flour two 9-inch round baking pans or line them with parchment paper. In a large bowl sift together the dry ingredients." + }, + { + "ingredients": [ + "milk", + "vegetable oil", + "eggs", + "vanilla extract" + ], + "directions": "Add the milk, vegetable oil, eggs, and vanilla to the bowl of dry ingredients and mix until smooth and well combined." + }, + { + "ingredients": [ + "boiling water" + ], + "directions": "Slowly add the cup of boiling water to the mixture (the batter will be thin). Stir until well mixed." + }, + { + "ingredients": [], + "directions": "Divide the batter evenly between the two prepared pans and bake in the preheated oven for 30-35 minutes, or until a toothpick inserted in the center comes out clean." + }, + { + "ingredients": [], + "directions": "Remove the cakes from the oven and allow them to cool in the pans for about 10 minutes, then transfer them to a wire rack to cool completely." + } +] +Bake time: "30-35 minutes" +``` diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample1_ChatCompletions.md b/sdk/ai/Azure.AI.Inference/samples/Sample1_ChatCompletions.md index 12b08f872cca..e5fc8306ccfc 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample1_ChatCompletions.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample1_ChatCompletions.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret, keep it safe. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret, keep it safe. ```C# Snippet:Azure_AI_Inference_HelloWorldScenario var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample2_ChatCompletionsWithAoai.md b/sdk/ai/Azure.AI.Inference/samples/Sample2_ChatCompletionsWithAoai.md index 92d69a45595b..5d20f5f26483 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample2_ChatCompletionsWithAoai.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample2_ChatCompletionsWithAoai.md @@ -7,7 +7,7 @@ This sample demonstrates how to get a chat completions response from the service Set these two environment variables before running the sample: 1. AZURE_OPENAI_CHAT_ENDPOINT - Your AOAI endpoint URL, with partial path, in the form `https://.openai.azure.com/openai/deployments/` where `your-unique-resource-name` is your globally unique AOAI resource name, and `your-deployment-name` is your AI Model deployment name. For example: `https://your-unique-host.openai.azure.com/openai/deployments/gpt-4-turbo` -2. AZURE_OPENAI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. This is only required for key authentication. +2. AZURE_OPENAI_CHAT_KEY - Your model key. Keep it secret. This is only required for key authentication. In order to target AOAI, the auth key must currently be provided as a separate header. This can be done by creating a `HttpPipelinePolicy` like below: diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample3_ChatCompletionsStreaming.md b/sdk/ai/Azure.AI.Inference/samples/Sample3_ChatCompletionsStreaming.md index 81558e6dcb2f..f59898d593de 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample3_ChatCompletionsStreaming.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample3_ChatCompletionsStreaming.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_HelloWorldStreamingScenarioAsync var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample4_ChatCompletionsWithHistory.md b/sdk/ai/Azure.AI.Inference/samples/Sample4_ChatCompletionsWithHistory.md index 23370dee1955..1da3180b0b21 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample4_ChatCompletionsWithHistory.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample4_ChatCompletionsWithHistory.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_ChatCompletionsWithHistoryScenario var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample5_ChatCompletionsWithImages.md b/sdk/ai/Azure.AI.Inference/samples/Sample5_ChatCompletionsWithImages.md index 13f14fee9dcb..fcf51d0111ca 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample5_ChatCompletionsWithImages.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample5_ChatCompletionsWithImages.md @@ -10,7 +10,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_ChatCompletionsWithImageUrlScenario var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample6_ChatCompletionsWithAdditionalProperties.md b/sdk/ai/Azure.AI.Inference/samples/Sample6_ChatCompletionsWithAdditionalProperties.md index a84ac304f02f..b9d3caf2bc03 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample6_ChatCompletionsWithAdditionalProperties.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample6_ChatCompletionsWithAdditionalProperties.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_ChatCompletionsWithAdditionalPropertiesScenario var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample7_ChatCompletionsWithTools.md b/sdk/ai/Azure.AI.Inference/samples/Sample7_ChatCompletionsWithTools.md index 55c433c972de..df3ebdb354fa 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample7_ChatCompletionsWithTools.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample7_ChatCompletionsWithTools.md @@ -8,7 +8,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_CHAT_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_CHAT_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_CHAT_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_ChatCompletionsWithToolsScenario var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/samples/Sample9_Embeddings.md b/sdk/ai/Azure.AI.Inference/samples/Sample9_Embeddings.md index ade0458bd9e1..c1e1877b611e 100644 --- a/sdk/ai/Azure.AI.Inference/samples/Sample9_Embeddings.md +++ b/sdk/ai/Azure.AI.Inference/samples/Sample9_Embeddings.md @@ -10,7 +10,7 @@ Set these two environment variables before running the sample: 1. AZURE_AI_EMBEDDINGS_ENDPOINT - Your endpoint URL, in the form `https://your-deployment-name.your-azure-region.inference.ai.azure.com` where `your-deployment-name` is your unique AI Model deployment name, and `your-azure-region` is the Azure region where your model is deployed. -2. AZURE_AI_EMBEDDINGS_KEY - Your model key (a 32-character string). Keep it secret. +2. AZURE_AI_EMBEDDINGS_KEY - Your model key. Keep it secret. ```C# Snippet:Azure_AI_Inference_BasicEmbedding var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_EMBEDDINGS_ENDPOINT")); diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsClient.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsClient.cs index ae38e6b47cb4..18c270aa5c56 100644 --- a/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsClient.cs +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsClient.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -17,8 +18,9 @@ namespace Azure.AI.Inference /// The ChatCompletions service client. - [CodeGenSuppress("Complete", typeof(ChatCompletionsOptions), typeof(ExtraParameters?), typeof(CancellationToken))] - [CodeGenSuppress("CompleteAsync", typeof(ChatCompletionsOptions), typeof(ExtraParameters?), typeof(CancellationToken))] + [SuppressMessage("Azure Analysis", "AZC0007", Justification = "Analyzer is incorrectly flagging valid overloads.")] + [CodeGenSuppress("Complete", typeof(IEnumerable), typeof(float?), typeof(bool?), typeof(float?), typeof(float?), typeof(float?), typeof(int?), typeof(ChatCompletionsResponseFormat), typeof(IEnumerable), typeof(IEnumerable), typeof(BinaryData), typeof(long?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] + [CodeGenSuppress("CompleteAsync", typeof(IEnumerable), typeof(float?), typeof(bool?), typeof(float?), typeof(float?), typeof(float?), typeof(int?), typeof(ChatCompletionsResponseFormat), typeof(IEnumerable), typeof(IEnumerable), typeof(BinaryData), typeof(long?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] public partial class ChatCompletionsClient { /// Initializes a new instance of ChatCompletionsClient. diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsResponseFormat.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsResponseFormat.cs new file mode 100644 index 000000000000..15269fff9087 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatCompletionsResponseFormat.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// + /// Represents the format that the model must output. Use this to enable JSON mode instead of the default text mode. + /// Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON + /// via a system or user message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class ChatCompletionsResponseFormat + { + /// Creates a new requesting plain text. + public static ChatCompletionsResponseFormat CreateTextFormat() => new ChatCompletionsResponseFormatText(); + + /// Creates a new requesting valid JSON, a.k.a. JSON mode. + public static ChatCompletionsResponseFormat CreateJsonFormat() => new ChatCompletionsResponseFormatJsonObject(); + + /// + /// Creates a new requesting adherence to the specified JSON schema, + /// a.k.a. structured outputs. + /// + /// The name of the response format. + /// + /// + /// The schema of the response format, described as a JSON schema. Learn more in the + /// structured outputs guide. + /// and the + /// JSON schema reference documentation. + /// + /// + /// You can easily create a JSON schema via the factory methods of the class, such + /// as or . For + /// example, the following code defines a simple schema for step-by-step responses to math problems: + /// + /// BinaryData jsonSchema = BinaryData.FromBytes(""" + /// { + /// "type": "object", + /// "properties": { + /// "steps": { + /// "type": "array", + /// "items": { + /// "type": "object", + /// "properties": { + /// "explanation": {"type": "string"}, + /// "output": {"type": "string"} + /// }, + /// "required": ["explanation", "output"], + /// "additionalProperties": false + /// } + /// }, + /// "final_answer": {"type": "string"} + /// }, + /// "required": ["steps", "final_answer"], + /// "additionalProperties": false + /// } + /// """U8.ToArray()); + /// + /// + /// + /// + /// The description of what the response format is for, which is used by the model to determine how to respond + /// in the format. + /// + /// + /// + /// Whether to enable strict schema adherence when generating the response. If set to true, the + /// model will follow the exact schema defined in . + /// + /// + /// Only a subset of the JSON schema specification is supported when this is set to true. Learn more + /// in the + /// structured outputs guide. + /// + /// + /// or is null. + /// is an empty string, and was expected to be non-empty. + public static ChatCompletionsResponseFormat CreateJsonFormat(string jsonSchemaFormatName, IDictionary jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = null) + { + Argument.AssertNotNullOrEmpty(jsonSchemaFormatName, nameof(jsonSchemaFormatName)); + Argument.AssertNotNull(jsonSchema, nameof(jsonSchema)); + + ChatCompletionsResponseFormatJsonSchemaDefinition internalSchema = new( + jsonSchemaFormatName, + jsonSchema, + jsonSchemaFormatDescription, + jsonSchemaIsStrict, + serializedAdditionalRawData: null); + + return new ChatCompletionsResponseFormatJsonSchema(internalSchema); + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.Serialization.cs new file mode 100644 index 000000000000..43204c421ed9 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + public partial class ChatMessageAudioContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + if (_dataContentItem != null) + { + ((IJsonModel)_dataContentItem).Write(writer, options); + } + else + { + ((IJsonModel)_urlContentItem).Write(writer, options); + } + } + + ChatMessageAudioContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + // This is a purely client side class, so it should never be received over the wire. Implementation here is only for interface compliance. + return new ChatMessageAudioContentItem(); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + if (_dataContentItem != null) + { + return ((IJsonModel)_dataContentItem).Write(options); + } + else + { + return ((IJsonModel)_urlContentItem).Write(options); + } + } + + ChatMessageAudioContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + // This is a purely client side class, so it should never be received over the wire. Implementation here is only for interface compliance. + return new ChatMessageAudioContentItem(); + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.cs new file mode 100644 index 000000000000..5d048a2e4c9a --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageAudioContentItem.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.IO; + +namespace Azure.AI.Inference +{ + public partial class ChatMessageAudioContentItem : ChatMessageContentItem + { + private ChatMessageAudioDataContentItem _dataContentItem; + private ChatMessageAudioUrlContentItem _urlContentItem; + + public ChatMessageAudioContentItem(Uri audioUri) + { + _urlContentItem = new ChatMessageAudioUrlContentItem(new ChatMessageInputAudioUrl(audioUri.AbsoluteUri)); + } + + public ChatMessageAudioContentItem(BinaryData bytes, AudioContentFormat audioFormat) + { + string base64AudioData = Convert.ToBase64String(bytes.ToArray()); + _dataContentItem = new ChatMessageAudioDataContentItem(new ChatMessageInputAudio(base64AudioData, audioFormat)); + } + + public ChatMessageAudioContentItem(Stream stream, AudioContentFormat audioFormat) + : this(BinaryData.FromStream(stream), audioFormat) + { } + + public ChatMessageAudioContentItem(string audioFilePath, AudioContentFormat audioFormat) + : this(File.OpenRead(audioFilePath), audioFormat) + { } + + /// Initializes a new instance of for deserialization. + internal ChatMessageAudioContentItem() + { + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageInputAudio.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageInputAudio.cs new file mode 100644 index 000000000000..20a57edd358b --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatMessageInputAudio.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.IO; + +namespace Azure.AI.Inference +{ + public partial class ChatMessageInputAudio + { + public static ChatMessageInputAudio Load(string path, AudioContentFormat format) + { + byte[] bytes = File.ReadAllBytes(path); + string base64 = Convert.ToBase64String(bytes); + return new ChatMessageInputAudio(base64, format); + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ChatRequestToolMessage.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ChatRequestToolMessage.cs new file mode 100644 index 000000000000..42a5d4fa05f0 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ChatRequestToolMessage.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Data; + +namespace Azure.AI.Inference +{ + public partial class ChatRequestToolMessage + { + public ChatRequestToolMessage(string content, string toolCallId) + { + Argument.AssertNotNull(toolCallId, nameof(toolCallId)); + + Role = ChatRole.Tool; + Content = content; + ToolCallId = toolCallId; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/EmbeddingsClient.cs b/sdk/ai/Azure.AI.Inference/src/Customized/EmbeddingsClient.cs index a332c531f8da..f1b07aca787b 100644 --- a/sdk/ai/Azure.AI.Inference/src/Customized/EmbeddingsClient.cs +++ b/sdk/ai/Azure.AI.Inference/src/Customized/EmbeddingsClient.cs @@ -8,6 +8,7 @@ using System.Threading; using Azure.Core; using Azure.Core.Pipeline; +using System.Diagnostics.CodeAnalysis; namespace Azure.AI.Inference { @@ -15,8 +16,10 @@ namespace Azure.AI.Inference // Modified code for the ChatCompletionsClient /// The Embeddings service client. - [CodeGenSuppress("Embed", typeof(EmbeddingsOptions), typeof(ExtraParameters?), typeof(CancellationToken))] - [CodeGenSuppress("EmbedAsync", typeof(EmbeddingsOptions), typeof(ExtraParameters?), typeof(CancellationToken))] + + [SuppressMessage("Azure Analysis", "AZC0007", Justification = "Analyzer is incorrectly flagging valid overloads.")] + [CodeGenSuppress("Embed", typeof(IEnumerable), typeof(int?), typeof(EmbeddingEncodingFormat?), typeof(EmbeddingInputType?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] + [CodeGenSuppress("EmbedAsync", typeof(IEnumerable), typeof(int?), typeof(EmbeddingEncodingFormat?), typeof(EmbeddingInputType?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] public partial class EmbeddingsClient { /// Initializes a new instance of EmbeddingsClient. diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/FunctionDefinition.cs b/sdk/ai/Azure.AI.Inference/src/Customized/FunctionDefinition.cs index 445b94493478..ea54cf7b9fce 100644 --- a/sdk/ai/Azure.AI.Inference/src/Customized/FunctionDefinition.cs +++ b/sdk/ai/Azure.AI.Inference/src/Customized/FunctionDefinition.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Generic; +using System; + namespace Azure.AI.Inference { public partial class FunctionDefinition @@ -31,6 +34,38 @@ public FunctionDefinition() /// The name of the function to be called. public string Name { get; set; } + /// + /// The parameters the function accepts, described as a JSON Schema object. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Parameters { get; set; } + internal bool IsPredefined { get; set; } = false; internal static FunctionDefinition CreatePredefinedFunctionDefinition(string functionName) diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingInput.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingInput.cs new file mode 100644 index 000000000000..41f9cd3a102b --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingInput.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.IO; + +namespace Azure.AI.Inference +{ + public partial class ImageEmbeddingInput + { + public static ImageEmbeddingInput Load(string imageFilePath, string imageFormat, string text = null) + { + byte[] imageArray = File.ReadAllBytes(imageFilePath); + string base64ImageData = Convert.ToBase64String(imageArray); + + string imageUrl = $"data:image/{imageFormat};base64,{base64ImageData}"; + ImageEmbeddingInput imageInput = new ImageEmbeddingInput(imageUrl) + { + Text = text + }; + + return imageInput; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingsClient.cs b/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingsClient.cs new file mode 100644 index 000000000000..0c276ce8f2fe --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Customized/ImageEmbeddingsClient.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Diagnostics.CodeAnalysis; +using Azure.Core.Pipeline; +using Azure.Core; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading; +using System.Linq; +using Azure.AI.Inference.Telemetry; + +namespace Azure.AI.Inference +{ + [SuppressMessage("Azure Analysis", "AZC0007", Justification = "Analyzer is incorrectly flagging valid overloads.")] + [CodeGenSuppress("Embed", typeof(IEnumerable), typeof(int?), typeof(EmbeddingEncodingFormat?), typeof(EmbeddingInputType?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] + [CodeGenSuppress("EmbedAsync", typeof(IEnumerable), typeof(int?), typeof(EmbeddingEncodingFormat?), typeof(EmbeddingInputType?), typeof(string), typeof(ExtraParameters?), typeof(CancellationToken))] + public partial class ImageEmbeddingsClient + { + /// Initializes a new instance of ImageEmbeddingsClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ImageEmbeddingsClient(Uri endpoint, AzureKeyCredential credential, AzureAIInferenceClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureAIInferenceClientOptions(); + credential.Deconstruct(out var key); + options.AddPolicy(new AddApiKeyHeaderPolicy(key), HttpPipelinePosition.PerCall); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// + /// Return the embedding vectors for given images. + /// The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + /// + /// + /// The cancellation token to use. + /// is null. + public virtual async Task> EmbedAsync(ImageEmbeddingsOptions imageEmbeddingsOptions, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(imageEmbeddingsOptions, nameof(imageEmbeddingsOptions)); + ExtraParameters? extraParams = null; + + // CUSTOM CODE NOTE: + // If AdditionalProperties are provided, the decision has been made to default extraParams to "PassThrough" + if (imageEmbeddingsOptions.AdditionalProperties != null && imageEmbeddingsOptions.AdditionalProperties.Count > 0) + { + extraParams ??= ExtraParameters.PassThrough; + } + + using RequestContent content = imageEmbeddingsOptions.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await EmbedAsync(content, extraParams?.ToString(), context).ConfigureAwait(false); + return Response.FromValue(EmbeddingsResult.FromResponse(response), response); + } + + /// + /// Return the embedding vectors for given images. + /// The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + /// + /// + /// The cancellation token to use. + /// is null. + public virtual Response Embed(ImageEmbeddingsOptions imageEmbeddingsOptions, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(imageEmbeddingsOptions, nameof(imageEmbeddingsOptions)); + ExtraParameters? extraParams = null; + + // CUSTOM CODE NOTE: + // If AdditionalProperties are provided, the decision has been made to default extraParams to "PassThrough" + if (imageEmbeddingsOptions.AdditionalProperties != null && imageEmbeddingsOptions.AdditionalProperties.Count > 0) + { + extraParams ??= ExtraParameters.PassThrough; + } + + using RequestContent content = imageEmbeddingsOptions.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Embed(content, extraParams?.ToString(), context); + return Response.FromValue(EmbeddingsResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Return the embedding vectors for given images. + /// The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// + /// Controls what happens if extra parameters, undefined by the REST API, + /// are passed in the JSON request payload. + /// This sets the HTTP request header `extra-parameters`. Allowed values: "error" | "drop" | "pass-through" + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task EmbedAsync(RequestContent content, string extraParams = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ImageEmbeddingsClient.Embed"); + scope.Start(); + try + { + using HttpMessage message = CreateEmbedRequest(content, extraParams, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Return the embedding vectors for given images. + /// The method makes a REST API call to the `/images/embeddings` route on the given endpoint. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// + /// Controls what happens if extra parameters, undefined by the REST API, + /// are passed in the JSON request payload. + /// This sets the HTTP request header `extra-parameters`. Allowed values: "error" | "drop" | "pass-through" + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Embed(RequestContent content, string extraParams = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ImageEmbeddingsClient.Embed"); + scope.Start(); + try + { + using HttpMessage message = CreateEmbedRequest(content, extraParams, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + private class AddApiKeyHeaderPolicy : HttpPipelinePolicy + { + public string Token { get; } + + public AddApiKeyHeaderPolicy(string token) + { + Token = token; + } + + public override void Process(HttpMessage message, ReadOnlyMemory pipeline) + { + // Add your desired header name and value + message.Request.Headers.Add("api-key", Token); + + ProcessNext(message, pipeline); + } + + public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) + { + // Add your desired header name and value + message.Request.Headers.Add("api-key", Token); + + return ProcessNextAsync(message, pipeline); + } + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Customized/StreamingChatCompletionsUpdate.cs b/sdk/ai/Azure.AI.Inference/src/Customized/StreamingChatCompletionsUpdate.cs index fb0963157b22..895898fdde50 100644 --- a/sdk/ai/Azure.AI.Inference/src/Customized/StreamingChatCompletionsUpdate.cs +++ b/sdk/ai/Azure.AI.Inference/src/Customized/StreamingChatCompletionsUpdate.cs @@ -2,6 +2,8 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; +using System.Linq; namespace Azure.AI.Inference { @@ -96,6 +98,33 @@ public partial class StreamingChatCompletionsUpdate /// public CompletionsFinishReason? FinishReason { get; } + /// Initializes a new instance of . + /// A unique identifier associated with this chat completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// The model used for the chat completion. + /// + /// An update to the collection of completion choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// , or is null. + internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, string model, IEnumerable choices, CompletionsUsage usage) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(model, nameof(model)); + Argument.AssertNotNull(choices, nameof(choices)); + + Id = id; + Created = created; + Model = model; + Choices = choices.ToList(); + Usage = usage; + } + internal StreamingChatCompletionsUpdate( string id, string model, diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceClientBuilderExtensions.cs index 5ef054431019..b164a88148d3 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceClientBuilderExtensions.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceClientBuilderExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Azure { - /// Extension methods to add , to client builder. + /// Extension methods to add , , to client builder. public static partial class AIInferenceClientBuilderExtensions { /// Registers a instance. @@ -53,6 +53,25 @@ public static IAzureClientBuilder((options, cred) => new EmbeddingsClient(endpoint, cred, options)); } + /// Registers a instance. + /// The builder to register with. + /// Service host. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new ImageEmbeddingsClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Service host. + public static IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ImageEmbeddingsClient(endpoint, cred, options)); + } + /// Registers a instance. /// The builder to register with. /// The configuration values. @@ -69,5 +88,13 @@ public static IAzureClientBuilder(configuration); } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddImageEmbeddingsClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceModelFactory.cs b/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceModelFactory.cs index b69b4ab3c432..8bd673de3aa2 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceModelFactory.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/AIInferenceModelFactory.cs @@ -22,6 +22,14 @@ public static ChatRequestSystemMessage ChatRequestSystemMessage(string content = return new ChatRequestSystemMessage(ChatRole.System, serializedAdditionalRawData: null, content); } + /// Initializes a new instance of . + /// The contents of the developer message. + /// A new instance for mocking. + public static ChatRequestDeveloperMessage ChatRequestDeveloperMessage(string content = null) + { + return new ChatRequestDeveloperMessage(ChatRole.Developer, serializedAdditionalRawData: null, content); + } + /// Initializes a new instance of . /// The content of the message. /// A new instance for mocking. @@ -67,16 +75,6 @@ public static ChatCompletionsNamedToolChoice ChatCompletionsNamedToolChoice(Chat return new ChatCompletionsNamedToolChoice(type, function, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The number of tokens generated across all completions emissions. - /// The number of tokens in the provided prompts for the completions request. - /// The total number of tokens processed for the completions request and response. - /// A new instance for mocking. - public static CompletionsUsage CompletionsUsage(int completionTokens = default, int promptTokens = default, int totalTokens = default) - { - return new CompletionsUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The ordered index associated with this chat completions choice. /// The reason that this chat completions choice completed its generated. @@ -102,6 +100,16 @@ public static ChatResponseMessage ChatResponseMessage(ChatRole role = default, s return new ChatResponseMessage(role, content, toolCalls?.ToList(), serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The number of tokens generated across all completions emissions. + /// The number of tokens in the provided prompts for the completions request. + /// The total number of tokens processed for the completions request and response. + /// A new instance for mocking. + public static CompletionsUsage CompletionsUsage(int completionTokens = default, int promptTokens = default, int totalTokens = default) + { + return new CompletionsUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The name of the AI model. For example: `Phi21`. /// The type of the AI model. A Unique identifier for the profile. @@ -149,6 +157,18 @@ public static EmbeddingsUsage EmbeddingsUsage(int promptTokens = default, int to return new EmbeddingsUsage(promptTokens, totalTokens, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`. + /// + /// Optional. The text input to feed into the model (like DINO, CLIP). + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// A new instance for mocking. + public static ImageEmbeddingInput ImageEmbeddingInput(string image = null, string text = null) + { + return new ImageEmbeddingInput(image, text, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// A unique identifier associated with this chat completions response. /// @@ -156,14 +176,14 @@ public static EmbeddingsUsage EmbeddingsUsage(int promptTokens = default, int to /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. /// /// The model used for the chat completion. - /// Usage information for tokens processed and generated as part of this completions operation. /// /// An update to the collection of completion choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// + /// Usage information for tokens processed and generated as part of this completions operation. /// A new instance for mocking. - public static StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, DateTimeOffset created = default, string model = null, CompletionsUsage usage = null, IEnumerable choices = null) + public static StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(string id = null, DateTimeOffset created = default, string model = null, IEnumerable choices = null, CompletionsUsage usage = null) { choices ??= new List(); @@ -171,8 +191,8 @@ public static StreamingChatCompletionsUpdate StreamingChatCompletionsUpdate(stri id, created, model, - usage, choices?.ToList(), + usage, serializedAdditionalRawData: null); } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/AudioContentFormat.cs b/sdk/ai/Azure.AI.Inference/src/Generated/AudioContentFormat.cs new file mode 100644 index 000000000000..3723b8aa68c8 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/AudioContentFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Inference +{ + /// A representation of the possible audio formats for audio. + public readonly partial struct AudioContentFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioContentFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WavValue = "wav"; + private const string Mp3Value = "mp3"; + + /// Specifies audio in WAV format. + public static AudioContentFormat Wav { get; } = new AudioContentFormat(WavValue); + /// Specifies audio in MP3 format. + public static AudioContentFormat Mp3 { get; } = new AudioContentFormat(Mp3Value); + /// Determines if two values are the same. + public static bool operator ==(AudioContentFormat left, AudioContentFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioContentFormat left, AudioContentFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioContentFormat(string value) => new AudioContentFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioContentFormat other && Equals(other); + /// + public bool Equals(AudioContentFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.Serialization.cs index 1fd5ab2dd912..8ad5ae184eda 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.Serialization.cs @@ -40,8 +40,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNumberValue(Created, "U"); writer.WritePropertyName("model"u8); writer.WriteStringValue(Model); - writer.WritePropertyName("usage"u8); - writer.WriteObjectValue(Usage, options); writer.WritePropertyName("choices"u8); writer.WriteStartArray(); foreach (var item in Choices) @@ -49,6 +47,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); + writer.WritePropertyName("usage"u8); + writer.WriteObjectValue(Usage, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,8 +89,8 @@ internal static ChatCompletions DeserializeChatCompletions(JsonElement element, string id = default; DateTimeOffset created = default; string model = default; - CompletionsUsage usage = default; IReadOnlyList choices = default; + CompletionsUsage usage = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,11 +110,6 @@ internal static ChatCompletions DeserializeChatCompletions(JsonElement element, model = property.Value.GetString(); continue; } - if (property.NameEquals("usage"u8)) - { - usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); - continue; - } if (property.NameEquals("choices"u8)) { List array = new List(); @@ -125,6 +120,11 @@ internal static ChatCompletions DeserializeChatCompletions(JsonElement element, choices = array; continue; } + if (property.NameEquals("usage"u8)) + { + usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -135,8 +135,8 @@ internal static ChatCompletions DeserializeChatCompletions(JsonElement element, id, created, model, - usage, choices, + usage, serializedAdditionalRawData); } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.cs index 1861a3df65f8..7af202a83311 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletions.cs @@ -57,25 +57,25 @@ public partial class ChatCompletions /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. /// /// The model used for the chat completion. - /// Usage information for tokens processed and generated as part of this completions operation. /// /// The collection of completions choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// - /// , , or is null. - internal ChatCompletions(string id, DateTimeOffset created, string model, CompletionsUsage usage, IEnumerable choices) + /// Usage information for tokens processed and generated as part of this completions operation. + /// , , or is null. + internal ChatCompletions(string id, DateTimeOffset created, string model, IEnumerable choices, CompletionsUsage usage) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(model, nameof(model)); - Argument.AssertNotNull(usage, nameof(usage)); Argument.AssertNotNull(choices, nameof(choices)); + Argument.AssertNotNull(usage, nameof(usage)); Id = id; Created = created; Model = model; - Usage = usage; Choices = choices.ToList(); + Usage = usage; } /// Initializes a new instance of . @@ -85,20 +85,20 @@ internal ChatCompletions(string id, DateTimeOffset created, string model, Comple /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. /// /// The model used for the chat completion. - /// Usage information for tokens processed and generated as part of this completions operation. /// /// The collection of completions choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// + /// Usage information for tokens processed and generated as part of this completions operation. /// Keeps track of any properties unknown to the library. - internal ChatCompletions(string id, DateTimeOffset created, string model, CompletionsUsage usage, IReadOnlyList choices, IDictionary serializedAdditionalRawData) + internal ChatCompletions(string id, DateTimeOffset created, string model, IReadOnlyList choices, CompletionsUsage usage, IDictionary serializedAdditionalRawData) { Id = id; Created = created; Model = model; - Usage = usage; Choices = choices; + Usage = usage; _serializedAdditionalRawData = serializedAdditionalRawData; } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsClient.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsClient.cs index 89ce6729a893..bc5b400f83fd 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsClient.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsClient.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure.Core; diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs index 7310e1ae4649..75212bef133f 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs @@ -11,6 +11,15 @@ using System.Text.Json; using Azure.Core; +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedQuestionAnsweringOrchestration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== namespace Azure.AI.Inference { public partial class ChatCompletionsNamedToolChoiceFunction : IUtf8JsonSerializable, IJsonModel @@ -18,6 +27,7 @@ public partial class ChatCompletionsNamedToolChoiceFunction : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,27 +36,27 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The JSON writer. /// The client options for reading and writing models. -<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; -======== protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); +======== var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; ->>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs if (format != "J") { throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support writing '{format}' format."); } -<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("results"u8); - writer.WriteObjectValue(Results, options); -======== writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -62,9 +72,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit #endif } } ->>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs } +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + ExportedQuestionAnsweringOrchestration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + + internal static ExportedQuestionAnsweringOrchestration DeserializeExportedQuestionAnsweringOrchestration(JsonElement element, ModelReaderWriterOptions options = null) +======== ChatCompletionsNamedToolChoiceFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -78,6 +102,7 @@ ChatCompletionsNamedToolChoiceFunction IJsonModel>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -85,14 +110,24 @@ internal static ChatCompletionsNamedToolChoiceFunction DeserializeChatCompletion { return null; } +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + string projectName = default; +======== string name = default; +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); +======== if (property.NameEquals("name"u8)) { name = property.Value.GetString(); +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs continue; } if (options.Format != "W") @@ -101,18 +136,36 @@ internal static ChatCompletionsNamedToolChoiceFunction DeserializeChatCompletion } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + return new ExportedQuestionAnsweringOrchestration(projectName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== return new ChatCompletionsNamedToolChoiceFunction(name, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedQuestionAnsweringOrchestration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support writing '{options.Format}' format."); } } @@ -120,12 +173,30 @@ BinaryData IPersistableModel.Write(Model ChatCompletionsNamedToolChoiceFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedQuestionAnsweringOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement); +======== return DeserializeChatCompletionsNamedToolChoiceFunction(document.RootElement, options); } default: @@ -141,6 +212,7 @@ internal static ChatCompletionsNamedToolChoiceFunction FromResponse(Response res { using var document = JsonDocument.Parse(response.Content); return DeserializeChatCompletionsNamedToolChoiceFunction(document.RootElement); +>>>>>>>> main:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsOptions.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsOptions.cs index 55b2bf833d24..7bcda3441011 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsOptions.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsOptions.cs @@ -25,7 +25,7 @@ public partial class ChatCompletionsOptions /// the behavior of the assistant, followed by alternating messages between the User and /// Assistant roles. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , , , and . /// /// is null. public ChatCompletionsOptions(IEnumerable messages) @@ -45,7 +45,7 @@ public ChatCompletionsOptions(IEnumerable messages) /// the behavior of the assistant, followed by alternating messages between the User and /// Assistant roles. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , , , and . /// /// /// A value that influences the probability of generated tokens appearing based on their cumulative @@ -81,11 +81,15 @@ public ChatCompletionsOptions(IEnumerable messages) /// /// The maximum number of tokens to generate. /// - /// The format that the model must output. Use this to enable JSON mode instead of the default text mode. - /// Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON - /// via a system or user message. + /// An object specifying the format that the model must output. + /// + /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. + /// + /// Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + /// + /// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include and . /// /// A collection of textual sequences that will end completions generation. /// @@ -154,11 +158,15 @@ internal ChatCompletionsOptions(IList messages, float? frequ /// The maximum number of tokens to generate. public int? MaxTokens { get; set; } /// - /// The format that the model must output. Use this to enable JSON mode instead of the default text mode. - /// Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON - /// via a system or user message. + /// An object specifying the format that the model must output. + /// + /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. + /// + /// Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + /// + /// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include and . /// public ChatCompletionsResponseFormat ResponseFormat { get; set; } /// A collection of textual sequences that will end completions generation. diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.Serialization.cs index 19320a2d360f..606d1d581e54 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.Serialization.cs @@ -77,7 +77,8 @@ internal static ChatCompletionsResponseFormat DeserializeChatCompletionsResponse { switch (discriminator.GetString()) { - case "json_object": return ChatCompletionsResponseFormatJSON.DeserializeChatCompletionsResponseFormatJSON(element, options); + case "json_object": return ChatCompletionsResponseFormatJsonObject.DeserializeChatCompletionsResponseFormatJsonObject(element, options); + case "json_schema": return ChatCompletionsResponseFormatJsonSchema.DeserializeChatCompletionsResponseFormatJsonSchema(element, options); case "text": return ChatCompletionsResponseFormatText.DeserializeChatCompletionsResponseFormatText(element, options); } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.cs index 93d9fa9b6c0d..0bb1aeceeb2a 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormat.cs @@ -15,7 +15,7 @@ namespace Azure.AI.Inference /// Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON /// via a system or user message. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include and . /// public abstract partial class ChatCompletionsResponseFormat { diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.Serialization.cs similarity index 61% rename from sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.Serialization.cs rename to sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.Serialization.cs index c86d5a9969bd..2764deb57b5b 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Inference { - public partial class ChatCompletionsResponseFormatJSON : IUtf8JsonSerializable, IJsonModel + public partial class ChatCompletionsResponseFormatJsonObject : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJSON)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonObject)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - ChatCompletionsResponseFormatJSON IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatCompletionsResponseFormatJsonObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJSON)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonObject)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatCompletionsResponseFormatJSON(document.RootElement, options); + return DeserializeChatCompletionsResponseFormatJsonObject(document.RootElement, options); } - internal static ChatCompletionsResponseFormatJSON DeserializeChatCompletionsResponseFormatJSON(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatCompletionsResponseFormatJsonObject DeserializeChatCompletionsResponseFormatJsonObject(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,46 +73,46 @@ internal static ChatCompletionsResponseFormatJSON DeserializeChatCompletionsResp } } serializedAdditionalRawData = rawDataDictionary; - return new ChatCompletionsResponseFormatJSON(type, serializedAdditionalRawData); + return new ChatCompletionsResponseFormatJsonObject(type, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJSON)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonObject)} does not support writing '{options.Format}' format."); } } - ChatCompletionsResponseFormatJSON IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatCompletionsResponseFormatJsonObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatCompletionsResponseFormatJSON(document.RootElement, options); + return DeserializeChatCompletionsResponseFormatJsonObject(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJSON)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonObject)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ChatCompletionsResponseFormatJSON FromResponse(Response response) + internal static new ChatCompletionsResponseFormatJsonObject FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeChatCompletionsResponseFormatJSON(document.RootElement); + return DeserializeChatCompletionsResponseFormatJsonObject(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.cs similarity index 68% rename from sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.cs rename to sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.cs index e52f9c3529f0..10ae830bb0be 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonObject.cs @@ -15,18 +15,18 @@ namespace Azure.AI.Inference /// Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON /// via a system or user message. /// - public partial class ChatCompletionsResponseFormatJSON : ChatCompletionsResponseFormat + public partial class ChatCompletionsResponseFormatJsonObject : ChatCompletionsResponseFormat { - /// Initializes a new instance of . - public ChatCompletionsResponseFormatJSON() + /// Initializes a new instance of . + public ChatCompletionsResponseFormatJsonObject() { Type = "json_object"; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The response format type to use for chat completions. /// Keeps track of any properties unknown to the library. - internal ChatCompletionsResponseFormatJSON(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + internal ChatCompletionsResponseFormatJsonObject(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.Serialization.cs new file mode 100644 index 000000000000..c830d922a9cf --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class ChatCompletionsResponseFormatJsonSchema : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchema)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("json_schema"u8); + writer.WriteObjectValue(JsonSchema, options); + } + + ChatCompletionsResponseFormatJsonSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchema)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsResponseFormatJsonSchema(document.RootElement, options); + } + + internal static ChatCompletionsResponseFormatJsonSchema DeserializeChatCompletionsResponseFormatJsonSchema(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("json_schema"u8)) + { + jsonSchema = ChatCompletionsResponseFormatJsonSchemaDefinition.DeserializeChatCompletionsResponseFormatJsonSchemaDefinition(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsResponseFormatJsonSchema(type, serializedAdditionalRawData, jsonSchema); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchema)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsResponseFormatJsonSchema IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsResponseFormatJsonSchema(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchema)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsResponseFormatJsonSchema FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsResponseFormatJsonSchema(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.cs new file mode 100644 index 000000000000..f6932d2b4955 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchema.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// + /// A response format for Chat Completions that restricts responses to emitting valid JSON objects, with a + /// JSON schema specified by the caller. + /// + internal partial class ChatCompletionsResponseFormatJsonSchema : ChatCompletionsResponseFormat + { + /// Initializes a new instance of . + /// The definition of the required JSON schema in the response, and associated metadata. + /// is null. + public ChatCompletionsResponseFormatJsonSchema(ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema) + { + Argument.AssertNotNull(jsonSchema, nameof(jsonSchema)); + + Type = "json_schema"; + JsonSchema = jsonSchema; + } + + /// Initializes a new instance of . + /// The response format type to use for chat completions. + /// Keeps track of any properties unknown to the library. + /// The definition of the required JSON schema in the response, and associated metadata. + internal ChatCompletionsResponseFormatJsonSchema(string type, IDictionary serializedAdditionalRawData, ChatCompletionsResponseFormatJsonSchemaDefinition jsonSchema) : base(type, serializedAdditionalRawData) + { + JsonSchema = jsonSchema; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsResponseFormatJsonSchema() + { + } + + /// The definition of the required JSON schema in the response, and associated metadata. + public ChatCompletionsResponseFormatJsonSchemaDefinition JsonSchema { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.Serialization.cs new file mode 100644 index 000000000000..0701b54653a0 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.Serialization.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class ChatCompletionsResponseFormatJsonSchemaDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchemaDefinition)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("schema"u8); + writer.WriteStartObject(); + foreach (var item in Schema) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Strict)) + { + writer.WritePropertyName("strict"u8); + writer.WriteBooleanValue(Strict.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsResponseFormatJsonSchemaDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchemaDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsResponseFormatJsonSchemaDefinition(document.RootElement, options); + } + + internal static ChatCompletionsResponseFormatJsonSchemaDefinition DeserializeChatCompletionsResponseFormatJsonSchemaDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IDictionary schema = default; + string description = default; + bool? strict = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("schema"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + schema = dictionary; + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("strict"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strict = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsResponseFormatJsonSchemaDefinition(name, schema, description, strict, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchemaDefinition)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsResponseFormatJsonSchemaDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsResponseFormatJsonSchemaDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormatJsonSchemaDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsResponseFormatJsonSchemaDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsResponseFormatJsonSchemaDefinition(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.cs new file mode 100644 index 000000000000..749179704791 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJsonSchemaDefinition.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// + /// Defines the response format for chat completions as JSON with a given schema. + /// The AI model will need to adhere to this schema when generating completions. + /// + internal partial class ChatCompletionsResponseFormatJsonSchemaDefinition + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema. + /// Note that AI models usually only support a subset of the keywords defined by JSON schema. + /// Consult your AI model documentation to determine what is supported. + /// + /// or is null. + public ChatCompletionsResponseFormatJsonSchemaDefinition(string name, IDictionary schema) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(schema, nameof(schema)); + + Name = name; + Schema = schema; + } + + /// Initializes a new instance of . + /// A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema. + /// Note that AI models usually only support a subset of the keywords defined by JSON schema. + /// Consult your AI model documentation to determine what is supported. + /// + /// A description of the response format, used by the AI model to determine how to generate responses in this format. + /// + /// If set to true, the service will error out if the provided JSON schema contains keywords + /// not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`. + /// If false, and the provided JSON schema contains keywords not supported by the AI model, + /// the AI model will not error out. Instead it will ignore the unsupported keywords. + /// + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsResponseFormatJsonSchemaDefinition(string name, IDictionary schema, string description, bool? strict, IDictionary serializedAdditionalRawData) + { + Name = name; + Schema = schema; + Description = description; + Strict = strict; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsResponseFormatJsonSchemaDefinition() + { + } + + /// A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + public string Name { get; } + /// + /// The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema. + /// Note that AI models usually only support a subset of the keywords defined by JSON schema. + /// Consult your AI model documentation to determine what is supported. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Schema { get; } + /// A description of the response format, used by the AI model to determine how to generate responses in this format. + public string Description { get; set; } + /// + /// If set to true, the service will error out if the provided JSON schema contains keywords + /// not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`. + /// If false, and the provided JSON schema contains keywords not supported by the AI model, + /// the AI model will not error out. Instead it will ignore the unsupported keywords. + /// + public bool? Strict { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.Serialization.cs new file mode 100644 index 000000000000..2a14715c4b27 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class ChatMessageAudioDataContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageAudioDataContentItem)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("input_audio"u8); + writer.WriteObjectValue(InputAudio, options); + } + + ChatMessageAudioDataContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageAudioDataContentItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageAudioDataContentItem(document.RootElement, options); + } + + internal static ChatMessageAudioDataContentItem DeserializeChatMessageAudioDataContentItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatMessageInputAudio inputAudio = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("input_audio"u8)) + { + inputAudio = ChatMessageInputAudio.DeserializeChatMessageInputAudio(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatMessageAudioDataContentItem(type, serializedAdditionalRawData, inputAudio); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageAudioDataContentItem)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageAudioDataContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageAudioDataContentItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageAudioDataContentItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatMessageAudioDataContentItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageAudioDataContentItem(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.cs new file mode 100644 index 000000000000..28f939ee09a9 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioDataContentItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// A structured chat content item for audio content passed as base64 encoded data. + internal partial class ChatMessageAudioDataContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// The details of the input audio data. + /// is null. + public ChatMessageAudioDataContentItem(ChatMessageInputAudio inputAudio) + { + Argument.AssertNotNull(inputAudio, nameof(inputAudio)); + + Type = "input_audio"; + InputAudio = inputAudio; + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + /// The details of the input audio data. + internal ChatMessageAudioDataContentItem(string type, IDictionary serializedAdditionalRawData, ChatMessageInputAudio inputAudio) : base(type, serializedAdditionalRawData) + { + InputAudio = inputAudio; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageAudioDataContentItem() + { + } + + /// The details of the input audio data. + public ChatMessageInputAudio InputAudio { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.Serialization.cs new file mode 100644 index 000000000000..ae3b5b22c15d --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class ChatMessageAudioUrlContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageAudioUrlContentItem)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("audio_url"u8); + writer.WriteObjectValue(AudioUrl, options); + } + + ChatMessageAudioUrlContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageAudioUrlContentItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageAudioUrlContentItem(document.RootElement, options); + } + + internal static ChatMessageAudioUrlContentItem DeserializeChatMessageAudioUrlContentItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatMessageInputAudioUrl audioUrl = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audio_url"u8)) + { + audioUrl = ChatMessageInputAudioUrl.DeserializeChatMessageInputAudioUrl(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatMessageAudioUrlContentItem(type, serializedAdditionalRawData, audioUrl); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageAudioUrlContentItem)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageAudioUrlContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageAudioUrlContentItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageAudioUrlContentItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatMessageAudioUrlContentItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageAudioUrlContentItem(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.cs new file mode 100644 index 000000000000..36aa6cad1fe0 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageAudioUrlContentItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// A structured chat content item for audio content passed as a url. + internal partial class ChatMessageAudioUrlContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// The details of the audio url. + /// is null. + public ChatMessageAudioUrlContentItem(ChatMessageInputAudioUrl audioUrl) + { + Argument.AssertNotNull(audioUrl, nameof(audioUrl)); + + Type = "audio_url"; + AudioUrl = audioUrl; + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + /// The details of the audio url. + internal ChatMessageAudioUrlContentItem(string type, IDictionary serializedAdditionalRawData, ChatMessageInputAudioUrl audioUrl) : base(type, serializedAdditionalRawData) + { + AudioUrl = audioUrl; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageAudioUrlContentItem() + { + } + + /// The details of the audio url. + public ChatMessageInputAudioUrl AudioUrl { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageContentItem.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageContentItem.Serialization.cs index 11e7c365f14e..10c7a6310d0c 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageContentItem.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageContentItem.Serialization.cs @@ -77,7 +77,9 @@ internal static ChatMessageContentItem DeserializeChatMessageContentItem(JsonEle { switch (discriminator.GetString()) { + case "audio_url": return ChatMessageAudioUrlContentItem.DeserializeChatMessageAudioUrlContentItem(element, options); case "image_url": return ChatMessageImageContentItem.DeserializeChatMessageImageContentItem(element, options); + case "input_audio": return ChatMessageAudioDataContentItem.DeserializeChatMessageAudioDataContentItem(element, options); case "text": return ChatMessageTextContentItem.DeserializeChatMessageTextContentItem(element, options); } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.Serialization.cs new file mode 100644 index 000000000000..55c7f032a84b --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + public partial class ChatMessageInputAudio : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageInputAudio)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatMessageInputAudio IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageInputAudio)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageInputAudio(document.RootElement, options); + } + + internal static ChatMessageInputAudio DeserializeChatMessageInputAudio(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string data = default; + AudioContentFormat format = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("data"u8)) + { + data = property.Value.GetString(); + continue; + } + if (property.NameEquals("format"u8)) + { + format = new AudioContentFormat(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatMessageInputAudio(data, format, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageInputAudio)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageInputAudio IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageInputAudio(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageInputAudio)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatMessageInputAudio FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageInputAudio(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.cs new file mode 100644 index 000000000000..e0ab9298c130 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudio.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// The details of the input audio data. + public partial class ChatMessageInputAudio + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Base64 encoded audio data. + /// The audio format of the audio content. + /// is null. + public ChatMessageInputAudio(string data, AudioContentFormat format) + { + Argument.AssertNotNull(data, nameof(data)); + + Data = data; + Format = format; + } + + /// Initializes a new instance of . + /// Base64 encoded audio data. + /// The audio format of the audio content. + /// Keeps track of any properties unknown to the library. + internal ChatMessageInputAudio(string data, AudioContentFormat format, IDictionary serializedAdditionalRawData) + { + Data = data; + Format = format; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageInputAudio() + { + } + + /// Base64 encoded audio data. + public string Data { get; } + /// The audio format of the audio content. + public AudioContentFormat Format { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.Serialization.cs new file mode 100644 index 000000000000..f86c52a17694 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class ChatMessageInputAudioUrl : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageInputAudioUrl)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatMessageInputAudioUrl IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageInputAudioUrl)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageInputAudioUrl(document.RootElement, options); + } + + internal static ChatMessageInputAudioUrl DeserializeChatMessageInputAudioUrl(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatMessageInputAudioUrl(url, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageInputAudioUrl)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageInputAudioUrl IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageInputAudioUrl(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageInputAudioUrl)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatMessageInputAudioUrl FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageInputAudioUrl(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.cs new file mode 100644 index 000000000000..3d10e3b2eede --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatMessageInputAudioUrl.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// The details of the audio url. + internal partial class ChatMessageInputAudioUrl + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The URL of the audio content. + /// is null. + public ChatMessageInputAudioUrl(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// Initializes a new instance of . + /// The URL of the audio content. + /// Keeps track of any properties unknown to the library. + internal ChatMessageInputAudioUrl(string url, IDictionary serializedAdditionalRawData) + { + Url = url; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageInputAudioUrl() + { + } + + /// The URL of the audio content. + public string Url { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestAssistantMessage.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestAssistantMessage.Serialization.cs index 76ab70699d71..eb2393dae82f 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestAssistantMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestAssistantMessage.Serialization.cs @@ -37,15 +37,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Content)) { - if (Content != null) - { - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - } - else - { - writer.WriteNull("content"); - } + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); } if (Optional.IsCollectionDefined(ToolCalls)) { @@ -88,11 +81,6 @@ internal static ChatRequestAssistantMessage DeserializeChatRequestAssistantMessa { if (property.NameEquals("content"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - content = null; - continue; - } content = property.Value.GetString(); continue; } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.Serialization.cs new file mode 100644 index 000000000000..a09fd02d795c --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + public partial class ChatRequestDeveloperMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestDeveloperMessage)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + + ChatRequestDeveloperMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestDeveloperMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatRequestDeveloperMessage(document.RootElement, options); + } + + internal static ChatRequestDeveloperMessage DeserializeChatRequestDeveloperMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string content = default; + ChatRole role = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = property.Value.GetString(); + continue; + } + if (property.NameEquals("role"u8)) + { + role = new ChatRole(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatRequestDeveloperMessage(role, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatRequestDeveloperMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatRequestDeveloperMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatRequestDeveloperMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatRequestDeveloperMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatRequestDeveloperMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatRequestDeveloperMessage(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.cs new file mode 100644 index 000000000000..5c624ca5fde3 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestDeveloperMessage.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// + /// A request chat message containing developer instructions that influence how the model will generate a chat completions + /// response. Some AI models support a developer message instead of a system message. + /// + public partial class ChatRequestDeveloperMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The contents of the developer message. + /// is null. + public ChatRequestDeveloperMessage(string content) + { + Argument.AssertNotNull(content, nameof(content)); + + Role = ChatRole.Developer; + Content = content; + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The contents of the developer message. + internal ChatRequestDeveloperMessage(ChatRole role, IDictionary serializedAdditionalRawData, string content) : base(role, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestDeveloperMessage() + { + } + + /// The contents of the developer message. + public string Content { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.Serialization.cs index a72c920f047d..1456ceca2870 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.Serialization.cs @@ -78,6 +78,7 @@ internal static ChatRequestMessage DeserializeChatRequestMessage(JsonElement ele switch (discriminator.GetString()) { case "assistant": return ChatRequestAssistantMessage.DeserializeChatRequestAssistantMessage(element, options); + case "developer": return ChatRequestDeveloperMessage.DeserializeChatRequestDeveloperMessage(element, options); case "system": return ChatRequestSystemMessage.DeserializeChatRequestSystemMessage(element, options); case "tool": return ChatRequestToolMessage.DeserializeChatRequestToolMessage(element, options); case "user": return ChatRequestUserMessage.DeserializeChatRequestUserMessage(element, options); diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.cs index a6e357f67e17..714f0b59290a 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestMessage.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Inference /// /// An abstract representation of a chat message as provided in a request. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . + /// The available derived classes include , , , and . /// public abstract partial class ChatRequestMessage { diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.Serialization.cs index cb137da445a7..8bc691ac2a0c 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.Serialization.cs @@ -35,15 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Content != null) + if (Optional.IsDefined(Content)) { writer.WritePropertyName("content"u8); writer.WriteStringValue(Content); } - else - { - writer.WriteNull("content"); - } writer.WritePropertyName("tool_call_id"u8); writer.WriteStringValue(ToolCallId); } @@ -77,11 +73,6 @@ internal static ChatRequestToolMessage DeserializeChatRequestToolMessage(JsonEle { if (property.NameEquals("content"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - content = null; - continue; - } content = property.Value.GetString(); continue; } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.cs index 0d848616d078..d496a231572f 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRequestToolMessage.cs @@ -14,15 +14,13 @@ namespace Azure.AI.Inference public partial class ChatRequestToolMessage : ChatRequestMessage { /// Initializes a new instance of . - /// The content of the message. /// The ID of the tool call resolved by the provided content. /// is null. - public ChatRequestToolMessage(string content, string toolCallId) + public ChatRequestToolMessage(string toolCallId) { Argument.AssertNotNull(toolCallId, nameof(toolCallId)); Role = ChatRole.Tool; - Content = content; ToolCallId = toolCallId; } @@ -43,7 +41,7 @@ internal ChatRequestToolMessage() } /// The content of the message. - public string Content { get; } + public string Content { get; set; } /// The ID of the tool call resolved by the provided content. public string ToolCallId { get; } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRole.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRole.cs index d6cfaec1e44c..73bc4e44cd54 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatRole.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ChatRole.cs @@ -26,6 +26,7 @@ public ChatRole(string value) private const string UserValue = "user"; private const string AssistantValue = "assistant"; private const string ToolValue = "tool"; + private const string DeveloperValue = "developer"; /// The role that instructs or sets the behavior of the assistant. public static ChatRole System { get; } = new ChatRole(SystemValue); @@ -35,6 +36,8 @@ public ChatRole(string value) public static ChatRole Assistant { get; } = new ChatRole(AssistantValue); /// The role that represents extension tool activity within a chat completions operation. public static ChatRole Tool { get; } = new ChatRole(ToolValue); + /// The role that instructs or sets the behavior of the assistant. Some AI models support this role instead of the 'system' role. + public static ChatRole Developer { get; } = new ChatRole(DeveloperValue); /// Determines if two values are the same. public static bool operator ==(ChatRole left, ChatRole right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.Serialization.cs index 5b75cc0ab4da..f5a9dc2847bf 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.Serialization.cs @@ -34,22 +34,101 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CompleteRequest)} does not support writing '{format}' format."); } - writer.WritePropertyName("chatCompletionsOptions"u8); - writer.WriteObjectValue(ChatCompletionsOptions, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + writer.WritePropertyName("messages"u8); + writer.WriteStartArray(); + foreach (var item in Messages) { - foreach (var item in _serializedAdditionalRawData) + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(FrequencyPenalty)) + { + writer.WritePropertyName("frequency_penalty"u8); + writer.WriteNumberValue(FrequencyPenalty.Value); + } + if (Optional.IsDefined(InternalShouldStreamResponse)) + { + writer.WritePropertyName("stream"u8); + writer.WriteBooleanValue(InternalShouldStreamResponse.Value); + } + if (Optional.IsDefined(PresencePenalty)) + { + writer.WritePropertyName("presence_penalty"u8); + writer.WriteNumberValue(PresencePenalty.Value); + } + if (Optional.IsDefined(Temperature)) + { + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature.Value); + } + if (Optional.IsDefined(NucleusSamplingFactor)) + { + writer.WritePropertyName("top_p"u8); + writer.WriteNumberValue(NucleusSamplingFactor.Value); + } + if (Optional.IsDefined(MaxTokens)) + { + writer.WritePropertyName("max_tokens"u8); + writer.WriteNumberValue(MaxTokens.Value); + } + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteObjectValue(ResponseFormat, options); + } + if (Optional.IsCollectionDefined(StopSequences)) + { + writer.WritePropertyName("stop"u8); + writer.WriteStartArray(); + foreach (var item in StopSequences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tools)) + { + writer.WritePropertyName("tools"u8); + writer.WriteStartArray(); + foreach (var item in Tools) { - writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ToolChoice)) + { + writer.WritePropertyName("tool_choice"u8); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(ToolChoice); #else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } + using (JsonDocument document = JsonDocument.Parse(ToolChoice)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } #endif + } + if (Optional.IsDefined(Seed)) + { + writer.WritePropertyName("seed"u8); + writer.WriteNumberValue(Seed.Value); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); } +#endif } } @@ -73,23 +152,165 @@ internal static CompleteRequest DeserializeCompleteRequest(JsonElement element, { return null; } - ChatCompletionsOptions chatCompletionsOptions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); + IReadOnlyList messages = default; + float? frequencyPenalty = default; + bool? stream = default; + float? presencePenalty = default; + float? temperature = default; + float? topP = default; + int? maxTokens = default; + ChatCompletionsResponseFormat responseFormat = default; + IReadOnlyList stop = default; + IReadOnlyList tools = default; + BinaryData toolChoice = default; + long? seed = default; + string model = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("chatCompletionsOptions"u8)) + if (property.NameEquals("messages"u8)) { - chatCompletionsOptions = ChatCompletionsOptions.DeserializeChatCompletionsOptions(property.Value, options); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatRequestMessage.DeserializeChatRequestMessage(item, options)); + } + messages = array; + continue; + } + if (property.NameEquals("frequency_penalty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyPenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("stream"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stream = property.Value.GetBoolean(); continue; } - if (options.Format != "W") + if (property.NameEquals("presence_penalty"u8)) { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + presencePenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("top_p"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topP = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("max_tokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = ChatCompletionsResponseFormat.DeserializeChatCompletionsResponseFormat(property.Value, options); + continue; + } + if (property.NameEquals("stop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stop = array; + continue; + } + if (property.NameEquals("tools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatCompletionsToolDefinition.DeserializeChatCompletionsToolDefinition(item, options)); + } + tools = array; + continue; + } + if (property.NameEquals("tool_choice"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + toolChoice = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("seed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + seed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } - serializedAdditionalRawData = rawDataDictionary; - return new CompleteRequest(chatCompletionsOptions, serializedAdditionalRawData); + additionalProperties = additionalPropertiesDictionary; + return new CompleteRequest( + messages, + frequencyPenalty, + stream, + presencePenalty, + temperature, + topP, + maxTokens, + responseFormat, + stop ?? new ChangeTrackingList(), + tools ?? new ChangeTrackingList(), + toolChoice, + seed, + model, + additionalProperties); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.cs b/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.cs index 5e6b00ae756c..596d83bd87d4 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/CompleteRequest.cs @@ -7,14 +7,239 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.AI.Inference { /// The CompleteRequest. internal partial class CompleteRequest { + /// Initializes a new instance of . + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// is null. + internal CompleteRequest(IEnumerable messages) + { + Argument.AssertNotNull(messages, nameof(messages)); + + Messages = messages.ToList(); + StopSequences = new ChangeTrackingList(); + Tools = new ChangeTrackingList(); + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// Supported range is [-2, 2]. + /// + /// A value indicating whether chat completions should be streamed for this request. + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// Supported range is [-2, 2]. + /// + /// + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// Supported range is [0, 1]. + /// + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// Supported range is [0, 1]. + /// + /// The maximum number of tokens to generate. + /// + /// An object specifying the format that the model must output. + /// + /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. + /// + /// Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + /// + /// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A collection of textual sequences that will end completions generation. + /// + /// A list of tools the model may request to call. Currently, only functions are supported as a tool. The model + /// may response with a function call request and provide the input arguments in JSON format for that function. + /// + /// If specified, the model will configure which of the provided tools it can use for the chat completions response. + /// + /// If specified, the system will make a best effort to sample deterministically such that repeated requests with the + /// same seed and parameters should return the same result. Determinism is not guaranteed. + /// + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + /// Additional Properties. + internal CompleteRequest(IReadOnlyList messages, float? frequencyPenalty, bool? internalShouldStreamResponse, float? presencePenalty, float? temperature, float? nucleusSamplingFactor, int? maxTokens, ChatCompletionsResponseFormat responseFormat, IReadOnlyList stopSequences, IReadOnlyList tools, BinaryData toolChoice, long? seed, string model, IReadOnlyDictionary additionalProperties) + { + Messages = messages; + FrequencyPenalty = frequencyPenalty; + InternalShouldStreamResponse = internalShouldStreamResponse; + PresencePenalty = presencePenalty; + Temperature = temperature; + NucleusSamplingFactor = nucleusSamplingFactor; + MaxTokens = maxTokens; + ResponseFormat = responseFormat; + StopSequences = stopSequences; + Tools = tools; + ToolChoice = toolChoice; + Seed = seed; + Model = model; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal CompleteRequest() + { + } + + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IReadOnlyList Messages { get; } + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// Supported range is [-2, 2]. + /// + public float? FrequencyPenalty { get; } + /// A value indicating whether chat completions should be streamed for this request. + public bool? InternalShouldStreamResponse { get; } + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// Supported range is [-2, 2]. + /// + public float? PresencePenalty { get; } /// - /// Keeps track of any properties unknown to the library. + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// Supported range is [0, 1]. + /// + public float? Temperature { get; } + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// Supported range is [0, 1]. + /// + public float? NucleusSamplingFactor { get; } + /// The maximum number of tokens to generate. + public int? MaxTokens { get; } + /// + /// An object specifying the format that the model must output. + /// + /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. + /// + /// Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + /// + /// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public ChatCompletionsResponseFormat ResponseFormat { get; } + /// A collection of textual sequences that will end completions generation. + public IReadOnlyList StopSequences { get; } + /// + /// A list of tools the model may request to call. Currently, only functions are supported as a tool. The model + /// may response with a function call request and provide the input arguments in JSON format for that function. + /// + public IReadOnlyList Tools { get; } + /// + /// If specified, the model will configure which of the provided tools it can use for the chat completions response. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData ToolChoice { get; } + /// + /// If specified, the system will make a best effort to sample deterministically such that repeated requests with the + /// same seed and parameters should return the same result. Determinism is not guaranteed. + /// + public long? Seed { get; } + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + public string Model { get; } + /// + /// Additional Properties /// /// To assign an object to the value of this property use . /// @@ -43,33 +268,6 @@ internal partial class CompleteRequest /// /// /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// is null. - internal CompleteRequest(ChatCompletionsOptions chatCompletionsOptions) - { - Argument.AssertNotNull(chatCompletionsOptions, nameof(chatCompletionsOptions)); - - ChatCompletionsOptions = chatCompletionsOptions; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal CompleteRequest(ChatCompletionsOptions chatCompletionsOptions, IDictionary serializedAdditionalRawData) - { - ChatCompletionsOptions = chatCompletionsOptions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CompleteRequest() - { - } - - /// Gets the chat completions options. - public ChatCompletionsOptions ChatCompletionsOptions { get; } + public IReadOnlyDictionary AdditionalProperties { get; } } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/Docs/EmbeddingsClient.xml b/sdk/ai/Azure.AI.Inference/src/Generated/Docs/EmbeddingsClient.xml index 2f52491f2297..54f0260f0b6b 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/Docs/EmbeddingsClient.xml +++ b/sdk/ai/Azure.AI.Inference/src/Generated/Docs/EmbeddingsClient.xml @@ -1,122 +1,6 @@ - - -This sample shows how to call EmbedAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -EmbeddingsOptions embeddingsOptions = null; -Response response = await client.EmbedAsync(embeddingsOptions); -]]> -This sample shows how to call EmbedAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -EmbeddingsOptions embeddingsOptions = null; -Response response = await client.EmbedAsync(embeddingsOptions); -]]> - - - -This sample shows how to call Embed. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -EmbeddingsOptions embeddingsOptions = null; -Response response = client.Embed(embeddingsOptions); -]]> -This sample shows how to call Embed. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -EmbeddingsOptions embeddingsOptions = null; -Response response = client.Embed(embeddingsOptions); -]]> - - - -This sample shows how to call EmbedAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = await client.EmbedAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); -Console.WriteLine(result.GetProperty("model").ToString()); -]]> -This sample shows how to call EmbedAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = await client.EmbedAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); -Console.WriteLine(result.GetProperty("model").ToString()); -]]> - - - -This sample shows how to call Embed and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = client.Embed(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); -Console.WriteLine(result.GetProperty("model").ToString()); -]]> -This sample shows how to call Embed and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = client.Embed(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); -Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); -Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); -Console.WriteLine(result.GetProperty("model").ToString()); -]]> - This sample shows how to call GetModelInfoAsync. diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/Docs/ImageEmbeddingsClient.xml b/sdk/ai/Azure.AI.Inference/src/Generated/Docs/ImageEmbeddingsClient.xml new file mode 100644 index 000000000000..280a6ad03aa7 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/Docs/ImageEmbeddingsClient.xml @@ -0,0 +1,101 @@ + + + + + +This sample shows how to call GetModelInfoAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = await client.GetModelInfoAsync(); +]]> +This sample shows how to call GetModelInfoAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = await client.GetModelInfoAsync(); +]]> + + + +This sample shows how to call GetModelInfo. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = client.GetModelInfo(); +]]> +This sample shows how to call GetModelInfo. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = client.GetModelInfo(); +]]> + + + +This sample shows how to call GetModelInfoAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = await client.GetModelInfoAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("model_name").ToString()); +Console.WriteLine(result.GetProperty("model_type").ToString()); +Console.WriteLine(result.GetProperty("model_provider_name").ToString()); +]]> +This sample shows how to call GetModelInfoAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = await client.GetModelInfoAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("model_name").ToString()); +Console.WriteLine(result.GetProperty("model_type").ToString()); +Console.WriteLine(result.GetProperty("model_provider_name").ToString()); +]]> + + + +This sample shows how to call GetModelInfo and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = client.GetModelInfo(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("model_name").ToString()); +Console.WriteLine(result.GetProperty("model_type").ToString()); +Console.WriteLine(result.GetProperty("model_provider_name").ToString()); +]]> +This sample shows how to call GetModelInfo and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + +Response response = client.GetModelInfo(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("model_name").ToString()); +Console.WriteLine(result.GetProperty("model_type").ToString()); +Console.WriteLine(result.GetProperty("model_provider_name").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.Serialization.cs index db940a8c92d0..714871be964a 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.Serialization.cs @@ -34,22 +34,44 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(EmbedRequest)} does not support writing '{format}' format."); } - writer.WritePropertyName("embeddingsOptions"u8); - writer.WriteObjectValue(EmbeddingsOptions, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + writer.WritePropertyName("input"u8); + writer.WriteStartArray(); + foreach (var item in Input) { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + if (Optional.IsDefined(EncodingFormat)) + { + writer.WritePropertyName("encoding_format"u8); + writer.WriteStringValue(EncodingFormat.Value.ToString()); + } + if (Optional.IsDefined(InputType)) + { + writer.WritePropertyName("input_type"u8); + writer.WriteStringValue(InputType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); } +#endif } } @@ -73,23 +95,67 @@ internal static EmbedRequest DeserializeEmbedRequest(JsonElement element, ModelR { return null; } - EmbeddingsOptions embeddingsOptions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); + IReadOnlyList input = default; + int? dimensions = default; + EmbeddingEncodingFormat? encodingFormat = default; + EmbeddingInputType? inputType = default; + string model = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("embeddingsOptions"u8)) + if (property.NameEquals("input"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + input = array; + continue; + } + if (property.NameEquals("dimensions"u8)) { - embeddingsOptions = EmbeddingsOptions.DeserializeEmbeddingsOptions(property.Value, options); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); continue; } - if (options.Format != "W") + if (property.NameEquals("encoding_format"u8)) { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encodingFormat = new EmbeddingEncodingFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("input_type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inputType = new EmbeddingInputType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } - serializedAdditionalRawData = rawDataDictionary; - return new EmbedRequest(embeddingsOptions, serializedAdditionalRawData); + additionalProperties = additionalPropertiesDictionary; + return new EmbedRequest( + input, + dimensions, + encodingFormat, + inputType, + model, + additionalProperties); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.cs b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.cs index 4cb73d47f7cd..7fa22a30f281 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest.cs @@ -7,14 +7,84 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.AI.Inference { /// The EmbedRequest. internal partial class EmbedRequest { + /// Initializes a new instance of . + /// + /// Input text to embed, encoded as a string or array of tokens. + /// To embed multiple inputs in a single request, pass an array + /// of strings or array of token arrays. + /// + /// is null. + internal EmbedRequest(IEnumerable input) + { + Argument.AssertNotNull(input, nameof(input)); + + Input = input.ToList(); + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// Input text to embed, encoded as a string or array of tokens. + /// To embed multiple inputs in a single request, pass an array + /// of strings or array of token arrays. + /// + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// Optional. The desired format for the returned embeddings. + /// + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + /// Additional Properties. + internal EmbedRequest(IReadOnlyList input, int? dimensions, EmbeddingEncodingFormat? encodingFormat, EmbeddingInputType? inputType, string model, IReadOnlyDictionary additionalProperties) + { + Input = input; + Dimensions = dimensions; + EncodingFormat = encodingFormat; + InputType = inputType; + Model = model; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal EmbedRequest() + { + } + + /// + /// Input text to embed, encoded as a string or array of tokens. + /// To embed multiple inputs in a single request, pass an array + /// of strings or array of token arrays. + /// + public IReadOnlyList Input { get; } + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public int? Dimensions { get; } + /// Optional. The desired format for the returned embeddings. + public EmbeddingEncodingFormat? EncodingFormat { get; } /// - /// Keeps track of any properties unknown to the library. + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public EmbeddingInputType? InputType { get; } + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + public string Model { get; } + /// + /// Additional Properties /// /// To assign an object to the value of this property use . /// @@ -43,33 +113,6 @@ internal partial class EmbedRequest /// /// /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// is null. - internal EmbedRequest(EmbeddingsOptions embeddingsOptions) - { - Argument.AssertNotNull(embeddingsOptions, nameof(embeddingsOptions)); - - EmbeddingsOptions = embeddingsOptions; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal EmbedRequest(EmbeddingsOptions embeddingsOptions, IDictionary serializedAdditionalRawData) - { - EmbeddingsOptions = embeddingsOptions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal EmbedRequest() - { - } - - /// Gets the embeddings options. - public EmbeddingsOptions EmbeddingsOptions { get; } + public IReadOnlyDictionary AdditionalProperties { get; } } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.Serialization.cs new file mode 100644 index 000000000000..e2081793dcbf --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class EmbedRequest1 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbedRequest1)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("input"u8); + writer.WriteStartArray(); + foreach (var item in Input) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + if (Optional.IsDefined(EncodingFormat)) + { + writer.WritePropertyName("encoding_format"u8); + writer.WriteStringValue(EncodingFormat.Value.ToString()); + } + if (Optional.IsDefined(InputType)) + { + writer.WritePropertyName("input_type"u8); + writer.WriteStringValue(InputType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + EmbedRequest1 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbedRequest1)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmbedRequest1(document.RootElement, options); + } + + internal static EmbedRequest1 DeserializeEmbedRequest1(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList input = default; + int? dimensions = default; + EmbeddingEncodingFormat? encodingFormat = default; + EmbeddingInputType? inputType = default; + string model = default; + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("input"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImageEmbeddingInput.DeserializeImageEmbeddingInput(item, options)); + } + input = array; + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("encoding_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encodingFormat = new EmbeddingEncodingFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("input_type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inputType = new EmbeddingInputType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new EmbedRequest1( + input, + dimensions, + encodingFormat, + inputType, + model, + additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmbedRequest1)} does not support writing '{options.Format}' format."); + } + } + + EmbedRequest1 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmbedRequest1(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmbedRequest1)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EmbedRequest1 FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEmbedRequest1(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.cs b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.cs new file mode 100644 index 000000000000..f139f3785243 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/EmbedRequest1.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Inference +{ + /// The EmbedRequest1. + internal partial class EmbedRequest1 + { + /// Initializes a new instance of . + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + /// is null. + internal EmbedRequest1(IEnumerable input) + { + Argument.AssertNotNull(input, nameof(input)); + + Input = input.ToList(); + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + /// Additional Properties. + internal EmbedRequest1(IReadOnlyList input, int? dimensions, EmbeddingEncodingFormat? encodingFormat, EmbeddingInputType? inputType, string model, IReadOnlyDictionary additionalProperties) + { + Input = input; + Dimensions = dimensions; + EncodingFormat = encodingFormat; + InputType = inputType; + Model = model; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal EmbedRequest1() + { + } + + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + public IReadOnlyList Input { get; } + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public int? Dimensions { get; } + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public EmbeddingEncodingFormat? EncodingFormat { get; } + /// + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public EmbeddingInputType? InputType { get; } + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + public string Model { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/EmbeddingsClient.cs b/sdk/ai/Azure.AI.Inference/src/Generated/EmbeddingsClient.cs index 1d747f7cedad..27badd749c53 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/EmbeddingsClient.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/EmbeddingsClient.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure.Core; diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ExtraParameters.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ExtraParameters.cs index 9ffda5f51e8a..f049bc41d649 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ExtraParameters.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ExtraParameters.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Inference { /// Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. - public readonly partial struct ExtraParameters : IEquatable + internal readonly partial struct ExtraParameters : IEquatable { private readonly string _value; diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/FunctionDefinition.cs b/sdk/ai/Azure.AI.Inference/src/Generated/FunctionDefinition.cs index 459048905218..64ee8c5ce805 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/FunctionDefinition.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/FunctionDefinition.cs @@ -75,36 +75,5 @@ internal FunctionDefinition(string name, string description, BinaryData paramete /// interpreting its parameters. /// public string Description { get; set; } - /// - /// The parameters the function accepts, described as a JSON Schema object. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Parameters { get; set; } } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.Serialization.cs new file mode 100644 index 000000000000..a5ee0aaaf375 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + public partial class ImageEmbeddingInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageEmbeddingInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("image"u8); + writer.WriteStringValue(Image); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageEmbeddingInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageEmbeddingInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageEmbeddingInput(document.RootElement, options); + } + + internal static ImageEmbeddingInput DeserializeImageEmbeddingInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string image = default; + string text = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("image"u8)) + { + image = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageEmbeddingInput(image, text, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageEmbeddingInput)} does not support writing '{options.Format}' format."); + } + } + + ImageEmbeddingInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageEmbeddingInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageEmbeddingInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageEmbeddingInput FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageEmbeddingInput(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.cs new file mode 100644 index 000000000000..2ac62dd102f2 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingInput.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Inference +{ + /// Represents an image with optional text. + public partial class ImageEmbeddingInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`. + /// is null. + public ImageEmbeddingInput(string image) + { + Argument.AssertNotNull(image, nameof(image)); + + Image = image; + } + + /// Initializes a new instance of . + /// The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`. + /// + /// Optional. The text input to feed into the model (like DINO, CLIP). + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// Keeps track of any properties unknown to the library. + internal ImageEmbeddingInput(string image, string text, IDictionary serializedAdditionalRawData) + { + Image = image; + Text = text; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImageEmbeddingInput() + { + } + + /// The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`. + public string Image { get; } + /// + /// Optional. The text input to feed into the model (like DINO, CLIP). + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public string Text { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsClient.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsClient.cs new file mode 100644 index 000000000000..5af1f48b85ce --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsClient.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Inference +{ + // Data plane generated client. + /// The ImageEmbeddings service client. + public partial class ImageEmbeddingsClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; + private static readonly string[] AuthorizationScopes = new string[] { "https://ml.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ImageEmbeddingsClient for mocking. + protected ImageEmbeddingsClient() + { + } + + /// Initializes a new instance of ImageEmbeddingsClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ImageEmbeddingsClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureAIInferenceClientOptions()) + { + } + + /// Initializes a new instance of ImageEmbeddingsClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ImageEmbeddingsClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureAIInferenceClientOptions()) + { + } + + /// Initializes a new instance of ImageEmbeddingsClient. + /// Service host. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ImageEmbeddingsClient(Uri endpoint, TokenCredential credential, AzureAIInferenceClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureAIInferenceClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// + /// Returns information about the AI model. + /// The method makes a REST API call to the `/info` route on the given endpoint. + /// This method will only work when using Serverless API or Managed Compute endpoint. + /// It will not work for GitHub Models endpoint or Azure OpenAI endpoint. + /// + /// The cancellation token to use. + /// + public virtual async Task> GetModelInfoAsync(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelInfoAsync(context).ConfigureAwait(false); + return Response.FromValue(ModelInfo.FromResponse(response), response); + } + + /// + /// Returns information about the AI model. + /// The method makes a REST API call to the `/info` route on the given endpoint. + /// This method will only work when using Serverless API or Managed Compute endpoint. + /// It will not work for GitHub Models endpoint or Azure OpenAI endpoint. + /// + /// The cancellation token to use. + /// + public virtual Response GetModelInfo(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelInfo(context); + return Response.FromValue(ModelInfo.FromResponse(response), response); + } + + /// + /// [Protocol Method] Returns information about the AI model. + /// The method makes a REST API call to the `/info` route on the given endpoint. + /// This method will only work when using Serverless API or Managed Compute endpoint. + /// It will not work for GitHub Models endpoint or Azure OpenAI endpoint. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetModelInfoAsync(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ImageEmbeddingsClient.GetModelInfo"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelInfoRequest(context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns information about the AI model. + /// The method makes a REST API call to the `/info` route on the given endpoint. + /// This method will only work when using Serverless API or Managed Compute endpoint. + /// It will not work for GitHub Models endpoint or Azure OpenAI endpoint. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetModelInfo(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ImageEmbeddingsClient.GetModelInfo"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelInfoRequest(context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateEmbedRequest(RequestContent content, string extraParams, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/images/embeddings", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (extraParams != null) + { + request.Headers.Add("extra-parameters", extraParams); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetModelInfoRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/info", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.Serialization.cs new file mode 100644 index 000000000000..6588ea2e3e1d --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + public partial class ImageEmbeddingsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageEmbeddingsOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("input"u8); + writer.WriteStartArray(); + foreach (var item in Input) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + if (Optional.IsDefined(EncodingFormat)) + { + writer.WritePropertyName("encoding_format"u8); + writer.WriteStringValue(EncodingFormat.Value.ToString()); + } + if (Optional.IsDefined(InputType)) + { + writer.WritePropertyName("input_type"u8); + writer.WriteStringValue(InputType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + ImageEmbeddingsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageEmbeddingsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageEmbeddingsOptions(document.RootElement, options); + } + + internal static ImageEmbeddingsOptions DeserializeImageEmbeddingsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList input = default; + int? dimensions = default; + EmbeddingEncodingFormat? encodingFormat = default; + EmbeddingInputType? inputType = default; + string model = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("input"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImageEmbeddingInput.DeserializeImageEmbeddingInput(item, options)); + } + input = array; + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("encoding_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encodingFormat = new EmbeddingEncodingFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("input_type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inputType = new EmbeddingInputType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ImageEmbeddingsOptions( + input, + dimensions, + encodingFormat, + inputType, + model, + additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageEmbeddingsOptions)} does not support writing '{options.Format}' format."); + } + } + + ImageEmbeddingsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageEmbeddingsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageEmbeddingsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageEmbeddingsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageEmbeddingsOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.cs new file mode 100644 index 000000000000..e4e9a3b5b99f --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ImageEmbeddingsOptions.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Inference +{ + /// The configuration information for an image embeddings request. + public partial class ImageEmbeddingsOptions + { + /// Initializes a new instance of . + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + /// is null. + public ImageEmbeddingsOptions(IEnumerable input) + { + Argument.AssertNotNull(input, nameof(input)); + + Input = input.ToList(); + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + /// Additional Properties. + internal ImageEmbeddingsOptions(IList input, int? dimensions, EmbeddingEncodingFormat? encodingFormat, EmbeddingInputType? inputType, string model, IDictionary additionalProperties) + { + Input = input; + Dimensions = dimensions; + EncodingFormat = encodingFormat; + InputType = inputType; + Model = model; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal ImageEmbeddingsOptions() + { + } + + /// + /// Input image to embed. To embed multiple inputs in a single request, pass an array. + /// The input must not exceed the max input tokens for the model. + /// + public IList Input { get; } + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public int? Dimensions { get; set; } + /// + /// Optional. The number of dimensions the resulting output embeddings should have. + /// Passing null causes the model to use its default value. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public EmbeddingEncodingFormat? EncodingFormat { get; set; } + /// + /// Optional. The type of the input. + /// Returns a 422 error if the model doesn't support the value or parameter. + /// + public EmbeddingInputType? InputType { get; set; } + /// ID of the specific AI model to use, if more than one model is available on the endpoint. + public string Model { get; set; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ModelType.cs b/sdk/ai/Azure.AI.Inference/src/Generated/ModelType.cs index 960fae6ae43b..c9a683ad7562 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ModelType.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/ModelType.cs @@ -27,20 +27,20 @@ public ModelType(string value) private const string TextGenerationValue = "text_generation"; private const string ImageEmbeddingsValue = "image_embeddings"; private const string AudioGenerationValue = "audio_generation"; - private const string ChatValue = "chat"; + private const string ChatCompletionValue = "chat_completion"; - /// Embeddings. + /// A model capable of generating embeddings from a text. public static ModelType Embeddings { get; } = new ModelType(EmbeddingsValue); - /// Image generation. + /// A model capable of generating images from an image and text description. public static ModelType ImageGeneration { get; } = new ModelType(ImageGenerationValue); - /// Text generation. + /// A text generation model. public static ModelType TextGeneration { get; } = new ModelType(TextGenerationValue); - /// Image embeddings. + /// A model capable of generating embeddings from an image. public static ModelType ImageEmbeddings { get; } = new ModelType(ImageEmbeddingsValue); - /// Audio generation. + /// A text-to-audio generative model. public static ModelType AudioGeneration { get; } = new ModelType(AudioGenerationValue); - /// Chat completions. - public static ModelType Chat { get; } = new ModelType(ChatValue); + /// A model capable of taking chat-formatted messages and generate responses. + public static ModelType ChatCompletion { get; } = new ModelType(ChatCompletionValue); /// Determines if two values are the same. public static bool operator ==(ModelType left, ModelType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.Serialization.cs index 6a0c2f39f312..fdd8543b88eb 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.Serialization.cs @@ -40,8 +40,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNumberValue(Created, "U"); writer.WritePropertyName("model"u8); writer.WriteStringValue(Model); - writer.WritePropertyName("usage"u8); - writer.WriteObjectValue(Usage, options); writer.WritePropertyName("choices"u8); writer.WriteStartArray(); foreach (var item in Choices) @@ -49,6 +47,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); + if (Optional.IsDefined(Usage)) + { + writer.WritePropertyName("usage"u8); + writer.WriteObjectValue(Usage, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,8 +92,8 @@ internal static StreamingChatCompletionsUpdate DeserializeStreamingChatCompletio string id = default; DateTimeOffset created = default; string model = default; - CompletionsUsage usage = default; IReadOnlyList choices = default; + CompletionsUsage usage = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,11 +113,6 @@ internal static StreamingChatCompletionsUpdate DeserializeStreamingChatCompletio model = property.Value.GetString(); continue; } - if (property.NameEquals("usage"u8)) - { - usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); - continue; - } if (property.NameEquals("choices"u8)) { List array = new List(); @@ -125,6 +123,15 @@ internal static StreamingChatCompletionsUpdate DeserializeStreamingChatCompletio choices = array; continue; } + if (property.NameEquals("usage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -135,8 +142,8 @@ internal static StreamingChatCompletionsUpdate DeserializeStreamingChatCompletio id, created, model, - usage, choices, + usage, serializedAdditionalRawData); } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.cs b/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.cs index de1a266e5616..6cdc90bb0036 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/StreamingChatCompletionsUpdate.cs @@ -58,24 +58,21 @@ public partial class StreamingChatCompletionsUpdate /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. /// /// The model used for the chat completion. - /// Usage information for tokens processed and generated as part of this completions operation. /// /// An update to the collection of completion choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// - /// , , or is null. - internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, string model, CompletionsUsage usage, IEnumerable choices) + /// , or is null. + internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, string model, IEnumerable choices) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(model, nameof(model)); - Argument.AssertNotNull(usage, nameof(usage)); Argument.AssertNotNull(choices, nameof(choices)); Id = id; Created = created; Model = model; - Usage = usage; Choices = choices.ToList(); } @@ -86,20 +83,20 @@ internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, strin /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. /// /// The model used for the chat completion. - /// Usage information for tokens processed and generated as part of this completions operation. /// /// An update to the collection of completion choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// + /// Usage information for tokens processed and generated as part of this completions operation. /// Keeps track of any properties unknown to the library. - internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, string model, CompletionsUsage usage, IReadOnlyList choices, IDictionary serializedAdditionalRawData) + internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, string model, IReadOnlyList choices, CompletionsUsage usage, IDictionary serializedAdditionalRawData) { Id = id; Created = created; Model = model; - Usage = usage; Choices = choices; + Usage = usage; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -107,13 +104,13 @@ internal StreamingChatCompletionsUpdate(string id, DateTimeOffset created, strin internal StreamingChatCompletionsUpdate() { } - /// Usage information for tokens processed and generated as part of this completions operation. - public CompletionsUsage Usage { get; } /// /// An update to the collection of completion choices associated with this completions response. /// Generally, `n` choices are generated per provided prompt with a default value of 1. /// Token limits and other settings may limit the number of choices generated. /// public IReadOnlyList Choices { get; } + /// Usage information for tokens processed and generated as part of this completions operation. + public CompletionsUsage Usage { get; } } } diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs new file mode 100644 index 000000000000..c3c50bb2e9e9 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Inference +{ + internal partial class UnknownChatCompletionsNamedToolSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ChatCompletionsNamedToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + + internal static UnknownChatCompletionsNamedToolSelection DeserializeUnknownChatCompletionsNamedToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatCompletionsNamedToolSelection(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsNamedToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatCompletionsNamedToolSelection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatCompletionsNamedToolSelection(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs b/sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs similarity index 55% rename from sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs rename to sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs index 96cea7708042..84f7e3fe34a6 100644 --- a/sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs +++ b/sdk/ai/Azure.AI.Inference/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs @@ -13,23 +13,23 @@ namespace Azure.AI.Inference { - public partial class ChatCompletionsNamedFunctionToolSelection : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownChatCompletionsToolCall : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("function"u8); - writer.WriteObjectValue(Function, options); writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -48,19 +48,19 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteEndObject(); } - ChatCompletionsNamedFunctionToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatCompletionsToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatCompletionsNamedFunctionToolSelection(document.RootElement, options); + return DeserializeChatCompletionsToolCall(document.RootElement, options); } - internal static ChatCompletionsNamedFunctionToolSelection DeserializeChatCompletionsNamedFunctionToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownChatCompletionsToolCall DeserializeUnknownChatCompletionsToolCall(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -68,20 +68,20 @@ internal static ChatCompletionsNamedFunctionToolSelection DeserializeChatComplet { return null; } - ChatCompletionsFunctionToolSelection function = default; - string type = default; + string type = "Unknown"; + string id = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("function"u8)) + if (property.NameEquals("type"u8)) { - function = ChatCompletionsFunctionToolSelection.DeserializeChatCompletionsFunctionToolSelection(property.Value, options); + type = property.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("id"u8)) { - type = property.Value.GetString(); + id = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,53 +90,53 @@ internal static ChatCompletionsNamedFunctionToolSelection DeserializeChatComplet } } serializedAdditionalRawData = rawDataDictionary; - return new ChatCompletionsNamedFunctionToolSelection(type, serializedAdditionalRawData, function); + return new UnknownChatCompletionsToolCall(type, id, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{options.Format}' format."); } } - ChatCompletionsNamedFunctionToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatCompletionsToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatCompletionsNamedFunctionToolSelection(document.RootElement, options); + return DeserializeChatCompletionsToolCall(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ChatCompletionsNamedFunctionToolSelection FromResponse(Response response) + internal static new UnknownChatCompletionsToolCall FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeChatCompletionsNamedFunctionToolSelection(document.RootElement); + return DeserializeUnknownChatCompletionsToolCall(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryConstants.cs b/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryConstants.cs index 2f3d1a379137..93f1954b46d9 100644 --- a/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryConstants.cs +++ b/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryConstants.cs @@ -11,6 +11,8 @@ internal class OpenTelemetryConstants // https://github.com/open-telemetry/semantic-conventions/tree/v1.27.0/docs/gen-ai public const string ErrorTypeKey = "error.type"; + + public const string AzNamespaceKey = "az.namespace"; public const string ServerAddressKey = "server.address"; public const string ServerPortKey = "server.port"; @@ -39,6 +41,8 @@ internal class OpenTelemetryConstants public const string GenAiEventContent = "gen_ai.event.content"; public const string GenAiChoice = "gen_ai.choice"; + public const string AzureRpNamespaceValue = "Microsoft.CognitiveServices"; + public const string ClientName = "Azure.AI.Inference.ChatCompletionsClient"; public const string EnableOpenTelemetrySwitch = "Azure.Experimental.EnableActivitySource"; public const string TraceContentsSwitch = "Azure.Experimental.TraceGenAIMessageContent"; diff --git a/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryScope.cs b/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryScope.cs index 73bd03d3369f..96143a4f3041 100644 --- a/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryScope.cs +++ b/sdk/ai/Azure.AI.Inference/src/Telemetry/OpenTelemetryScope.cs @@ -88,6 +88,7 @@ private OpenTelemetryScope(ChatCompletionsOptions requestOptions, Uri endpoint) { _activity?.SetTag(kv.Key, kv.Value); } + _activity?.SetTag(AzNamespaceKey, AzureRpNamespaceValue); SetTagMaybe(GenAiRequestMaxTokensKey, requestOptions.MaxTokens); SetTagMaybe(GenAiRequestTemperatureKey, requestOptions.Temperature); SetTagMaybe(GenAiRequestTopPKey, requestOptions.NucleusSamplingFactor); diff --git a/sdk/ai/Azure.AI.Inference/tests/ChatCompletionsClientTest.cs b/sdk/ai/Azure.AI.Inference/tests/ChatCompletionsClientTest.cs index 30e1e0148f11..db2b100d1b48 100644 --- a/sdk/ai/Azure.AI.Inference/tests/ChatCompletionsClientTest.cs +++ b/sdk/ai/Azure.AI.Inference/tests/ChatCompletionsClientTest.cs @@ -23,7 +23,9 @@ public enum TargetModel { MistralSmall, GitHubGpt4o, - AoaiGpt4Turbo, + AoaiGpt4o, + AoaiAudioModel, + PhiAudioModel } public enum ToolChoiceTestType @@ -48,27 +50,58 @@ public ChatCompletionsClientTest(bool isAsync) : base(isAsync) { TestDiagnostics = false; JsonPathSanitizers.Add("$.messages[*].content[*].image_url.url"); + JsonPathSanitizers.Add("$.messages[*].content[*].audio_url.url"); } /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/TemplateClientLiveTests.cs to write tests. */ [RecordedTest] - public async Task TestChatCompletions() + [TestCase(TargetModel.MistralSmall)] + [TestCase(TargetModel.GitHubGpt4o)] + [TestCase(TargetModel.AoaiGpt4o)] + public async Task TestChatCompletions(TargetModel targetModel) { - var mistralSmallEndpoint = new Uri(TestEnvironment.MistralSmallEndpoint); - var mistralSmallCredential = new AzureKeyCredential(TestEnvironment.MistralSmallApiKey); + var endpoint = targetModel switch + { + TargetModel.MistralSmall => new Uri(TestEnvironment.MistralSmallEndpoint), + TargetModel.GitHubGpt4o => new Uri(TestEnvironment.GithubEndpoint), + TargetModel.AoaiGpt4o => new Uri(TestEnvironment.AoaiEndpoint), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + var credential = targetModel switch + { + TargetModel.MistralSmall => new AzureKeyCredential(TestEnvironment.MistralSmallApiKey), + TargetModel.GitHubGpt4o => new AzureKeyCredential(TestEnvironment.GithubToken), + TargetModel.AoaiGpt4o => new AzureKeyCredential(TestEnvironment.AoaiKey), + _ => throw new ArgumentException(nameof(targetModel)), + }; - var client = CreateClient(mistralSmallEndpoint, mistralSmallCredential, new AzureAIInferenceClientOptions()); + var client = CreateClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + IList messages = new List(); + + if (targetModel == TargetModel.AoaiGpt4o) + { + messages.Add(new ChatRequestDeveloperMessage("You are a helpful assistant.")); + } + else + { + messages.Add(new ChatRequestSystemMessage("You are a helpful assistant.")); + } + + messages.Add(new ChatRequestUserMessage("How many feet are in a mile?")); var requestOptions = new ChatCompletionsOptions() { - Messages = - { - new ChatRequestSystemMessage("You are a helpful assistant."), - new ChatRequestUserMessage("How many feet are in a mile?"), - }, + Messages = messages, }; + if (targetModel == TargetModel.GitHubGpt4o) + { + requestOptions.Model = "gpt-4o"; + } + Response response = await client.CompleteAsync(requestOptions); Assert.That(response, Is.Not.Null); @@ -456,9 +489,9 @@ public async Task TestChatCompletionsWithImages(ImageTestSourceKind imageSourceK ChatMessageImageContentItem imageContentItem = imageSourceKind switch { ImageTestSourceKind.UsingInternetLocation => new(GetTestImageInternetUri(), ChatMessageImageDetailLevel.Low), - ImageTestSourceKind.UsingStream => new(GetTestImageStream("image/jpg"), "image/jpg", ChatMessageImageDetailLevel.Low), - ImageTestSourceKind.UsingBinaryData => new(GetTestImageData("image/jpg"), "image/jpg", ChatMessageImageDetailLevel.Low), - ImageTestSourceKind.UsingFilePath => new(TestEnvironment.TestImageJpgInputPath, "image/jpg", ChatMessageImageDetailLevel.Low), + ImageTestSourceKind.UsingStream => new(GetTestImageStream("image/png"), "image/png", ChatMessageImageDetailLevel.Low), + ImageTestSourceKind.UsingBinaryData => new(GetTestImageData("image/png"), "image/png", ChatMessageImageDetailLevel.Low), + ImageTestSourceKind.UsingFilePath => new(TestEnvironment.TestImagePngInputPath, "image/png", ChatMessageImageDetailLevel.Low), _ => throw new ArgumentException(nameof(imageSourceKind)), }; @@ -496,6 +529,111 @@ public async Task TestChatCompletionsWithImages(ImageTestSourceKind imageSourceK Assert.That(result.Content, Is.Not.Null.Or.Empty); } + [RecordedTest] + [TestCase(TargetModel.AoaiAudioModel)] + [TestCase(TargetModel.PhiAudioModel)] + public async Task TestChatCompletionsWithAudio(TargetModel targetModel) + { + if (targetModel == TargetModel.AoaiAudioModel && Mode == RecordedTestMode.Playback) + { + Assert.Inconclusive("Unable to run test with file path in playback mode."); + } + + var endpoint = targetModel switch + { + TargetModel.AoaiAudioModel => new Uri(TestEnvironment.AoaiAudioEndpoint), + TargetModel.PhiAudioModel => new Uri(TestEnvironment.PhiAudioEndpoint), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + var credential = targetModel switch + { + TargetModel.AoaiAudioModel => new AzureKeyCredential(TestEnvironment.AoaiAudioKey), + TargetModel.PhiAudioModel => new AzureKeyCredential(TestEnvironment.PhiAudioKey), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + CaptureRequestPayloadPolicy captureRequestPayloadPolicy = new CaptureRequestPayloadPolicy(); + AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions(); + clientOptions.AddPolicy(captureRequestPayloadPolicy, HttpPipelinePosition.PerCall); + + // Uncomment the following lines to enable enhanced log output + // AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(EventLevel.Verbose); + // clientOptions.Diagnostics.IsLoggingContentEnabled = true;\ + + if (targetModel == TargetModel.AoaiAudioModel) + { + OverrideApiVersionPolicy overrideApiVersionPolicy = new OverrideApiVersionPolicy("2024-11-01-preview"); + clientOptions.AddPolicy(overrideApiVersionPolicy, HttpPipelinePosition.PerCall); + } + + var client = CreateClient(endpoint, credential, clientOptions); + + ChatMessageAudioContentItem audioContentItem = targetModel switch + { + TargetModel.AoaiAudioModel => new(TestEnvironment.TestAudioMp3InputPath, AudioContentFormat.Mp3), + TargetModel.PhiAudioModel => new(GetTestAudioInternetUri()), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + List messages = new List(); + + if (targetModel == TargetModel.PhiAudioModel) + { + messages.Add(new ChatRequestSystemMessage("You are a helpful assistant that helps describe audio.")); + messages.Add( + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Please describe this audio clip."), + audioContentItem)); + } + else + { + messages.Add(new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations.")); + messages.Add( + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Please translate this audio snippet to spanish."), + audioContentItem)); + } + + var requestOptions = new ChatCompletionsOptions() + { + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Please translate this audio snippet to spanish."), + audioContentItem), + }, + MaxTokens = 2048, + }; + + if (targetModel == TargetModel.PhiAudioModel) + { + requestOptions.Model = "phi-4-multimodal-instruct-1"; + } + + Response response = null; + try + { + response = await client.CompleteAsync(requestOptions); + } + catch (Exception ex) + { + var requestPayload = captureRequestPayloadPolicy._requestContent; + var requestHeaders = captureRequestPayloadPolicy._requestHeaders; + Assert.True(false, $"Request failed with the following exception:\n {ex}\n Request headers: {requestHeaders}\n Request payload: {requestPayload}"); + } + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + } + [RecordedTest] public async Task TestChatCompletionsUserAgent() { @@ -542,7 +680,7 @@ public async Task TestChatCompletionsUserAgent() [TestCase(ToolChoiceTestType.UseNonePresetToolChoice, TargetModel.MistralSmall)] [TestCase(ToolChoiceTestType.UseRequiredPresetToolChoice, TargetModel.MistralSmall, IgnoreReason = "Endpoint needs to be updated to support")] [TestCase(ToolChoiceTestType.UseFunctionByExplicitToolDefinitionForToolChoice, TargetModel.GitHubGpt4o)] - [TestCase(ToolChoiceTestType.UseFunctionByExplicitToolDefinitionForToolChoice, TargetModel.AoaiGpt4Turbo)] + [TestCase(ToolChoiceTestType.UseFunctionByExplicitToolDefinitionForToolChoice, TargetModel.AoaiGpt4o)] [TestCase(ToolChoiceTestType.UseFunctionByImplicitToolDefinitionForToolChoice, TargetModel.GitHubGpt4o)] public async Task TestChatCompletionsFunctionToolHandlingWithStreaming(ToolChoiceTestType toolChoiceType, TargetModel targetModel) { @@ -576,7 +714,7 @@ public async Task TestChatCompletionsFunctionToolHandlingWithStreaming(ToolChoic { TargetModel.MistralSmall => new Uri(TestEnvironment.MistralSmallEndpoint), TargetModel.GitHubGpt4o => new Uri(TestEnvironment.GithubEndpoint), - TargetModel.AoaiGpt4Turbo => new Uri(TestEnvironment.AoaiEndpoint), + TargetModel.AoaiGpt4o => new Uri(TestEnvironment.AoaiEndpoint), _ => throw new ArgumentException(nameof(targetModel)), }; @@ -584,7 +722,7 @@ public async Task TestChatCompletionsFunctionToolHandlingWithStreaming(ToolChoic { TargetModel.MistralSmall => new AzureKeyCredential(TestEnvironment.MistralSmallApiKey), TargetModel.GitHubGpt4o => new AzureKeyCredential(TestEnvironment.GithubToken), - TargetModel.AoaiGpt4Turbo => new AzureKeyCredential(TestEnvironment.AoaiKey), + TargetModel.AoaiGpt4o => new AzureKeyCredential(TestEnvironment.AoaiKey), _ => throw new ArgumentException(nameof(targetModel)), }; @@ -722,6 +860,131 @@ public async Task TestChatCompletionsFunctionToolHandlingWithStreaming(ToolChoic #endregion } + [RecordedTest] + [TestCase(TargetModel.GitHubGpt4o)] + [TestCase(TargetModel.AoaiGpt4o)] + public async Task TestChatCompletionsResponseFormat(TargetModel targetModel) + { + var endpoint = targetModel switch + { + TargetModel.GitHubGpt4o => new Uri(TestEnvironment.GithubEndpoint), + TargetModel.AoaiGpt4o => new Uri(TestEnvironment.AoaiEndpoint), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + var credential = targetModel switch + { + TargetModel.GitHubGpt4o => new AzureKeyCredential(TestEnvironment.GithubToken), + TargetModel.AoaiGpt4o => new AzureKeyCredential(TestEnvironment.AoaiKey), + _ => throw new ArgumentException(nameof(targetModel)), + }; + + var githubModelName = "gpt-4o"; + + CaptureRequestPayloadPolicy captureRequestPayloadPolicy = new CaptureRequestPayloadPolicy(); + AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions(); + clientOptions.AddPolicy(captureRequestPayloadPolicy, HttpPipelinePosition.PerCall); + + // Uncomment the following lines to enable enhanced log output + // AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(EventLevel.Verbose); + // clientOptions.Diagnostics.IsLoggingContentEnabled = true; + + if (targetModel == TargetModel.AoaiGpt4o) + { + OverrideApiVersionPolicy overrideApiVersionPolicy = new OverrideApiVersionPolicy("2024-08-01-preview"); + clientOptions.AddPolicy(overrideApiVersionPolicy, HttpPipelinePosition.PerCall); + } + else if (targetModel == TargetModel.GitHubGpt4o) + { + OverrideApiVersionPolicy overrideApiVersionPolicy = new OverrideApiVersionPolicy("2024-08-01-preview"); + clientOptions.AddPolicy(overrideApiVersionPolicy, HttpPipelinePosition.PerCall); + } + + var client = CreateClient(endpoint, credential, clientOptions); + + var messages = new List() + { + new ChatRequestSystemMessage("You are a helpful assistant."), + new ChatRequestUserMessage("Please give me directions and ingredients to bake a chocolate cake."), + }; + + var requestOptions = new ChatCompletionsOptions(messages); + + if (targetModel == TargetModel.GitHubGpt4o) + { + requestOptions.Model = githubModelName; + } + + Dictionary jsonSchema = new Dictionary + { + { "type", BinaryData.FromString("\"object\"") }, + { "properties", BinaryData.FromString(""" + { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "directions": { + "type": "string" + } + } + } + }, + "prep_time": { + "type": "string" + }, + "bake_time": { + "type": "string" + } + } + """) }, + { "required", BinaryData.FromString("[\"ingredients\", \"steps\", \"bake_time\"]") }, + { "additionalProperties", BinaryData.FromString("false") } + }; + + requestOptions.ResponseFormat = ChatCompletionsResponseFormat.CreateJsonFormat("cakeBakingDirections", jsonSchema); + + Response response = await client.CompleteAsync(requestOptions); + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + + using JsonDocument structuredJson = JsonDocument.Parse(result.Content); + structuredJson.RootElement.TryGetProperty("ingredients", out var ingredients); + structuredJson.RootElement.TryGetProperty("steps", out var steps); + structuredJson.RootElement.TryGetProperty("bake_time", out var bakeTime); + + Assert.AreEqual(ingredients.ValueKind, JsonValueKind.Array); + Assert.AreEqual(steps.ValueKind, JsonValueKind.Array); + foreach (JsonElement stepElement in steps.EnumerateArray()) + { + stepElement.TryGetProperty("ingredients", out var stepIngredients); + stepElement.TryGetProperty("directions", out var stepDirections); + Assert.AreEqual(stepIngredients.ValueKind, JsonValueKind.Array); + Assert.AreEqual(stepDirections.ValueKind, JsonValueKind.String); + } + Assert.AreEqual(bakeTime.ValueKind, JsonValueKind.String); + } + #region Helpers private class CaptureRequestPayloadPolicy : HttpPipelinePolicy { @@ -753,6 +1016,30 @@ public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) + { + message.Request.Uri.Query = $"?api-version={ApiVersion}"; + ProcessNext(message, pipeline); + } + + public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) + { + message.Request.Uri.Query = $"?api-version={ApiVersion}"; + var task = ProcessNextAsync(message, pipeline); + + return task; + } + } + private class AddAppIdPolicy : HttpPipelinePolicy { private string AppId { get; } @@ -829,7 +1116,7 @@ private Stream GetTestImageStream(string mimeType) } return File.OpenRead(mimeType switch { - "image/jpg" => TestEnvironment.TestImageJpgInputPath, + "image/png" => TestEnvironment.TestImagePngInputPath, _ => throw new ArgumentException(nameof(mimeType)), }); } @@ -837,6 +1124,15 @@ private Stream GetTestImageStream(string mimeType) private BinaryData GetTestImageData(string mimeType) => BinaryData.FromStream(GetTestImageStream(mimeType)); + private Uri GetTestAudioInternetUri() + { + if (Mode == RecordedTestMode.Playback) + { + return new Uri("https://sanitized"); + } + return new Uri("https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba-online-audio-converter.com_-1.wav"); + } + private async Task ProcessStreamingResponse(StreamingResponse response, List messages) { string toolCallId = null; diff --git a/sdk/ai/Azure.AI.Inference/tests/Data/hello_how_are_you.mp3 b/sdk/ai/Azure.AI.Inference/tests/Data/hello_how_are_you.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..b3ac80a46dfc55b34ffd9abc80694eab26110f34 GIT binary patch literal 91951 zcmeF(XH=8v8ZZ1bLI?puH3^6WLY0z0sG=tH5|rLc2t~Sd0Ualym(W{4P`ZGKfT)0t zE?t@kf=Usj=?M0I=G}A3I%m)8?EO9YlC1l>KmAtz>w0qMd9I&dC;I{5ZUC?b002k; z07N?0;OEzAc7%T6!!EG}{z-tHp??x$*VzKU7GP)S z*FNkjTi~Ar*ctjKA$FZD@M{5fhJNkCuCfLGNr0W9e-dKX*#f^7U}xypKI|%6;GYE8 z8Tuz7cAYKoYXNqKe(l4qvIYK0fSsX#5@Ofc0>2huXXw{H>?&K}p9I($`X?cFoh|Td zfuHPKPJa!=uCfJwEx>L=zxH8Q*#iG0z|PP=39;*JfnN)-GxTd8c9kvgPXg=={gV*8 z&KCH!06Rm!_F-4q0{pEH9DUEy<8rdyu?e4R22~NpW5hW z8br%=W%R-wtI2ObY6!B{Oid@rTmL2}iyO(~NX;xcHPJlV&eDE`K=r{697 zRBYYVca~=D?;VCESUWva{@Zdnl>>6lNW~A2C>in4R%0*?5`wIfY8E;V6EdSd1Zi;^ zc_b$`SVF}7iOT_iF;IeMUYFd#WSK7>Pzc2&*UztK*>(dAQs>ts&qI_M8EJSj8C)rf z&~4G6*G#u&U*S5RRtRH?b)G)>`Eaides? zyCv#gGvUBU$SDjS4nj89LQY-z?a=gI=6%b)C%Jy~3G>Nn&lEg~)cT6W%&E&wTIIls z03PV~BLFppJ^Y;A6SIw~u%uP@BPfM}K%>Y2AW6Y4GCkc|F#?bRbIHRNtq7BztNVFL zD`+)&(^WBX)H}z>RpwAUjGu){-P=iGNDW6PrEw~|XfWM+tMuFBtWqS_M3D-s(c(0r z+%WSG^THs*%2FM9bCENsc+kv(GiJ4hpLw^BqIAJsaYe2VuJ|7E+smiWxaM4bKt}L| zYaHA3cXxgZ?n;MFVby|8A z-1$374^nWHTZ%xYNFo6A>lFRfhxQr~{fL$CMm#-^J!LCe znk`K5X|45R>lz*>B=s|Uvr5Kojf!292~c1{FK+0K5n!ZA%h467u>n^EL`nI9Z`!E0 ztR=&=E^4=Fu{c97`VI`fPpLLqqbx^77z) zda_847b$jOBCfWZM#%QXkhI-QUu5x}`+>agHA%}H zIayw#0reGH21JD3O~VTeaVSk(v~)m4x6)01SL^J|3K5^3s)Y6sz<)G|KR?LoVM)#VWgo67ayn36Rq5e z_NsVwt?08y%OlIkN1s(ZmEwn7p;NXepjJ6jkoc`x-5Hq#pstJz;0lZqCV+xVZhH(c zDG!eDpI7vp(4K5xd_gRN@6|~6PM_v%bvp!(DX1Hhf0*^qw8uKtOw;ekYn^4F!G%F* zqfw(Sz*-3lsfH8^^N=8okPVMIT+o}L!>d$<7O-fx?(sLT zYpUQm&%K^y6EzqaNg!XR)(vZsFP!$XxQgxg=DF~>(zoyRuGaP_ruo^_*=I`tOW-s( zyjQ3mE&=E^Byk7qN$;J>C~&Pc+wL(v=OQ^QvY=DhzM;71oncUJ6&0+q6=Z`hwrDGS z((k#r5P%6U-`3xNcCCXdk0Hk8!(p!>0MM?k`+FiB#z9Et_>Cx~Z2UUq_N7LVwz|WJ z(Hbj}wmzrP+e)|5(axjVfz7X8E)+D{nf23JWyBf^)!fp@wJBTIj!*A6t~J;s-Y!zR zT1tZl$e{oxr2lW;$iKh->O(4D5JQTdALq1s7S@@op(Gw9psQ8NxRAj^n-V+6et_zH zhZQGOGVR{-UIHpqGC?F)NX%%E3oexkf$9~a0Cz2mb_kqTqi#X2nHtF1e}F)NmY1E1 zQzr^sAV@J|LoUDO8`Jo?$O%=G7n0UxtGc0jJbDIg`xqgy?!bw+D!F~eBwo}~kA!q* z!E$XOAS5Rrkfn`PuuwucCyQ8d9I_+)jn-BB-1683N{Sj4Rs5lSSS(;Ql<9TqnY&%4 zhxR8w)uO#mog#Zb;vk`UyrFhQj6t4va#;G3Ht8OJ+cvO+k+zKFCapogAdGwLlR#8d z5(_=tDTg3-o)gsX&P|OIQc4ip#quh=kGmJ~X4K#SbmnTO<+F`Tb`8Rah&!k4b_MvU zpdiMlY+iYZfp(?vUehPo7-v68WX=sv&jY!i#ZqaoFMOV}^p&jfG8hSl(v09}TVgGU zz+fb2p+*q|GTakIPR)eXAHv}xP+u&4$yv`5`%-qagRhH;UQ`~rIX22eyr(qLaza%l}u z)Leg3Re2)(^BqMVPf4!b5!+V}JsRsiSH*>mEWTR~@WNi{-;Q-UXmB>6c6g-r72@XJ zfm)XfflQ0@`ny}lAD?prAFAh)eG#G)cFn4Vx4W5U_?(#ra zygDW49FfH#>VDvP(^l&@Cr_m99Q>L=PAif^CDH_0zMg4CzC^kalm-^?BwN?yR5c*)fZpPGFKU}?fm?yD zm}N4Vp+Kj`t%P zr=N=}wNNMO;)G%P^ZW9+EE(KmTMY;0Y^kAmtu#r~sgF0?8)*_*l2&qM-ftgy_Yajx zap|{e&3|2r*({Uh?Q7XRBw`L1z^O_LCer-c(+!9+D4~qR+!v*iMaHwhH!ae6L$sJx zc>x1!e}g4+=@hT|X=193$uiV3p!-y6z|d)?XZ>kb%b>~dQp*|xgN1c#JOe8F_lK~k z%ApFb`P#%#!~GwCB4OBcBxJZ8eaEy!`;|OX{swBALy!9d(%f9Fm{Y)8Cqw|?{hSKn zZ=9UgBcx`L0?WLWJ*0%IgXmljxJlSdk)$GFImg*A#*^}_5MB~U>EJ>p8Cy|MV;8n9rBDhK ziRX|m{G?iMjaIrA)yz-EnU_<(U9I7Cf}hwlu#7v6;h&ndX^HbGqnSha6`kep1&Nu! z3QrsBc~%4*2f?o`{%Upkyy^x`ygkSzsUJj@OU0R8sOW>gPP<)c%uu7Xx zWxUd5hM!djRUVeTnMYrJT`?VvbEX{Fyd%9~`VOzxUaGWpHfJ?A^+!H1o?=-sLq?8t zSCXjJ;bNA^(ljGpxCci%D|Lccc-{+?%uExWCd)C%_RDQ{PsG4AlL&85FG>B#P!oZ1 zg?i@DTmn$!G@|ZQe3IUPiU3zo{;Xb4Wz!AaU$>%vWeA|Ojd-lM@|AbEhXpKK(*l~6 z-v5jV_~?@=8{1QrBF>{|sxEHFTx#dlW>!#>ZU0P!jYuZND8nIXw3%9pi!E6827yuw zto2FK3yDOyce7Y*a>rZ0E?rfelrshmQ`6VM)&ZE@s&t8NJyB9@9AeLR&@EFgin=14 z%Rye$*L%)l^^uXvBUlkf=d^S1Rrz8%yfB2nti8U*-EybNGIA1@vz#C`1sh$;k}Fdj zxPt;MT*Fru^yk2;SfFUG%Xw8AK@?uR4 z;hwi9j0_Qjt2^iUNChx2<-H{hrBs(MV)pUR6@$0iRg+o^8}Nyeys$kBt!)kU9yv^t zSf}{sgC7sJpjSZgmUA1c@jS$0O=%q|4Pj!MLq-8W3srCx4H%YtX!3{z$#=w4h;y3G zL?cc}6%|0yvwd;5PVXh;GDKEzgI=+0>;El3wV!CKLDliodZy(HB*Hl2)Kp)vpci;A zoGcf*Fjlh7DK=6WYzYS@d$z5#^;8U(p?#eb({;ZV)c~~9t?~$2lA=dO2gr7c*dDUH zuVs{wXL7qMPTXLwS|p|b{pCzi2ETH+sC?esV6dlOiMeO2BfK+E<#6K91D&+0fX+bG z0IjhR+u~0>$OotgCHG>8L)d zHi8E$!H|N;e1e+iOq^i4TI}1SU>s;s0tE+VdDivZ=YK$GTBwg@!r`sL1PIhyJV3|4 zJ*df_1(iQb8E})RhXQ@WW%6XGD}e5_KM!?!>D-ZCgj%R2_PUQU7rpkT%_-*n+Cs&V zM{$fQ0Hoj2(*6of&zet0@QiUaSEh_=8gS}Hu(Dav=%fG@&DtPUT$wK$YHIa@dvgF2 z0a&R53ySmp|J9nl`Zf$0_@x6 z{sx7;#1{C^1=wxqKeuAYQ4a!c&=)q>UKq}5$W9idCMapSf8K2-!*R&5oe*Y^{Na+Xm5 zyC_R@Td)w$pV4Osxqs5o#@riJfbw6Vli$UdNB+?B4^E#{qNfy1A!e|$mSwKi?P;!J z@$1#J({%BIu$EME_*}d*iCz0$np|)d4ppVMDXL_dIE-xbDzNld2tgPdion zs`=c})a(GQI}YJn4yMbD)MK>>9|l1Lal>Yue=^K$-iF72{ECcAT0LtAaL+M9+IQ^H z>6%gng|06&#fAD?qkHNC2fdYqXYV_{B|B|3r>Bdz7n?n!Wt}BDaGkHtC=8VE{pp7& zcdK2^ZeHKMK39D*FsGMmR-{SGDU}3Og)0Ui5heU>m^U#u#VGX0#Fk_2;>$wkd;-xM zMRyEZXO|h5Z?;B>!9dACm>=k%zEMzj1b2OM1}{)SFt?^xxGYxyZW_muEB!&n1|G7H zuJa`!Yr#bomc1sHM3RCKuR+Wy6{2U8iQ7B8`*hwH+4#Oz&3Tx#8KD06UKlWSCYA2; zU7i$A4_A(VTfw8BNSBn%HRYW4ZIaKaErr_}x4m!WbR2?=I!a-4D=CvA@RHvJj{Xt8 zZr&PkIk%M(tj(c!)xzMqzj%vqH$B!7yr2Gx(M|I+@ef!4;UNH1yLlw2_GC?W$R@to z)#q9I>nD#>?~K&BwPz%_-F&*#)&11Z*I<3HT=>VlI%QR zowA$o&sh?hz35QlN-^@dMZS|z9^&aPL9s@s$cd zB3%GOPeK`wK2EcCq7JS6YbK@Ko$Z?J~0fV^UpK=i}{ zy#QF9(dEoN(&4BHByu!~LyutaGyof?z<2bL?=+B!G?cx+M*VIIo%Tp@8>?~Y+K^`m4_hzWX z{IqEJrH_NE3nD-#Z13kQv>j7}9$(mX6PK{BRDrU-cPuJiHa<+G;j(Rn; z85B!t{9FBtW0x(i zq}Po<;iE5v|K5J)w*kgdft{gG+$&A35r@vJK2P2GypLo23AG8HX&qx~9^tj^GfS)} z8CZI+j8t>!i|E4Ki#YSdD(+Xs#}!`5mF(W31Dfmgz~ay=v8OX)<|$%)YOHQYZ_mlt zs!^FXO21Y&t9h_8zo-td#!9 ztbN$+HN2G{djSGWWup1SU+h>Xhu2q`i0c6Y$VMq5v|gZn#WIb@RPtgJ&`~=O$q+Bi z!Z2iJeHb{Gk(Yhh8J;Ji0*oHKGQu25O-*yWHx0Z>Y~PI*VfbIN{bF$=$UJZCM&}3T z$@$bCN0&E~i&2)bq8VCNhNt~Uo~56@T``%X{XIBeI_}8pQG@VjzPK$p9f6|w$7T;= z==`?y69b1`q}K`*j3jsQ>PuDp4kgx7eV3h-pS=`LX%SZP*tTsl^g3*Cn!=u7@v62=!nDNoJcoa-tdrN79(@jMmU-&)vx`nJ}DxqQ}Q;-i9rr^R#U zUp4;+V@dw%LoFi6O~tpq(2$;|z-Phr;P{m^FP#l$PMtBWvIYXVUKY-5um$i&t0kiI_C7JujMAMW_# z>+xN9(skoQ>iyLUKthWR45vn>r+Oje)!MwIxSWkJ=cy}R5%qyK%j!O{L4{vgKl9ipfM|!X+cP|g4-hqV&rf6?1MmcZGP9IEp zGOMQd;)ucmSnbxUkFhw%`=I9mWz(XK-KcitZ~o4D;5{Pc{kV19SC9rokv>hPF)w|S^&@sq81EIJ7o zch$ig+cAmr+-&yEtM|<9Kh=t)R`Q0FY(x~5ot8L9y<+4;{yh7bn&zKp{L)($bB!4g zy_YIVeI1))Ql~17LWO#De`f0WnhIjXnge2BpNTV-eQ!@>+bwH28axWs&*!3i$sk>l4QVCTS6FR8ccAX1}ISNlMv0P~wD_3YJ z;b6tcU(TrvXeDp+mi*z&JO(#~NlKBk6+2zq{3=O$TaGc65`uA5x{-jHqDFCsbl|95 z>4kzF^IFPuGJ!vc-#B)`^WhAx&cCVrMOyHn*9;(EOb%XQ( z!2jKi{>sob9rzpN;E%k?{C>MTI5 zG>3_Z(3r$MepuZZIu`wb(73zUzs8#$zk2;3nt6hcFi+{L!21!qd)7E1V@NH6KQ#dF zH$^C%koA^9;lFrI$KFSl&v3to=PT&`>NO)4XAaZk%x&-bRPYBL_NsWhn1g%k zhQ~)9_7~hPEEnW$l{JkYsm$2luc&i(IE-4jSd~@ay!+BXD%<+W=}YM~N=YW~e$uzT z<_qUh-kkU}%2{Ucb-h-yq@k=s?u1d2_P6fuJMt4F59OaM=>6Cd`Yw@k)KSj1@pVA8 zU}Dox^ZQqapA^n+8H}XKgg4qXKxeNHSO|yZTRt{@DHMCQJo%cvqis&WH3RImTnfRX zRo3g6m$@vq$*l4!zuEiuUg?HK(eD*0rw2^8RyDah3%QV=He3(P zOFuP89BNLys>_^t9&zxCdA{e6Tgjueclz4u_N}<_cTx6vZxpq&KT1hl65opdaXa~f zlq{L2^+TsYF;M{ZgFsNp7adRUC*~=jTo;9QMm~-fy~_+KvTvzAVELuI&_-w{y7c%X zbI?e{F<*ymUHdZ)^;<9Gz5igaQVpGQ^H9_E*vmYFN^grYV50W|KvgoqURPC*)c00FLUl?F3~~ktO3@SupkDqpZFe;Q z7J#xu>*pU8pW_wv_eDa8$fYfz$+ooA_XGJBhLhfOBtlC;oaTcadqMU^AeW7;EE4+o zQ>!1z^SP_HuWDzaY!u%pnWPb#A5mB?C4i;7J(rpp z{6derIQAk~^YThQjAg6UJZrRl2zmFQiRKO8Fhloh@HY52)PO5kGf7 zrNc^7$(I|~?&Tz!GRsN#nH)Frgf{vbU6J|Rym9If^;E?b5no~>bPqxIjywV7u4?wW zBMCkIa+~Ie+VEJ>^2*|^!>yQ6$3&rM>VzjR*DAk%_LO(^8egt)v9AR;tD}s%yinX% zA;DE+vax$ctPdB}zSq9U$vTTVit)}R-!R^|D1<>$1C97QG08T^N?xRLT*X{{Mn&aJ zF3kaLY`DjvXSB)7D@9=G41|cOn!maYDrO9;QYsIJIHBcn_5ki8%8v*lmw^xsUzs}4 zlW>3m1gv;&%3-LvIW2c8NE;}a0M!ba3yU%FV$i2?4-&5n%2G5O@RRSxR|Prp$7J~U zAxw~vDK#`~GW|pAdtQXrqq7{iRKb4FJXhnU(t5F_3m5O6zjlT2qu98K^4-4o-sc-5 zXC5A^I;2gGo}aryyKlXPe2jLTI>luAor``cy5c-oT)4ySE!-P%xJfsDc091L8LG4^&$) z;4T_8tb|HKWxV;4xpV#;_=lwuA6WMHR`&Pp$#qxE_gXFwNDB2>u?&usI6_N`RMGQO zB{##-E}G~>U)Hx!H0pQEr*IUDib;$`opZoYk8s>R={+<}HQ+banU8#AOmp^HOQzlN zq9+@D30NI;my({3jp=rG7pec{E;+@JKTKI(T*xYhjmK)&2l#paK+11-1Ex7?M#j#fUIEGD`$pZP#e7fHxt#p?=tK>o?I`CDEr$!^Yd3Cw zEkQ#U1-gK-vKqby47wjEmR^>GuG)piG6Y&yE*S7nrDyV1j)N>q&i)>jIC%&)&^+9p zV~rBu%x&ndMZZ0Vy_9RmBI)E7Sb|U`e1xu^hD`O9R!V!m8ImuL_s2yh^Gs?g>B&#%QN?QSbE zzaKq%5NFMAYA&5&?o+Hnx`lgd=U?%}xnPf?TDUK3L9pQ4zIX2W?YPTNubj;qKc(=D zXnQG;%Xsfcwy~_VjrxYVmwoJUi<84mS3}yfxJ)z}i$ZPA?_J%aa~OHOS{tHKg&Yw`H!3iK*%ra=oKhv;o7(kRV6hLTT!S;!s zQkkG-3}gGW z3jy}Q(5;dL8Ckay+gU#!shd8Dt?{OH3Y-OSQqR<%qb0gE0djHzyh(Jv?G)8pCEtpS zmgPTMT`(!T)q2NaqA~oqw56&%j7-7;h;XLiAG}~v^Xxs9aF5$dU(7q7J>u}l++WOB ziI+cS*YM@{hU~?Qw+l*toO`IyG3IgqWRc@qoWotKY4@kGhU&z)fJ^J&A7ymTOr3n1 z`L<-~mi2`*_kJ81$tun-T2tukXx36S1auBqVs7+5mliwM9NGems7V4C`pN*p<8JLA zIOG@WboJ-&UyI+CxZNn<#ZSzJuHqylVBFu;DgYQfXMT=qE8`aQsG`p}$2Rr5PzyB< zu&jXi%*27F7zoEOMi)0ae$&G$(HfjqAkN>h){rStISQ^!goQD&TS=>*-rWSMS;9Tv zboff}Qsv>gSQLsgTOnCOe2~mp2M{+(V{J&~Kx06q04)W)hi_tgTL*I032;G~0Gk8eEWGJVp2cE8EYSXD0>!SNy z(^>3A8$mR(0%|2x+{w2uDC7A-S|})!Q10CFd8py}MkVOPx-m$#sgmhq_xwv?UC3fh zdD`54m71$fYi&1Q>VsycJm~wymfiSBFU5w}Q&0QEZOaNCPQHHHa9T#?mciR1DN$NA zeeN^W6t9^%e)8q0i&^v+2Ff<3LS}Q5aE-I4`FBO1``@BYsZ6~7?KNiO{`<^#{X(;r zct8#vK>A-@=AYmHXCM0f5UTPuZQ^(**5YTFHW*CT#_O0lsczEGWcAQyaulj!5H9&kI>swhl9bg8Ll|!j9|uj4K7U^5hD`*JXasMyM$9>IJx2n>PTWI z!%>CBpl>BOHZuUN-|>kcFf2?M1lVKDQ&`@B6~>!()Sol5l3J!wBZ;j{>Q6KrFqJs8 ziMq`-m6LY_?F4CH0IWH>H+wd9$JEI!Lt%75lLvVf(|jjt7d>3YpAqNQ`7#AOvH<)%S%+&m zgaHs}#vPOdC8ryE%81Ug9yg3i*7@U1k=xaPGm7r8IKs(81+Sx@2Z!_CwSRbg{fuYH zx4Qb;1O656E8l-?58iP8R;{)B-I--I`C)>nd{=ij&OzaR^rLbMyFP^M$M2V}ciIh- z7B+-Mr%t@Te4(q-YC*N!>db8L^~bL8$SYp^I%P|ld*{|8N?#xC?791g7gs%uOs@yU zCV;Hca)Kb03HMH5vtIC7(M7TuOe3w8RMvys-1dXyl$#X!)G+?i*OhyD)F=$sWB%l{ z3H1CEMr{Qcbw1xS0Tso1o|v0R;$j_5-D9u>S&<;Cc)$r19qg1KVS|EmkceE#X+k{} zng~SzqIdHI!h}5E^XUj;q=yt5#OzLr8Cp2PECBcS;X)Bb^!eUU3nn>%)Q{K5d{U^T zsQ9$CU}3dRUN=ASb@ptSq0XP(_x zzyJK>PvynpzVPPzc{}?eLzBw(^p`JMzY69T1rBe-X~Kc5sG(Z8c? zw66Iv;38q9^qRf!L3=HlHPGAgm9UoniA*a zZoEo*81rlhE)N-gHJ{}pG~8_ceC5*RFXyH@;{UH1KL4JnzcSQv@B!lF*TWMW+Ss($ z8^ZvQK2U;R5KL)|fG^9~h|C7fAT6cd;)D)>L5h^OPPXp_4|RtmAZJgl@g+* zicXsnza5WI4hz$YZdB9OyoTYsE-v9pP)GEM0Oaw@2q}>YPkaC(0YDGM*B}yLmP_~y z?(1OsBAA;%cZ_DGC*`KaG_l&!_p(`6Sz|fmoK{6Nre-0h9#e7>yOpX%W}OvCV>+Hj zS@WRdO|GLp)6wzssjTgIt`tWrRA53$BHk0ln*fxvL5U?uz_8us2Wu}F=8Eg)cC|L; z+IEww(_8uzRN=}dc#i$Vm)c}o$2*PTB0LdI(_2?+1daraIC7ZKt1o$SLY}4Oidc?t zSl?;e`OrD>`;U*$JF{ntZH`Yuj;LS&B57*e4;w z=&`5n@ z1-h7!*U-9I)nC7TyZ`xfNC31TT4t<#Af<4yvT6T?xt+{ui{}$p@4DvL*50tc`!xsA z7_k2B(uH};@rQl0Ij&gNu!Gmo)#fG1vAz$xIbcasE&26ZV|9eenppkU<*Yw0$y`$NZG=6`Ua{eQCbSB4Zj zAMl<$qhbWo#*V-Cc>~~E1Coe@x2|3g;ZJxtZ@%awEI!BS&%aJkOzqtM>j9LNWEwtj!l~wZ_$8%NYD#xGPTD7X@(*Qvmn|5P=a=Tws~Y>Pyv5 zFquWkWyoj9y+VZ^G-Y+fp#~u<^@T=e4ka-%SaeBFg;$ssq{+*Ms~{aJr3K5b%TY!* z-1EbbGvZS$Y($;rqi>bm8t^qO!SG=GC8t{QH^h&k-)#C>0lR{YGAJcOWmNT!Q2J1} z4JM0eCWB-!5du&!cPXu9H61{Lx(g>UDsp;K06{ra_!DKCZ%Lz&v{m>*941prL8Udi zT%tmi=AB@0P-qzsLL$9d)HEZIYF1z^fSUw;$|v34^RfRcuY;}brQt5_x?k?A#+BzD zpAh=(R?^Kk26va48k|ofMx1*erfXt$kDxSW+`=zchuGc}E9jbXR?wBNKBL$dT=FVx z9e=jk;6b1%ZMNyp>5og!eHIxMldER6Lho+Aa&MKdm?O-c9~V7bFR%!6uGCR{j*y1lc}!HnZB0ZB;qD-wNa=mzJ|}sRR4(T zuBe)jApt0fd4)HDbJ45S;iTl)!JS%C(|4 z7p;C%{7CMe7L-?~He3^Og&>hmBz3AW9}%=d)H<9sU%l75Q;4tSJ&rDWgi}*C8xI*E zn&^%hz9r@wWevg)#6t&tRao7;UhVXi-Jy2DtW*k20KsClM2bb?Hx2Ya1d<#QD8kX; zH)&@tktgKg@IGI;$gw4ev7`5Lp{xR-zzyUyFYp9for$m1RO~qEI@a~Uxv%_L+w+eR zH)~qbbDl!(*))F1GHE_l)b!+;y0XvxiTj$D_HPo;7TG>KzS!RW?p?wD>-qBX`&qwT z(Plcwk&9fuU0qY`Oj=yJf33hvqG-kGg0kQA3%#w^MiP#GldkA_#=A7Gj9^Vn>-YDSsJ$Bw5PA2o1N3QR&J;IG5qUT2DOc0uz-#d6Xl)ij z&vvrGj0bc=YnC{1ay}T}z0^BqkUTUN>B|IgI`&NB4LK-16$pw39nv3TK;ebx_NGRd zFhBJ#ArLWU9epv^5E8ug4%VL6c)g8Lqt)nK30JvB70qrV#)?ZgOWV@IlZ( zFehb7Pw@fDXv}I7{#DW%&Ju|d+Xl@h*BUHB0-|BFh`kc zz{n9;wI+ZWXA9yqAuW?)CFs5JHb781WLZKUfVFtk%13LeZ5IGa=6zFa)G2;<%QL<} z223V{W}u8bb?>VF8*@d^Zg+ib{vr5b`{~77VwIViMt6@oXQ9{6YT4zx&&EAcoUoG* znwfD=vn|QjIIwYtfS7hKK5^=(GrZ(CnwpTM*sC3ld*OG+^e~sJvemCRoVwa)TXqe3 z;WqzBph$aV*r4IT^B1kZ+@R6}-UVIH8_;&qkRI+=h13Q=+t7OYhjXWL@}W;pvb8!# zWdg_DORl#6@>kMdZAdwI?vqOJr@8p9XPG~PwIHB0q#v>6CGvL^bxm>I=9tb!#r*Fs zMn|4*SBqdCt2P1OYEy}lBl+Ty2C9B;)n+9s+GBDycv1|W0U^-z2mr7k8s8=&W`)dS zNpR%kc%q^c8A)%#S#}&#iK$_%5hy>il2TGvf~`EOi|XO;OhH}y^XgnlRHCDWaQ@zeCGu%MqfyIMMHyP+1JX1M%1Ew!2xs|S3RVJ%Rf^P z?Ux4JYu3p?j??2A-4uWrBHm8e1h}%X$EX)o%)ft~U@XsSYo*%;IOZ(;mQnR1FEK|z z%}C5;za_q2pgLY&iSL#{-mS#ftrhwwtszPp9o-?}u^ht_N7kRAo*m0bI&y45Vc@2r z%@FU|r@K?>PopOurF{ejJH3pcKNTMLZ-`#4&|N<4pw!yHv6FD|i0h}Jbq8_&M~$o7 z=8%?c+v~O+qDs3B(WqDVA4+>z^AxEw1q*(x1B z!1_JDBqhg`Ws|UyGIWfk!huexw?&yGr=?Evq2ki_(olUUdh$XZAP>V?%wIn3UkXYx zEdrFWpzxj~lV(;|ntW142P-O*QIK=81S-IvtT4oyN=eI@2e71)uy2Y*Z*#F^#W3Vd zSdu_ekyU?s{R0Z9euEO}-j{`kCrWZ9aw@dqpFD7eAHzknuzwz_CoS^|xeJc<>I?{I z+gxwqYM__E2I4CR-zVq!-fQ33 zZmLlKA;*!^A{SyCyzE!sSMuEfeF@Om>AB@&^nb%NOFpe8LECWzuJX$_NDK0ph7Jy7SUF|AEWdpwAmlu?eH>c_^Wg2KOSud?@fPF`55fptMk6|=fD&BisIP^Tvv3(KBG3wVb=$lWJbj$QH6DvuCJTjK4wA_sd zBAun+Lz@t9jhWI=#1&3vq!`6OgaQ_%9N-u;Bm6%uIL5j7J0i8!*pzY{N8!`**b`LSIM*``m87G zK)irZl9uilv3jpc8GsoV2f@BtTML7M09gPzE#dhXls>P^NCa3y_}XRe54&w2##$FJ za<{LHOWAV-sejN-(eCa};&kP!nbEFW3M?;*9w?QkjPI&lIqx+5xl`=E-Hio%+e=4H zY3*0+u6SGvcvbx22WsvjBdpN1q`LLwJ4cWE&JJXIr-1&V_4MhNPrg6%aW+TYw}`%a zR5@nCW1Xi7|G)u#dt5Hs<8ymlOyx*4;^CGb=1Xfob}-;>(3(nV{KZDst23VED%wd} zIk4{YsF=r)V+PY{H2Ool5Nb*kLwrKY?Uc|rJi|%%=$T3T8W+Vxq2R1seQctBIjD(jl)G@FOFL{vqg44TalbQ~f;j2PXZ80+9 z@p7~xNS%Hyz+3g>pmN`aCskK&DADfWkDA0X0-0`^r29;-jF21>)KkPW4bxTH;V>I z^Rsca8CnBRJJ1`~LW1k3?IR>GelBj&r;Y2@czi)V9~KhdcOI#KR745xEjXSnv>5F( zD-=}N6NF6Oo^c=|H*eZcbw`%2n?`(kGn>=v_jvK$2xb;CcdgB|gQM4b+*hRf)h?%5 zZ}qgZQRJHCJzV!q`^q71Ur)dkiWlJSP3oOK9x@L@KzLf$O^~w6k)Yk47K(WBftAz5 zd*u)4%YHjo4vZZ7fAaKKAHoaI?ecxJFbe%MLqB{v@Zn^dCZIQxVDyZv_7eJ0Rmwn| z$l7+n=Ot7V7W-oeHrcZHEgl^HYbKBwW^jh^4Stn?0t(@MN!9q&an(=<#8IX_#MD4< z0#yM;U6e;5(DXEY{$70u*9-_8frEIdSyc0sL~wpexH+64Lw<|3QX}QAp+)k!#@2)^ z1SPrGDGFVjlRIn+niEAgYN(^ z03`&tRL0*&Lj6Q&m5}=wte5di=*Wyt))&dstcfZg6vf~aDvD%@R-)fUrvnFA@$|!B z#yVb>!AoG=8CU@;01({>5?4A2isck$FeUT}xo)CkcT`|t0B3~_qa;P9no(l$BIJ@) z5_ZsBljY}4i{C3Uh3>eaaFevHp-i(tBf@2bZ?XaEsUB6ZryZ1hBfqp(D5!s`vftNA z60M|5qa(ds$2ivb1$!pnn#v+fT+~noy(?2Wsx2r4w76#oK<3uvq|eIXXOdM%MY&|m z0&$GrPC$e##Ku>+^|A(rouo(L^-M-dE>ZCyB+lp!rKh#?bLq8Ni;pSds6h+mL%I5| zt|;Ypo%lZJAR4{394m&cJz@MddA;RrAAgF(C;p)z#9(#keY5E&=89=X?xm)}4%=41 zYjNZ8Qt*Nfl^MmnKICH9RnD%K{(CdJ#k$CTvCaFVe23gR$h+i69sBCH+<3hF1sGR& z^)Seuwk^w+wl3_;2S!2r`^fU3^)UYw;ia`TI;FE@`hC3xK*9j1r@*-2+N6o#Pm?lkelotK<&9jRNgyeHM0qW23D zBLq6sp_X=d40CV};VlHf`3ff|$OQO$c|d7Y8pD@Y#ET>oBIdt5IR8ILd(WsQx3FC| z2}wvGfdB!LPz(?tRFlvVHKBwSAQX|NhR};j6S1xYLTCZ$hNhtk2uM@GO79&+R8$Z_ ztP8O$>sp(0);IR}&MxQMXPo)_{rO(=Df7Oc=LN(TvP)b^keMf|#!4?7WFSs0^z3L^ z0oCgpLP?%Mzqm3iHYQmrJp0ZjZY=KM!ei;&c-N@-bo*zrH&a zf8+6k2EBEqa(+m>?CX=mFOEyHIr{eM6ot!iVi$&W$Fxqkh|yn8KE`BDPfz!WHV>21 zu=mqyj%O9^RXOh$bdc+R*Z5SqMf}HyvG0oef&JOgSy%i>jtJ|J7kvF;A&4Y#6>sI^})k@vh?*QX4q&G z&B1oN)vh~cWZ+pC8~{bPPQNnitlR)SVhn|kTJrV71@v9QJSdcyxj_`=Y9WYdzI2zL z79lrkgTS#4mBffw_5LAL6vgdgw6gM2%@sN09NP=|3xk4Qe)WJl2*8eP(S1{wgLMPqjo+Y;}Q#+3+VzXEAM|gj#7CA!{g*uQlbs+Sxg#IjsuB z=oqCQTn{Pr68k`s)F&O|g%>($2yA^UME^{Il2uSV2@#ak^FqVr$|3~`E)B6Rb!WfD zY8;f|HNH-6!gKumcI{4VTBjF65ETlYyrZf4b$h^WMY+QZN4)|D?lz4-WZ0SEA_F># z_&%p1BaN>2wJ#@nZ+1R>5Uf6am?>V4FH%2pGjBRP9n)JyddFAiBMiqjeDiCU<|~G=4B{;0Zbad+ z|Cc3R|G^M)aea5Z?a*b*C$#sg-vB`0GgL(M(zmUD9_J8VEcIhB4DFQV@n1Kyw_EmI z^_fo>yJ9=RF|-uMEUb#{Gn@eJB85)$;AL2%Tp5sh53`r`0=SVdn+q+Zn>VETXy70u zQn<4^1p%=D(bS9Lz{%q|jz$>-wDD*usb;bq7^B6o;2uuuk;>APP_PcC!<^fUE%G$L zB?n(tJ^KtsC{d^!j{(U^EUoZ841z%LraS%M$`X_mzA`8+R|V!Yd5G}9P{bO_ADjDF znVQ_KPJQzD0*H3AHNe_xtgZf5t$fj3Be~(`(-S7$O3^pfDE70vmQU_TB)zXH35?e3 zN6<3GdtK5rkx{#EJH_eN5!Pz1l|3>7pIeKPn$GH}Ywh>zMmR5L=}FDt>Cr3G*5$#Q zStJEcsUz;qHO2PWKa8(@sdc+`bS=c`;t#`8myichlTUjCJM^x%Sh;?pgc!=zs(Xu1E_j|-dPTtG*-);jcb@7OOW#=A8ZN4zyFdI}4-PG3F-3$oh9HJ|;5kXec z8wmDtaK82i^2IXS39F^GN(!Rb4H49)lvOq`D^3dF84?8}35?~#WiuPZ;An9;1k}sZ zLK9h4kSQ`Z1qXyE3OV(*O98>whuO*2fL0!p$VyFLbl_jfqc`z zI#mO~s$?l?=K^u#%R)v^xz^?ykFQM9hu^@sH*4m$$(R%E&i+>H~Nf-Tq7UKEC|ieR~^;bmp97yKKpJ*vBh!ng)<|YbblW zCaxTn%;_3$h}A_mh->-?S5MeWwH^2vKW<*t;$z$l-20sFWX_bIQ_B$*k9-bv(ih_C zCdIe%gNE&bTcYv_`7SG1YmfnYAsP^MA)tZ&;esAm}lf$|BcRMiAJLrWS+oBaKqmCgAeN zsIo`WkPPn11e5~CL`0O4VC~92{fiL3F>A7?>VZ&fgIEq_9gr#_=}m}&w@sj~?kT#p z5*fT*nzmX%8vP1Jw3ApgS?l*n8#TJ#T>-9H5GLx$(d(;Rpr^!HLb7a$rEADei+V`7 zAb%>#x?e$pZ`!i6(ei)+GjLVgF`osv_}R;D$hBB&7TvJOs4JfHjnb-RLc98(*MJSp zv`}3spl-Hv#lX?h$8pIiSl3Qo@+A;J-_heYMvUmmNv8XZ@6Xjci~DLXI#K?7-X8>&mJCm7181C3FzHixEJzmBAS^RLGa>Fg4glQeP}Fj0_9j?TCSTEt7+di(4jXgg)q=%E zf}?RxWHqzN+%DClIA+c6ooq;x830I3cG5Y?D?o8Dqw<=c-Gc{d4yV9JXUHhgpWU(q zkhm6D%``}&D^ET;Um*ZZ?Uj`WIj71dm*Y8tghx;0fEqygbds)aRrN1Re0oSr5fGS@ zTpNs6i~EC{hIY9|D1b*bC~Hu`F|CNZ<_fw&TCB~GX3s=dOBorbDk(5d_efEWlR!n)!FY22${WXOvgQOz%5W7jL`y z?QCuX2f`@--D31_JrrZIxa=B*9E!O0xOb9mt_Bc`Ekgt*lRumtgW$cFA4`7n(sw~? z$;)A8l7e!{*(o9xklQ;15X0Gm@J=(8uk|e}=$_ycRLh;ktqSy$J;g@K4hOKP+}6%L z3hxH;Q4oqFkUN3x@#u-5tOHYpS_BQ0GSK|kw6GsK=sOJ3|BN${r-B%dBL9Nky1&1;}4W%@Df_!IUfFq^T+rL zDq%<@xoGUj)z7!xK8lRKqHZcy_0{=sjGbi+KVNxjeB+F2E*GB%&x$F`Fs6iY3{BeQ zWt|l@Rb*@R4z0c|uKYWv61I{nx*r+&n_M$tu)-OeYd8|T>@(UcCg~o0@!Z{jcWry; zi)IdldKb0Ksrv;@&cOp-@B7C_jcIJ!nbIh5cqiphHd)#k=<9cj-WjrZM;LpfXo&Z^ zBs(&s1NgS6u9brM1q$RvaM9_Q5M~cLQ5_B9RWh+08ZcQtg@gfw>+527{_!dzE6n+V zt?gEm7!NZpPbQ3UC#dT6aGO` z;w3l8^5-S+Rf7}p4+l_|g-JGGbKzraHIPFl5@pff1oV=U!2xQqc_F!{J({DoyhaEF z3ol4^rHqgckP+c#JSDdqb>foQV|77H0}n5Sv#=NI9A0j+Tt~ZT33$r8$`jKU;-f|z zQ${)E!3lXIa_U-&*#?Mk@eFlnaw<$X&qN%$zU*6<*vqO)Mo@20EbLI~nb6|(+Gk61 zEcv2>lBedkYxzFZMB4*SdvEnogZR0GGw$J#e&miW$5BV^-BANVGuIT=Q6T*c+NeGT!!@g8Ml^xXe1#oy+CK zEduQ_a|6;RSOdZVJOrmqB*k~<@Y4gUKx`!6+ye_QCVj}Hl3AZ^oFBt-+|Wwm-*Hi z!1LOVU}GS-q=mtco8tO0vZ;m#^{jLg&(1idOCXO_>wXDqH1_{|)1AGQp%N&&#nF+d zu6Llnm~5?;b?f|mq9{k%mZ0$DmvR#b^cDB?j%W_8N93GafdyQGH;0y<{D3(-T%x%<)nH5a@A? zg7|*0scA1VBWVBTGmiR-RHsIg#xd)G3Su@fY28$uLUx#BeTHa#CweM4L}VeAmx;M%Z)QfIE@m9p;e555*7NwzkB!T8x%tFX`w0<*5ZWW@iyTSXYZ-Or~+=qz9N(;bt#R?OpE^tbXYx_E?N+n^}6`ir@_p!!+ zp_BeEpGOAZ^~kOlUHn-J9t+G|1Y5VzrguV=RX+g zUYtR`g%8nhJsP|l{LLiEW;no9em=>|G^~%*VYUaQBFvm&J>p9Qg_lw79pRZC(G?d7 z69l|NB!~~8WHQcn=wo`|MsIQ!08wI{>CW&xZ8N(P9@ z@d$%~u>}$VA|oGjmMz$5P`|||?Ybba6A87LcV0-7%ivk_{tj%8E{s^R!<%wByB|yMY#4{CaYc%f35R&% z{>Qd%$}}W5kS0(_K!gKF+{bd$bU2`IvZkuhsIKN0*(*k}=spwlu3zVV%DsXF2a)L7 z?Ldat!Ptoqr>YN{pmS{(i_{)J`TNOu2|N4>0aws0bwmN$LBTxd&n|c zHf<0X3^hg#3EnRUNXQ$66iP8HY-|Zg&`t`N4uc11L=hFkFH+KN zdRF8O6{`3}KJrgDWTu<&ZaUNq9NM6|&4$uE5lUjBJoBK;mI1U*+P!PrWj3pvn(a6* zSIFnI6UT87RK>c<(Fa|3>R0e8QFXU2)KQ}9C6f-nc#f&AzRE`e^kIPY!>#p%vjA&S z5GJ8c9a+jVZ5&P4sozP!)Bpg^ek!Q<6)Qr$^RAx!OEW*5i^AeFTR3*z`XO*yPfLTLM!sSvjf|0HPau~`n zRu}NL6#L_tGjhfx;1HC~fnjIsSTUj1=@XM17C{pjBW8$c9?~j8x1ruxEz!AgSZ*{1 zU!vperyjoZ>MbTl>^TKa*U2Yc(6?|UqLI;|fLGZjpirA!6J_)y(L29LIe;I&$?@6< z(o3|^-u=nUJ)DKc(`I4=#|sdhJi30tRN06OQ9^7=#&)PKt7?E=t!Bqyewp!m@waF+ z5-DJ_3)I6f;cE0+*;;ngDb>bO9V7oo1| z>bTeRpsju^E4Am9Qzq9@bF8z#9FP~@Kf!mDs%}X1@7THfaY`Z15txVdUJ_F~ZFJwo zRp9QgD^KumMpR{IsmT&;MEKW)lDNMkoPrx$s@44*tp2HCay1xEGY*n(nu%jIK3$lm zJ_$7`ahJmaXGSe&w9o_2!C`~|16LECvd{r|TRbvebfB;uG=ZyCk`OZBQdX-~m4&{! zvfi9xlAbR9crj{4NRJPBYf0_;K! z6PK(c$<*~2m;(h1vJC}!U;qX39MT3*jVmt$)mQ0lbnnDo1Zrq8k>(<jdgxq@f>RKPCQM=Rkg*7uBmc*mt2UkIeLc5psR{dKSlkr}Y z)^i!3R8;o3|30+a3xq11cb{Q-QmsEiiNPRtx}v;f?r%;#vCxK70!d{-`Qey=SObPT zjt$$@3ZpSSz0gUpdF9nSA9oHOw!*4?={jS?xsrPV!5#b`+6n(ROaI29Eyu+vWEgs< z9(u&R8^R&G*{J+|1puI~VJOaTqXhyzxf!6;If!h*9cHkd2fO%zyrAKYJjjTadmiA6^Aor>{L( z)O~7l7u+Cq4cq!rR+B2Q4$ekV-evBh4NL_zzs#9w4d9BhFeqa+h!1s!T;OFxIOps1 z_|U;xJG-1O_j*hr>H57ZK-&VivH|){Fxy%RB-v=hm7!kex3-#R68iB`LguFEwkxm_lFh{ka zUG!qictb4!R=^kq;NC#7#h{VUgm7iF7Y!)E@c?Lp_{RMvo=t|V3c7&9Pb(tWiTAB( zw3`WpksO)!G#O?n4jynS?kd#jGdRXv)r+6O`t(2EY~1qPnH_P=mWVj?y4pos!q zoM4i4QxieWi}DqAXi=+@E6btR4uVRxs~R(OrE2g+_n_ejPgxt;c`#yl{Be*h6ap4& zgi)c&fb@GqrCM3xrJx?f3vF>+Hxoe-`9c-g?SWNu2sEvBSp_fKBhP+?$T`5nwJuQE z^JrnF+KU;j65ga(vKk0~QB-47VV_q&+6Gd9cnu>fKwu#LaGFCT>Q9>@M{)yq+<+*5 zsWon`$(#z%LeG#$ya#s)DanzWZxoa}>vJ;^AAf~O#Q4ns*m&PlVO#>CDS}#1a?2=V z=-AB%WB;4?A+bMyFAgEYB!?1j6mZLf(*f;PR?-Gy$52x?<_s4Zav${UY$ip5%^Jb! zD-&TCO(kJyi7iWyw-_RB1q3IF8A;M@ffz}iQypDW+%lsMOn4ju%r?eYqO~83d5;lr zyK$RviSXrZ1tVz%UDmXA;p7cS)5; zdesu-RE{;ZzGz>ML!#Xg&LAA+f)*y`@XK>dd2jlGXtxvLA>m8$L7A=Mf5`Y+xcIBT zKATE4M*jdHbM<0xg51c6*|sQ5^5J=R|LQkz*2j{MULcQyyC3K2w>vd6Y0PK~y%1}3 z{%=5@bJl=72jNie<@-oSqJ-ZC6tG~8+&O55c)#rHi*}!Oa*Xg7V4{e#XhVnxn(B&1 z$0|oo9LSs!a);t(YT;h^S)DR{Je=kyCJvJ<%&q+z7I7#04FzeQkCGf()rcw|QTp2} zw{l=Nz(Jw#iFvJOO^0J3HW&z$BE3S*9Mv*xTTp9BBB}o+tP{?|u9_|)gQXsIlFZ|t zVR_j2%%!6g$#BgcOpueLR%B)vgB)>V1(}!B`%=c%MXd{Xh4`L7eD27XC1L!pN< znVwl(wp%5+a9|(D-j>B#Fbh&{T{!z1b8fD%ccq{_DLK|bt#g*MK{!-ZXie8(eTBU) z#0HkYhnS^=SI~TI>{rJ}w3Jg9fL-Acw(PV*>D*uDADf1{fY|mJ2aQ$9OtJERygs*1 z4k*dgr0Z24qxV_y_6zrZG-^dTh1Gxt_NZNRBTs*wjz(Gy2UFxttYMwbYa>D5`=1** zgB%$rvekMXK;x1!&)+!Big@9b+ZQlPTtLXrt^hx`twmJE>eop^W9x)NEBL>r3th($ zkH_*bk|kGgsb$sht~2O_p zWvBg0yRchkq4lbCNr15@FUZ$(KX?}^X4w^yfdmhxK{>YSCm#YA`A zf-M>IqOc+Jpzcxo*}QMRIgWft z+DciO#IfV3Pk>+d5T4sWhmzz+tHcjvOzhXrSJn#Z$zmh0>^SBb@aNOm$sy;|&w2%D z zmt;$WX5uQtF^{1oSTU~{Y%Rx8Fk>Sp1{hJooN~n*>x%&$(?!5=I6FWQrBqh{!0E0Y zU{k)VB}K@UK>eA%MdL9&PxE8qhV4hg2asu}c9^pC{bh8`Kqa0R0&a z>oE@a^uRNJ#f9aGs#QaLoj3{-R%92PmCD;UPmsl*(8h%JbHl*kE1u3IDBzY6usr-P zR^xcp^dn>iDxTMK(R?+u_a3C9+~Kl^b>X>CTim%RV2Z?t?sN}m09~J zUZyi6lqMmg>Y2?qO}&aIN6_n_zVSHcBPVk)5KN!s4`Z*CQ#eX^7L3A=OGW7t?y{Vw zyigobHQGyU)38PH2NY1uqNY}B8NQLI-Nsx@GOw9N&=MDbBdkr)p|~HKx3jdIk{wB|f^uL-y@}KLWe^WWK z7I$;N_vlntjEYjU2Oj6#YR}a?bmDCGqkz6IZB~ z=k8?GdLGF!im3u;XvNN11w*UAK$K!t)>RLdX<>B8zVYw! z0G%C~2$Bc@!~|bmwL-jSZZJdL!{t1b?AtxTar*h|KP9N2?WW3)>xuiJIDshumh2c` zl6V+gu{*%(7T(06IinPMCbx{LWtjHS$>lV0mz+}NmLPS5Rn_hWd9yR>E0KQ`o2d54(90=;H+Kpn%hu#f;2#A~!aX}Jm5Kutdw6lRo zlUn1R7dQ1-+koC0W8^2e{zJ#^A$-z%IUu0s1`Ke>c8^#xS_K~Q^44za4gH>DV%HI7 zTN<;0kM4s_qo331pIzLkttXOV{}`+by^TM!{->?q?YEJ>WVge694%pYepp);7{z@{ zPuhE7uvbkd1#q_TshfDwdfKXgy-6xNU3!XvT%ol6NOP>+{?oY16y21pA$KEf@ucI3 z$j3GtENF{phh9`MJZy{((-ZAgE&QHp;Bn|^OH*)F5cQrdmC6$CXmcy|Sv(maCp}}W zUy5Z+(o*bIV6(7V`>mIQ3eg)T=L|HNKu0AW$DW z1O)zIhXVRY$_8ztLiz>i62w6Gg8RtDE5L_ku{WY$W^A>FHta7!M~4SusO76j4OFEI z&W>^nycAx2!o`n;4R@-}Q}4 zbSOy3#G?>sfHwFH_Q%QYwmCN=?_2L~HlFGlshuRx7e7gs{qiC-w`T+gPHxl3abpSb z=6emKQ-0cf9%8UW+CyUf8uNPzB?XcxzaZDO+%HQ26{gc{?bZ*+_~_q%gSx!$l!m-{ zY?w*h-2T9Ic#gZ7Ylhwv!QQfK9nU`n6IsJ!ebm!YfhrvTUY!e;?i&nKTB%K*S>RB9ul(!uy7Szm`FI8FhdquhC5%-c(DN+V$o znE;;{p&uBxQH?N1joLWo>VD>G&6IaC#^Ls6gxw@zG+BR!>@zH>xFN6q=}; z8-=tUfSN;D{e4ELi13}EL7f8yj9B8saX}$zB^PmSg6}gdKk?33I5U{e=oDE-yb_bg zw3ejFmvWZ!N6@)G7$1{3vKiO94&^$5drfkxmjn)jM3N75Uxmo)v&xU)X5$>7nt=oP zH`KWYD$5`RT%@f0l&ji-4`+5;_!~irjUT04X?R9f4La#-V{k9Dc4KNWfBM69H{XG? z{F|)BsrPPWK^fTV!bsmc7S5eF6rZ1b<#Ye~*VFfp{5TNxPmA{T#m8T2V-2b_c(p)i z8wQF30pi82tMLL)6ljgsS0F281n}-S7F}Rf?0IJ)C2PL_n56ql((0ns7+JKeRX(o4 znpylc;Ds7~`FS;T>6v>#Prjh9zjI86IZVRz&nb^>vj)Hpv+S*YsPp{B3If&h4lS=GX`K{^K=8#yPOM3-2=$XqAbho70Kf*$QR32a zGL?w0PdPeH)Q3;jWvdJ3-q~J)<#LhQW>UwG)}bN+yGV0uk{Y-GN(yBOb_md?rLSv( zP@d}S0qP{=Fi^LFF<>SRVkGm)(V4XMH2|Y}m$-VhBgrImYWXqv`cT4hefiJE$Ck&0 zM2PRg&zy_F)Jgdk3SE7bwEkoXx$QLi*FEdUH+{QgclpnKg}t>ARH#4SytJ&qzgguW zG?~q|K4exQvfTdKjkqV9)#P&TtYK&O2~EN~BhUxc>w29(62&XdslEn(v9d66ar5^2 zc`xs;Oa0$n!f^lSKD+tzX6iC&>fYWD&GGx*d_D8fsQdD%)VtV*|G!qee;I1^{qRFN z_99en-x0eHloiGrkVPTw0UJSMFOkXtYp571`LukB%1RdrtI#3i*+9N!BPYFJZ>(+_ zga8~RKT)VQ0wO3W;2>C#DG4Lhp}F?ms1l)p5Dk+q%b~)ZFgj_od>>aSXm`d)y^sSO z%`uO`@G{_KTdf!kIcyHuPS_$*lD*TaVyDxFX+!&O%ORwpld94}9bP!h@v7rSKMeQU zFpB4!%MVS2l%iFGV^#%&z`km2c|r6pvU|V)Z;e#i`_41IiSf+K0zTp70MN!R1h7^C z4FP@qK+$)e9o-WF0YDF_VS@2&QD91DC_uM()Zb35vcJwpN+KU5kTN7W*!I2lxn`~bC3mJaLk*g%#`otk( zU_Va^zb*4Aq(9R`L8E)}ui1)sdxLIC*$=zzyZ37OFJ(o0+p~ggqrx%B2fT9k#r3~3 zy7XV_v8Rik1?e7q+pwJa_Pt@{w@2(}AKKi`LB*&Zfr*NtP}U9BfbxbEu$)zjqpMc& z0_zDI%E_n0s7j&7R{_ENP%S5LUvPWG#@@=qf!4GQo$B1c$NRMOQ!lZq%=vWgSl~Xw z2CnKWi-Uy1)$uGR1-gW2LRph8K^s#2OuDsku>lgAQ(_v1%O6^gqZ75}@E3Y1yo1ca8VkvKsSQtbh8E!nVLT2ftShH5{ zWRHjHq&KPccfcTNK)RGhwm5?&4HLhGpndnG>txw)9ydMdrIA#$@1}je?+L_a@Hy!+ zW!vi^A8r*F5}#+~9(bdr@X~RTD4H2feIPu=I1*nrzwA*rBA(!j)|FJZ7+Y_8^h(}a zGc+{JG~&~z+7R|_gS~(FqOHd4{(OJ)@56p=Q6UTBPfzDQ_^a~$z2E083 z%g~3}tzXiyX3)cTchNqC!AK$4HM1&J(x0kE`tGmDQ79waObIj{&NZLKVjwaXS_`r2 z(AZ3$eZm7}?rAW^)MP||cqe1e9B0le2EoZVJ4PLuAlP^HzH~yU4y^Ry6$D_aLmv}? z*kwI4u)JFUNzv~SsxkKP&h`gOBYtFW^_|_zFdgXW+fqWHfZ>Y+M%1dIe5k)P_QVZV zNN>ID&>~xSV!}(Jlra=)+gq5em1VJ`fefiURcpQBD=FN0`lLoA+i##ealoZW^Y3YP zp)raWUU*n#Z+4%StUAVgUr=r<6+NJlhe04rX`~t3q1Dydo|y@25Q&6N^2URN2?{LI zN~>*O<(C;&uUw`v^yscOk+V(6m$GMzSB~CW`mPvh_lP!sJ=kvVF5m8wvvCG8)^xO$ zbKS%)7aPL}X#>r8t;cuKq>H;pm&(3CnlMLwrys&dfWz+5#@eR8kwGf&)))qU`=c+HycmM&-FlW>1nttAzh z6K%;2Awi7lgJdJk`D^}Pj4Bj8L*gD7kvSbJ74}BbPHPVNfyUhZ9rhwcO7AXD<$Mc@ zn2IM@O`1|*_(@sj2qm8oq_oy<;=0Sm?$aT1g@aMx0eSK%xqjtO2BZo(8<`$U@?B-} z$~W=@xdK#vnbBLMoXUzD`HR{-w2e;65Uz!MLP-kZl8m^h=@%VQ>im?-=^2OC;To}n zVlH!a7O29$v>-hR7uYBmNdx3|HxXGRJo*vJ@vnD=Bk2jRB=$)#Q4*u}s8e`#J{_h! zV+wbAp~W4;T~#6%{cxfQd<4Ptko@lVCoPXXd}tAs^qX;fZtQjCrjnB4yLesyAKhjj zzsp}$;=cGjqv4l^D6qP{>hJjyo~9RO3Wv1 z+8s$-UCzJ%(Q;bpnr6P}x0UQ`P4@iBSHD-z$hACOSdNu#ukOYaJjs44I=%YiY()m+ zZ#nOuds+@$-P7niC(xyt)%{oVvHoS~{g+oD>7(DK{O=v%?$}tN0N|`O5yL<9y4k@L z_Z}UXR*o(6ypT7;SHzlsBhLWJu^{vB<&p9wi9A}zjD@hX%UAeAQkm}?o7WqHotJPg z0Dcg*NJZqvq+tv zXEm+jpBb+hSgWFy6wfBfXLLCHzQ0gfXSDC_p*J@c{i=)x3iJyvfaofbTAvta9)HUS z?;ceB=KJlke@pcv#~nLKcbeO6D=zkJK#OAF{@o9@T@1<(-@JS7Mo`|1W@ z3UV*7#J=XXA8RNyR48fmIPaJRo(5JZV|+!^49w}<-Hn+iE@zj}F6=TC;tsF&oxEG3 z0_2wG=9QkSp3M&L$4Pkm;2Zm7i>; zZ%euys;-{Jk*Ru6t(IFXu7FPps9OH%;f3tHFQ@ zzdjU+bpBZKpv>qi`{UIwSH8&9<~Y4>9ybhQd&VW_KW%tkRd*>rNat?j45F&|hI`kt z>k&5#!*uIQqn`aV*}}=OKLZliB=>3r-1x1Z$qBMaEjwl$XH`D5E6RB8qE^2{{jc`! z3@hEpQxyXdxwpD zWl8*7er33j)X!y1zX12k1@u)aE1wqzB;;d5rI16@pir7oU5VI6q|}BqG<2P_o5lhd zU^CN~U2llJo>)yb+ng$|`UL`FTM@5~Qc^NGk_bI1xCBGCB17>JI=@JqxGDN7`gub) zyP~N*!|TLJ>b?*AJDMZy;BkKayJHvQ6ZrF*%bq?VUyqk#_Ta2q`(EBN3&VXe`BK~J zc{shZH22dZ<;3#PHpqjDn9vyhD&_XICdX#idGmz@*-gmZ#BjEWcHo{N_fVDci!*cE zc14*gu2TmZvdcVv&kemx%zqe^dsgXKVxnhu$sgbSHbnjEPFl7Y zb+1qyk3_RX1sjuTf3wqxLs~D&S%ruV7+b(L$8A{mxd#4FfhyA$gFb`m)M@pBFFc0K ztT|TcbO=?%mXO|2*u=1^(0temv{^K`W`ERFBR&gf%`Rt!JD#FOTG5#gL3d%;X_ zPcL>BOt#=}8r9ms$qz?vkzV`iQh)^t#vR$svaa|Yqb}=e@;cRm}77oVEc`Qj~i(VxsEd&F9#$JK_HbV4(n4#|&O zCz$0_9V4d2=mO6INDv-YDlGY&shetPjoypD(j=t=&R(7LFqBis{QP^s;Z(@s&c}i) znL~}ICoaDpN~||Bx6i6K$r)9!-}(z{+4?}C&A%M$>qS-{W=%d)=|5kPGZ4sHk8{#{ zb$adq$f0IGb+b`?OEGzc;xipgIL2mmi%VK0nP#E-tNty-4&)s4ck~b)Bto zxh$q8y3^4Za3@9d5;LN?E<6T5iCL?JV;g!@OY%YrOGp{IxV362Vb_N?{%QAJ)u|Sp zy`I9Un(ymOy-SI=Pt^xs!yFUQTJR~DE%0|i@^f6ja_{<|}wM#UZl1 zo)=LQd#R64HxYhLkJM@?lY~MQg$?Nue%StlR|*!DtW`tWR!by9_h@6Nar&NQlI=ik z5IO^h-wLmgXQ&g%YMg=U4hbNmQPnUm2S!Es{@DF#rJ$*H;*ZC-BflBhHEkK5dORnu z6X3i5y-q4?Sd?(xk+%`N)*B;Z?%?2LKKSS2i{GDIOv~v;($F zGd4#2(6v%?2Yz}i+-R>@h%#P?`{}uOeEWLiUt8ndeto4ErC|TH*z{kN{$;57#JeBT zKhs=U`&3i^N!TP2k}F6XE^(w1&j4~UU!OEOszV;a-K1poFPdKN6Pbs#80nG!*&7Q@ zah=6ccI9*kX&q*&3=QXdiB?o@5R@)Peo3vy!gI~`?e4H)eIz-X^VZzV9uWu zorGTP4vH*wc+Cn34p#S~W!r?p14|5V#8xj!gQ8%onS*NFAZaK=SJEwy<(mr5CieB3 zx>_0S*pv`h$_%(K5RclMmdV+6>wFkI2l*i~m~EOKY^Xcr00oxSm5c$?mMtW00x9+l z%{Sz?8;avX^j;k!?=G}i$e%jcaB|o3z?F??4~MJH7IDp4vtzgVYA-P-y>8m4J~1l2 zX5_Z}y7yq#KaOtXORv@y-g_*MC%#$E^s4{o@%1LH&_AC(b-4cSYT}ugLGUHrzxQ@} zF@G{*E-vnt=pfnEnM3&VmZgCB#}MNXO9fz-*;|#CsRP%&Khs^;jl0f^_q`-%m-#L~ z-Me4oAm#5w(Rlpz^IK7W* zJO_)M;B=NhC%I)SO(YClqh2sl;{9z^DR4WGFs-Pcoll?nFi<+-j^65NA|RyfSNd}8 zCXv=I2k;YKT7m>|M2k41QhV5qwKg*RGQ59?w*uyTvJ9Ad0GnDJctis9(CSGzI$1qB zNd|};0H9`i0PqP_9dQR{7u!-+h(e%1HuzrDX$esOj#(XmqACpgbU1{(8Q7|=j?3ON z_J00Sk{Oi4ODY20{cFYo=N zMajK(*j;1Oe;mT9naJ*2dOQ7Q?@KaTdDn&PWIfQnrF+L~76$56vuvw9XX{Ply#KbV zmYdD!3b0W5V|`0FY2WYS+GK>f>!@Eb_^WX2xkIKM;ib6r!m&5k3mfKLIigzY%rTGB zO+;;0ZT?!ZC*c$mbyHaqsQc{ghEH@3C|n`-;hzQS7Cp&6Qg_#HA*Hjud3x#1 z|A*-GFGJUKwtwvYS<8>TcewYT6XsxqRE*-pOk2Ky?U})7QVU`H(QAMNcJvD#HznNv<}6ZhV?jwKSHr{PqSKmSTNn(P!xA%#sKJQ z)g0b#N*eWF1TS2QZqVAL9s8`bqHEyLlPDmrF828=9d1`_>iLT4gxKFT{FcX8#~J<>P-F&eVin&&qCYP$K@2Qza2&o88RZf&rIKj#wP zUC>e4oP7Gcn64>z8B@`(GOly==_Rjs*W*1G-@V)Os2+FE08)Gxx&5Hx-0~HL<*_-I z3-F!I$g;GX-^7CnGaJM6!FiG$~{kz-Zp@NPE$k}0yYp}z&Il2Gs1x*P+0>r=FXEk zi>$FD^$6iCZ~eq^WYuBxQ?+5iFPQDH^4tWAzA_R`XV7SygFdbkG`evwOG=Q(`!)Eo ze?lM3nd{jFmWW{)XF#ojibLKQgo09h*i<|eBuZxGL+NPFOc=Z~nEQ=Q`Wk^P4!l(# zl89i#(QI=P~BNYdV25M$ZmejVR7(W!Un4aWQ3We^Usk2OEBqNo&r@i5X z>7EV?c4Tt#9!G=Q7Ua-@Ivor4g!kajZm(aSN|1#8M(GPMv@yT`jp6X6Llmt*s zfs#$l4%!!(Ya-3C`-8B+QZ3jpu`qgqXsw6e>HA&Pm$qHHkTY-?C z1J=aw*(5&5NEXi_H}ADEY&~my7gylMuO^o`R$KO#lb=$=6t2W4Ky1#6YuH!^!LyCT zt@}gV;>Dfgot9GeLaObKd{VBi?s8i@T$X~)Nl2nt`I1L=I-!Di2m=9S$mt-Ap@?s4 z2otM`{YnD3I0FUN1OmE~Iip-Wpmk>{Tj~9oT7p-%=!!<&bOA#jq!9rCja>G=wEX;) zTHXE^o6@oj2-v-m`Vih`qz_BU`}pJP^@TTY`%hU#Pdn`1UWg>w`ea8CC7LG|=pOXk0jf!4D0&?X5On( z=M3=Cqp_TY!B&ZdzGGlm{|zLu2O^Q%Qwx08^9+pW@rs&Y0^jw|>_TY35&Z}=1`z}p zNYI+l=O;~kRGMnS1@w=+mY$i+eRaWxv3+J?ky`JfBlEe({S3o%B4K2N#JHQ~GaP;a zadcp0ULc*liyG70LqihjnECP%L4`GMNF*iD1H9~wc1PIsjP#-`Cgj24Ljy{PpuUl@ zJH&}yg7SfHg^WXE_Ghg7c0RghEEcKeIpnkptib}i(Nht-)n8#$X ztQ}7ZY>8km!jLW{7|5zl=2*Yt1LZ-5LZUJiQGJO5Gh#ka6#;<;j%sA=6pccZ9(if#$~Pv(I(brvIw@e=i{Z zk;^r1zW<{a^Vu=^-b>(zgH9kM%mUEsr9-njL+PJB?I7j_drS};jiqh~)bcAQ%aLx`_jRammNW z+-g>O7=CTftt2$5epU)rT8WCGKai|AOwieBKgkwWp?{R^a$t8Ali3lq5Y8ID9l$JO zgunIu9;+lvn-oPBXz?h<4xWfHNgNH2`p)XDb~e#Dide} zgh6CG^V$NwWxn-T(H-YYh>ts9>|Cd+JROiA@j?XLeC4OJ-VPi4KNhQ-QXRfTPk>vrFMzU`^`L}L21 zi}%rzqv_VPuiiJ#J-gj|VlRE6Nz*MqF#FN{`GaH1gmqV~x4t!hPMyw5xHEY1wZYhC zN2Y3Zz=N+ZY9iS$Yd4jq-Yolp=wA&31m=3z>W!wgd;j#e6N&{Y!Jkf%vJ_oF&esT^ zg-ObOge-Uzgds^dFWLgQLnr{5i#Mea28GD*O(w}pa!M4)AdVhZ5!WY^yNp`{3NZU$ zN0Uv9+zevL=0UIa>xbgwg8|b98i%GXY#$@>_mPbZGz?yAsE9M039V96HlJJwr}ejx zSrX*0_$9=|6+$m83cUa$?t^cM0M8Ni0c1ERmS8ErB!}A~v399IGk*}Sfv3baeD#{Y zuP>*NV$q^DB{l{XUDp_5u* zJ>7uPo+&+huH~i<_FgdcK7Vy7cFzg>yP8)!luMquiH_WMwSVfj-}S(8Q&l=75;zcf z*S_1S_@Cb1U{A8C9SC0hae%6z5B|XM_sPa^okvZh!fF)sSJGQqz(3 zm&Aud4{f+BpQomubr6=qSk(Wv2JK8l|CFH{?QftbV?GSj-#=#i;UFCV2u;=&8t@uU zWlo+RI7Oj?mRd!kh6!hYWjI%i0<@5F5Mv2oc*s!znjmNd3J#!3GW(E{7!nv$rV(#l zsRl7WVI40olEdq5&3zCb0`Oat?=5~5E;`RJ@(DbA{KV9Dgfb4Jn zlRrX|WkUF=%(PBFRw{ES(3eHq*~n?n&(-1q1(<-y{Bm|wGNptoj6{tkXlg3 z%0GNvHMZD|*!4`lzv@Q3(~oEi3r&T_Jn}&8H}hPc`-r@oscGvD=jQnP0;Tbps*D5MBjze?bVh3ekHAhN8Vfl>G!XBqs|gDHkOzX+|(nj>49A z5Na=&lY_=h>{#Y-V=~dupjCrwLB1RWW|aRhx>*Gl{rZ-mfl|?o(<1&ctkAF|ONy06 zJSl+}HD8ufEhJ^8WZL9lUZxtSz^pKD*b+$|p9*V{cal)G82fC_)uso9*F~~8jA0Cd z9nl!;SEJCcetz?@a%jr+6du$!u4uux98kfAIS?fP079j{f@e`B$d8f^mQ>WoQ_%`d z{HuC{JYRTs_pve?qM0_7-K?rY@o6GNU%Ie3Eu7%8Ik&CW9&$hHP?WMfe;f~(l`+Q( zqpoQcXl!&|cOA6Led}CR(Z0{MJT1)j+l}V1dQZa;CEoQt63XVsz10qY(8!3+TS3Xe z(rZwqKjF}#)r=$1OB z&p<3H-hKvxB<*K!^^Lv*BSU`mI+}*KpZFN&e&>IwU--WmdWG1*&{&ii({}xX5dff; z%#YTf;h&iH{Bm+Av78@N)J2X8p?Z95c}Pw}Hy+l_KRYuHf(vnQbbZ=0?#+nz~jz7wf^ibXGAzD;D) zhOe8B=d6uI`HcR>ANIqK=CLL~suL2t{<8Od3$wi&lwJGVZMar@Kjr zoR!bv>xbX3>kJMUkbUi>ezHhxx<=VW-Sk383e(&=`$G!K> zY|^@VfX9UFe^|4&mW~~h|Ne7kZ)4EzABWG(yQb%i|M71yf_hp*0&iar{HV6(I}l|p z({JQ^o*W2Q8elpiYa}_*zNji`2u}pW(~_g@lO3Wo0csfEycEPS`G%Mi$l{$yAxD#9 z52`|uapA*jR{~??25X8@T)FmxSSU!U+H zp016DDmeP}p~-M>ZGa7^6IT;2d2;>cb{gGPsH$YTO3SU$E~h*~FL44u^Sbc-uXVFM z;ZL7E$XQ$7mvttIIe1#j_r&}`e13yTNz1pp>^fQVFPpmk$#=Dmec4&T+lGoW-#e_b zW&Kbwi=xa^21DTWJM(Ae0y0MCzpkg;G#0yfB{3ml_u;UYF>?^atHy8G?-%8$Yf;a@ zq6xQ>0-^=HUkVaD2gvb9VOUxwGe9 z9zCqLE}2TZU#+IGXZX$g3;XvUa8uXP+NjF+SUG#{&Hvk`{X@L{&+q?WNY_pTB_2ag zd~CR5SikN>7}!PL$2m%1DYnW`9ZAs#%zYOR5o3kPD0UGc6DS469VWY#}@hJ0Z<*OQASV6a&coKLcaNsh(7p9^ndN;_1s z5puva<9VP=KKZ0nheS9JLFn*Ilx^n3vMSMJewX>^^hP{?Xg= z`TdVuYayT$*-xHd+gEQik=HnN>By7S++=N7_PB?nsA;W-qwAo-XSD>>^XB4kw)MT}Zhy~CuG+v(Z$*=YRYV3vNp zs)JXpXFnT|_M0G&086>m6El#08dm+pr<&jjgVV$!p>QWJ41(Lt9z^B?{rL(IfhYyV z2MF_klw3Xz(+gyd_V7MxdnmjQ8}|W&?!njixu*|-}?!E%x1!l&`4^JdenMR zvHnkFuI}oUudfbeWJUjPcc}j}g#PK}00e{AFt?8YF>aqy(!m7)02+^Kt|PbWO}SEO z#JL-OyK*-5Gu|zk^!y;3%2tX2%Lv|ZbJ4PvU7#g6MU2B!>}K$dL}?lz8-A=TPtDAy z*Plis0;l^MxIBu8>qPhxau$7lod19)k>>HJ?SLTO71^_3o8H=ez7MZ2dVdhp8_T09 zcH4CGz5CNN``CU03dN|~)k;9MV)Y3w33i!bda4Y~_^PNqH6qMu1_^{?j1$BFQUG=g z0Sk-=;DV6iWC%_e1kfg_cp0}i10X1XCjcNbXakrqIF`&7s+Ki4&jA>C6-|D~Q@bl^ zu?-n`#%6$8`raI}h`a8)@|!!rRzvYADq6u!GoJ;2dwjg~?Q7oa3epp(d0%gkd%*D?=37JRxp?-=g%-S#n=4qR~+!w&-lZ{5R<4wP|` zQ_PTOJ2D`EQw#|}hAEV;4>8*z>WmWG1WMQW!mNPv=W3kF`hxxtpvnC&7}<9M8IaV# z9t|$@T}Rk)e2qHiTd<^6jRzR*H>jx&1FiX2&;|^Z#sg(`uM%Eq`gc(Vpl0g6HX2;4 zUyDBr%9Svyg$t_)h075RBN!-i9-us)5mE?FnBaulrhsc1V9b6nkdukUkmK2zY9O`| zUjcxAm2CL#%hBrhMHG>6D1bqL#IwPPO|*gR>p%+ljPDx)0|D$W<_xkiXkaA;#xMjj z7-BM@!CcL7fG`{84`M)7aKHYBC!dRb+#D2pX`N!yCug>vsJr~9P}YCdApr5L zJQDj605v|qu)nte(BDvz@)NN2rT2j&G7#h%9T$adc_TIS5+bvd%r}qUMNkz7yNJ_o z;eaXt{tTgNC&6p{IUxbMC9wb^{DH-@qT+~C#8#VDDPoOErPBC*;x6D8a)4^!tpYZn z_mW-UqWr{(%s_H+G#x{oXOPRsv#xX07|&&uiO*??o; zE$2p)L}J3MOIXt%pP!Gq<%LOmg+HxI@PP**ZYjp-*e@A`x(r`?AJOXUE%wOLy;1M$ zng4iNzd99z!`cPk51Z=R9sKv>`Z)FAV_4}%t3SX52?QHG94<+hdbIG`=Lb!EHTwG| zKoEl^40PxU=r#?y1S=z@GUg|hoe7G-RF_tVE+p)TNukp5Gk(sVfv)Dl%ZEPo_k!vempl-BId%U^*)~eCU#pgj^e4!Vr4+WHZAO3v@kG?Nue@y4on8Lkbd(%7f?T6-O zooCxa3q#NSeEwfy%xR2%&H6g^(0z<<0BmyWTcJbg3f zATjU%tn4~%zxg+Q15hB%H|@ruY4EsjJqic`8i?=pM-1>%;6n+I9%}6f&h)9_ zLXYsqYWP|Y8`rxi800sxY81dg^K$Mh23-UwgeyZzDq>o+Fc)`&dU#}$=9G&}&$}99`Zn>I_Tg10Q45#oUC}3m21PnL*50!ADIN^2uijJ` z7<#j1?L@tV*G>8QM5xL+a`)|$S4`vCjSQ951KMQ0nV%t3VVQY}+a^aZ74JjMA64If zasBVVKbHPDwET6nqA7I3LJ=vvF-aSUejs|-=`m80Feq^7Q5jV-e@1J^{T4`t7b5{| zdm0XPgBNCt=}8db9YaC}cM7#0oIh&N$7|o!AfRU>?};S{G;;-VLx3ULJkQ;1xtCr< zJIJ;e-cT47vZeQlnv436b`2%JrEyc(y$}l?4K&W56%k;mwS65nG%5uK@r7Dyz7O=$ z4J4XNGBbe-^bEoXpc2qT61zYQFVna4dEmH5lcQiHgXOA5txv^HlsyruAkActDAT=B zQy(-#+HQQJPlhx@@l9hT8SjkrRBJ>|Gr4_}zL{z&T_3H>ms9PYDt~uyey+9+%DxHy z_DCgM#wGl(51VQDf>-aedw;~0>z2Iz;}&q@QP&CkmcJc4*551shc6@SKRUdB&qLUa z_lKh315pQd4Sm@7Cb9rVQ_19hlAm_Io_@XL6xl4D07v(N0AwU$3PKl00X^6|x$T^S zL95+T#qhI!Fo|bxxWbl2{zq8}wu!^5=~~z@qu4B?psF(zh)=@4(UDaW+hZofX{s(+ z5*n;i^Sy`KaW!ZvS() zK|3DvS=*#GY&&HnPF;ln38*nX^|COhX32!!0n*dWvcDFZ6&thB2v44(E}m>XJAduE z9sOswd+FiThLZ)?p3cpsd*@m_pN;rkl*zyKKF|_zsf-(+aV1vpb8h{hPc9|f2%(2Q z|5APUhl$M1`xCV;zwaDZmTMQCJkWZJm(p;5OV@8ptB1x)!lZ%t4@D@VRJDVU;qGoF*V?dX&&%b)eGFk31l8nuR$_-zG&HjHtkTDRTn)l zKJZ~@M03q?Rt(qbxn?NGTF5^VGqBUuRjl6r5*5U#TnM3WFPIp;B8YadUd#(t{hx0= zIzmgK^gMC2g^h;iwEX3euVkQFww~`7A7AX z6Ekyi>$aolMkc6kOkCPl^Z-JD}mOIZrPG^nhTI6&upJv$f$qAMm zP6fuSvg>WiqbGs~0~}Pu{}jK_9cg;etJ~@k?u}0zx_(}*x#MM^s==bm?1(}N)L_BH zrvI&${_TukdB5}K@*bo|ip0GM=Z!h^S4+1PJSniOYqU_y{@Id(|8;-GG(K;z4BY~5e9;ZQY87?h2ypZ@3@B_d5NJ}!tq&q^UMW;>n%%vt zBgDThFW%3r6%kMK@znQCsP`2{@IK8EhpQf2lhrFkpshHVU@eF+0o(DImdrv{AYgh$ zd9dTroa#39QxTZ*;b1d3XNv0tEwte>{OYO*45UOh&HD6B><`k38r$Xq^#RACMebQq ztw~tm&#GM)n@*x53avCk9+j50_{M)P6ANsMEv7de|I%GQ$Yp63Hrd&M5MU~wK~L$n zfol$y(qn@plnSP}IjW^u?tuoI*UX@e6cJ+fU*lWFGYrH-15jEcldi41&d(R^pIrbdZ zW3zLQ_zrq9FT7tj7n@6s1XovcnRZ6P+rqOEzRHW1ujz!qi$ACnCba=p(vr{jFDutg zKErQY2RclwTs~)LY~ElE%Qjq=-XBr@t~kW;O+$Nqwu^J*-}E1+lnI}V1m#OdJ~*tO z(cjAK|6p#cB6G*tEgJx!bzrYMezoNu0htdE-LWik1 z!5|o7rZsI_6<)P;A7D&6YVqljwD*q9pA*maW>FiHTUSn}^sSe!gRYSfdOy;HxE29_ zmdu^Molt(&jI}p7;_`8t)V(IFazX2u*5I^?uCMtW{3+OlqG;K$t$SV(@k zKIdCY&9eIvkG$h(kLAdRoPFeSYfrG)F9)+st+>`fiN)kccLxLS%m-!bfbM_P51VrF z^eTPm<}CBZ*e8_Sv`>OIp!wm}*VN?S4)5J}PpiNF)i7a{K+g`4X4dhNA!eKKx%80_pzVct3V> z&p`BjAED7VMqq#&j>)L=7w`;>;oCil&cd%Mf#&>(G8l!lTOv_lgYQohplqVUyRD@# zJ;?)wG>B?FF(-lU|t-D zsRDAzt~#GWQwu%IEA0}78)lr7IQ#p{&;M#U=m!dj}HUZ+XY^6 zDo@jTKOft!_6du))|AI|n(mB1(UR(G?v}z@J%VpR(s>7IA5QfjPMdp8w$_fgW%{Kc zR}>!ZHGSXfk5Amu;aEZQlaxDdifWh5HQSNKE|F`!75o6N2T7^9_75OtR)uo^M9!EYtoR;fqKJAl-;|==0RMPpDK)!7_ zKBGKkeTM|jUQWRAK#{uN;BM|w`=WDzZdVGzSlY9o(z`klO#799{rP9(TKb;Yf2%a+ zdZO=LF-VklP%Uv-IVZ(X8$INCJ*=qwv4KaFjjluUf=mt;`BdKKu(*A~L+MWSp=17E zInTnIWDeTPl(XJ{f9CUM0_A&0-vD)KcVhAUWc8)HA0zpse6evE?Mv5hl$Hd06gkAe zu2^(Nf46DO+;jN99EJYX&;3(}Hu^uk5Pc_OWq#k=?4EBXPF|Q>^myV+t32sV9FQ$+ zpTM4i%YSbO>%{OB4co#ol5>FtbBmb|hOW~;V+ z*?z)e9B{PCpPf6wTpHa{&TZ5R=~e1n_H6*s)5YG^Ry2uh9dZs5hp6lYXp#_mgZb(r(N{r#M{22G(>}g zTF=oN5>0yppbUGb08(;Ad!1{Yb6u$NN!OK>yRFBcK5>}s38-s5LZ5N&^D;SK!#nfY z<+K_l`@@ami{*`1@S%bd`xdfpE8b*qY&d#v212mE7r(k(%BUj z4=Aq*Sq@d<0>q>x$x}{NWc|xTb#pgshz9BPV~hS&lZ(9J@OVls6oz^hkEkk^C?z}* z_%cy`6n}vM>;*jrCi_c2{k1_ormVPux}O)mr_E){6ynA-)iWL&(3J#q139U}B$G!$)OXxEf6c|{4w zT63?qpQWgpIQX)acSAeeMcAWOpC3Bz4T(7NEfk$j>$?_rgj<&X@kUp{ z$~|lA&w3@L4$%j0Rs2;MCF3hdq{_h(_IwB0*4KKveTjmYIcER2p27cMD8h4NPApVp z0Da%v_8v2qIGj1@C*=ijBvDXG7V7z+fbk|=Bzp-QPw9?Z$`QwK{e&g6jE#{nT+)C6 zu1&=_c7V4N0xBy5!LobJMZ+qqq8HpfUL^snX%r?4Qr*id%nceZGi}b+4i%Lfr>Lov z1L-}>E->xm#wcITPSy%UO}FIzJ&^^rCBWP=_!QqtFFQE?s%G26GXsj=cRY+V7sUp* zj`f_>t(`?HSLt5~hM}I@3tCa84=g|GlIGDUEtpz39j$b>sZO%2JI)rKc+&E4k->z2 zSHN4k7rI@NDqqlisxdLlkvdn<PW$l7Y+8f-#Ei(0hMt$o^%r`2;;os6R6Y7b z+5SSDG1?-|yCySPtIeb><6_>95;jKpQy1>lWqsQ|LBvtWCyFoIxPQZ6ZC#|CWjaU; zcR#xk?h!ePVCQDsD8A!qaizAP|5916j@Qk|^&rjV1*l@o^5Nj=-_%(XSGCAj^uYkY zJJ`U>)u&hQ5apt8U6>)IQ&MiBShN+4$6OuF^s?MyloZBRpDPvTN=lHbmj1l z7RF=P0KYhvsTz`vqN=_kfN2ppDg8W9l_3DwhD5a*u{+dLWG$jJC=VhII!|eOk^Ul9kh4D}Lvz9e{&5^iWMPAAh4z(9 zbqh$-qJvp~_DhhvPu|=Ov^0Xsw)<9c@YF=VcyWkJUCz~2?Ur|k9u^u)EJPFxduRtt z9vkTI@0X|d)B3$5f3#g!q_n!&mh?Qn_lo{_{VAg@$!=!g!QoOuE?sik#^#K-_p(%e z-s&zDXEz~D4>N|Pxd`Y$@Nd=2CJ=soBhR zYEzFEk6tk^aQRDyXCC?v3RvDl{&W|!Z+z-m@ql&QJlR6)f|I9eVWc-cfDwj3-J6LH z#y|01{V#Zg{~#20KKx5A2ReCVeQuQbi+kaKms!^m44`5IkS#n^DtN1ZL-ePL3~Dx> zU~kFR>61#P%6#i(>q;bBbv?|fuoFPC$V(_z?Sj46vBb;8<^wTx93&Ho4pc{};1GSX zG-xIRUf2P)>vkK4$og~xMC3s*h=5%3&=xDzy~YvZake1aHZ~qbX*7)gR0jR?QLzJ> zz$JA#xT`)*LE@DhB^3M(iHXI??aDIkVyb~KpJD_Bg2B*tnfH|mxNxk)a|w5Cel3Rw z96nSa5t+*A*t3eP3G4RPARkiSliQafR)Bg3wW4nPMbbZ|$+g)o(pb2a=?c)LcC*7W z3KKeA$h zB2KY#5-X-x^&V#5BgyH+`{!%hG2wf8%s)!$xFc%X8ugM#-AnOco-g!XQs!-RZ()2+ zrP3&cYj$u1UV+hOoP-0_)fPL9OY>OUo%lkX>&fdj_7MjZMAezj{)=%5)@AwOD^=8P zAt5Ihq70c&h?~Nw5t_)_KuF;YV0^sBo3woF;0C>lJ>6|TiX9&+6e#c?QjnXd;UZ-9 z`{4|vDP%Dn7#}Ey4}247feHmI@k1zu_=i~nQ^p|N%(6RSRYn<`C`)(>ne4N1*ATiK zFHSDs=Sw=`Ci$K5?);#?J2I_}MWxlIq`mS-dqU^TDuft895-wF+2-V~72OD_|)YlCX;# z%?ZLP;U2XKV+scDjvS!;o%2tetx)L@c(I!u6M`=rhJ~oa(7BePZTXCOrH~JObXB6K zb3U}RJi_j&?a2uzd5pFcefb@XTO9B-@-W6Isv2mW92Qm21U^nd$w(V8uOCry`E8jB z`k2w^QDE~1=n$5fDSoYn#X4^^!yluM{ z$5F`5amB*Gw1JF}qf=@~f@J10p(7$SxzK}|C<3;UH&j;`HY@C9au6A#TJ)hsPh^Nn zs6tOVhHy?A;8H|{?qpGV$W7e$h>-=9!oVV$05xr{wt{{ylIT09OcE(KOEyB|2>{9C z51aLa9$FMO+l_~X6qc}b$S*8p$u<NikRcn};>sP;{hm_Lp= z42%ROqsTftQgaBwLBs7x$pFdSls1-!?k4NcW(dN>SA9Vd|%og_Ab^Zuc|>OjMe^K?vkE6EOFE!LL>5gt5w{N>#+l^ z+5K^KKFx~~E)^iWXZse${^E&;$pwYLgL@r>DL}|;6)i?ylw~|r* z8Q3tCc|{<4r)j&#q2K1d#*sWxt8IRO=nW;PMYQlC!vEoCO+XYv**H5<6DY=sM;^x^ z_5(14eaRy)E6lLHa4}_}d`y`U^-hH(#J1>;O&uo(O{sy9eEU~#|I%4xX|g9JAu1i_ z$H3CzoE|YD_pzdmD!cY-HXTxP65-8Y0Q^TzjAdx|3!`avD$!Cz!eV?0pcqbgMp4l` zL=*~0%s{f_&7XjNfuj_h`qy1$)FY(n@KKPL57eb@|KoT-=lNPPAUDaiiidNk0^@ixrCv;H}b9N8geiJMW&D_VsQC#|Pk+bT}#2>ew zW6na|yO}q9Z9yYLXh0k{Mv<-2c%-_HjHouF1at`B9!N>rUv9<9}YM z{^t_(e?I?%p^uxNW<`T!xJLKofmarB`q==%$ZbF2c1{m~U;Pu1riP?re_TpXO2}>< zm)ZhZVF*fjXLq?{(7fI(BWZ`sEGc~uK(rWF)h7O&Z@P7*Z3<4X9nI`hE20<2W9o&D z5z-MbLl0MFoI8tQmJ^pA0OU*8dsk^ICYp3V!dhT}s9HzdB%9F#)A7>5N~owwG;m_@ zu77|M-q0sb?-gMvt+gx1-)9X8iY%PfQ#mzsz;T&8-$cH{f*^lBI2d%qGPR7g%&B+% zdoQz3cK$~0nnxxn{+=zaamwz)SIcDQ(RdNlGG~9i02`Q{8g=sMj6fE!Ilg{X?Wu=4 z|B9xsn(tSVo4AKNdS>?QI_q6u4E((JURz9oGgD2HgHOVW7Mc9?SDwuww`>_ga zey*t3&Tj3Ls|ECw=@*Yq=FI0UGwpDkcF{yAz3QO*-b8J5Kt%ZmZ2~(<0}}EIDU0^?8A)YEjoIt@~3CG8+`X~bc5Q>z%ChQf8-(N$6d9gW4 z3RbH6U(UF7mp7u+PnP)$pj7WBM6w~r2emLAW@Ov~(~<#fjIX$-J7WeoyOR^u zx<@ksk1^`G4oSaFlfD@t!LH?Y?W9am{P!@?_WtopqmHh|J0!*+v}<>BrB0@e+fR3$ zNcY-UCzy|#^?rFQzKha_wXaIPS>GMeAy~U7Zchm#~+1qL* zx+McslRCQY-hFr(#VeX1Dz|V)1VT;w@kVC+0irpoTIEDV+RB8}^-Xp`ddD8LPDH#r zzsNWEu8W}jX2I_OgFM}1uo_jF-0ZaKDO=Ew{fL<&7Q}v=>pTsv`%GD(W(%>Zmzu@) zfUv5dAxA@wX3$FO9d!`|?HU%x{Ky$Zt`~4hf<-IWa^Z zDPc^Ou;aBnoMVwo3ho8;^dXykUljALe3a5v1Jeu9uRET;zaKIrw>YQ}GM6Zdnp3_S z-Ge|A+xu)shlns78@E~YkbgKCidnJJ0qF}lVmm|$Xw30oGYli#Jyo)9WO~1UqMViz zT~Vy)6vV=*;#neH20TfEIO%8-1|$_-BdCL*U8cME#N>n!gm~h#g=;!PJFr@$8W%@m zX`Mzlc52{o0g_6}#_bd(fsmNbTLZ0DWd)ZvjyWu#u);2jA-{oy@=>sStx~9EMQy#Z zmbzn|Yy}r_Wxp%cqNrJ#)_x>N`UE?hcLQra8#1SdBs2wP)@C2*wT&HoE%K!~vz${s z#143wsA-CvlgXtRK$)Zc?~cR%T(0j)*g1h+VIS4Idn`wDO4(j5jGB*YfOjMb!oV+t zM#S%ZTpUR-75zDQXK`$g6X#ifWZXcOUQOh(?J%NEB%ym!Vw`Fat%go*)#R|2S-Z8m_z`wLWVnT~B%7Lnz zH_=Q83gSsklJXfv5u5-G)IsE{EC!>T9pPsSgY2OyAc1702Sl1Mm>Xxo&XLuhfObuISo2Q((y_WIYZoiA%J7jWYyE^E(Uro08XdI~MD?|ckB{7rduZ3YVEw^E+6-`O ztA1+1U1+!az(6T$qp6Xze;M`GuO`uAjrG6PpZ-&a!gnYI{5uINx1BoFxCEoaL|p(m zj|4{|viq`iU@+(J5~`>{c&n)m@T0H-jX-CUgPlX$0&1|-fcHjBo|g;qxCPLhhU;OO z57EBSlb{VwQ-P|}Fq)DG)G|VXu-M}`;F0u$xH&jm5+n?nAWA8tAExWrNv7EBgWB+Y z-f)nC13(cN8(0O|r3%BytWsScTV*9z_qyVTyd^v6jd0@OBGYql_62F!D`;?S{B1R97 zY}_c%y-y>)YMbuK2SO_xJ5LfHx?R9R-yIkfI;QNX$MAs@;^mLOHA2cay} z2fya8eJ_vb9~qY8Y*;%zx{}+FFcl^{c~V@|%<0Wws3SF9)vlD1Jdk;_*XB?{yu*y- zZzTgfcA6p=(AVXnibUR7-K}Z0C8^q5gi6{8yAy+I2lC6-B2ayP{KPa~YA6`MR!$fz zD4l9FeJz-yj954h!itoHqhlE=0MsinXp<}^Z(u(b2P;a{_XCvWc8eHT(DsmAqEyZt zENbcqE^dv>N;DJDj9|2CD=UvXE7E6A!az;QMvt8~N#pZMnl*l@rrhStT8Wcr*D?-R(Rr4sq$mjj z&(GAS#=~5?AIf6gQdA!#>*lqSb8^i@jSuO{*_l27zp|`-nK5C? zo)K7)gf1Vs!?Cv)%<3WwletABVqT=_yTh7n>koEbXFrs=R7}+RV$0O337#DhdQYM@ z?mIPg4Bt!$B}z;`e&V2dlBKWvAx2!6u_iKpP2~9!$35GS$L_d6=|r{b1c>$@s`)R5 zq5tUR^zM9GpuNLzY4^P?8(#xJ3qTlu(y`xW>~^Z3ot~d2s)^I5nawVw>da>415i@N zxJTTFR++|}2wIaUT9AY!2^gXpX8jtN1}KalYX3fuB`Q%NhA!vVakXr(`dR>lbCfO>wl^fYFd+bpApl`QsX7QU&RW@{E-j8Cfm0I>AlJs@^H`<`QdX_dk` z*atY{k?#jpkr`-u9#?>OdUF0>bLIvRpvUN>EH z$>y%^g!hKrm5c6#p3-zqNx9j9O)wdaX(n05#};}YEkAmz(#UHlMyS=TKKo;3?W+f{ zv6AM~5#^+IxkGm#MU^#MGC?=wl#~)%xMvGbwr1b0(kaA|HOJCkjSr+4eX1Bj!n^}U zQOUF@w1g}&n9;G_h(OAbadyjW?6}P{Ws8`2=kX4UhwUA6qC8b5;I(QKbD_)*;hMT~+w(@|J)qmsTuz9{ zuX}YJJ#*h9rM1qxJU=+y|3w)3Nb+;K>f5@?$?2HKp9<9H&Qx?_3^uc}HxZI6#1)>g zc|{+tRi9uJ2&3BnDL&ch#}PgyB{UZ=+lzN`r)Ki5EKt>9i8h7TW@et7^kvjcU)|-C zMpN1=jd~mcwx?dxhW#Zs;fjXdg09s!$&df4jS5L#7dhp88&_XJ#7rG>&fV|}MQHjc zndWN;n~FY9uMg0YG+0qrbo`%rxqsIoosC(YAUUYleJ|T9ei)c2Gpejl6E)j~Y{2g) z=HF)W(%zymph&!GtPO#(p#sqdDC3fR%OV+UXTnyW7y(HV#j7WX647d{TZ2q z%GNufS45%bZHHOMzw7kg1cN*p{`&1?s2SmH$Fb3Y=A&67gV7yFHythLfS3Z6;3V8j1=oM?2pVlA^N# z3o||63lxTSR%sCwWApA^eZ@Q>D^dv&E2JJgtnAYfC>n8{qGam(MjU3s?H16oo0Yi) z&sK#9t9WYBZK%VBP*##F5UGR*qL~ln+q;Da;e`^Rf`NJ>xEBlpN$R7DiIymcZ+ect zCM1B8=iJuz4nNYC`XRutviO38xSW`Ox9C1Gb%%vE7{!2ErI5wKOqZ?IQqhKo7Uxxz zlhl4(DS*G!F-aGl8O1wMGzm>-5n}C6qHI0hD|A>9WjyXY+LCv% z9Pi9M-cqZ^ti%Dz6%e#*o{m zar|qE0rLZLmREuRIFYk<0QrR|Yh#X@G1PoOA9_x$A3z9b`mIKR^wC80neIj=!RZ7R z9#dW>?{G1Vi&Joo*Re;5lg*~2(JK`nNI9HIs8i2V`%6^0bhTq2j)$315 zk*pgCP8NZ&RAtPxGDFN#6#IJW)AeI&oqWQwOu-PLc<%vBnafa8=qepBkU3Zw^W_n5 z0yS?Tzla0q;NEGi_Hi?920Bb(`es1}aoxil|COh(K|eZ3Ng~41HK7KqCy}dZsGYt@ zuq!D(SaxOA<<#w@!AU=*Hrl9K&x$l6+ivw}^LRtbyL5CRG3E&9ZFh=Ql7Xntn?BC~ zZI8D{AC&6f^T@7lHBxYUTa|s!{7Kpyp`$*>oAVvJPb8qKwzyl|OphCcpGDp|&-hrJ}%&#)R`Sh~kbnr*7m;-YzpPXtbE;$qLE)L|Yx@ z1*hzZh|X(dcz2GRO)%3*JD@XJbMblG4_6VbBA%$*Got}I3?jc_Kz1XILnk9EPSX8L z88GyIMYF?bPz)EtKdqKWU?aqgDm`gxRKzT7Goy#5R>UpD@+Bxu{eh>ci3n}K`9Of~ zvoeH}ZDB5kV&%!Xo)NH$1(bybBAZXzJ0tL2qai?eF%c5@Ssc-5rj!Vi5c~vdsCRh) zm*a&^pArLwOh9I^flQ($`I%vx928)cg9qS1z^9R?(xaoV;)7$xvv)48XQLOU6Cm;B z0W3Kb2`+)MjfhXv$FL%gzt}CpzNQ`$M;bZbkTNBQ0m*JfqUGtP))Fo@=ID@sU%J}L|%(E&g|38<~(_O??_^Ige6DDn656lsE28)|E_cTA8D9b{})rg`L4tAU4P$QVSC4&YP5~)aD_inJjUw$trj0UGV(xN{jOl%_c+fe zVbp!F#YF>D)F79pRkD`z1%;2zn~Xc1=P5-L6J0vrmA$`7X@8B5f4jS(+~U5LRhCa1 z{RoT+qg#?JV-}L?{)gMVe=xKG{4|T)>E%KWcyX@02I&7Xc}Id6q%vzvu2VoOdn0g^ z3gYr%YSY^QPLgVrnmUqB(YHk~0n$?`j-Ro!F1rbN;n@)FF_6H%`qH$C*8ff;o-AlkwZB&)RLB+Zhm`BN# zP`F>$jo*nlh6gchNrk<0AEz{WTGcDCS&ixFJR_U}4_gGA)kgNl<>ImnI9AH|qY>u~ zYroalyV>@h#(c&4|vg*h@UvR+|XE2`t0Nq!`?D7^cHV?gQ+4+)(}T`9 zNH%wN9%gT{IX-CAn9_1BRy6CLe4Xb*DGgSs&0dtsrFe~c<9=G@*|LZDg=>PdqkjvZ zNpKMFaDM|uHg$ovy>G!qHaEtLp1%MoTw-5=RO&)Dh$H6Uv(^=Hl);=AJQ0%wC?Wvc zjf1kvVXG+UR-#RP=yk*{eB?4ww9zHg*8$p`X}PshKumHYZbAowz?)RGCU{<;m}ka?P3}g+nZ3^UA#xW#^6rS5y5)@urnfrnZh$S z6%d{GLs(Afcc7{v5(lXjUaSOFIC-g0Gt~7OX+|*?4GJ-oL9-*84J4Bi(|%kz7(D&q zr1awWiv*AO`NN`qg|n^>fG9%sNGf8VQyuKlwrC{V6bE)YTm=kpfz2=D4*C7ZTYJBKhcrJ; zTRudO`CKMNRY}a=@2w^$mpEtIS8uG9UWAj-MO*5&=NS6zKp+XM>Wi?mwsGtmM`F6m zi+6cU!jrg}(S^N$oBXMBY|-$SA$xT9!z~ZefkE{kE5J<8X<4lrej4Hz@GXWZ$isiq zx|_V{VCzxac$hJ4b(4oBUVIqRP&hZ;hUTRi5BpoTf>Im>ubJ-0#izS0yJhGp(>d8fXqj3K_Dj0B7mg}vyE!v;wMqIGh~rs1hqm_D-GUNLChivmKO5vS#2 zsL51BbjmE>I(QEt0vvJBr>sbyq;;M5B3{k9_GmjQ`dr^sPBb}Qf8FHa;U*8>WHhC8 zB`3%?l`(z!3QpEt!{3+inHtdClUNUy% zd`wtiUDaQDUK&zp%Lx;SUE9CD2`VA6cB8hU1R3Iwb(->XX}IvFb5knb zdFK6?a|8VNxJqYXSO@Lq8^+z)#9O|34Aj7uJB&>+Wx{=0*TfBJDEz%M#F`vEYb*TD zYHWV6wJZe-wkq_DI|p3gWFG%8aBPQr zQv=|~=H}O?IVPTkbqB^^CWfA#mDdxQ8v|t9-1?R9>GwnE5w5^Qgdhv21x2>T`Te7| z>+wH?v5pTu`zlOPZkyh>``}0r9Y2!c`puVwCtA0?;B?oStZHE()q|frwJ$>b+@6+z zas5UHa)Y>g=0D)QZq7(5vYUd1HT4%If}qqP@$msXBIXTSXzue3T)(F{ZRPz_3Gi(U z#JG@gN2qxCpZ=`=%dP!y-!|lV)KBAiT0PAZY}hncd41Pk5j&mizU?9*G!!{6aM{{Zsm0U5XKpNuQ8GaQawIL`pYED zsu(>#*)B=19oI948j$9>dL}-U z=G7bl)62>rtV0--_;j0a$gP7i;v)H^Z130k`cwXa(M`grCTMc`#o|XsTR?*Dw2#WA z>VMuYU27Ll0`^DL2nK}%z}}58o|D7xTrrDT4Pr^ zSdOoR5x^wx*Vdd5R69)qi0QdUuN6Mh_D;co%5?P6bUc|n`%kCnhW#*KM767JI$g4- z6ErQG;DKF?!Q5JQah|$1&&;NLXDz!drI!sBTWFFo;!AlF`u5w@!m^Nv;4(2e(Axr~ z1#7rjcmj{eD2c(bI25=68-16XFg$@)>lxz*^J3%C7<5f(X;LeK})MinWdR?lx9`gKPJam&wujRz3`0$B?ENxAni1+~>EmT+PM$*zY!Q0l-%V08j=1 zkxbo@yEb?`Uge^kKx&dYv4kU&kaUjj^lCe$ z^gF~M!wgWZaDj6E4*K>g^q)Zg4uypN718DlRTCH!s%wY&uq`&=*@V!Lbh60 zb-g@Mj1rsh9*&A3c|0Jbj_)?CrvzgT>xU?V48R?=;?j?L1SlRJF)UC;GHhuf`W|vG z5SMRm)Gy&y$5w!vBkVP?dmp)eT%?nu<=Jqv{c3ymYC-auexj6MishYa5 z9BhC|cNJ1h3sczejD#|%8piEbv$-;JkAt4@ONcnKRN273BE@;d6^i~EV@|r{gG#9&9*-SfnPQBSy@|&RW5lf@iGZ{C<~FN&f#KMmbQoh zX%DsS$oOzmlRTU?t~MvlYuLHviXQO!bu##f#;{Q$tfaG1eB|&>OFOdF_w!KSmDtu0 zc$%P_QcQf#QDn7+l&Z?Dt)0ozWCmV54m?)r_vklTg;PT%x@O_n0=>U`CYLDhi_WnH ziz@g77D%N@foq+GEb|u&eK)CAJ8oX-3 zb(bFlw}qB4z2OKdj8aLd)#nXXIq?v5OZ9VOwpicNcNAH31uRy4L{WfLeCCWDWyXn1 zCuZj2&RjhZCg!X||1vc#1{WbfX~2!Zv0)nXws4t;$oY~E0j+qXWHzu0b6y-kz)PRB z+&@SI&|tL_B4F#wm{}JvLbur9d(YCPwl=|YE(J1ZZ8<0(ijD3@2rErPN@DorS2^G; zBvpAlEALbJEVShkbyxrmY>n$s00$=~v}2`D$T`j#a#i2AE+A!PLDA>IqR7#Nk6i$q zUIWMKWKlAa5eK|iPW1-^l?$!s2ZJFxYUFx}w~?H14obY@*4HpcEn5-lw|TZb-SYjS z`1YP%w@c#fvBizN^IFpkdDUgvXeI44DHH8HJ22dO3Z{z_>A8EQUCZ}-j{x~>J_NI^ z;zO_lp6?R1U<&;fCPENpV3EhrV&2ot-%q8mD)L`7^h5hkqpVyk_cxaU03iPkc&Wi~ z>0{t_aP7-MeqLts(nmhGUpwqOB5j_&&gqo3`uO>Y2^zY$D|*S650yTF#Qi?>_0%0m)ro4ajOXcoT{ z&-iE9h~IG=*Uob9_ySlP{#z4R)6iQZT"); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = client.Embed(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); - Console.WriteLine(result.GetProperty("model").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Client2_Embed_MaximumSetEmbeddings_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = await client.EmbedAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); - Console.WriteLine(result.GetProperty("model").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Client2_Embed_MaximumSetEmbeddings_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - EmbeddingsOptions embeddingsOptions = null; - Response response = client.Embed(embeddingsOptions); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Client2_Embed_MaximumSetEmbeddings_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - EmbeddingsOptions embeddingsOptions = null; - Response response = await client.EmbedAsync(embeddingsOptions); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Client2_Embed_MinimumSetEmbeddings() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = client.Embed(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); - Console.WriteLine(result.GetProperty("model").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Client2_Embed_MinimumSetEmbeddings_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = await client.EmbedAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("embedding").ToString()); - Console.WriteLine(result.GetProperty("data")[0].GetProperty("index").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("prompt_tokens").ToString()); - Console.WriteLine(result.GetProperty("usage").GetProperty("total_tokens").ToString()); - Console.WriteLine(result.GetProperty("model").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Client2_Embed_MinimumSetEmbeddings_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - EmbeddingsOptions embeddingsOptions = null; - Response response = client.Embed(embeddingsOptions); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Client2_Embed_MinimumSetEmbeddings_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - EmbeddingsClient client = new EmbeddingsClient(endpoint, credential); - - EmbeddingsOptions embeddingsOptions = null; - Response response = await client.EmbedAsync(embeddingsOptions); - } - [Test] [Ignore("Only validating compilation of examples")] public void Example_Client2_GetModelInfo_MaximumSetModelInformation() diff --git a/sdk/ai/Azure.AI.Inference/tests/Generated/Samples/Samples_ImageEmbeddingsClient.cs b/sdk/ai/Azure.AI.Inference/tests/Generated/Samples/Samples_ImageEmbeddingsClient.cs new file mode 100644 index 000000000000..7c068f00b89c --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/tests/Generated/Samples/Samples_ImageEmbeddingsClient.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Inference.Samples +{ + public partial class Samples_ImageEmbeddingsClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Client3_GetModelInfo_MaximumSetModelInformation() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = client.GetModelInfo(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("model_name").ToString()); + Console.WriteLine(result.GetProperty("model_type").ToString()); + Console.WriteLine(result.GetProperty("model_provider_name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Client3_GetModelInfo_MaximumSetModelInformation_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = await client.GetModelInfoAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("model_name").ToString()); + Console.WriteLine(result.GetProperty("model_type").ToString()); + Console.WriteLine(result.GetProperty("model_provider_name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Client3_GetModelInfo_MaximumSetModelInformation_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = client.GetModelInfo(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Client3_GetModelInfo_MaximumSetModelInformation_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = await client.GetModelInfoAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Client3_GetModelInfo_MinimumSetModelInformation() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = client.GetModelInfo(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("model_name").ToString()); + Console.WriteLine(result.GetProperty("model_type").ToString()); + Console.WriteLine(result.GetProperty("model_provider_name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Client3_GetModelInfo_MinimumSetModelInformation_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = await client.GetModelInfoAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("model_name").ToString()); + Console.WriteLine(result.GetProperty("model_type").ToString()); + Console.WriteLine(result.GetProperty("model_provider_name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Client3_GetModelInfo_MinimumSetModelInformation_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = client.GetModelInfo(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Client3_GetModelInfo_MinimumSetModelInformation_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ImageEmbeddingsClient client = new ImageEmbeddingsClient(endpoint, credential); + + Response response = await client.GetModelInfoAsync(); + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/tests/ImageEmbeddingClientTests.cs b/sdk/ai/Azure.AI.Inference/tests/ImageEmbeddingClientTests.cs new file mode 100644 index 000000000000..1ebe9ed7ba28 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/tests/ImageEmbeddingClientTests.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; +using Azure.Core; + +namespace Azure.AI.Inference.Tests +{ + public class ImageEmbeddingClientTests : RecordedTestBase + { + public ImageEmbeddingClientTests(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task TestEmbed() + { + if (Mode == RecordedTestMode.Playback) + { + Assert.Inconclusive("Unable to run test with file path in playback mode."); + } + + var cohereEmbeddingEndpoint = new Uri(TestEnvironment.CohereEmbeddingEndpoint); + var cohereEmbeddingCredential = new AzureKeyCredential(TestEnvironment.CohereEmbeddingApiKey); + + var client = CreateClient(cohereEmbeddingEndpoint, cohereEmbeddingCredential, new AzureAIInferenceClientOptions()); + + List input = new List + { + ImageEmbeddingInput.Load(TestEnvironment.TestImagePngInputPath, "png"), + }; + + var requestOptions = new ImageEmbeddingsOptions(input); + + Response response = await client.EmbedAsync(requestOptions); + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + Assert.That(response.Value.Id, Is.Not.Null.Or.Empty); + Assert.AreEqual(response.Value.Data.Count, input.Count); + for (int i = 0; i < input.Count; i++) + { + Assert.AreEqual(response.Value.Data[i].Index, i); + Assert.That(response.Value.Data[i].Embedding, Is.Not.Null.Or.Empty); + var embedding = response.Value.Data[i].Embedding.ToObjectFromJson>(); + Assert.That(embedding.Count, Is.GreaterThan(0)); + } + } + + [RecordedTest] + public async Task TestEmbedWithBase64() + { + if (Mode == RecordedTestMode.Playback) + { + Assert.Inconclusive("Unable to run test with file path in playback mode."); + } + + var cohereEmbeddingEndpoint = new Uri(TestEnvironment.CohereEmbeddingEndpoint); + var cohereEmbeddingCredential = new AzureKeyCredential(TestEnvironment.CohereEmbeddingApiKey); + + var client = CreateClient(cohereEmbeddingEndpoint, cohereEmbeddingCredential, new AzureAIInferenceClientOptions()); + + List input = new List + { + ImageEmbeddingInput.Load(TestEnvironment.TestImagePngInputPath, "png"), + }; + + var requestOptions = new ImageEmbeddingsOptions(input) + { + EncodingFormat = EmbeddingEncodingFormat.Base64, + }; + + var response = await client.EmbedAsync(requestOptions); + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + Assert.That(response.Value.Id, Is.Not.Null.Or.Empty); + Assert.AreEqual(response.Value.Data.Count, input.Count); + for (int i = 0; i < input.Count; i++) + { + Assert.AreEqual(response.Value.Data[i].Index, i); + Assert.That(response.Value.Data[i].Embedding, Is.Not.Null.Or.Empty); + var stringEmbedding = response.Value.Data[i].Embedding.ToObjectFromJson(); + Assert.That(stringEmbedding, Is.Not.Null.Or.Empty); + } + Assert.That(response.Value.Usage.PromptTokens, Is.GreaterThan(0)); + Assert.That(response.Value.Usage.TotalTokens, Is.GreaterThan(0)); + } + + #region Helpers + private ImageEmbeddingsClient CreateClient(Uri endpoint, AzureKeyCredential credential, AzureAIInferenceClientOptions clientOptions) + { + return InstrumentClient(new ImageEmbeddingsClient(endpoint, credential, InstrumentClientOptions(clientOptions))); + } + + private ImageEmbeddingsClient CreateClient(Uri endpoint, TokenCredential credential, AzureAIInferenceClientOptions clientOptions) + { + return InstrumentClient(new ImageEmbeddingsClient(endpoint, credential, InstrumentClientOptions(clientOptions))); + } + #endregion + } +} diff --git a/sdk/ai/Azure.AI.Inference/tests/InferenceClientTestEnvironment.cs b/sdk/ai/Azure.AI.Inference/tests/InferenceClientTestEnvironment.cs index 916ba01e1730..b5518c9f4b76 100644 --- a/sdk/ai/Azure.AI.Inference/tests/InferenceClientTestEnvironment.cs +++ b/sdk/ai/Azure.AI.Inference/tests/InferenceClientTestEnvironment.cs @@ -17,7 +17,12 @@ public class InferenceClientTestEnvironment : TestEnvironment public string AoaiKey => GetRecordedVariable("AOAI_CHAT_COMPLETIONS_KEY", options => options.IsSecret()); public string AoaiEmbeddingsEndpoint => GetRecordedVariable("AOAI_EMBEDDINGS_ENDPOINT"); public string AoaiEmbeddingsKey => GetRecordedVariable("AOAI_EMBEDDINGS_KEY", options => options.IsSecret()); - public string TestImageJpgInputPath => GetRecordedVariable("AZUREAI_TEST_IMAGE_JPG_INPUT_PATH"); + public string TestImagePngInputPath => GetRecordedVariable("AZUREAI_TEST_IMAGE_PNG_INPUT_PATH"); + public string AoaiAudioEndpoint => GetRecordedVariable("AOAI_AUDIO_ENDPOINT"); + public string AoaiAudioKey => GetRecordedVariable("AOAI_AUDIO_KEY", options => options.IsSecret()); + public string PhiAudioEndpoint => GetRecordedVariable("PHI_AUDIO_ENDPOINT"); + public string PhiAudioKey => GetRecordedVariable("PHI_AUDIO_KEY", options => options.IsSecret()); + public string TestAudioMp3InputPath => GetRecordedVariable("AZUREAI_TEST_AUDIO_MP3_INPUT_PATH"); // Add other client paramters here as above. } } diff --git a/sdk/ai/Azure.AI.Inference/tests/Samples/Sample11_ImageEmbeddings.cs b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample11_ImageEmbeddings.cs new file mode 100644 index 000000000000..94dfddcf2a14 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample11_ImageEmbeddings.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using System; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Inference.Tests.Samples +{ + public class Sample11_ImageEmbeddings : SamplesBase + { + [Test] + [SyncOnly] + public void BasicEmbedding() + { + #region Snippet:Azure_AI_Inference_BasicImageEmbedding +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_KEY")); +#else + var endpoint = new Uri(TestEnvironment.CohereEmbeddingEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.CohereEmbeddingApiKey); +#endif + + var client = new ImageEmbeddingsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + List input = new List + { +#if SNIPPET + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +#else + ImageEmbeddingInput.Load(TestEnvironment.TestImagePngInputPath, "png"), +#endif + }; + + var requestOptions = new ImageEmbeddingsOptions(input); + + Response response = client.Embed(requestOptions); + foreach (EmbeddingItem item in response.Value.Data) + { + List embedding = item.Embedding.ToObjectFromJson>(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{string.Join(", ", embedding)}>"); + } +#endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + Assert.That(response.Value.Id, Is.Not.Null.Or.Empty); + Assert.AreEqual(response.Value.Data.Count, input.Count); + for (int i = 0; i < input.Count; i++) + { + Assert.AreEqual(response.Value.Data[i].Index, i); + Assert.That(response.Value.Data[i].Embedding, Is.Not.Null.Or.Empty); + var embedding = response.Value.Data[i].Embedding.ToObjectFromJson>(); + Assert.That(embedding.Count, Is.GreaterThan(0)); + } + } + + [Test] + [AsyncOnly] + public async Task BasicImageEmbeddingAsync() + { + #region Snippet:Azure_AI_Inference_BasicImageEmbeddingAsync +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_KEY")); +#else + var endpoint = new Uri(TestEnvironment.CohereEmbeddingEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.CohereEmbeddingApiKey); +#endif + + var client = new ImageEmbeddingsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + List input = new List + { +#if SNIPPET + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +#else + ImageEmbeddingInput.Load(TestEnvironment.TestImagePngInputPath, "png"), +#endif + }; + + var requestOptions = new ImageEmbeddingsOptions(input); + + Response response = await client.EmbedAsync(requestOptions); + foreach (EmbeddingItem item in response.Value.Data) + { + List embedding = item.Embedding.ToObjectFromJson>(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{string.Join(", ", embedding)}>"); + } + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + Assert.That(response.Value.Id, Is.Not.Null.Or.Empty); + Assert.AreEqual(response.Value.Data.Count, input.Count); + for (int i = 0; i < input.Count; i++) + { + Assert.AreEqual(response.Value.Data[i].Index, i); + Assert.That(response.Value.Data[i].Embedding, Is.Not.Null.Or.Empty); + var embedding = response.Value.Data[i].Embedding.ToObjectFromJson>(); + Assert.That(embedding.Count, Is.GreaterThan(0)); + } + } + + [Test] + [SyncOnly] + public void BasicEmbeddingBase64() + { +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_IMAGE_EMBEDDINGS_KEY")); +#else + var endpoint = new Uri(TestEnvironment.CohereEmbeddingEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.CohereEmbeddingApiKey); +#endif + + var client = new ImageEmbeddingsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + #region Snippet:Azure_AI_Inference_Base64ImageEmbedding + List input = new List + { +#if SNIPPET + ImageEmbeddingInput.Load(imageFilePath:"sampleImage.png", imageFormat:"png") +#else + ImageEmbeddingInput.Load(TestEnvironment.TestImagePngInputPath, "png"), +#endif + }; + + var requestOptions = new ImageEmbeddingsOptions(input) + { + EncodingFormat = EmbeddingEncodingFormat.Base64, + }; + + Response response = client.Embed(requestOptions); + foreach (EmbeddingItem item in response.Value.Data) + { + string embedding = item.Embedding.ToObjectFromJson(); + Console.WriteLine($"Index: {item.Index}, Embedding: <{embedding}>"); + } + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + Assert.That(response.Value.Id, Is.Not.Null.Or.Empty); + Assert.AreEqual(response.Value.Data.Count, input.Count); + for (int i = 0; i < input.Count; i++) + { + Assert.AreEqual(response.Value.Data[i].Index, i); + Assert.That(response.Value.Data[i].Embedding, Is.Not.Null.Or.Empty); + var embedding = response.Value.Data[i].Embedding.ToObjectFromJson(); + Assert.That(embedding, Is.Not.Null.Or.Empty); + } + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/tests/Samples/Sample12_ChatCompletionsWithAudioInput.cs b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample12_ChatCompletionsWithAudioInput.cs new file mode 100644 index 000000000000..d8d63bc4632f --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample12_ChatCompletionsWithAudioInput.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Inference.Tests.Samples +{ + internal class Sample12_ChatCompletionsWithAudioInput : SamplesBase + { + [Test] + [SyncOnly] + public void AudioUrlInput() + { + #region Snippet:Azure_AI_Inference_AudioUrlInput +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); +#else + var endpoint = new Uri(TestEnvironment.PhiAudioEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.PhiAudioKey); +#endif + + var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + var requestOptions = new ChatCompletionsOptions() + { + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Translate this audio for me"), + new ChatMessageAudioContentItem(new Uri("https://example.com/audio.mp3"))), + }, + }; + + Response response = client.Complete(requestOptions); + System.Console.WriteLine(response.Value.Content); + + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + } + + [Test] + [AsyncOnly] + public async Task AudioUrlInputAsync() + { + var endpoint = new Uri(TestEnvironment.PhiAudioEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.PhiAudioKey); + + var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + var requestOptions = new ChatCompletionsOptions() + { + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Translate this audio for me"), + new ChatMessageAudioContentItem(new Uri("https://example.com/audio.mp3"))), + }, + }; + + #region Snippet:Azure_AI_Inference_AudioInputAsync + + Response response = await client.CompleteAsync(requestOptions); + System.Console.WriteLine(response.Value.Content); + + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + } + + [Test] + [SyncOnly] + public void AudioDataInput() + { + #region Snippet:Azure_AI_Inference_AudioDataFileInput +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); + + ChatMessageAudioContentItem audioContentItem = new ChatMessageAudioContentItem("sample_audio.mp3", AudioContentFormat.Mp3); +#else + var endpoint = new Uri(TestEnvironment.AoaiAudioEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.AoaiAudioKey); + + ChatMessageAudioContentItem audioContentItem = new ChatMessageAudioContentItem(TestEnvironment.TestAudioMp3InputPath, AudioContentFormat.Mp3); +#endif + + var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); + + var requestOptions = new ChatCompletionsOptions() + { + Messages = + { + new ChatRequestSystemMessage("You are a helpful assistant that helps provide translations."), + new ChatRequestUserMessage( + new ChatMessageTextContentItem("Translate this audio for me"), + new ChatMessageAudioContentItem(new Uri("https://example.com/audio.mp3"))), + }, + }; + + Response response = client.Complete(requestOptions); + System.Console.WriteLine(response.Value.Content); + + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/tests/Samples/Sample13_ChatCompletionsWithStructuredOutput.cs b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample13_ChatCompletionsWithStructuredOutput.cs new file mode 100644 index 000000000000..46bbd4d85713 --- /dev/null +++ b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample13_ChatCompletionsWithStructuredOutput.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using System.Xml.Linq; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Azure.AI.Inference.Tests.Samples +{ + public class Sample13_ChatCompletionsWithStructuredOutput : SamplesBase + { + [Test] + [SyncOnly] + public void SampleStructuredOutput() + { + #region Snippet:Azure_AI_Inference_SampleStructuredOutput +#if SNIPPET + var endpoint = new Uri(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_ENDPOINT")); + var credential = new AzureKeyCredential(System.Environment.GetEnvironmentVariable("AZURE_AI_CHAT_KEY")); + + var client = new ChatCompletionsClient(endpoint, credential, new AzureAIInferenceClientOptions()); +#else + var endpoint = new Uri(TestEnvironment.AoaiEndpoint); + var credential = new AzureKeyCredential(TestEnvironment.AoaiKey); + + AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions(); + OverrideApiVersionPolicy overrideApiVersionPolicy = new OverrideApiVersionPolicy("2024-08-01-preview"); + clientOptions.AddPolicy(overrideApiVersionPolicy, HttpPipelinePosition.PerCall); + var client = new ChatCompletionsClient(endpoint, credential, clientOptions); +#endif + + var messages = new List() + { + new ChatRequestSystemMessage("You are a helpful assistant."), + new ChatRequestUserMessage("Please give me directions and ingredients to bake a chocolate cake."), + }; + + var requestOptions = new ChatCompletionsOptions(messages); + + Dictionary jsonSchema = new Dictionary + { + { "type", BinaryData.FromString("\"object\"") }, + { "properties", BinaryData.FromString(""" + { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ingredients": { + "type": "array", + "items": { + "type": "string" + } + }, + "directions": { + "type": "string" + } + } + } + }, + "prep_time": { + "type": "string" + }, + "bake_time": { + "type": "string" + } + } + """) }, + { "required", BinaryData.FromString("[\"ingredients\", \"steps\", \"bake_time\"]") }, + { "additionalProperties", BinaryData.FromString("false") } + }; + + requestOptions.ResponseFormat = ChatCompletionsResponseFormat.CreateJsonFormat("cakeBakingDirections", jsonSchema); + + Response response = client.Complete(requestOptions); + #endregion + + Assert.That(response, Is.Not.Null); + Assert.That(response.Value, Is.InstanceOf()); + ChatCompletions result = response.Value; + Assert.That(result.Id, Is.Not.Null.Or.Empty); + Assert.That(result.Created, Is.Not.Null.Or.Empty); + Assert.That(result.FinishReason, Is.EqualTo(CompletionsFinishReason.Stopped)); + Assert.That(result.Role, Is.EqualTo(ChatRole.Assistant)); + Assert.That(result.Content, Is.Not.Null.Or.Empty); + + #region Snippet:Azure_AI_Inference_SampleStructuredOutputParseJson + using JsonDocument structuredJson = JsonDocument.Parse(result.Content); + structuredJson.RootElement.TryGetProperty("ingredients", out var ingredients); + structuredJson.RootElement.TryGetProperty("steps", out var steps); + structuredJson.RootElement.TryGetProperty("bake_time", out var bakeTime); + #endregion + + Assert.AreEqual(ingredients.ValueKind, JsonValueKind.Array); + Assert.AreEqual(steps.ValueKind, JsonValueKind.Array); + foreach (JsonElement stepElement in steps.EnumerateArray()) + { + stepElement.TryGetProperty("ingredients", out var stepIngredients); + stepElement.TryGetProperty("directions", out var stepDirections); + Assert.AreEqual(stepIngredients.ValueKind, JsonValueKind.Array); + Assert.AreEqual(stepDirections.ValueKind, JsonValueKind.String); + } + Assert.AreEqual(bakeTime.ValueKind, JsonValueKind.String); + + #region Snippet:Azure_AI_Inference_SampleStructuredOutputPrintOutput + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + Console.WriteLine($"Ingredients: {System.Text.Json.JsonSerializer.Serialize(ingredients, options)}"); + Console.WriteLine($"Steps: {System.Text.Json.JsonSerializer.Serialize(steps, options)}"); + Console.WriteLine($"Bake time: {System.Text.Json.JsonSerializer.Serialize(bakeTime, options)}"); + #endregion + } + + private class OverrideApiVersionPolicy : HttpPipelinePolicy + { + private string ApiVersion { get; } + + public OverrideApiVersionPolicy(string apiVersion) + { + ApiVersion = apiVersion; + } + + public override void Process(HttpMessage message, ReadOnlyMemory pipeline) + { + message.Request.Uri.Query = $"?api-version={ApiVersion}"; + ProcessNext(message, pipeline); + } + + public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) + { + message.Request.Uri.Query = $"?api-version={ApiVersion}"; + var task = ProcessNextAsync(message, pipeline); + + return task; + } + } + } +} diff --git a/sdk/ai/Azure.AI.Inference/tests/Samples/Sample5_ChatCompletionsWithImages.cs b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample5_ChatCompletionsWithImages.cs index 027b052e99c3..eb840da5842b 100644 --- a/sdk/ai/Azure.AI.Inference/tests/Samples/Sample5_ChatCompletionsWithImages.cs +++ b/sdk/ai/Azure.AI.Inference/tests/Samples/Sample5_ChatCompletionsWithImages.cs @@ -153,7 +153,7 @@ public void ChatCompletionsWithImageStreamScenario() ChatMessageImageDetailLevel.Low ); #else - Stream imageStream = File.OpenRead(TestEnvironment.TestImageJpgInputPath); + Stream imageStream = File.OpenRead(TestEnvironment.TestImagePngInputPath); ChatMessageImageContentItem imageContentItem = new ChatMessageImageContentItem( @@ -212,8 +212,8 @@ public void ChatCompletionsWithImagePathScenario() #else ChatMessageImageContentItem imageContentItem = new ChatMessageImageContentItem( - TestEnvironment.TestImageJpgInputPath, - "image/jpg", + TestEnvironment.TestImagePngInputPath, + "image/png", ChatMessageImageDetailLevel.Low ); #endif diff --git a/sdk/ai/Azure.AI.Inference/tests/StreamingRecordingResponseTest.cs b/sdk/ai/Azure.AI.Inference/tests/StreamingRecordingResponseTest.cs index 2439032dd357..aa2f66d46b5c 100644 --- a/sdk/ai/Azure.AI.Inference/tests/StreamingRecordingResponseTest.cs +++ b/sdk/ai/Azure.AI.Inference/tests/StreamingRecordingResponseTest.cs @@ -50,12 +50,12 @@ public void TestSeveralChunks( id: "4", model: "gpt-100o", created: DateTimeOffset.Now, + choices: new List(), usage: new CompletionsUsage( totalTokens: 10, completionTokens: 7, promptTokens: 3 - ), - choices: new List() + ) )); } diff --git a/sdk/ai/Azure.AI.Inference/tests/Utilities/ValidatingActivityListener.cs b/sdk/ai/Azure.AI.Inference/tests/Utilities/ValidatingActivityListener.cs index 53f94c51fc5e..b0f94f399413 100644 --- a/sdk/ai/Azure.AI.Inference/tests/Utilities/ValidatingActivityListener.cs +++ b/sdk/ai/Azure.AI.Inference/tests/Utilities/ValidatingActivityListener.cs @@ -93,6 +93,7 @@ public void ValidateResponse(RecordedResponse response, string errorType, string ValidateTag(activity, GenAiResponseFinishReasonsKey, response.FinishReasons); ValidateIntTag(activity, GenAiUsageOutputTokensKey, response.CompletionTokens); ValidateIntTag(activity, GenAiUsageInputTokensKey, response.PromptTokens); + ValidateTag(activity, AzNamespaceKey, AzureRpNamespaceValue); HashSet expectedChoices = new HashSet(response.Choices.Select(c => JsonSerializer.Serialize(c, options: s_jsonOptions))); for (int i = 0; i < actualChoices.Count; i++) diff --git a/sdk/ai/Azure.AI.Inference/tsp-location.yaml b/sdk/ai/Azure.AI.Inference/tsp-location.yaml index a65691285852..4ddcd7950ab7 100644 --- a/sdk/ai/Azure.AI.Inference/tsp-location.yaml +++ b/sdk/ai/Azure.AI.Inference/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/ai/ModelClient repo: trangevi/azure-rest-api-specs -commit: aa97e50e44d2c620c92e5a4c791bb387a741d64c +commit: 41bbb0705062205769a3360373705880ee98b6a5 diff --git a/sdk/ai/Azure.AI.Projects/CHANGELOG.md b/sdk/ai/Azure.AI.Projects/CHANGELOG.md index d761aabbbd3d..ee811c47c6e0 100644 --- a/sdk/ai/Azure.AI.Projects/CHANGELOG.md +++ b/sdk/ai/Azure.AI.Projects/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.4 (Unreleased) ### Features Added @@ -8,8 +8,18 @@ ### Bugs Fixed +* Fixed deserialization failure for AzureBlobStorage connection [issue](https://github.com/Azure/azure-sdk-for-net/issues/47874) + ### Other Changes +## 1.0.0-beta.3 (2025-01-22) + +### Bugs Fixed + +* Fixed the bug preventing addition of a single Azure blob URI to the VectorStore. +* Fixed deserialization of Run Step when the file search is used [issue](https://github.com/Azure/azure-sdk-for-net/issues/47836). +* Fixed the issue preventing using streaming with function tools [issue](https://github.com/Azure/azure-sdk-for-net/issues/47797). + ## 1.0.0-beta.2 (2024-12-13) ### Features Added diff --git a/sdk/ai/Azure.AI.Projects/README.md b/sdk/ai/Azure.AI.Projects/README.md index 01e4c932cc1a..6a59b5b793f1 100644 --- a/sdk/ai/Azure.AI.Projects/README.md +++ b/sdk/ai/Azure.AI.Projects/README.md @@ -541,7 +541,7 @@ await foreach (StreamingUpdate streamingUpdate in client.CreateRunStreamingAsync #### Azure function call -We also can use Azure Function from inside the agent. In the example below we are calling function "foo", which responds "Bar". In this example we create `AzureFunctionToolDefinition` object, with the function name, description, input and output queues, followed by function parameters. +We also can use Azure Function from inside the agent. In the example below we are calling function "foo", which responds "Bar". In this example we create `AzureFunctionToolDefinition` object, with the function name, description, input and output queues, followed by function parameters. See below for the instructions on function deployment. ```C# Snippet:AzureFunctionsDefineFunctionTools AzureFunctionToolDefinition azureFnTool = new( name: "foo", @@ -616,6 +616,107 @@ while (runResponse.Value.Status == RunStatus.Queued || runResponse.Value.Status == RunStatus.RequiresAction); ``` +To make a function call we need to create and deploy the Azure function. In the code snippet below, we have an example of function on C# which can be used by the code above. + +```C# +namespace FunctionProj +{ + public class Response + { + public required string Value { get; set; } + public required string CorrelationId { get; set; } + } + + public class Arguments + { + public required string OutputQueueUri { get; set; } + public required string CorrelationId { get; set; } + } + + public class Foo + { + private readonly ILogger _logger; + + public Foo(ILogger logger) + { + _logger = logger; + } + + [Function("Foo")] + public void Run([QueueTrigger("azure-function-foo-input")] Arguments input, FunctionContext executionContext) + { + var logger = executionContext.GetLogger("Foo"); + logger.LogInformation("C# Queue function processed a request."); + + // We have to provide the Managed identity for function resource + // and allow this identity a Queue Data Contributor role on the storage account. + var cred = new DefaultAzureCredential(); + var queueClient = new QueueClient(new Uri(input.OutputQueueUri), cred, + new QueueClientOptions { MessageEncoding = QueueMessageEncoding.Base64 }); + + var response = new Response + { + Value = "Bar", + // Important! Correlation ID must match the input correlation ID. + CorrelationId = input.CorrelationId + }; + + var jsonResponse = JsonSerializer.Serialize(response); + queueClient.SendMessage(jsonResponse); + } + } +} +``` + +In this code we define function input and output class: `Arguments` and `Response` respectively. These two data classes will be serialized in JSON. It is important that these both contain field `CorrelationId`, which is the same between input and output. + +In our example the function will be stored in the storage account, created with the AI hub. For that we need to allow key access to that storage. In Azure portal go to Storage account > Settings > Configuration and set "Allow storage account key access" to Enabled. If it is not done, the error will be displayed "The remote server returned an error: (403) Forbidden." To create the function resource that will host our function, install azure-cli python package and run the next command: + +```shell +pip install -U azure-cli +az login +az functionapp create --resource-group your-resource-group --consumption-plan-location region --runtime dotnet-isolated --functions-version 4 --name function_name --storage-account storage_account_already_present_in_resource_group --app-insights existing_or_new_application_insights_name +``` + +This function writes data to the output queue and hence needs to be authenticated to Azure, so we will need to assign the function system identity and provide it `Storage Queue Data Contributor`. To do that in Azure portal select the function, located in `your-resource-group` resource group and in Settings>Identity, switch it on and click Save. After that assign the `Storage Queue Data Contributor` permission on storage account used by our function (`storage_account_already_present_in_resource_group` in the script above) for just assigned System Managed identity. + +Now we will create the function itself. Install [.NET](https://dotnet.microsoft.com/download) and [Core Tools](https://go.microsoft.com/fwlink/?linkid=2174087) and create the function project using next commands. +``` +func init FunctionProj --worker-runtime dotnet-isolated --target-framework net8.0 +cd FunctionProj +func new --name foo --template "HTTP trigger" --authlevel "anonymous" +dotnet add package Azure.Identity +dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues --prerelease +``` + +**Note:** There is a "Azure Queue Storage trigger", however the attempt to use it results in error for now. +We have created a project, containing HTTP-triggered azure function with the logic in `Foo.cs` file. As far as we need to trigger Azure function by a new message in the queue, we will replace the content of a Foo.cs by the C# sample code above. +To deploy the function run the command from dotnet project folder: + +``` +func azure functionapp publish function_name +``` + +In the `storage_account_already_present_in_resource_group` select the `Queue service` and create two queues: `azure-function-foo-input` and `azure-function-tool-output`. Note that the same queues are used in our sample. To check that the function is working, place the next message into the `azure-function-foo-input` and replace `storage_account_already_present_in_resource_group` by the actual resource group name, or just copy the output queue address. +```json +{ + "OutputQueueUri": "https://storage_account_already_present_in_resource_group.queue.core.windows.net/azure-function-tool-output", + "CorrelationId": "42" +} +``` + +Next, we will monitor the output queue or the message. You should receive the next message. +```json +{ + "Value": "Bar", + "CorrelationId": "42" +} +``` +Please note that the input `CorrelationId` is the same as output. +*Hint:* Place multiple messages to input queue and keep second internet browser window with the output queue open and hit the refresh button on the portal user interface, so that you will not miss the message. If the message instead went to `azure-function-foo-input-poison` queue, the function completed with error, please check your setup. +After we have tested the function and made sure it works, please make sure that the Azure AI Project have the next roles for the storage account: `Storage Account Contributor`, `Storage Blob Data Contributor`, `Storage File Data Privileged Contributor`, `Storage Queue Data Contributor` and `Storage Table Data Contributor`. Now the function is ready to be used by the agent. + + #### Create Agent With OpenAPI OpenAPI specifications describe REST operations against a specific endpoint. Agents SDK can read an OpenAPI spec, create a function from it, and call that function against the REST endpoint without additional client-side execution. @@ -708,5 +809,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/ai/Azure.AI.Projects/README.png) diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs index 62347572ad06..a0f794d2d9c0 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs @@ -218,9 +218,9 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateVectorStoreAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateVectorStoreAsync(System.Collections.Generic.IEnumerable fileIds = null, string name = null, Azure.AI.Projects.VectorStoreConfiguration storeConfiguration = null, Azure.AI.Projects.VectorStoreExpirationPolicy expiresAfter = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, Azure.AI.Projects.VectorStoreDataSource dataSource = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateVectorStoreFileAsync(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, Azure.AI.Projects.VectorStoreDataSource dataSource = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStoreFileBatch(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateVectorStoreFileBatch(string vectorStoreId, System.Collections.Generic.IEnumerable fileIds = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateVectorStoreFileBatchAsync(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -494,6 +494,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.FileSearchToolCallContent FileSearchToolCallContent(Azure.AI.Projects.FileSearchToolCallContentType type = default(Azure.AI.Projects.FileSearchToolCallContentType), string text = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } + public static Azure.AI.Projects.InternalConnectionPropertiesNoAuth InternalConnectionPropertiesNoAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -559,7 +560,7 @@ public static partial class AIProjectsModelFactory } public partial class ApplicationInsightsConfiguration : Azure.AI.Projects.InputData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ApplicationInsightsConfiguration(string resourceId, string query, string serviceName) { } + public ApplicationInsightsConfiguration(string resourceId, string query) { } public string ConnectionString { get { throw null; } set { } } public string Query { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } @@ -576,6 +577,7 @@ public enum AuthenticationType ApiKey = 0, EntraId = 1, SAS = 2, + None = 3, } public partial class AzureAISearchResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1136,6 +1138,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InternalConnectionPropertiesNoAuth : Azure.AI.Projects.ConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InternalConnectionPropertiesNoAuth() : base (default(Azure.AI.Projects.ConnectionType), default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.InternalConnectionPropertiesNoAuth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.InternalConnectionPropertiesNoAuth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ListConnectionsResponse : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ListConnectionsResponse() { } diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs index 62347572ad06..a0f794d2d9c0 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs @@ -218,9 +218,9 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateVectorStoreAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateVectorStoreAsync(System.Collections.Generic.IEnumerable fileIds = null, string name = null, Azure.AI.Projects.VectorStoreConfiguration storeConfiguration = null, Azure.AI.Projects.VectorStoreExpirationPolicy expiresAfter = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, Azure.AI.Projects.VectorStoreDataSource dataSource = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateVectorStoreFileAsync(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, Azure.AI.Projects.VectorStoreDataSource dataSource = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStoreFileBatch(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateVectorStoreFileBatch(string vectorStoreId, System.Collections.Generic.IEnumerable fileIds = null, System.Collections.Generic.IEnumerable dataSources = null, Azure.AI.Projects.VectorStoreChunkingStrategyRequest chunkingStrategy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateVectorStoreFileBatchAsync(string vectorStoreId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -494,6 +494,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.FileSearchToolCallContent FileSearchToolCallContent(Azure.AI.Projects.FileSearchToolCallContentType type = default(Azure.AI.Projects.FileSearchToolCallContentType), string text = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } + public static Azure.AI.Projects.InternalConnectionPropertiesNoAuth InternalConnectionPropertiesNoAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -559,7 +560,7 @@ public static partial class AIProjectsModelFactory } public partial class ApplicationInsightsConfiguration : Azure.AI.Projects.InputData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ApplicationInsightsConfiguration(string resourceId, string query, string serviceName) { } + public ApplicationInsightsConfiguration(string resourceId, string query) { } public string ConnectionString { get { throw null; } set { } } public string Query { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } @@ -576,6 +577,7 @@ public enum AuthenticationType ApiKey = 0, EntraId = 1, SAS = 2, + None = 3, } public partial class AzureAISearchResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1136,6 +1138,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InternalConnectionPropertiesNoAuth : Azure.AI.Projects.ConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InternalConnectionPropertiesNoAuth() : base (default(Azure.AI.Projects.ConnectionType), default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.InternalConnectionPropertiesNoAuth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.InternalConnectionPropertiesNoAuth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ListConnectionsResponse : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ListConnectionsResponse() { } diff --git a/sdk/ai/Azure.AI.Projects/assets.json b/sdk/ai/Azure.AI.Projects/assets.json index 9abe6480dea9..aa22adea7eb3 100644 --- a/sdk/ai/Azure.AI.Projects/assets.json +++ b/sdk/ai/Azure.AI.Projects/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", - "TagPrefix": "net/openai/Azure.AI.OpenAI.Assistants", - "Tag": "net/openai/Azure.AI.OpenAI.Assistants_11106f4f8f" + "TagPrefix": "net/ai/Azure.AI.Projects", + "Tag": "net/ai/Azure.AI.Projects_c34fc3243d" } diff --git a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj index 85bf509a8290..9f469b07d430 100644 --- a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj +++ b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj @@ -2,7 +2,7 @@ This is the Azure.AI.Projects client library for developing .NET applications with rich experience. Microsoft Azure.AI.Projects client library - 1.0.0-beta.3 + 1.0.0-beta.4 Azure.AI.Projects true $(RequiredTargetFrameworks) diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Connection/ConnectionsClient.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Connection/ConnectionsClient.cs index f6098342a936..c0ff3d73780c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Connection/ConnectionsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Connection/ConnectionsClient.cs @@ -524,10 +524,11 @@ public virtual async Task> GetDefaultConnectionAsyn throw new InvalidOperationException("No connections found for the specified parameters."); } - var secret = connections.Value[0]; + var connection = connections.Value[0]; return withCredential.GetValueOrDefault() - ? await GetConnectionWithSecretsAsync(secret.Name, "ignored").ConfigureAwait(false) - : await GetConnectionAsync(secret.Name).ConfigureAwait(false); + ? await GetConnectionWithSecretsAsync(connection.Name, "ignored").ConfigureAwait(false) + : Response.FromValue(connection, null); + ; } /// Get the details of a single connection. @@ -545,10 +546,10 @@ public virtual Response GetDefaultConnection(ConnectionType throw new InvalidOperationException("No connections found for the specified parameters."); } - var secret = connections.Value[0]; + ConnectionResponse connection = connections.Value[0]; return withCredential.GetValueOrDefault() - ? GetConnectionWithSecrets(secret.Name, "ignored") - : GetConnection(secret.Name); + ? GetConnectionWithSecrets(connection.Name, "ignored") + : Response.FromValue(connection, null); } // CUSTOM: Fixed the request URI by removing "/agents/v1.0" diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index 7080847507e8..546d614966d8 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -129,7 +129,7 @@ public static ListConnectionsResponse ListConnectionsResponse(IEnumerable /// The properties of the resource /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . + /// The available derived classes include and . /// /// A new instance for mocking. public static ConnectionResponse ConnectionResponse(string id = null, string name = null, ConnectionProperties properties = null) @@ -164,6 +164,15 @@ public static CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null) return new CredentialsApiKeyAuth(key, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Category of the connection. + /// The connection URL to be used for this service. + /// A new instance for mocking. + public static InternalConnectionPropertiesNoAuth InternalConnectionPropertiesNoAuth(ConnectionType category = default, string target = null) + { + return new InternalConnectionPropertiesNoAuth(AuthenticationType.None, category, target, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The type of binding, which is always 'storage_queue'. /// Storage queue. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs index 4e121fd65385..56679b3d00d5 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs @@ -4042,16 +4042,16 @@ public virtual Response GetVectorStoreFiles(string vectorStoreId, string filter, /// Create a vector store file by attaching a file to a vector store. /// Identifier of the vector store. /// Identifier of the file. - /// Azure asset ID. + /// Azure asset ID. /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, IEnumerable dataSources = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - CreateVectorStoreFileRequest createVectorStoreFileRequest = new CreateVectorStoreFileRequest(fileId, dataSources?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), chunkingStrategy, null); + CreateVectorStoreFileRequest createVectorStoreFileRequest = new CreateVectorStoreFileRequest(fileId, dataSource, chunkingStrategy, null); RequestContext context = FromCancellationToken(cancellationToken); Response response = await CreateVectorStoreFileAsync(vectorStoreId, createVectorStoreFileRequest.ToRequestContent(), context).ConfigureAwait(false); return Response.FromValue(VectorStoreFile.FromResponse(response), response); @@ -4060,16 +4060,16 @@ public virtual async Task> CreateVectorStoreFileAsync( /// Create a vector store file by attaching a file to a vector store. /// Identifier of the vector store. /// Identifier of the file. - /// Azure asset ID. + /// Azure asset ID. /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, IEnumerable dataSources = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - CreateVectorStoreFileRequest createVectorStoreFileRequest = new CreateVectorStoreFileRequest(fileId, dataSources?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), chunkingStrategy, null); + CreateVectorStoreFileRequest createVectorStoreFileRequest = new CreateVectorStoreFileRequest(fileId, dataSource, chunkingStrategy, null); RequestContext context = FromCancellationToken(cancellationToken); Response response = CreateVectorStoreFile(vectorStoreId, createVectorStoreFileRequest.ToRequestContent(), context); return Response.FromValue(VectorStoreFile.FromResponse(response), response); @@ -4085,7 +4085,7 @@ public virtual Response CreateVectorStoreFile(string vectorStor /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -4126,7 +4126,7 @@ public virtual async Task CreateVectorStoreFileAsync(string vectorStor /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.Serialization.cs index 0e676b83dce5..29c711154545 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.Serialization.cs @@ -39,8 +39,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(ResourceId); writer.WritePropertyName("query"u8); writer.WriteStringValue(Query); - writer.WritePropertyName("serviceName"u8); - writer.WriteStringValue(ServiceName); + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName); + } if (Optional.IsDefined(ConnectionString)) { writer.WritePropertyName("connectionString"u8); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.cs index 4dcafb02042b..6658add0777d 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ApplicationInsightsConfiguration.cs @@ -16,18 +16,15 @@ public partial class ApplicationInsightsConfiguration : InputData /// Initializes a new instance of . /// LogAnalytic Workspace resourceID associated with ApplicationInsights. /// Query to fetch the data. - /// Service name. - /// , or is null. - public ApplicationInsightsConfiguration(string resourceId, string query, string serviceName) + /// or is null. + public ApplicationInsightsConfiguration(string resourceId, string query) { Argument.AssertNotNull(resourceId, nameof(resourceId)); Argument.AssertNotNull(query, nameof(query)); - Argument.AssertNotNull(serviceName, nameof(serviceName)); Type = "app_insights"; ResourceId = resourceId; Query = query; - ServiceName = serviceName; } /// Initializes a new instance of . diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.Serialization.cs index c6167b8231e2..c64772bece56 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.Serialization.cs @@ -16,6 +16,7 @@ internal static partial class AuthenticationTypeExtensions AuthenticationType.ApiKey => "ApiKey", AuthenticationType.EntraId => "AAD", AuthenticationType.SAS => "SAS", + AuthenticationType.None => "None", _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AuthenticationType value.") }; @@ -24,6 +25,7 @@ public static AuthenticationType ToAuthenticationType(this string value) if (StringComparer.OrdinalIgnoreCase.Equals(value, "ApiKey")) return AuthenticationType.ApiKey; if (StringComparer.OrdinalIgnoreCase.Equals(value, "AAD")) return AuthenticationType.EntraId; if (StringComparer.OrdinalIgnoreCase.Equals(value, "SAS")) return AuthenticationType.SAS; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return AuthenticationType.None; throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AuthenticationType value."); } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.cs index e1403328a385..70ef54413110 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AuthenticationType.cs @@ -15,6 +15,8 @@ public enum AuthenticationType /// Entra ID authentication (formerly known as AAD). EntraId, /// Shared Access Signature (SAS) authentication. - SAS + SAS, + /// No authentication. + None } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.Serialization.cs index 6b84125aed62..23ccdd4fff96 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.Serialization.cs @@ -83,6 +83,7 @@ internal static ConnectionProperties DeserializeConnectionProperties(JsonElement { case "AAD": return InternalConnectionPropertiesAADAuth.DeserializeInternalConnectionPropertiesAADAuth(element, options); case "ApiKey": return ConnectionPropertiesApiKeyAuth.DeserializeConnectionPropertiesApiKeyAuth(element, options); + case "None": return InternalConnectionPropertiesNoAuth.DeserializeInternalConnectionPropertiesNoAuth(element, options); case "SAS": return InternalConnectionPropertiesSASAuth.DeserializeInternalConnectionPropertiesSASAuth(element, options); } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.cs index da25ba3389a7..b3abf7895c7f 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionProperties.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Projects /// /// Connection properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . + /// The available derived classes include and . /// public abstract partial class ConnectionProperties { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionResponse.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionResponse.cs index 0391fdfebd8a..0197ccf697dc 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionResponse.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ConnectionResponse.cs @@ -51,7 +51,7 @@ public partial class ConnectionResponse /// /// The properties of the resource /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . + /// The available derived classes include and . /// /// , or is null. internal ConnectionResponse(string id, string name, ConnectionProperties properties) @@ -71,7 +71,7 @@ internal ConnectionResponse(string id, string name, ConnectionProperties propert /// /// The properties of the resource /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . + /// The available derived classes include and . /// /// Keeps track of any properties unknown to the library. internal ConnectionResponse(string id, string name, ConnectionProperties properties, IDictionary serializedAdditionalRawData) @@ -94,7 +94,7 @@ internal ConnectionResponse() /// /// The properties of the resource /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . + /// The available derived classes include and . /// public ConnectionProperties Properties { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.Serialization.cs index 381c9dc815d1..e71ec7ac03ba 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.Serialization.cs @@ -39,15 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("file_id"u8); writer.WriteStringValue(FileId); } - if (Optional.IsCollectionDefined(DataSources)) + if (Optional.IsDefined(DataSource)) { - writer.WritePropertyName("data_sources"u8); - writer.WriteStartArray(); - foreach (var item in DataSources) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("data_source"u8); + writer.WriteObjectValue(DataSource, options); } if (Optional.IsDefined(ChunkingStrategy)) { @@ -92,7 +87,7 @@ internal static CreateVectorStoreFileRequest DeserializeCreateVectorStoreFileReq return null; } string fileId = default; - IReadOnlyList dataSources = default; + VectorStoreDataSource dataSource = default; VectorStoreChunkingStrategyRequest chunkingStrategy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,18 +98,13 @@ internal static CreateVectorStoreFileRequest DeserializeCreateVectorStoreFileReq fileId = property.Value.GetString(); continue; } - if (property.NameEquals("data_sources"u8)) + if (property.NameEquals("data_source"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VectorStoreDataSource.DeserializeVectorStoreDataSource(item, options)); - } - dataSources = array; + dataSource = VectorStoreDataSource.DeserializeVectorStoreDataSource(property.Value, options); continue; } if (property.NameEquals("chunking_strategy"u8)) @@ -132,7 +122,7 @@ internal static CreateVectorStoreFileRequest DeserializeCreateVectorStoreFileReq } } serializedAdditionalRawData = rawDataDictionary; - return new CreateVectorStoreFileRequest(fileId, dataSources ?? new ChangeTrackingList(), chunkingStrategy, serializedAdditionalRawData); + return new CreateVectorStoreFileRequest(fileId, dataSource, chunkingStrategy, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.cs index eefc1246e460..fba9287eb54a 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateVectorStoreFileRequest.cs @@ -48,22 +48,21 @@ internal partial class CreateVectorStoreFileRequest /// Initializes a new instance of . internal CreateVectorStoreFileRequest() { - DataSources = new ChangeTrackingList(); } /// Initializes a new instance of . /// Identifier of the file. - /// Azure asset ID. + /// Azure asset ID. /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// /// Keeps track of any properties unknown to the library. - internal CreateVectorStoreFileRequest(string fileId, IReadOnlyList dataSources, VectorStoreChunkingStrategyRequest chunkingStrategy, IDictionary serializedAdditionalRawData) + internal CreateVectorStoreFileRequest(string fileId, VectorStoreDataSource dataSource, VectorStoreChunkingStrategyRequest chunkingStrategy, IDictionary serializedAdditionalRawData) { FileId = fileId; - DataSources = dataSources; + DataSource = dataSource; ChunkingStrategy = chunkingStrategy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -71,7 +70,7 @@ internal CreateVectorStoreFileRequest(string fileId, IReadOnlyList Identifier of the file. public string FileId { get; } /// Azure asset ID. - public IReadOnlyList DataSources { get; } + public VectorStoreDataSource DataSource { get; } /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.Serialization.cs new file mode 100644 index 000000000000..8eedad6d6280 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class InternalConnectionPropertiesNoAuth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalConnectionPropertiesNoAuth)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + InternalConnectionPropertiesNoAuth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalConnectionPropertiesNoAuth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalConnectionPropertiesNoAuth(document.RootElement, options); + } + + internal static InternalConnectionPropertiesNoAuth DeserializeInternalConnectionPropertiesNoAuth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AuthenticationType authType = default; + ConnectionType category = default; + string target = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = property.Value.GetString().ToAuthenticationType(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString().ToConnectionType(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalConnectionPropertiesNoAuth(authType, category, target, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InternalConnectionPropertiesNoAuth)} does not support writing '{options.Format}' format."); + } + } + + InternalConnectionPropertiesNoAuth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInternalConnectionPropertiesNoAuth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalConnectionPropertiesNoAuth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new InternalConnectionPropertiesNoAuth FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInternalConnectionPropertiesNoAuth(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.cs new file mode 100644 index 000000000000..75ba735d790d --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalConnectionPropertiesNoAuth.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Connection properties for connections with no authentication. + public partial class InternalConnectionPropertiesNoAuth : ConnectionProperties + { + /// Initializes a new instance of . + /// Category of the connection. + /// The connection URL to be used for this service. + /// is null. + internal InternalConnectionPropertiesNoAuth(ConnectionType category, string target) : base(category, target) + { + Argument.AssertNotNull(target, nameof(target)); + + AuthType = AuthenticationType.None; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// The connection URL to be used for this service. + /// Keeps track of any properties unknown to the library. + internal InternalConnectionPropertiesNoAuth(AuthenticationType authType, ConnectionType category, string target, IDictionary serializedAdditionalRawData) : base(authType, category, target, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal InternalConnectionPropertiesNoAuth() + { + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs index c9a526ba9412..6752eef1d222 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs @@ -26,14 +26,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The JSON writer. /// The client options for reading and writing models. +<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.Serialization.cs + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs if (format != "J") { throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support writing '{format}' format."); } +<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsResponseFormatJSON.Serialization.cs + base.JsonModelWriteCore(writer, options); +======== if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("message_id"u8); @@ -54,6 +63,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit #endif } } +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs } RunStepDeltaMessageCreationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs index 8df010fe02d9..e7cefef91d86 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs @@ -13,15 +13,72 @@ namespace Azure.AI.Projects { +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + public partial class RunStepDeltaMessageCreationObject : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== internal partial class UnknownRunStepDeltaCodeInterpreterOutput : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs { writer.WriteStartObject(); JsonModelWriteCore(writer, options); writer.WriteEndObject(); +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MessageId)) + { + writer.WritePropertyName("message_id"u8); + writer.WriteStringValue(MessageId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RunStepDeltaMessageCreationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRunStepDeltaMessageCreationObject(document.RootElement, options); + } + + internal static RunStepDeltaMessageCreationObject DeserializeRunStepDeltaMessageCreationObject(JsonElement element, ModelReaderWriterOptions options = null) +======== } /// The JSON writer. @@ -50,6 +107,7 @@ RunStepDeltaCodeInterpreterOutput IJsonModel. } internal static UnknownRunStepDeltaCodeInterpreterOutput DeserializeUnknownRunStepDeltaCodeInterpreterOutput(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -57,20 +115,28 @@ internal static UnknownRunStepDeltaCodeInterpreterOutput DeserializeUnknownRunSt { return null; } +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + string messageId = default; +======== int index = default; string type = "Unknown"; +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + if (property.NameEquals("message_id"u8)) +======== if (property.NameEquals("index"u8)) { index = property.Value.GetInt32(); continue; } if (property.NameEquals("type"u8)) +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs { - type = property.Value.GetString(); + messageId = property.Value.GetString(); continue; } if (options.Format != "W") @@ -79,18 +145,36 @@ internal static UnknownRunStepDeltaCodeInterpreterOutput DeserializeUnknownRunSt } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + return new RunStepDeltaMessageCreationObject(messageId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== return new UnknownRunStepDeltaCodeInterpreterOutput(index, type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support writing '{options.Format}' format."); + } + } + + RunStepDeltaMessageCreationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support writing '{options.Format}' format."); } } @@ -98,12 +182,30 @@ BinaryData IPersistableModel.Write(ModelReade RunStepDeltaCodeInterpreterOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + return DeserializeRunStepDeltaMessageCreationObject(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RunStepDeltaMessageCreationObject FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRunStepDeltaMessageCreationObject(document.RootElement); +======== return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement, options); } default: @@ -119,13 +221,18 @@ RunStepDeltaCodeInterpreterOutput IPersistableModel>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs } /// Convert into a . - internal override RequestContent ToRequestContent() + internal virtual RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); +======== content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); +>>>>>>>> main:sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs return content; } } diff --git a/sdk/ai/Azure.AI.Projects/tests/AgentClientTests.cs b/sdk/ai/Azure.AI.Projects/tests/AgentClientTests.cs new file mode 100644 index 000000000000..dce85fab6459 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/tests/AgentClientTests.cs @@ -0,0 +1,1308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.Tests +{ + public class AgentClientTests : RecordedTestBase + { + private const string AGENT_NAME = "cs_e2e_tests_client"; + private const string AGENT_NAME2 = "cs_e2e_tests_client2"; + private const string VCT_STORE_NAME = "cs_e2e_tests_vct_store"; + private const string FILE_NAME = "product_info_1.md"; + private const string FILE_NAME2 = "test_file.txt"; + private const string TEMP_DIR = "cs_e2e_temp_dir"; + + private const string FILE_UPLOAD_CONSTRAINT = "The file is being uploaded as a multipart multipart/form-data, which cannot be recorded."; + + public AgentClientTests(bool isAsync) : base(isAsync) { + TestDiagnostics = false; + } + + #region enumerations + public enum ArgumentType + { + Metadata, + Bytes, + Stream + } + + public enum VecrorStoreTestType + { + JustVectorStore, + Batch, + File + } + #endregion + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestCreateAgent(ArgumentType argType) + { + AgentsClient client = GetClient(); + string id; + string name; + if (argType == ArgumentType.Metadata) + { + Response agentResponse = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "You are helpful assistant." + ); + id = agentResponse.Value.Id; + name = agentResponse.Value.Name; + } + else + { + object objParams = new { + model = "gpt-4", + name = AGENT_NAME, + instructions = "You are helpful assistant" + }; + RequestContent content = argType == ArgumentType.Bytes?RequestContent.Create(GetBytes(objParams)): RequestContent.Create(GetStream(objParams)); + Response agentResponse = await client.CreateAgentAsync(content); + id = GetFieldFromJson(agentResponse.Content, "id"); + name = GetFieldFromJson(agentResponse.Content, "name"); + } + Assert.AreNotEqual(default, id); + Assert.AreEqual(name, AGENT_NAME); + Response delResponse = await client.DeleteAgentAsync(id); + Assert.IsTrue(delResponse.Value); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestUpdateAgent(ArgumentType argType) + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + string name = default; + if (argType == ArgumentType.Metadata) + { + Response agentResponse = await client.UpdateAgentAsync( + assistantId: agent.Id, + model: "gpt-4", + name: AGENT_NAME2, + instructions: "You are helpful assistant." + ); + name = agentResponse.Value.Name; + } + else + { + object objParams = new + { + model = "gpt-4", + name = AGENT_NAME2, + instructions = "You are helpful assistant" + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(objParams)) : RequestContent.Create(GetStream(objParams)); + Response agentResponse = await client.UpdateAgentAsync(agent.Id, content); + name = GetFieldFromJson(agentResponse.Content, "name"); + } + Assert.AreEqual(AGENT_NAME2, name); + } + + [RecordedTest] + public async Task TestListAgent() + { + AgentsClient client = GetClient(); + // Note: if the numer of arent will be bigger then 100 this test will fail. + HashSet ids = new(); + int initialAgentCount = await CountElementsAndRemoveIds(client, ids); + Agent agent1 = await GetAgent(client, AGENT_NAME); + ids = [agent1.Id]; + int count = await CountElementsAndRemoveIds(client, ids); + Assert.AreEqual(0, ids.Count); + Assert.AreEqual(initialAgentCount + 1, count); + + Agent agent2 = await GetAgent(client, AGENT_NAME2); + ids.Add(agent1.Id); + ids.Add(agent2.Id); + count = await CountElementsAndRemoveIds(client, ids); + Assert.AreEqual(0, ids.Count); + Assert.AreEqual(initialAgentCount + 2, count); + + DeleteAndAssert(client, agent1); + ids.Add(agent1.Id); + ids.Add(agent2.Id); + count = await CountElementsAndRemoveIds(client, ids); + Assert.AreEqual(1, ids.Count); + Assert.False(ids.Contains(agent2.Id)); + Assert.AreEqual(initialAgentCount + 1, count); + DeleteAndAssert(client, agent2); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestCreateThread(ArgumentType argType) + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + + string thread_id; + IReadOnlyDictionary metadata; + if (argType == ArgumentType.Metadata) + { + Response threadResponse = await client.CreateThreadAsync( + metadata: new Dictionary { + {"key1", "value1"}, + {"key2", "value2"} + }); + thread_id = threadResponse.Value.Id; + metadata = threadResponse.Value.Metadata; + } + else + { + object data = new + { + metadata = new + { + key1="value1", + key2="value2" + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawThreadResponse = await client.CreateThreadAsync(content); + thread_id = GetFieldFromJson(rawThreadResponse.Content, "id"); + Response threadResponse = await client.GetThreadAsync(thread_id); + metadata = threadResponse.Value.Metadata; + } + Assert.AreNotEqual(default, thread_id); + Assert.AreEqual(2, metadata.Count); + + // Test delete thread + Response delResponse = await client.DeleteThreadAsync(thread_id); + Assert.True(delResponse); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestUpdateThread(ArgumentType argType) + { + AgentsClient client = GetClient(); + AgentThread thread = await GetThread(client); + Assert.AreEqual(0, thread.Metadata.Count); + + if (argType == ArgumentType.Metadata) + { + //"metadata": {"key1": "value1", "key2": "value2"}, + await client.UpdateThreadAsync( + thread.Id, + metadata: new Dictionary { + {"key1", "value1"}, + {"key2", "value2"} + }); + } + else + { + object data = new + { + metadata = new + { + key1 = "value1", + key2 = "value2" + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + await client.UpdateThreadAsync(thread.Id, content); + } + + // Test get thread + Response getThreadResponse = await client.GetThreadAsync(thread.Id); + thread = getThreadResponse.Value; + Assert.AreNotEqual(default, thread.Id); + Assert.AreEqual(2, thread.Metadata.Count); + + // Test delete thread + Response delResponse = await client.DeleteThreadAsync(thread.Id); + Assert.True(delResponse); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestCreateMessage(ArgumentType argType) + { + AgentsClient client = GetClient(); + AgentThread thread = await GetThread(client); + ThreadMessage tmTest; + string message = "Hello, tell me a joke"; + if (argType == ArgumentType.Metadata) + { + Response msg = await client.CreateMessageAsync(thread.Id, MessageRole.User, message); + tmTest = msg.Value; + } + else + { + object data = new + { + role = "user", + content = message + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawMsg = await client.CreateMessageAsync(thread.Id, content); + Response msg = await client.GetMessageAsync(thread.Id, GetFieldFromJson(rawMsg.Content, "id")); + tmTest = msg.Value; + } + Assert.AreEqual(1, tmTest.ContentItems.Count); + Assert.IsTrue(tmTest.ContentItems[0] is MessageTextContent text); + Assert.AreEqual(message, ((MessageTextContent)tmTest.ContentItems[0]).Text); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestUpdateMessage(ArgumentType argType) + { + AgentsClient client = GetClient(); + AgentThread thread = await GetThread(client); + ThreadMessage tmTest; + Response oldMsgResp = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "Hello, tell me a joke"); + Assert.AreEqual(0, oldMsgResp.Value.Metadata.Count); + if (argType == ArgumentType.Metadata) + { + Response msg = await client.UpdateMessageAsync(thread.Id, oldMsgResp.Value.Id, metadata: new Dictionary { + {"key1", "value1"}, + {"key2", "value2"} + }); + tmTest = msg.Value; + } + else + { + object data = new + { + metadata = new + { + key1 = "value1", + key2 = "value2" + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawMsg = await client.UpdateMessageAsync(thread.Id, oldMsgResp.Value.Id, content); + Response msg = await client.GetMessageAsync(thread.Id, GetFieldFromJson(rawMsg.Content, "id")); + tmTest = msg.Value; + } + Assert.AreEqual(2, tmTest.Metadata.Count); + } + + [RecordedTest] + public async Task TestListMessage() + { + AgentsClient client = GetClient(); + AgentThread thread = await GetThread(client); + Response> msgResp = await client.GetMessagesAsync(thread.Id); + Assert.AreEqual(0, msgResp.Value.Data.Count); + + HashSet ids = new(); + ThreadMessage msg1 = await client.CreateMessageAsync(thread.Id, MessageRole.User, "foo"); + ids.Add(msg1.Id); + msgResp = await client.GetMessagesAsync(thread.Id); + foreach (ThreadMessage msg in msgResp.Value) + { + ids.Remove(msg.Id); + } + Assert.AreEqual(0, ids.Count); + Assert.AreEqual(1, msgResp.Value.Data.Count); + + ThreadMessage msg2 = await client.CreateMessageAsync(thread.Id, MessageRole.User, "bar"); + ids.Add(msg1.Id); + ids.Add(msg2.Id); + msgResp = await client.GetMessagesAsync(thread.Id); + foreach (ThreadMessage msg in msgResp.Value) + { + ids.Remove(msg.Id); + } + Assert.AreEqual(0, ids.Count); + Assert.AreEqual(2, msgResp.Value.Data.Count); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestCreateRun(ArgumentType argType) + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + AgentThread thread = await GetThread(client); + await client.CreateMessageAsync(thread.Id, MessageRole.User, "Hello, tell me a joke"); + ThreadRun result; + if (argType == ArgumentType.Metadata) + { + Response runResp = await client.CreateRunAsync(thread.Id, agent.Id); + result = runResp.Value; + } + else + { + object data = new + { + assistant_id = agent.Id + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawRun = await client.CreateRunAsync(thread.Id, content); + Response resResp = await client.GetRunAsync(thread.Id, GetFieldFromJson(rawRun.Content, "id")); + result = resResp.Value; + } + Assert.AreEqual(agent.Id, result.AssistantId); + Assert.AreEqual(thread.Id, result.ThreadId); + // Check run status + result = await WaitForRun(client, result); + Response> msgResp = await client.GetMessagesAsync(thread.Id); + Assert.AreEqual(2, msgResp.Value.Data.Count); + Assert.AreEqual(MessageRole.Agent, msgResp.Value.Data[0].Role); + Assert.AreEqual(MessageRole.User, msgResp.Value.Data[1].Role); + // Get Run steps + PageableList steps = await client.GetRunStepsAsync(result); + Assert.GreaterOrEqual(steps.Data.Count, 1); + RunStep step = await client.GetRunStepAsync(result.ThreadId, result.Id, steps.Data[0].Id); + Assert.AreEqual(steps.Data[0].Id, step.Id); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestCreateThreadAndRun(ArgumentType argType) + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + ThreadRun result; + var threadOp = new AgentThreadCreationOptions(); + threadOp.Messages.Add(new ThreadMessageOptions( + role: MessageRole.User, + content: "Hello, tell me a joke" + )); + if (argType == ArgumentType.Metadata) + { + result = await client.CreateThreadAndRunAsync( + assistantId: agent.Id, + thread: threadOp, + metadata: new Dictionary { + { "key1", "value1"}, + { "key2", "value2"} + } + ); + } + else + { + object data = new + { + assistant_id = agent.Id, + thread = new { + messages = new object[] + { + new { + role = MessageRole.User.ToString(), + content = "Hello, tell me a joke", + } + } + }, + metadata = new + { + key1 = "value1", + key2 = "value2" + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawRun = await client.CreateThreadAndRunAsync(content); + result = await client.GetRunAsync( + GetFieldFromJson(rawRun.Content, "thread_id"), + GetFieldFromJson(rawRun.Content, "id")); + } + Assert.AreEqual(agent.Id, result.AssistantId); + // Check run status + result = await WaitForRun(client, result); + Response> msgResp = await client.GetMessagesAsync(result.ThreadId); + Assert.AreEqual(2, msgResp.Value.Data.Count); + Assert.AreEqual(MessageRole.Agent, msgResp.Value.Data[0].Role); + Assert.AreEqual(MessageRole.User, msgResp.Value.Data[1].Role); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata)] + [TestCase(ArgumentType.Bytes)] + [TestCase(ArgumentType.Stream)] + public async Task TestUpdateRun(ArgumentType argType) + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + AgentThread thread = await GetThread(client); + await client.CreateMessageAsync(thread.Id, MessageRole.User, "Hello, tell me a joke"); + ThreadRun runResp = await client.CreateRunAsync(thread.Id, agent.Id); + runResp = await WaitForRun(client, runResp); + Assert.AreEqual(0, runResp.Metadata.Count); + if (argType == ArgumentType.Metadata) + { + runResp = await client.UpdateRunAsync( + threadId: thread.Id, + runId: runResp.Id, + metadata: new Dictionary { + { "key1", "value1"}, + { "key2", "value2"} + } + ); + } + else + { + object data = new + { + metadata = new + { + key1 = "value1", + key2 = "value2" + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(data)) : RequestContent.Create(GetStream(data)); + Response rawRun = await client.UpdateRunAsync(thread.Id, runResp.Id, content); + runResp = await client.GetRunAsync(thread.Id, GetFieldFromJson(rawRun.Content, "id")); + } + Assert.AreEqual(2, runResp.Metadata.Count); + } + + [RecordedTest] + public async Task ListDeleteRuns() + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent(client); + AgentThread thread = await GetThread(client); + await client.CreateMessageAsync(thread.Id, MessageRole.User, "Hello, tell me a joke"); + ThreadRun runResp1 = await client.CreateRunAsync(thread.Id, agent.Id); + runResp1 = await WaitForRun(client, runResp1); + ThreadRun runResp2 = await client.CreateRunAsync(thread.Id, agent.Id); + runResp2 = await WaitForRun(client, runResp2); + PageableList runsResp = await client.GetRunsAsync(thread.Id, limit: 1); + Assert.AreEqual(1, runsResp.Count()); + runsResp = await client.GetRunsAsync(thread.Id); + Assert.AreEqual(2, runsResp.Count()); + HashSet ids = [runResp1.Id, runResp2.Id]; + foreach (ThreadRun rn in runsResp) + { + ids.Remove(rn.Id); + } + Assert.AreEqual(0, ids.Count); + } + + [RecordedTest] + [TestCase(ArgumentType.Metadata, true, false)] + [TestCase(ArgumentType.Bytes, true, false)] + [TestCase(ArgumentType.Stream, false, false)] + [TestCase(ArgumentType.Metadata, true, true)] + [TestCase(ArgumentType.Metadata, false, true)] + public async Task TestSubmitToolOutputs(ArgumentType argType, bool parallelToolCalls, bool CreateThreadAndRun) + { + AgentsClient client = GetClient(); + FunctionToolDefinition getFavouriteNameTool = new( + name: "getFavouriteWord", + description: "Gets the favourite word of the person.", + parameters: BinaryData.FromObjectAsJson( + new + { + Type = "object", + Properties = new + { + Name = new + { + Type = "string", + Description = "The name of the person.", + }, + }, + Required = new[] { "name" }, + }, + new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase })); + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "Use the provided functions to help answer questions.", + tools: new List { getFavouriteNameTool } + ); + ThreadRun toolRun; + if (CreateThreadAndRun) + { + var threadOp = new AgentThreadCreationOptions(); + threadOp.Messages.Add(new ThreadMessageOptions( + role: MessageRole.User, + content: "Tell me the favourite word of Mike?" + )); + toolRun = await client.CreateThreadAndRunAsync( + assistantId: agent.Id, + thread: threadOp, + parallelToolCalls: parallelToolCalls + ); + } + else + { + AgentThread thread = await GetThread(client); + await client.CreateMessageAsync(thread.Id, MessageRole.User, "Tell me the favourite word of Mike?"); + toolRun = await client.CreateRunAsync( + threadId: thread.Id, + assistantId: agent.Id, + parallelToolCalls: parallelToolCalls + ); + } + bool functionCalled = false; + do + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + toolRun = await client.GetRunAsync(toolRun.ThreadId, toolRun.Id); + if (toolRun.Status == RunStatus.RequiresAction && toolRun.RequiredAction is SubmitToolOutputsAction submitToolOutputsAction) + { + List toolOutputs = new(); + Assert.AreEqual(1, submitToolOutputsAction.ToolCalls.Count); + functionCalled = true; + if (submitToolOutputsAction.ToolCalls[0] is RequiredFunctionToolCall functionToolCall) + { + using JsonDocument argumentsJson = JsonDocument.Parse(functionToolCall.Arguments); + string nameArgument = argumentsJson.RootElement.GetProperty("name").GetString(); + Assert.AreEqual(0, string.Compare(nameArgument, "mike", true)); + toolOutputs.Add(new ToolOutput(submitToolOutputsAction.ToolCalls[0], "bar")); + } + else + { + Assert.Fail("The toolCall is of a wrong type."); + } + if (argType == ArgumentType.Metadata) + { + toolRun = await client.SubmitToolOutputsToRunAsync(toolRun, toolOutputs); + } + else + { + object objToolOutput = new + { + tool_outputs = new object[] { + new { + tool_call_id = toolOutputs[0].ToolCallId, + output = toolOutputs[0].Output + } + } + }; + RequestContent content = argType == ArgumentType.Bytes ? RequestContent.Create(GetBytes(objToolOutput)) : RequestContent.Create(GetStream(objToolOutput)); + await client.SubmitToolOutputsToRunAsync(toolRun.ThreadId, toolRun.Id, content); + toolRun = await client.GetRunAsync(toolRun.ThreadId, toolRun.Id); + } + } + } + while (toolRun.Status == RunStatus.Queued + || toolRun.Status == RunStatus.InProgress + || toolRun.Status == RunStatus.RequiresAction); + Assert.True(functionCalled); + Assert.AreEqual(toolRun.Status, RunStatus.Completed); + PageableList messages = await client.GetMessagesAsync(toolRun.ThreadId, toolRun.Id); + Assert.Greater(messages.Data.Count, 1); + Assert.AreEqual(parallelToolCalls, toolRun.ParallelToolCalls); + } + + [RecordedTest] + [TestCase(VecrorStoreTestType.JustVectorStore, true)] + [TestCase(VecrorStoreTestType.Batch, true)] + [TestCase(VecrorStoreTestType.File, true)] + [TestCase(VecrorStoreTestType.JustVectorStore, false)] + [TestCase(VecrorStoreTestType.Batch, false)] + [TestCase(VecrorStoreTestType.File, false)] + public async Task TestCreateVectorStore(VecrorStoreTestType testType, bool useFileSource) + { + if (useFileSource && Mode != RecordedTestMode.Live) + Assert.Inconclusive(FILE_UPLOAD_CONSTRAINT); + AgentsClient client = GetClient(); + VectorStore vectorStore; + + AgentFile fileDataSource = null; + VectorStoreDataSource vectorStoreDataSource = null; + VectorStoreConfiguration vectorStoreConf = null; + List fileIds = null; + if (useFileSource) + { + fileDataSource = await client.UploadFileAsync(GetFile(), AgentFilePurpose.Agents); + fileIds = [ fileDataSource.Id ]; + } + else + { + vectorStoreDataSource = new VectorStoreDataSource( + assetIdentifier: TestEnvironment.AZURE_BLOB_URI, + assetType: VectorStoreDataSourceAssetType.UriAsset + ); + vectorStoreConf = new VectorStoreConfiguration( + dataSources: [ vectorStoreDataSource ] + ); + } + if (testType == VecrorStoreTestType.JustVectorStore) + { + vectorStore = await client.CreateVectorStoreAsync( + name: VCT_STORE_NAME, + storeConfiguration: vectorStoreConf, + fileIds: fileIds + ); + } + else + { + vectorStore = await client.CreateVectorStoreAsync( + name: VCT_STORE_NAME + ); + if (testType == VecrorStoreTestType.Batch) + { + await client.CreateVectorStoreFileBatchAsync( + vectorStoreId: vectorStore.Id, + dataSources: vectorStoreConf?.DataSources, + fileIds: fileIds + ); + } + else + { + await client.CreateVectorStoreFileAsync( + vectorStoreId: vectorStore.Id, + dataSource: vectorStoreConf?.DataSources[0], + fileId: fileDataSource?.Id + ); + } + } + // Test file search + FileSearchToolResource fileSearchToolResource = new FileSearchToolResource(); + fileSearchToolResource.VectorStoreIds.Add(vectorStore.Id); + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: "SDK Test Agent - Retrieval", + instructions: "You are a helpful agent that can help fetch data from files you know about.", + tools: new List { new FileSearchToolDefinition() }, + toolResources: new ToolResources() { FileSearch = fileSearchToolResource }); + var threadOp = new AgentThreadCreationOptions(); + threadOp.Messages.Add(new ThreadMessageOptions( + role: MessageRole.User, + content: "What does the attachment say?" + )); + ThreadRun fileSearchRun = await client.CreateThreadAndRunAsync( + assistantId: agent.Id, + thread: threadOp + ); + fileSearchRun = await WaitForRun(client, fileSearchRun); + PageableList messages = await client.GetMessagesAsync(fileSearchRun.ThreadId, fileSearchRun.Id); + Assert.Greater(messages.Data.Count, 1); + // Check list, get and delete operations. + VectorStore getVct = await client.GetVectorStoreAsync(vectorStore.Id); + Assert.AreEqual(vectorStore.Id, getVct.Id); + AgentPageableListOfVectorStore stores = await client.GetVectorStoresAsync(limit: 100); + getVct = null; + foreach (VectorStore store in stores.Data) + { + if (store.Id == vectorStore.Id) + { + getVct = store; + break; + } + } + Assert.NotNull(getVct); + VectorStoreDeletionStatus removed = await client.DeleteVectorStoreAsync(vectorStore.Id); + Assert.True(removed.Deleted); + stores = await client.GetVectorStoresAsync(limit: 100); + getVct = null; + foreach (VectorStore store in stores.Data) + { + if (store.Id == vectorStore.Id) + { + getVct = store; + break; + } + } + Assert.IsNull(getVct); + } + + [RecordedTest] + [TestCase(true, true)] + [TestCase(true, false)] + [TestCase(false, true)] + [TestCase(false, false)] + public async Task TestCreateWithMessageAttachment(bool useFileSource, bool attachmentOnThread) + { + if (useFileSource && Mode != RecordedTestMode.Live) + Assert.Inconclusive(FILE_UPLOAD_CONSTRAINT); + AgentsClient client = GetClient(); + + MessageAttachment attachment; + List tools = [ + new FileSearchToolDefinition(), + new CodeInterpreterToolDefinition() + ]; + string fileId = default; + if (useFileSource) + { + AgentFile fileDataSource = await client.UploadFileAsync(GetFile(), AgentFilePurpose.Agents); + fileId = fileDataSource.Id; + attachment = new MessageAttachment(fileDataSource.Id, tools); + } + else + { + VectorStoreDataSource vectorStoreDataSource = new( + assetIdentifier: TestEnvironment.AZURE_BLOB_URI, + assetType: VectorStoreDataSourceAssetType.UriAsset + ); + attachment = new MessageAttachment(vectorStoreDataSource, tools); + } + // Test file search + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: "SDK Test Agent - Retrieval", + instructions: "You are a helpful agent that can help fetch data from files you know about." + ); + AgentThread thread; + List opts = null; + if (attachmentOnThread) + { + ThreadMessageOptions messageOp = new( + role: MessageRole.User, + content: "What does the attachment say?" + ); + opts = [messageOp]; + thread = await client.CreateThreadAsync(messages: opts); + } + else + { + thread = await client.CreateThreadAsync(); + await client.CreateMessageAsync( + threadId: thread.Id, + role: MessageRole.User, + content: "What does the attachment say?", + attachments: [attachment] + ); + } + ThreadRun fileSearchRun = await client.CreateRunAsync(thread, agent); + fileSearchRun = await WaitForRun(client, fileSearchRun); + PageableList messages = await client.GetMessagesAsync(fileSearchRun.ThreadId, fileSearchRun.Id); + Assert.Greater(messages.Data.Count, 1); + } + + [RecordedTest] + [TestCase(true, true)] + [TestCase(true, false)] + [TestCase(false, true)] + [TestCase(false, false)] + public async Task TestFileSearchWithCodeInterpreter(bool useFileSource, bool useThreads) + { + if (useFileSource && Mode != RecordedTestMode.Live) + Assert.Inconclusive(FILE_UPLOAD_CONSTRAINT); + AgentsClient client = GetClient(); + CodeInterpreterToolResource toolRes = new(); + if (useFileSource) + { + AgentFile fileDataSource = await client.UploadFileAsync(GetFile(), AgentFilePurpose.Agents); + toolRes.FileIds.Add(fileDataSource.Id); + } + else + { + VectorStoreDataSource vectorStoreDataSource = new( + assetIdentifier: TestEnvironment.AZURE_BLOB_URI, + assetType: VectorStoreDataSourceAssetType.UriAsset + ); + toolRes.DataSources.Add(vectorStoreDataSource); + } + ToolResources resources = new() + { + CodeInterpreter = toolRes + }; + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "You are a helpful agent that can help fetch data from files you know about.", + tools: [ new CodeInterpreterToolDefinition() ], + toolResources: useThreads ? null : resources + ); + AgentThread thread = await client.CreateThreadAsync( + toolResources: useThreads ? resources : null + ); + ThreadMessage message = await client.CreateMessageAsync( + threadId: thread.Id, + role: MessageRole.User, + content: "What Contoso Galaxy Innovations produces?" + ); + ThreadRun fileSearchRun = await client.CreateRunAsync(thread, agent); + + long milliseconds = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + fileSearchRun = await WaitForRun(client, fileSearchRun); + Console.WriteLine((milliseconds - DateTimeOffset.Now.ToUnixTimeMilliseconds()) / 1000); + PageableList messages = await client.GetMessagesAsync(fileSearchRun.ThreadId, fileSearchRun.Id); + Assert.Greater(messages.Data.Count, 1); + } + + [RecordedTest] + public async Task TestCreateVectorStoreOnline() + { + AgentsClient client = GetClient(); + VectorStoreDataSource vectorStoreDataSource = new( + assetIdentifier: TestEnvironment.AZURE_BLOB_URI, + assetType: VectorStoreDataSourceAssetType.UriAsset + ); + FileSearchToolResource fileSearch = new(); + fileSearch.VectorStores.Add(new VectorStoreConfigurations( + storeName: VCT_STORE_NAME, + new VectorStoreConfiguration([vectorStoreDataSource]) + ) + ); + ToolResources tools = new() + { + FileSearch=fileSearch + }; + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "You are a helpful agent that can help fetch data from files you know about.", + tools: [new FileSearchToolDefinition()], + toolResources: tools + ); + AgentThread thread = await client.CreateThreadAsync(); + ThreadMessage message = await client.CreateMessageAsync( + threadId: thread.Id, + role: MessageRole.User, + content: "What does the attachment say?" + ); + ThreadRun fileSearchRun = await client.CreateRunAsync(thread, agent); + + fileSearchRun = await WaitForRun(client, fileSearchRun); + PageableList messages = await client.GetMessagesAsync(fileSearchRun.ThreadId, fileSearchRun.Id); + Assert.Greater(messages.Data.Count, 1); + } + + [RecordedTest] + // TODO: Implement include in streaming scenario, see task 3801146. + // [TestCase(true, true)] + [TestCase(true, false)] + [TestCase(false, true)] + [TestCase(false, false)] + public async Task TestIncludeFileSearchContent(bool useStream, bool includeContent) + { + if (useStream && !IsAsync) + Assert.Inconclusive("The test framework does not support iteration of stream in Sync mode."); + AgentsClient client = GetClient(); + VectorStoreDataSource vectorStoreDataSource = new( + assetIdentifier: TestEnvironment.AZURE_BLOB_URI, + assetType: VectorStoreDataSourceAssetType.UriAsset + ); + VectorStoreConfiguration vectorStoreConf = new( + dataSources: [vectorStoreDataSource] + ); + VectorStore vctStore = await client.CreateVectorStoreAsync( + name: VCT_STORE_NAME, + storeConfiguration: vectorStoreConf + ); + FileSearchToolResource fileSearch = new(); + fileSearch.VectorStoreIds.Add(vctStore.Id); + + ToolResources tools = new() + { + FileSearch = fileSearch + }; + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "Hello, you are helpful assistant and can search information from uploaded files", + tools: [new FileSearchToolDefinition()], + toolResources: tools + ); + AgentThread thread = await client.CreateThreadAsync(); + ThreadMessage message = await client.CreateMessageAsync( + threadId: thread.Id, + role: MessageRole.User, + content: "What Contoso Galaxy Innovations produces?" + ); + List include = includeContent ? [RunAdditionalFieldList.FileSearchContents] : null; + ThreadRun fileSearchRun = null; + if (useStream) + { + // TODO: Implement include in streaming scenario, see task 3801146. + await foreach (StreamingUpdate streamingUpdate in client.CreateRunStreamingAsync(thread.Id, agent.Id)) + { + if (streamingUpdate is RunUpdate runUpdate) + fileSearchRun = runUpdate.Value; + } + Assert.IsNotNull(fileSearchRun); + } + else + { + fileSearchRun = await client.CreateRunAsync(thread.Id, agent.Id, include: include); + + fileSearchRun = await WaitForRun(client, fileSearchRun); + PageableList messages = await client.GetMessagesAsync(fileSearchRun.ThreadId, fileSearchRun.Id); + Assert.AreEqual(RunStatus.Completed, fileSearchRun.Status); + Assert.Greater(messages.Data.Count, 1); + } + // TODO: Implement include in streaming scenario, see task 3801146. + PageableList steps = await client.GetRunStepsAsync( + threadId: fileSearchRun.ThreadId, + runId: fileSearchRun.Id + // include: include + ); + Assert.GreaterOrEqual(steps.Data.Count, 1); + RunStep step = await client.GetRunStepAsync(fileSearchRun.ThreadId, fileSearchRun.Id, steps.Data[1].Id, include: include); + + Assert.That(step.StepDetails is RunStepToolCallDetails); + RunStepToolCallDetails toolCallDetails = step.StepDetails as RunStepToolCallDetails; + Assert.That(toolCallDetails.ToolCalls[0] is RunStepFileSearchToolCall); + RunStepFileSearchToolCall fileSearchCall = toolCallDetails.ToolCalls[0] as RunStepFileSearchToolCall; + Assert.Greater(fileSearchCall.FileSearch.Results.Count, 0); + if (includeContent) + { + Assert.Greater(fileSearchCall.FileSearch.Results[0].Content.Count, 0); + Assert.AreEqual(FileSearchToolCallContentType.Text, fileSearchCall.FileSearch.Results[0].Content[0].Type); + Assert.False(string.IsNullOrEmpty(fileSearchCall.FileSearch.Results[0].Content[0].Text)); + } + else + { + Assert.AreEqual(0, fileSearchCall.FileSearch.Results[0].Content.Count); + } + } + + [RecordedTest] + public async Task TestAzureFunctionCall() + { + // Note: This test was recorded in westus region as for now + // 2025-02-05 it is not supported in test region (East US 2) + AzureFunctionToolDefinition azureFnTool = new( + name: "foo", + description: "Get answers from the foo bot.", + inputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-foo-input", + storageServiceEndpoint: TestEnvironment.STORAGE_QUEUE_URI + ) + ), + outputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-tool-output", + storageServiceEndpoint: TestEnvironment.STORAGE_QUEUE_URI + ) + ), + parameters: BinaryData.FromObjectAsJson( + new + { + Type = "object", + Properties = new + { + query = new + { + Type = "string", + Description = "The question to ask.", + }, + outputqueueuri = new + { + Type = "string", + Description = "The full output queue uri." + } + }, + }, + new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase } + ) + ); + AgentsClient client = GetClient(); + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "You are a helpful support agent. Use the provided function any " + + "time the prompt contains the string 'What would foo say?'. When you invoke " + + "the function, ALWAYS specify the output queue uri parameter as " + + $"'{TestEnvironment.STORAGE_QUEUE_URI}/azure-function-tool-output'. Always responds with " + + "\"Foo says\" and then the response from the tool.", + tools: new List { azureFnTool } + ); + AgentThread thread = await client.CreateThreadAsync(); + ThreadMessage message = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What is the most prevalent element in the universe? What would foo say?"); + ThreadRun run = await client.CreateRunAsync(thread, agent); + await WaitForRun(client, run); + PageableList afterRunMessages = await client.GetMessagesAsync(thread.Id); + + Assert.Greater(afterRunMessages.Count(), 1); + bool foundResponse = false; + foreach (ThreadMessage msg in afterRunMessages) + { + foreach (MessageContent contentItem in msg.ContentItems) + { + if (contentItem is MessageTextContent textItem) + { + if (textItem.Text.ToLower().Contains("bar")) + { + foundResponse = true; + break; + } + } + } + } + Assert.True(foundResponse); + } + + [RecordedTest] + public async Task TestClientWithThreadMessages() + { + AgentsClient client = GetClient(); + Agent agent = await GetAgent( + client, + instruction: "You are a personal electronics tutor. Write and run code to answer questions."); + + List messages = [ + new(role: MessageRole.Agent, content: "E=mc^2"), + new(role: MessageRole.Agent, content: "What is the impedance formula?") + ]; + AgentThread thread = await client.CreateThreadAsync(messages: messages); + ThreadRun run = await client.CreateRunAsync(thread, agent); + run = await WaitForRun(client, run); + Assert.AreEqual(RunStatus.Completed, run.Status); + PageableList afterRunMessages = await client.GetMessagesAsync(thread.Id); + Assert.Greater(afterRunMessages.Count(), 1); + } + + [Ignore(FILE_UPLOAD_CONSTRAINT)] + [RecordedTest] + public async Task TestGenerateImageFile() + { + string tempDir = CreateTempDirMayBe(); + FileInfo file = new(Path.Combine(tempDir, FILE_NAME2)); + using (FileStream stream = file.OpenWrite()) + { + string content = "This is a test file"; + stream.Write(Encoding.UTF8.GetBytes(content), 0, content.Length); + }; + + AgentsClient client = GetClient(); + AgentFile fileDataSource = await client.UploadFileAsync(file.FullName, AgentFilePurpose.Agents); + + CodeInterpreterToolResource cdResource = new(); + cdResource.FileIds.Add(fileDataSource.Id); + ToolResources toolRes = new(); + toolRes.CodeInterpreter = cdResource; + + Agent agent = await client.CreateAgentAsync( + model: "gpt-4", + name: AGENT_NAME, + instructions: "You are helpful assistant", + tools: [new CodeInterpreterToolDefinition()], + toolResources: toolRes + ); + + AgentThread thread = await client.CreateThreadAsync(); + await client.CreateMessageAsync( + threadId: thread.Id, + role: MessageRole.User, + content: "Create an image file same as the text file and give me file id?" + ); + ThreadRun run = await client.CreateRunAsync(thread, agent); + run = await WaitForRun(client, run); + PageableList messages = await client.GetMessagesAsync(run.ThreadId, run.Id); + bool foundId = false; + foreach (ThreadMessage msg in messages) + { + foreach (MessageContent cont in msg.ContentItems) + { + if (cont is MessageTextContent textCont) + { + foreach (MessageTextAnnotation annotation in textCont.Annotations) + { + if (annotation is MessageTextFilePathAnnotation pathAnnotation) + { + Assert.NotNull(pathAnnotation.FileId); + foundId = true; + } + } + } + } + } + Assert.True(foundId); + } + + #region Helpers + + private static string CreateTempDirMayBe() + { + string tempDir = Path.Combine(Path.GetTempPath(), TEMP_DIR); + if (!Directory.Exists(tempDir)) + { + var info = Directory.CreateDirectory(tempDir); + Assert.True(info.Exists, "Unable to create temp directory."); + } + return tempDir; + } + + private AgentsClient GetClient() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + // If we are in the Playback, do not ask for authentication. + if (Mode == RecordedTestMode.Playback) + { + return InstrumentClient(new AgentsClient(connectionString, new MockCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + // For local testing if you are using non default account + // add USE_CLI_CREDENTIAL into the .runsettings and set it to true, + // also provide the PATH variable. + // This path should allow launching az command. + var cli = System.Environment.GetEnvironmentVariable("USE_CLI_CREDENTIAL"); + if (!string.IsNullOrEmpty(cli) && string.Compare(cli, "true", StringComparison.OrdinalIgnoreCase) == 0) + { + return InstrumentClient(new AgentsClient(connectionString, new AzureCliCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + else + { + return InstrumentClient(new AgentsClient(connectionString, new DefaultAzureCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + } + + private static async void DeleteAndAssert(AgentsClient client, Agent agent) + { + Response resp = await client.DeleteAgentAsync(agent.Id); + Assert.IsTrue(resp.Value); + } + + private static async Task GetAgent(AgentsClient client, string agentName=AGENT_NAME, string instruction= "You are helpful assistant.") + { + return await client.CreateAgentAsync( + model: "gpt-4", + name: agentName, + instructions: instruction + ); + } + + private static async Task GetThread(AgentsClient client, Dictionary metadata=null) + { + Agent agent = await GetAgent(client); + return await client.CreateThreadAsync(metadata: metadata); + } + + private static byte[] GetBytes(object value) + { + return Encoding.ASCII.GetBytes(JsonSerializer.Serialize(value)); + } + + private static MemoryStream GetStream(object value) + { + MemoryStream stream = new(); + stream.Write(GetBytes(value), 0, GetBytes(value).Length); + stream.Position = 0; + return stream; + } + + private static string GetFieldFromJson(BinaryData json, string field) + { + JsonDocument document = JsonDocument.Parse(json); + foreach (JsonProperty property in document.RootElement.EnumerateObject()) + { + if (property.NameEquals(field)) + { + return property.Value.GetString(); + } + } + return default; + } + + private async Task WaitForRun(AgentsClient client, ThreadRun run) + { + double delay = 500; + if (Mode == RecordedTestMode.Playback) + { + // No need to wait during playback. + delay = 1; + } + do + { + await Task.Delay(TimeSpan.FromMilliseconds(delay)); + run = await client.GetRunAsync(run.ThreadId, run.Id); + } + while (run.Status == RunStatus.Queued + || run.Status == RunStatus.InProgress + || run.Status == RunStatus.RequiresAction); + Assert.AreEqual(RunStatus.Completed, run.Status); + return run; + } + + private static string GetFile([CallerFilePath] string pth = "") + { + var dirName = Path.GetDirectoryName(pth) ?? ""; + return Path.Combine(new string[] { dirName, "TestData", FILE_NAME }); + } + + private static async Task CountElementsAndRemoveIds(AgentsClient client, HashSet ids) + { + PageableList agentsResp; + int count = 0; + string lastId = null; + do + { + agentsResp = await client.GetAgentsAsync(limit: 100, after: lastId); + foreach (Agent agent in agentsResp) + ids.Remove(agent.Id); + count += agentsResp.Count(); + lastId = agentsResp.LastId; + } + while (agentsResp.HasMore); + return count; + } + #endregion + #region Cleanup + [TearDown] + public void Cleanup() + { + // Remve temporary directory + DirectoryInfo tempDir = new(Path.Combine(Path.GetTempPath(), TEMP_DIR)); + if (tempDir.Exists) + { + tempDir.Delete(true); + } + if (Mode == RecordedTestMode.Playback) + return; + AgentsClient client; + var cli = System.Environment.GetEnvironmentVariable("USE_CLI_CREDENTIAL"); + if (!string.IsNullOrEmpty(cli) && string.Compare(cli, "true", StringComparison.OrdinalIgnoreCase) == 0) + { + client = new AgentsClient(TestEnvironment.AzureAICONNECTIONSTRING, new AzureCliCredential()); + } + else + { + client = new AgentsClient(TestEnvironment.AzureAICONNECTIONSTRING, new DefaultAzureCredential()); + } + + // Remove all files + IReadOnlyList files = client.GetFiles().Value; + foreach (AgentFile af in files) + { + if (af.Filename.Equals(FILE_NAME) || af.Filename.Equals(FILE_NAME2)) + client.DeleteFile(af.Id); + } + + // Remove all vector stores + AgentPageableListOfVectorStore stores = client.GetVectorStores(); + foreach (VectorStore store in stores.Data) + { + if (store.Name == null || store.Name.Equals(VCT_STORE_NAME)) + client.DeleteVectorStore(store.Id); + } + + // Remove all agents + PageableList agents = client.GetAgents(); + foreach (Agent agent in agents) + { + if (agent.Name.StartsWith(AGENT_NAME)) + client.DeleteAgent(agent.Id); + } + } + #endregion + } +} diff --git a/sdk/ai/Azure.AI.Projects/tests/ConnectionsClientTests.cs b/sdk/ai/Azure.AI.Projects/tests/ConnectionsClientTests.cs new file mode 100644 index 000000000000..83425d1df611 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/tests/ConnectionsClientTests.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.Tests +{ + public class ConnectionsClientTests : RecordedTestBase + { + public ConnectionsClientTests(bool isAsync) : base(isAsync) + { + TestDiagnostics = false; + } + + [RecordedTest] + [TestCase(true)] + [TestCase(false)] + public async Task TestGetDefaultBlobStore(bool withCredentials) + { + ConnectionsClient connectionsClient = GetClient(); + // TODO: When the service will be able to handle + // GetConnection requests, remove this condition. + if (!withCredentials) + { + Response conn = await connectionsClient.GetDefaultConnectionAsync( + category: ConnectionType.AzureBlobStorage, + withCredential: withCredentials, + includeAll: true); + Assert.AreEqual("ai-projects-sdk-testing-project-1/delete2me", conn.Value.Name); + // TODO: When the service will be able to handle + // GetConnection requests, check that it is not none. + Assert.IsNull(conn.GetRawResponse()); + } + else + { + Assert.ThrowsAsync( + () => connectionsClient.GetDefaultConnectionAsync( + category: ConnectionType.AzureBlobStorage, + withCredential: true, + includeAll: true)); + } + } + + #region helpers + private ConnectionsClient GetClient() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + // If we are in the Playback, do not ask for authentication. + if (Mode == RecordedTestMode.Playback) + { + return InstrumentClient(new ConnectionsClient(connectionString, new MockCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + // For local testing if you are using non default account + // add USE_CLI_CREDENTIAL into the .runsettings and set it to true, + // also provide the PATH variable. + // This path should allow launching az command. + var cli = System.Environment.GetEnvironmentVariable("USE_CLI_CREDENTIAL"); + if (!string.IsNullOrEmpty(cli) && string.Compare(cli, "true", StringComparison.OrdinalIgnoreCase) == 0) + { + return InstrumentClient(new ConnectionsClient(connectionString, new AzureCliCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + else + { + return InstrumentClient(new ConnectionsClient(connectionString, new DefaultAzureCredential(), InstrumentClientOptions(new AIProjectClientOptions()))); + } + } + #endregion + } +} diff --git a/sdk/ai/Azure.AI.Projects/tests/Utilities/MockTokenCredential.cs b/sdk/ai/Azure.AI.Projects/tests/Utilities/MockTokenCredential.cs new file mode 100644 index 000000000000..d195a3adf591 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/tests/Utilities/MockTokenCredential.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.AI.Projects.Tests +{ + internal class MockTokenCredential : TokenCredential + { + public override async ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + return await Task.Run(() => new AccessToken(accessToken: "Mock Token", expiresOn: DateTimeOffset.MaxValue)); + } + + public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + return new AccessToken(accessToken: "Mock Token", expiresOn: DateTimeOffset.MaxValue); + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/tsp-location.yaml b/sdk/ai/Azure.AI.Projects/tsp-location.yaml index 9b029b8ae858..2e8d2adc8a0a 100644 --- a/sdk/ai/Azure.AI.Projects/tsp-location.yaml +++ b/sdk/ai/Azure.AI.Projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Azure.AI.Projects -commit: 45d7bd5dfc21444d8bfdc9ff7a10cf4222286039 +commit: 6e507701253408679175e95176995c437f8e00d4 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md index 631f2f0c68a4..ce4a725ffe9d 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md @@ -247,8 +247,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fappconfiguration%2FAzure.Data.AppConfiguration%2FREADME.png) - [azconfig_docs]: https://learn.microsoft.com/azure/azure-app-configuration/ [azconfig_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/CONTRIBUTING.md diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md index 311f7c7f4af1..33ddc9644249 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md @@ -1,17 +1,27 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.5.0-beta.1 (Unreleased) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed ### Other Changes +## 1.4.0 (2025-01-24) + +### Features Added + +- Upgraded api-version tag from 'package-preview-2023-08' to 'package-2024-05-01'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/b72e0199fa3242d64b0b49f38e71586066a8c048/specification/appconfiguration/resource-manager/readme.md. +- Exposed `JsonModelWriteCore` for model serialization procedure. + +### Other Changes + +- Upgraded Azure.Core from 1.39.0 to 1.44.1 +- Upgraded Azure.ResourceManager from 1.12.0 to 1.13.0 + ## 1.3.2 (2024-05-07) ### Features Added @@ -112,6 +122,7 @@ Polishing since last public beta release: ## 1.0.0-beta.3 (2022-03-31) ### Breaking Changes + - Now all the resource classes would have a `Resource` suffix (if it previously does not have one). - Renamed some models to more comprehensive names. - `bool waitForCompletion` parameter in all long running operations were changed to `WaitUntil waitUntil`. @@ -119,6 +130,7 @@ Polishing since last public beta release: - Removed `GetIfExists` methods from all the resource classes. ### Other Changes + - Refresh reference ## 1.0.0-beta.2 (2022-01-06) diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.net8.0.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.net8.0.cs index ed47e19853a8..41892ad9e4f1 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.net8.0.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.net8.0.cs @@ -8,6 +8,7 @@ public static partial class AppConfigurationExtensions public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaResource GetAppConfigurationReplicaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetAppConfigurationStore(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetAppConfigurationStoreAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreResource GetAppConfigurationStoreResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -227,6 +228,55 @@ protected AppConfigurationReplicaResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class AppConfigurationSnapshotCollection : Azure.ResourceManager.ArmCollection + { + protected AppConfigurationSnapshotCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string snapshotName, Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string snapshotName, Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppConfigurationSnapshotData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppConfigurationSnapshotData() { } + public Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType? CompositionType { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ETag? ETag { get { throw null; } } + public System.DateTimeOffset? ExpireOn { get { throw null; } } + public System.Collections.Generic.IList Filters { get { throw null; } } + public long? ItemsCount { get { throw null; } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? ProvisioningState { get { throw null; } } + public long? RetentionPeriod { get { throw null; } set { } } + public long? Size { get { throw null; } } + public string SnapshotType { get { throw null; } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus? Status { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppConfigurationSnapshotResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppConfigurationSnapshotResource() { } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AppConfigurationStoreCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected AppConfigurationStoreCollection() { } @@ -249,6 +299,7 @@ public partial class AppConfigurationStoreData : Azure.ResourceManager.Models.Tr public AppConfigurationStoreData(Azure.Core.AzureLocation location, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSku sku) { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnablePurgeProtection { get { throw null; } set { } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties { get { throw null; } set { } } @@ -290,6 +341,9 @@ protected AppConfigurationStoreResource() { } public virtual Azure.Response GetAppConfigurationReplica(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAppConfigurationReplicaAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaCollection GetAppConfigurationReplicas() { throw null; } + public virtual Azure.Response GetAppConfigurationSnapshot(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppConfigurationSnapshotAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotCollection GetAppConfigurationSnapshots() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetKeys(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetKeysAsync(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -383,6 +437,7 @@ protected MockableAppConfigurationArmClient() { } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaResource GetAppConfigurationReplicaResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationStoreResource GetAppConfigurationStoreResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.DeletedAppConfigurationStoreResource GetDeletedAppConfigurationStoreResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -430,6 +485,18 @@ public enum AppConfigurationCreateMode Recover = 0, Default = 1, } + public partial class AppConfigurationDataPlaneProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppConfigurationDataPlaneProxyProperties() { } + public Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode? AuthenticationMode { get { throw null; } set { } } + public Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation? PrivateLinkDelegation { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AppConfigurationKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AppConfigurationKeyVaultProperties() { } @@ -613,6 +680,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppConfigurationSnapshotStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppConfigurationSnapshotStatus(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Archived { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Provisioning { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Ready { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus left, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus left, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class AppConfigurationStoreApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationStoreApiKey() { } @@ -632,6 +719,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationStorePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AppConfigurationStorePatch() { } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnablePurgeProtection { get { throw null; } set { } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties { get { throw null; } set { } } @@ -655,8 +743,77 @@ public static partial class ArmAppConfigurationModelFactory public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResourceData AppConfigurationPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionState AppConfigurationPrivateLinkServiceConnectionState(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionStatus? status = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionStatus?), string description = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationActionsRequired? actionsRequired = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationActionsRequired?)) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData AppConfigurationReplicaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationReplicaProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationReplicaProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData AppConfigurationSnapshotData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string snapshotType = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus? status = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus?), System.Collections.Generic.IEnumerable filters = null, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType? compositionType = default(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), long? retentionPeriod = default(long?), long? size = default(long?), long? itemsCount = default(long?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationStoreApiKey AppConfigurationStoreApiKey(string id = null, string name = null, string value = null, string connectionString = null, System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), bool? isReadOnly = default(bool?)) { throw null; } - public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess?), bool? disableLocalAuth = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode?)) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess?), bool? disableLocalAuth = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties dataPlaneProxy = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string skuName, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState, System.DateTimeOffset? createdOn, string endpoint, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth, int? softDeleteRetentionInDays, bool? enablePurgeProtection, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode) { throw null; } public static Azure.ResourceManager.AppConfiguration.DeletedAppConfigurationStoreData DeletedAppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier configurationStoreId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary tags = null, bool? isPurgeProtectionEnabled = default(bool?)) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPlaneProxyAuthenticationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPlaneProxyAuthenticationMode(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode Local { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode PassThrough { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPlaneProxyPrivateLinkDelegation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPlaneProxyPrivateLinkDelegation(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation Disabled { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SnapshotCompositionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SnapshotCompositionType(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType Key { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType KeyLabel { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType left, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType left, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SnapshotKeyValueFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SnapshotKeyValueFilter(string key) { } + public string Key { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.SnapshotKeyValueFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.SnapshotKeyValueFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.netstandard2.0.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.netstandard2.0.cs index ed47e19853a8..41892ad9e4f1 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.netstandard2.0.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/api/Azure.ResourceManager.AppConfiguration.netstandard2.0.cs @@ -8,6 +8,7 @@ public static partial class AppConfigurationExtensions public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaResource GetAppConfigurationReplicaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetAppConfigurationStore(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetAppConfigurationStoreAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string configStoreName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreResource GetAppConfigurationStoreResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -227,6 +228,55 @@ protected AppConfigurationReplicaResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class AppConfigurationSnapshotCollection : Azure.ResourceManager.ArmCollection + { + protected AppConfigurationSnapshotCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string snapshotName, Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string snapshotName, Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppConfigurationSnapshotData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppConfigurationSnapshotData() { } + public Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType? CompositionType { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ETag? ETag { get { throw null; } } + public System.DateTimeOffset? ExpireOn { get { throw null; } } + public System.Collections.Generic.IList Filters { get { throw null; } } + public long? ItemsCount { get { throw null; } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? ProvisioningState { get { throw null; } } + public long? RetentionPeriod { get { throw null; } set { } } + public long? Size { get { throw null; } } + public string SnapshotType { get { throw null; } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus? Status { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppConfigurationSnapshotResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppConfigurationSnapshotResource() { } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AppConfigurationStoreCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected AppConfigurationStoreCollection() { } @@ -249,6 +299,7 @@ public partial class AppConfigurationStoreData : Azure.ResourceManager.Models.Tr public AppConfigurationStoreData(Azure.Core.AzureLocation location, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSku sku) { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnablePurgeProtection { get { throw null; } set { } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties { get { throw null; } set { } } @@ -290,6 +341,9 @@ protected AppConfigurationStoreResource() { } public virtual Azure.Response GetAppConfigurationReplica(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAppConfigurationReplicaAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaCollection GetAppConfigurationReplicas() { throw null; } + public virtual Azure.Response GetAppConfigurationSnapshot(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppConfigurationSnapshotAsync(string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotCollection GetAppConfigurationSnapshots() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetKeys(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetKeysAsync(string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -383,6 +437,7 @@ protected MockableAppConfigurationArmClient() { } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaResource GetAppConfigurationReplicaResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.AppConfigurationStoreResource GetAppConfigurationStoreResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppConfiguration.DeletedAppConfigurationStoreResource GetDeletedAppConfigurationStoreResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -430,6 +485,18 @@ public enum AppConfigurationCreateMode Recover = 0, Default = 1, } + public partial class AppConfigurationDataPlaneProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppConfigurationDataPlaneProxyProperties() { } + public Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode? AuthenticationMode { get { throw null; } set { } } + public Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation? PrivateLinkDelegation { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AppConfigurationKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AppConfigurationKeyVaultProperties() { } @@ -613,6 +680,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppConfigurationSnapshotStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppConfigurationSnapshotStatus(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Archived { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Provisioning { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus Ready { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus left, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus left, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class AppConfigurationStoreApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationStoreApiKey() { } @@ -632,6 +719,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationStorePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AppConfigurationStorePatch() { } + public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnablePurgeProtection { get { throw null; } set { } } public Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties { get { throw null; } set { } } @@ -655,8 +743,77 @@ public static partial class ArmAppConfigurationModelFactory public static Azure.ResourceManager.AppConfiguration.AppConfigurationPrivateLinkResourceData AppConfigurationPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionState AppConfigurationPrivateLinkServiceConnectionState(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionStatus? status = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPrivateLinkServiceConnectionStatus?), string description = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationActionsRequired? actionsRequired = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationActionsRequired?)) { throw null; } public static Azure.ResourceManager.AppConfiguration.AppConfigurationReplicaData AppConfigurationReplicaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationReplicaProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationReplicaProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationSnapshotData AppConfigurationSnapshotData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string snapshotType = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus? status = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationSnapshotStatus?), System.Collections.Generic.IEnumerable filters = null, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType? compositionType = default(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), long? retentionPeriod = default(long?), long? size = default(long?), long? itemsCount = default(long?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.AppConfiguration.Models.AppConfigurationStoreApiKey AppConfigurationStoreApiKey(string id = null, string name = null, string value = null, string connectionString = null, System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), bool? isReadOnly = default(bool?)) { throw null; } - public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess?), bool? disableLocalAuth = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode?)) { throw null; } + public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string endpoint = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess?), bool? disableLocalAuth = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.AppConfiguration.Models.AppConfigurationDataPlaneProxyProperties dataPlaneProxy = null, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode = default(Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppConfiguration.AppConfigurationStoreData AppConfigurationStoreData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string skuName, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationProvisioningState? provisioningState, System.DateTimeOffset? createdOn, string endpoint, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationKeyVaultProperties encryptionKeyVaultProperties, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth, int? softDeleteRetentionInDays, bool? enablePurgeProtection, Azure.ResourceManager.AppConfiguration.Models.AppConfigurationCreateMode? createMode) { throw null; } public static Azure.ResourceManager.AppConfiguration.DeletedAppConfigurationStoreData DeletedAppConfigurationStoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier configurationStoreId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary tags = null, bool? isPurgeProtectionEnabled = default(bool?)) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPlaneProxyAuthenticationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPlaneProxyAuthenticationMode(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode Local { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode PassThrough { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyAuthenticationMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPlaneProxyPrivateLinkDelegation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPlaneProxyPrivateLinkDelegation(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation Disabled { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation left, Azure.ResourceManager.AppConfiguration.Models.DataPlaneProxyPrivateLinkDelegation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SnapshotCompositionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SnapshotCompositionType(string value) { throw null; } + public static Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType Key { get { throw null; } } + public static Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType KeyLabel { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType left, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType left, Azure.ResourceManager.AppConfiguration.Models.SnapshotCompositionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SnapshotKeyValueFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SnapshotKeyValueFilter(string key) { } + public string Key { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.SnapshotKeyValueFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppConfiguration.Models.SnapshotKeyValueFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/assets.json b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/assets.json index 48a2bb24e9d9..32a97c1432a6 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/assets.json +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/appconfiguration/Azure.ResourceManager.AppConfiguration", - "Tag": "net/appconfiguration/Azure.ResourceManager.AppConfiguration_58ecdb69fe" + "Tag": "net/appconfiguration/Azure.ResourceManager.AppConfiguration_ad053f3b5d" } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueCollection.cs index 44935187f14f..e5c7863e6d31 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationKeyValueCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_KeyValuesCreateOrUpdate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateKeyValue.json // this example is just showing the usage of "KeyValues_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_KeyValuesCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_KeyValuesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetKeyValue.json // this example is just showing the usage of "KeyValues_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_KeyValuesGet() [Ignore("Only validating compilation of examples")] public async Task Exists_KeyValuesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetKeyValue.json // this example is just showing the usage of "KeyValues_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Exists_KeyValuesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_KeyValuesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetKeyValue.json // this example is just showing the usage of "KeyValues_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueResource.cs index 02b14b3d87c3..28077bedea1c 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationKeyValueResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationKeyValueResource [Ignore("Only validating compilation of examples")] public async Task Get_KeyValuesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetKeyValue.json // this example is just showing the usage of "KeyValues_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_KeyValuesGet() [Ignore("Only validating compilation of examples")] public async Task Delete_KeyValuesDelete() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresDeleteKeyValue.json // this example is just showing the usage of "KeyValues_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_KeyValuesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_KeyValuesCreateOrUpdate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateKeyValue.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateKeyValue.json // this example is just showing the usage of "KeyValues_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionCollection.cs index f2d34195f024..c25dc891ffb8 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AppConfigurationPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionUpdate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetConnection() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_PrivateEndpointConnectionGetConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionList() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListPrivateEndpointConnections.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresListPrivateEndpointConnections.json // this example is just showing the usage of "PrivateEndpointConnections_ListByConfigurationStore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_PrivateEndpointConnectionList() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGetConnection() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_PrivateEndpointConnectionGetConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGetConnection() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionResource.cs index dbfaab93523c..5401681d72fa 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AppConfigurationPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetConnection() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGetConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionsDelete() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_PrivateEndpointConnectionsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionUpdate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResource.cs index f91c00691259..34bde02be050 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkResourcesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/PrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResourceCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResourceCollection.cs index 22761d6f1f00..28ce4c060b24 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResourceCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkResourcesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/PrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_PrivateLinkResourcesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateLinkResourcesListGroupIds() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourcesListByConfigurationStore.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/PrivateLinkResourcesListByConfigurationStore.json // this example is just showing the usage of "PrivateLinkResources_ListByConfigurationStore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_PrivateLinkResourcesListGroupIds() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateLinkResourcesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/PrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_PrivateLinkResourcesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateLinkResourcesGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/PrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaCollection.cs index 6d56cf0b9941..7a12d44360d9 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationReplicaCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ReplicasCreate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateReplica.json // this example is just showing the usage of "Replicas_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task CreateOrUpdate_ReplicasCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ReplicasGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetReplica.json // this example is just showing the usage of "Replicas_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_ReplicasGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ReplicasListByConfigurationStore() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListReplicas.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresListReplicas.json // this example is just showing the usage of "Replicas_ListByConfigurationStore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task GetAll_ReplicasListByConfigurationStore() [Ignore("Only validating compilation of examples")] public async Task Exists_ReplicasGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetReplica.json // this example is just showing the usage of "Replicas_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +158,7 @@ public async Task Exists_ReplicasGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ReplicasGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetReplica.json // this example is just showing the usage of "Replicas_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaResource.cs index 61e12d1720de..f0c96ae4ef40 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationReplicaResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AppConfigurationReplicaResource [Ignore("Only validating compilation of examples")] public async Task Get_ReplicasGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetReplica.json // this example is just showing the usage of "Replicas_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_ReplicasGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ReplicasDelete() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresDeleteReplica.json // this example is just showing the usage of "Replicas_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_ReplicasDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ReplicasCreate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateReplica.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateReplica.json // this example is just showing the usage of "Replicas_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotCollection.cs new file mode 100644 index 000000000000..6d0e0f246f99 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotCollection.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppConfiguration.Samples +{ + public partial class Sample_AppConfigurationSnapshotCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + AppConfigurationSnapshotResource result = await collection.GetAsync(snapshotName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + bool result = await collection.ExistsAsync(snapshotName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + NullableResponse response = await collection.GetIfExistsAsync(snapshotName); + AppConfigurationSnapshotResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotResource.cs new file mode 100644 index 000000000000..7d4672cd98c6 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationSnapshotResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppConfiguration.Samples +{ + public partial class Sample_AppConfigurationSnapshotResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationSnapshotResource created on azure + // for more information of creating AppConfigurationSnapshotResource, please refer to the document of AppConfigurationSnapshotResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + string snapshotName = "mySnapshot"; + ResourceIdentifier appConfigurationSnapshotResourceId = AppConfigurationSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName, snapshotName); + AppConfigurationSnapshotResource appConfigurationSnapshot = client.GetAppConfigurationSnapshotResource(appConfigurationSnapshotResourceId); + + // invoke the operation + AppConfigurationSnapshotResource result = await appConfigurationSnapshot.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreCollection.cs index 98ddff56e6a9..62d7bdaa2454 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_AppConfigurationStoreCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConfigurationStoresCreate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreate.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreate.json // this example is just showing the usage of "ConfigurationStores_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,11 +59,53 @@ public async Task CreateOrUpdate_ConfigurationStoresCreate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ConfigurationStoresCreateWithDataPlaneProxy() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateWithDataPlaneProxy.json + // this example is just showing the usage of "ConfigurationStores_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppConfigurationStoreResource + AppConfigurationStoreCollection collection = resourceGroupResource.GetAppConfigurationStores(); + + // invoke the operation + string configStoreName = "contoso"; + AppConfigurationStoreData data = new AppConfigurationStoreData(new AzureLocation("westus"), new AppConfigurationSku("Standard")) + { + DataPlaneProxy = new AppConfigurationDataPlaneProxyProperties + { + AuthenticationMode = DataPlaneProxyAuthenticationMode.PassThrough, + PrivateLinkDelegation = DataPlaneProxyPrivateLinkDelegation.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configStoreName, data); + AppConfigurationStoreResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationStoreData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConfigurationStoresCreateWithIdentity() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithIdentity.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateWithIdentity.json // this example is just showing the usage of "ConfigurationStores_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +153,7 @@ public async Task CreateOrUpdate_ConfigurationStoresCreateWithIdentity() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConfigurationStoresCreateWithLocalAuthDisabled() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json // this example is just showing the usage of "ConfigurationStores_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +191,7 @@ public async Task CreateOrUpdate_ConfigurationStoresCreateWithLocalAuthDisabled( [Ignore("Only validating compilation of examples")] public async Task Get_ConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +224,7 @@ public async Task Get_ConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ConfigurationStoresListByResourceGroup() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListByResourceGroup.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresListByResourceGroup.json // this example is just showing the usage of "ConfigurationStores_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +259,7 @@ public async Task GetAll_ConfigurationStoresListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_ConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +288,7 @@ public async Task Exists_ConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreResource.cs index 30ae1953e851..a772f2e35b7c 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_AppConfigurationStoreResource.cs @@ -21,7 +21,7 @@ public partial class Sample_AppConfigurationStoreResource [Ignore("Only validating compilation of examples")] public async Task Get_ConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ConfigurationStoresDelete() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDelete.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresDelete.json // this example is just showing the usage of "ConfigurationStores_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_ConfigurationStoresDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ConfigurationStoresUpdate() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdate.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresUpdate.json // this example is just showing the usage of "ConfigurationStores_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Update_ConfigurationStoresUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_ConfigurationStoresUpdateDisableLocalAuth() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json // this example is just showing the usage of "ConfigurationStores_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Update_ConfigurationStoresUpdateDisableLocalAuth() [Ignore("Only validating compilation of examples")] public async Task Update_ConfigurationStoresUpdateWithIdentity() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateWithIdentity.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresUpdateWithIdentity.json // this example is just showing the usage of "ConfigurationStores_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -198,7 +198,7 @@ public async Task Update_ConfigurationStoresUpdateWithIdentity() [Ignore("Only validating compilation of examples")] public async Task GetKeys_ConfigurationStoresListKeys() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListKeys.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresListKeys.json // this example is just showing the usage of "ConfigurationStores_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -227,7 +227,7 @@ public async Task GetKeys_ConfigurationStoresListKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_ConfigurationStoresRegenerateKey() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresRegenerateKey.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresRegenerateKey.json // this example is just showing the usage of "ConfigurationStores_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreCollection.cs index e5ee5d3663f9..e355825718fc 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeletedAppConfigurationStoreCollection [Ignore("Only validating compilation of examples")] public async Task Get_DeletedConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_DeletedConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DeletedConfigurationStoresList() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresList.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresList.json // this example is just showing the usage of "ConfigurationStores_ListDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task GetAll_DeletedConfigurationStoresList() [Ignore("Only validating compilation of examples")] public async Task Exists_DeletedConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Exists_DeletedConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DeletedConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreResource.cs index c4a18ff62031..0fc3bc644d8f 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_DeletedAppConfigurationStoreResource.cs @@ -19,7 +19,7 @@ public partial class Sample_DeletedAppConfigurationStoreResource [Ignore("Only validating compilation of examples")] public async Task Get_DeletedConfigurationStoresGet() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresGet.json // this example is just showing the usage of "ConfigurationStores_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Get_DeletedConfigurationStoresGet() [Ignore("Only validating compilation of examples")] public async Task PurgeDeleted_PurgeADeletedConfigurationStore() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/DeletedConfigurationStoresPurge.json // this example is just showing the usage of "ConfigurationStores_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotCollection.cs new file mode 100644 index 000000000000..b9624d2c9a21 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotCollection.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppConfiguration.Models; + +namespace Azure.ResourceManager.AppConfiguration.Samples +{ + public partial class Sample_SnapshotCollection + { + // Snapshots_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + AppConfigurationSnapshotResource result = await collection.GetAsync(snapshotName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Snapshots_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + bool result = await collection.ExistsAsync(snapshotName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Snapshots_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + NullableResponse response = await collection.GetIfExistsAsync(snapshotName); + AppConfigurationSnapshotResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Snapshots_Create + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_SnapshotsCreate() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresCreateSnapshot.json + // this example is just showing the usage of "Snapshots_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationStoreResource created on azure + // for more information of creating AppConfigurationStoreResource, please refer to the document of AppConfigurationStoreResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + ResourceIdentifier appConfigurationStoreResourceId = AppConfigurationStoreResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName); + AppConfigurationStoreResource appConfigurationStore = client.GetAppConfigurationStoreResource(appConfigurationStoreResourceId); + + // get the collection of this AppConfigurationSnapshotResource + AppConfigurationSnapshotCollection collection = appConfigurationStore.GetAppConfigurationSnapshots(); + + // invoke the operation + string snapshotName = "mySnapshot"; + AppConfigurationSnapshotData data = new AppConfigurationSnapshotData() + { + Filters = +{ +new SnapshotKeyValueFilter("app1/*") +{ +Label = "Production", +} +}, + RetentionPeriod = 3600, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, snapshotName, data); + AppConfigurationSnapshotResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotResource.cs new file mode 100644 index 000000000000..3184ec745587 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SnapshotResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; + +namespace Azure.ResourceManager.AppConfiguration.Samples +{ + public partial class Sample_SnapshotResource + { + // Snapshots_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_SnapshotsGet() + { + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresGetSnapshot.json + // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppConfigurationSnapshotResource created on azure + // for more information of creating AppConfigurationSnapshotResource, please refer to the document of AppConfigurationSnapshotResource + string subscriptionId = "c80fb759-c965-4c6a-9110-9b2b2d038882"; + string resourceGroupName = "myResourceGroup"; + string configStoreName = "contoso"; + string snapshotName = "mySnapshot"; + ResourceIdentifier snapshotResourceId = AppConfigurationSnapshotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, configStoreName, snapshotName); + AppConfigurationSnapshotResource snapshot = client.GetAppConfigurationSnapshotResource(snapshotResourceId); + + // invoke the operation + AppConfigurationSnapshotResource result = await snapshot.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppConfigurationSnapshotData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 4c0062540d05..a74672ae5db6 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetAppConfigurationStores_ConfigurationStoresList() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresList.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ConfigurationStoresList.json // this example is just showing the usage of "ConfigurationStores_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task GetAppConfigurationStores_ConfigurationStoresList() [Ignore("Only validating compilation of examples")] public async Task CheckAppConfigurationNameAvailability_ConfigurationStoresCheckNameAvailable() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameAvailable.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/CheckNameAvailable.json // this example is just showing the usage of "CheckAppConfigurationNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task CheckAppConfigurationNameAvailability_ConfigurationStoresCheck [Ignore("Only validating compilation of examples")] public async Task CheckAppConfigurationNameAvailability_ConfigurationStoresCheckNameNotAvailable() { - // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameNotAvailable.json + // Generated from example definition: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/CheckNameNotAvailable.json // this example is just showing the usage of "CheckAppConfigurationNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Azure.ResourceManager.AppConfiguration.csproj b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Azure.ResourceManager.AppConfiguration.csproj index 52107ecf3d90..d799d3a3d3d2 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Azure.ResourceManager.AppConfiguration.csproj +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Azure.ResourceManager.AppConfiguration.csproj @@ -1,8 +1,8 @@ - 1.4.0-beta.1 + 1.5.0-beta.1 - 1.3.2 + 1.4.0 Azure.ResourceManager.AppConfiguration Microsoft Azure management client SDK for Azure resource provider Microsoft.AppConfiguration. azure;management;appconfiguration diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Custom/AppConfigurationSnapshotResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Custom/AppConfigurationSnapshotResource.cs new file mode 100644 index 000000000000..7367641fee68 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Custom/AppConfigurationSnapshotResource.cs @@ -0,0 +1,28 @@ +// + +#nullable disable + +using System.Collections.Generic; +using System.Threading; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// + /// A Class representing a Snapshot along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetSnapshotResource method. + /// Otherwise you can get one from its parent resource using the GetSnapshot method. + /// + [CodeGenSuppress("UpdateAsync", typeof(WaitUntil), typeof(AppConfigurationSnapshotData), typeof(CancellationToken))] + [CodeGenSuppress("Update", typeof(WaitUntil), typeof(AppConfigurationSnapshotData), typeof(CancellationToken))] + [CodeGenSuppress("AddTagAsync", typeof(string), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("AddTag", typeof(string), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("SetTagsAsync", typeof(IDictionary), typeof(CancellationToken))] + [CodeGenSuppress("SetTags", typeof(IDictionary), typeof(CancellationToken))] + [CodeGenSuppress("RemoveTagAsync", typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("RemoveTag", typeof(string), typeof(CancellationToken))] + public partial class AppConfigurationSnapshotResource : ArmResource + { + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueCollection.cs index aaffc793b7db..4efccd19443b 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueCollection.cs @@ -61,7 +61,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -112,7 +112,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyValueNam /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual async Task> ExistsAsync(string keyValueName, Cance /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -339,7 +339,7 @@ public virtual Response Exists(string keyValueName, CancellationToken canc /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -384,7 +384,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueResource.cs index c2251b931e26..8c0a0d917d0e 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationKeyValueResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -643,7 +643,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionCollection.cs index 3ee26fbf3381..345d2ce27bd3 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionResource.cs index d7a2a44f22b0..258928161377 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResource.cs index c07ee03b722e..484b24ca5005 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResourceCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResourceCollection.cs index afca345539c0..a30459b868d6 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResourceCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupNam /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaCollection.cs index 0f6fba352ddc..f700ba77dcc7 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string replicaName, /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string skipToken /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string replicaName, Cancel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string replicaName, CancellationToken cance /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaResource.cs index adab8357e332..35ab069a30df 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationReplicaResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotCollection.cs new file mode 100644 index 000000000000..b9271e809488 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotCollection.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAppConfigurationSnapshots method from an instance of . + /// + public partial class AppConfigurationSnapshotCollection : ArmCollection + { + private readonly ClientDiagnostics _appConfigurationSnapshotSnapshotsClientDiagnostics; + private readonly SnapshotsRestOperations _appConfigurationSnapshotSnapshotsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AppConfigurationSnapshotCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AppConfigurationSnapshotCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appConfigurationSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppConfiguration", AppConfigurationSnapshotResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AppConfigurationSnapshotResource.ResourceType, out string appConfigurationSnapshotSnapshotsApiVersion); + _appConfigurationSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appConfigurationSnapshotSnapshotsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AppConfigurationStoreResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AppConfigurationStoreResource.ResourceType), nameof(id)); + } + + /// + /// Creates a snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Create + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the snapshot. + /// The parameters for creating a snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string snapshotName, AppConfigurationSnapshotData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _appConfigurationSnapshotSnapshotsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, data, cancellationToken).ConfigureAwait(false); + var operation = new AppConfigurationArmOperation(new AppConfigurationSnapshotOperationSource(Client), _appConfigurationSnapshotSnapshotsClientDiagnostics, Pipeline, _appConfigurationSnapshotSnapshotsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Create + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the snapshot. + /// The parameters for creating a snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string snapshotName, AppConfigurationSnapshotData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _appConfigurationSnapshotSnapshotsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, data, cancellationToken); + var operation = new AppConfigurationArmOperation(new AppConfigurationSnapshotOperationSource(Client), _appConfigurationSnapshotSnapshotsClientDiagnostics, Pipeline, _appConfigurationSnapshotSnapshotsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.Get"); + scope.Start(); + try + { + var response = await _appConfigurationSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.Get"); + scope.Start(); + try + { + var response = _appConfigurationSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.Exists"); + scope.Start(); + try + { + var response = await _appConfigurationSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.Exists"); + scope.Start(); + try + { + var response = _appConfigurationSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _appConfigurationSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotCollection.GetIfExists"); + scope.Start(); + try + { + var response = _appConfigurationSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, snapshotName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.Serialization.cs new file mode 100644 index 000000000000..30086b5ca534 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.Serialization.cs @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppConfiguration.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppConfiguration +{ + public partial class AppConfigurationSnapshotData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppConfigurationSnapshotData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(SnapshotType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SnapshotType); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsCollectionDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteStartArray(); + foreach (var item in Filters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CompositionType)) + { + writer.WritePropertyName("compositionType"u8); + writer.WriteStringValue(CompositionType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("created"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ExpireOn)) + { + writer.WritePropertyName("expires"u8); + writer.WriteStringValue(ExpireOn.Value, "O"); + } + if (Optional.IsDefined(RetentionPeriod)) + { + writer.WritePropertyName("retentionPeriod"u8); + writer.WriteNumberValue(RetentionPeriod.Value); + } + if (options.Format != "W" && Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"u8); + writer.WriteNumberValue(Size.Value); + } + if (options.Format != "W" && Optional.IsDefined(ItemsCount)) + { + writer.WritePropertyName("itemsCount"u8); + writer.WriteNumberValue(ItemsCount.Value); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WriteEndObject(); + } + + AppConfigurationSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppConfigurationSnapshotData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotData(document.RootElement, options); + } + + internal static AppConfigurationSnapshotData DeserializeAppConfigurationSnapshotData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type0 = default; + SystemData systemData = default; + AppConfigurationProvisioningState? provisioningState = default; + AppConfigurationSnapshotStatus? status = default; + IList filters = default; + SnapshotCompositionType? compositionType = default; + DateTimeOffset? created = default; + DateTimeOffset? expires = default; + long? retentionPeriod = default; + long? size = default; + long? itemsCount = default; + IDictionary tags = default; + ETag? etag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type0 = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppConfigurationProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AppConfigurationSnapshotStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("filters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(SnapshotKeyValueFilter.DeserializeSnapshotKeyValueFilter(item, options)); + } + filters = array; + continue; + } + if (property0.NameEquals("compositionType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compositionType = new SnapshotCompositionType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("created"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + created = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expires"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expires = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("retentionPeriod"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionPeriod = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("size"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + size = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("itemsCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + itemsCount = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("tags"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property0.NameEquals("etag"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppConfigurationSnapshotData( + id, + name, + type0, + systemData, + type, + provisioningState, + status, + filters ?? new ChangeTrackingList(), + compositionType, + created, + expires, + retentionPeriod, + size, + itemsCount, + tags ?? new ChangeTrackingDictionary(), + etag, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" type: "); + builder.AppendLine($"'{ResourceType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Filters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" filters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Filters)) + { + if (Filters.Any()) + { + builder.Append(" filters: "); + builder.AppendLine("["); + foreach (var item in Filters) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " filters: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CompositionType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" compositionType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CompositionType)) + { + builder.Append(" compositionType: "); + builder.AppendLine($"'{CompositionType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" created: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" created: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpireOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expires: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpireOn)) + { + builder.Append(" expires: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpireOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionPeriod), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" retentionPeriod: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RetentionPeriod)) + { + builder.Append(" retentionPeriod: "); + builder.AppendLine($"'{RetentionPeriod.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Size), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" size: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Size)) + { + builder.Append(" size: "); + builder.AppendLine($"'{Size.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ItemsCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" itemsCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ItemsCount)) + { + builder.Append(" itemsCount: "); + builder.AppendLine($"'{ItemsCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" etag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" etag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppConfigurationSnapshotData)} does not support writing '{options.Format}' format."); + } + } + + AppConfigurationSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAppConfigurationSnapshotData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppConfigurationSnapshotData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.cs new file mode 100644 index 000000000000..7e9059515be0 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotData.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppConfiguration.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// + /// A class representing the AppConfigurationSnapshot data model. + /// The snapshot resource. + /// + public partial class AppConfigurationSnapshotData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppConfigurationSnapshotData() + { + Filters = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The type of the resource. + /// The provisioning state of the snapshot. + /// The current status of the snapshot. + /// A list of filters used to filter the key-values included in the snapshot. + /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. + /// The time that the snapshot was created. + /// The time that the snapshot will expire. + /// The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. + /// The size in bytes of the snapshot. + /// The amount of key-values in the snapshot. + /// The tags of the snapshot. NOTE: These are data plane tags, not Azure Resource Manager (ARM) tags. + /// A value representing the current state of the snapshot. + /// Keeps track of any properties unknown to the library. + internal AppConfigurationSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string snapshotType, AppConfigurationProvisioningState? provisioningState, AppConfigurationSnapshotStatus? status, IList filters, SnapshotCompositionType? compositionType, DateTimeOffset? createdOn, DateTimeOffset? expireOn, long? retentionPeriod, long? size, long? itemsCount, IDictionary tags, ETag? eTag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + SnapshotType = snapshotType; + ProvisioningState = provisioningState; + Status = status; + Filters = filters; + CompositionType = compositionType; + CreatedOn = createdOn; + ExpireOn = expireOn; + RetentionPeriod = retentionPeriod; + Size = size; + ItemsCount = itemsCount; + Tags = tags; + ETag = eTag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the resource. + [WirePath("type")] + public string SnapshotType { get; } + /// The provisioning state of the snapshot. + [WirePath("properties.provisioningState")] + public AppConfigurationProvisioningState? ProvisioningState { get; } + /// The current status of the snapshot. + [WirePath("properties.status")] + public AppConfigurationSnapshotStatus? Status { get; } + /// A list of filters used to filter the key-values included in the snapshot. + [WirePath("properties.filters")] + public IList Filters { get; } + /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. + [WirePath("properties.compositionType")] + public SnapshotCompositionType? CompositionType { get; set; } + /// The time that the snapshot was created. + [WirePath("properties.created")] + public DateTimeOffset? CreatedOn { get; } + /// The time that the snapshot will expire. + [WirePath("properties.expires")] + public DateTimeOffset? ExpireOn { get; } + /// The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. + [WirePath("properties.retentionPeriod")] + public long? RetentionPeriod { get; set; } + /// The size in bytes of the snapshot. + [WirePath("properties.size")] + public long? Size { get; } + /// The amount of key-values in the snapshot. + [WirePath("properties.itemsCount")] + public long? ItemsCount { get; } + /// The tags of the snapshot. NOTE: These are data plane tags, not Azure Resource Manager (ARM) tags. + [WirePath("properties.tags")] + public IDictionary Tags { get; } + /// A value representing the current state of the snapshot. + [WirePath("properties.etag")] + public ETag? ETag { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.Serialization.cs new file mode 100644 index 000000000000..52c377b33418 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppConfiguration +{ + public partial class AppConfigurationSnapshotResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AppConfigurationSnapshotData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AppConfigurationSnapshotData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.cs new file mode 100644 index 000000000000..6f8fee1684a0 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationSnapshotResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// + /// A Class representing an AppConfigurationSnapshot along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAppConfigurationSnapshotResource method. + /// Otherwise you can get one from its parent resource using the GetAppConfigurationSnapshot method. + /// + public partial class AppConfigurationSnapshotResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The configStoreName. + /// The snapshotName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _appConfigurationSnapshotSnapshotsClientDiagnostics; + private readonly SnapshotsRestOperations _appConfigurationSnapshotSnapshotsRestClient; + private readonly AppConfigurationSnapshotData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AppConfiguration/configurationStores/snapshots"; + + /// Initializes a new instance of the class for mocking. + protected AppConfigurationSnapshotResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AppConfigurationSnapshotResource(ArmClient client, AppConfigurationSnapshotData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AppConfigurationSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appConfigurationSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppConfiguration", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string appConfigurationSnapshotSnapshotsApiVersion); + _appConfigurationSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appConfigurationSnapshotSnapshotsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AppConfigurationSnapshotData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotResource.Get"); + scope.Start(); + try + { + var response = await _appConfigurationSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _appConfigurationSnapshotSnapshotsClientDiagnostics.CreateScope("AppConfigurationSnapshotResource.Get"); + scope.Start(); + try + { + var response = _appConfigurationSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppConfigurationSnapshotResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreCollection.cs index 7cf2de8edcbb..130609d16c6a 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string configStoreNam /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(string s /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(string skipToken = /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string configStoreName, Ca /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual Response Exists(string configStoreName, CancellationToken c /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -446,7 +446,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.Serialization.cs index 1c394d6b6b4a..b48e988c0ba3 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.Serialization.cs @@ -105,6 +105,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePurgeProtection"u8); writer.WriteBooleanValue(EnablePurgeProtection.Value); } + if (Optional.IsDefined(DataPlaneProxy)) + { + writer.WritePropertyName("dataPlaneProxy"u8); + writer.WriteObjectValue(DataPlaneProxy, options); + } if (Optional.IsDefined(CreateMode)) { writer.WritePropertyName("createMode"u8); @@ -150,6 +155,7 @@ internal static AppConfigurationStoreData DeserializeAppConfigurationStoreData(J bool? disableLocalAuth = default; int? softDeleteRetentionInDays = default; bool? enablePurgeProtection = default; + AppConfigurationDataPlaneProxyProperties dataPlaneProxy = default; AppConfigurationCreateMode? createMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -304,6 +310,15 @@ internal static AppConfigurationStoreData DeserializeAppConfigurationStoreData(J enablePurgeProtection = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("dataPlaneProxy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataPlaneProxy = AppConfigurationDataPlaneProxyProperties.DeserializeAppConfigurationDataPlaneProxyProperties(property0.Value, options); + continue; + } if (property0.NameEquals("createMode"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -340,6 +355,7 @@ internal static AppConfigurationStoreData DeserializeAppConfigurationStoreData(J disableLocalAuth, softDeleteRetentionInDays, enablePurgeProtection, + dataPlaneProxy, createMode, serializedAdditionalRawData); } @@ -651,6 +667,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataPlaneProxy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dataPlaneProxy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DataPlaneProxy)) + { + builder.Append(" dataPlaneProxy: "); + BicepSerializationHelpers.AppendChildObject(builder, DataPlaneProxy, options, 4, false, " dataPlaneProxy: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreateMode), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.cs index eda63cb1ee61..de233b789454 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreData.cs @@ -81,9 +81,10 @@ public AppConfigurationStoreData(AzureLocation location, AppConfigurationSku sku /// Disables all authentication methods other than AAD authentication. /// The amount of time in days that the configuration store will be retained when it is soft deleted. /// Property specifying whether protection against purge is enabled for this configuration store. + /// Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). /// Indicates whether the configuration store need to be recovered. /// Keeps track of any properties unknown to the library. - internal AppConfigurationStoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, AppConfigurationSku sku, AppConfigurationProvisioningState? provisioningState, DateTimeOffset? createdOn, string endpoint, AppConfigurationStoreEncryptionProperties encryption, IReadOnlyList privateEndpointConnections, AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth, int? softDeleteRetentionInDays, bool? enablePurgeProtection, AppConfigurationCreateMode? createMode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal AppConfigurationStoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, AppConfigurationSku sku, AppConfigurationProvisioningState? provisioningState, DateTimeOffset? createdOn, string endpoint, AppConfigurationStoreEncryptionProperties encryption, IReadOnlyList privateEndpointConnections, AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth, int? softDeleteRetentionInDays, bool? enablePurgeProtection, AppConfigurationDataPlaneProxyProperties dataPlaneProxy, AppConfigurationCreateMode? createMode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Sku = sku; @@ -96,6 +97,7 @@ internal AppConfigurationStoreData(ResourceIdentifier id, string name, ResourceT DisableLocalAuth = disableLocalAuth; SoftDeleteRetentionInDays = softDeleteRetentionInDays; EnablePurgeProtection = enablePurgeProtection; + DataPlaneProxy = dataPlaneProxy; CreateMode = createMode; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -157,6 +159,9 @@ public AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties /// Property specifying whether protection against purge is enabled for this configuration store. [WirePath("properties.enablePurgeProtection")] public bool? EnablePurgeProtection { get; set; } + /// Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). + [WirePath("properties.dataPlaneProxy")] + public AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get; set; } /// Indicates whether the configuration store need to be recovered. [WirePath("properties.createMode")] public AppConfigurationCreateMode? CreateMode { get; set; } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs index 544c63b50406..1e52313b05cf 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs @@ -111,7 +111,7 @@ public virtual AppConfigurationPrivateEndpointConnectionCollection GetAppConfigu /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -180,7 +180,7 @@ public virtual AppConfigurationPrivateLinkResourceCollection GetAppConfiguration /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAppC /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -249,7 +249,7 @@ public virtual AppConfigurationKeyValueCollection GetAppConfigurationKeyValues() /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -280,7 +280,7 @@ public virtual async Task> GetAppConf /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual AppConfigurationReplicaCollection GetAppConfigurationReplicas() /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetAppConfi /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -367,6 +367,75 @@ public virtual Response GetAppConfigurationRepl return GetAppConfigurationReplicas().Get(replicaName, cancellationToken); } + /// Gets a collection of AppConfigurationSnapshotResources in the AppConfigurationStore. + /// An object representing collection of AppConfigurationSnapshotResources and their operations over a AppConfigurationSnapshotResource. + public virtual AppConfigurationSnapshotCollection GetAppConfigurationSnapshots() + { + return GetCachedClient(client => new AppConfigurationSnapshotCollection(client, Id)); + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppConfigurationSnapshotAsync(string snapshotName, CancellationToken cancellationToken = default) + { + return await GetAppConfigurationSnapshots().GetAsync(snapshotName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// Default Api Version + /// 2024-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the snapshot. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppConfigurationSnapshot(string snapshotName, CancellationToken cancellationToken = default) + { + return GetAppConfigurationSnapshots().Get(snapshotName, cancellationToken); + } + /// /// Gets the properties of the specified configuration store. /// @@ -380,7 +449,7 @@ public virtual Response GetAppConfigurationRepl /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -420,7 +489,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -460,7 +529,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -502,7 +571,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -544,7 +613,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -590,7 +659,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -636,7 +705,7 @@ public virtual ArmOperation Update(WaitUntil wait /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -667,7 +736,7 @@ public virtual AsyncPageable GetKeysAsync(string sk /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -698,7 +767,7 @@ public virtual Pageable GetKeys(string skipToken = /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -740,7 +809,7 @@ public virtual async Task> RegenerateKeyAs /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -782,7 +851,7 @@ public virtual Response RegenerateKey(AppConfigurat /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -844,7 +913,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -906,7 +975,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -963,7 +1032,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -1020,7 +1089,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -1080,7 +1149,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ArmAppConfigurationModelFactory.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ArmAppConfigurationModelFactory.cs index f1181fab3cc4..5945ca01b1d5 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ArmAppConfigurationModelFactory.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ArmAppConfigurationModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -34,9 +35,10 @@ public static partial class ArmAppConfigurationModelFactory /// Disables all authentication methods other than AAD authentication. /// The amount of time in days that the configuration store will be retained when it is soft deleted. /// Property specifying whether protection against purge is enabled for this configuration store. + /// Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). /// Indicates whether the configuration store need to be recovered. /// A new instance for mocking. - public static AppConfigurationStoreData AppConfigurationStoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string skuName = null, AppConfigurationProvisioningState? provisioningState = null, DateTimeOffset? createdOn = null, string endpoint = null, AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, IEnumerable privateEndpointConnections = null, AppConfigurationPublicNetworkAccess? publicNetworkAccess = null, bool? disableLocalAuth = null, int? softDeleteRetentionInDays = null, bool? enablePurgeProtection = null, AppConfigurationCreateMode? createMode = null) + public static AppConfigurationStoreData AppConfigurationStoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string skuName = null, AppConfigurationProvisioningState? provisioningState = null, DateTimeOffset? createdOn = null, string endpoint = null, AppConfigurationKeyVaultProperties encryptionKeyVaultProperties = null, IEnumerable privateEndpointConnections = null, AppConfigurationPublicNetworkAccess? publicNetworkAccess = null, bool? disableLocalAuth = null, int? softDeleteRetentionInDays = null, bool? enablePurgeProtection = null, AppConfigurationDataPlaneProxyProperties dataPlaneProxy = null, AppConfigurationCreateMode? createMode = null) { tags ??= new Dictionary(); privateEndpointConnections ??= new List(); @@ -59,6 +61,7 @@ public static AppConfigurationStoreData AppConfigurationStoreData(ResourceIdenti disableLocalAuth, softDeleteRetentionInDays, enablePurgeProtection, + dataPlaneProxy, createMode, serializedAdditionalRawData: null); } @@ -269,5 +272,74 @@ public static AppConfigurationReplicaData AppConfigurationReplicaData(ResourceId provisioningState, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The type of the resource. + /// The provisioning state of the snapshot. + /// The current status of the snapshot. + /// A list of filters used to filter the key-values included in the snapshot. + /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. + /// The time that the snapshot was created. + /// The time that the snapshot will expire. + /// The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. + /// The size in bytes of the snapshot. + /// The amount of key-values in the snapshot. + /// The tags of the snapshot. NOTE: These are data plane tags, not Azure Resource Manager (ARM) tags. + /// A value representing the current state of the snapshot. + /// A new instance for mocking. + public static AppConfigurationSnapshotData AppConfigurationSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string snapshotType = null, AppConfigurationProvisioningState? provisioningState = null, AppConfigurationSnapshotStatus? status = null, IEnumerable filters = null, SnapshotCompositionType? compositionType = null, DateTimeOffset? createdOn = null, DateTimeOffset? expireOn = null, long? retentionPeriod = null, long? size = null, long? itemsCount = null, IDictionary tags = null, ETag? eTag = null) + { + filters ??= new List(); + tags ??= new Dictionary(); + + return new AppConfigurationSnapshotData( + id, + name, + resourceType, + systemData, + snapshotType, + provisioningState, + status, + filters?.ToList(), + compositionType, + createdOn, + expireOn, + retentionPeriod, + size, + itemsCount, + tags, + eTag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed identity information, if configured. + /// The sku of the configuration store. + /// The provisioning state of the configuration store. + /// The creation date of configuration store. + /// The DNS endpoint where the configuration store API will be available. + /// The encryption settings of the configuration store. + /// The list of private endpoint connections that are set up for this resource. + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// Disables all authentication methods other than AAD authentication. + /// The amount of time in days that the configuration store will be retained when it is soft deleted. + /// Property specifying whether protection against purge is enabled for this configuration store. + /// Indicates whether the configuration store need to be recovered. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AppConfigurationStoreData AppConfigurationStoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string skuName, AppConfigurationProvisioningState? provisioningState, DateTimeOffset? createdOn, string endpoint, AppConfigurationKeyVaultProperties encryptionKeyVaultProperties, IEnumerable privateEndpointConnections, AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth, int? softDeleteRetentionInDays, bool? enablePurgeProtection, AppConfigurationCreateMode? createMode) + { + return AppConfigurationStoreData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, identity: identity, skuName: skuName, provisioningState: provisioningState, createdOn: createdOn, endpoint: endpoint, encryptionKeyVaultProperties: encryptionKeyVaultProperties, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, disableLocalAuth: disableLocalAuth, softDeleteRetentionInDays: softDeleteRetentionInDays, enablePurgeProtection: enablePurgeProtection, dataPlaneProxy: default, createMode: createMode); + } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreCollection.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreCollection.cs index 7d36d3e4699c..68453bce9c3e 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreCollection.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreCollection.cs @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -161,7 +161,7 @@ public virtual Response Get(AzureLocation /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// @@ -187,7 +187,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// @@ -213,7 +213,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual Response Exists(AzureLocation location, string configStoreN /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -347,7 +347,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreResource.cs index 6c828d1dd6fd..a0679363b69f 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/DeletedAppConfigurationStoreResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs index 9fc2515bb434..a6e8ce22c56f 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs @@ -147,6 +147,25 @@ public static AppConfigurationReplicaResource GetAppConfigurationReplicaResource return GetMockableAppConfigurationArmClient(client).GetAppConfigurationReplicaResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppConfigurationArmClient(client).GetAppConfigurationSnapshotResource(id); + } + /// /// Gets a collection of AppConfigurationStoreResources in the ResourceGroupResource. /// @@ -177,7 +196,7 @@ public static AppConfigurationStoreCollection GetAppConfigurationStores(this Res /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -215,7 +234,7 @@ public static async Task> GetAppConfigur /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -270,7 +289,7 @@ public static DeletedAppConfigurationStoreCollection GetDeletedAppConfigurationS /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -309,7 +328,7 @@ public static async Task> GetDele /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -348,7 +367,7 @@ public static Response GetDeletedAppConfig /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -385,7 +404,7 @@ public static AsyncPageable GetAppConfigurationSt /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -422,7 +441,7 @@ public static Pageable GetAppConfigurationStores( /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// @@ -454,7 +473,7 @@ public static async Task> Check /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationArmClient.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationArmClient.cs index 5aaa00e3b9ef..25f895e52584 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationArmClient.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationArmClient.cs @@ -105,5 +105,17 @@ public virtual AppConfigurationReplicaResource GetAppConfigurationReplicaResourc AppConfigurationReplicaResource.ValidateResourceId(id); return new AppConfigurationReplicaResource(Client, id); } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppConfigurationSnapshotResource GetAppConfigurationSnapshotResource(ResourceIdentifier id) + { + AppConfigurationSnapshotResource.ValidateResourceId(id); + return new AppConfigurationSnapshotResource(Client, id); + } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationResourceGroupResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationResourceGroupResource.cs index 44de87caad08..461319c3cdde 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationResourceGroupResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual AppConfigurationStoreCollection GetAppConfigurationStores() /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetAppConfigu /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationSubscriptionResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationSubscriptionResource.cs index a0c6ac6bcd68..5eacc545bc3b 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationSubscriptionResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/MockableAppConfigurationSubscriptionResource.cs @@ -66,7 +66,7 @@ public virtual DeletedAppConfigurationStoreCollection GetDeletedAppConfiguration /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -98,7 +98,7 @@ public virtual async Task> GetDel /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -130,7 +130,7 @@ public virtual Response GetDeletedAppConfi /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -161,7 +161,7 @@ public virtual AsyncPageable GetAppConfigurationS /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// Resource @@ -192,7 +192,7 @@ public virtual Pageable GetAppConfigurationStores /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// @@ -230,7 +230,7 @@ public virtual async Task> Chec /// /// /// Default Api Version - /// 2023-03-01 + /// 2024-05-01 /// /// /// diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/LongRunningOperation/AppConfigurationSnapshotOperationSource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/LongRunningOperation/AppConfigurationSnapshotOperationSource.cs new file mode 100644 index 000000000000..88a5523cae4e --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/LongRunningOperation/AppConfigurationSnapshotOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration +{ + internal class AppConfigurationSnapshotOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AppConfigurationSnapshotOperationSource(ArmClient client) + { + _client = client; + } + + AppConfigurationSnapshotResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = AppConfigurationSnapshotData.DeserializeAppConfigurationSnapshotData(document.RootElement); + return new AppConfigurationSnapshotResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = AppConfigurationSnapshotData.DeserializeAppConfigurationSnapshotData(document.RootElement); + return new AppConfigurationSnapshotResource(_client, data); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.Serialization.cs new file mode 100644 index 000000000000..e23155c72bce --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class AppConfigurationDataPlaneProxyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppConfigurationDataPlaneProxyProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AuthenticationMode)) + { + writer.WritePropertyName("authenticationMode"u8); + writer.WriteStringValue(AuthenticationMode.Value.ToString()); + } + if (Optional.IsDefined(PrivateLinkDelegation)) + { + writer.WritePropertyName("privateLinkDelegation"u8); + writer.WriteStringValue(PrivateLinkDelegation.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppConfigurationDataPlaneProxyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppConfigurationDataPlaneProxyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationDataPlaneProxyProperties(document.RootElement, options); + } + + internal static AppConfigurationDataPlaneProxyProperties DeserializeAppConfigurationDataPlaneProxyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataPlaneProxyAuthenticationMode? authenticationMode = default; + DataPlaneProxyPrivateLinkDelegation? privateLinkDelegation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationMode = new DataPlaneProxyAuthenticationMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateLinkDelegation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkDelegation = new DataPlaneProxyPrivateLinkDelegation(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppConfigurationDataPlaneProxyProperties(authenticationMode, privateLinkDelegation, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthenticationMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authenticationMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AuthenticationMode)) + { + builder.Append(" authenticationMode: "); + builder.AppendLine($"'{AuthenticationMode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateLinkDelegation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkDelegation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrivateLinkDelegation)) + { + builder.Append(" privateLinkDelegation: "); + builder.AppendLine($"'{PrivateLinkDelegation.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppConfigurationDataPlaneProxyProperties)} does not support writing '{options.Format}' format."); + } + } + + AppConfigurationDataPlaneProxyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAppConfigurationDataPlaneProxyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppConfigurationDataPlaneProxyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.cs new file mode 100644 index 000000000000..702b1248d3ac --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationDataPlaneProxyProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The data plane proxy settings for a configuration store. + public partial class AppConfigurationDataPlaneProxyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppConfigurationDataPlaneProxyProperties() + { + } + + /// Initializes a new instance of . + /// The data plane proxy authentication mode. This property manages the authentication mode of request to the data plane resources. + /// The data plane proxy private link delegation. This property manages if a request from delegated Azure Resource Manager (ARM) private link is allowed when the data plane resource requires private link. + /// Keeps track of any properties unknown to the library. + internal AppConfigurationDataPlaneProxyProperties(DataPlaneProxyAuthenticationMode? authenticationMode, DataPlaneProxyPrivateLinkDelegation? privateLinkDelegation, IDictionary serializedAdditionalRawData) + { + AuthenticationMode = authenticationMode; + PrivateLinkDelegation = privateLinkDelegation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The data plane proxy authentication mode. This property manages the authentication mode of request to the data plane resources. + [WirePath("authenticationMode")] + public DataPlaneProxyAuthenticationMode? AuthenticationMode { get; set; } + /// The data plane proxy private link delegation. This property manages if a request from delegated Azure Resource Manager (ARM) private link is allowed when the data plane resource requires private link. + [WirePath("privateLinkDelegation")] + public DataPlaneProxyPrivateLinkDelegation? PrivateLinkDelegation { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationSnapshotStatus.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationSnapshotStatus.cs new file mode 100644 index 000000000000..694acf623419 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationSnapshotStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The current status of the snapshot. + public readonly partial struct AppConfigurationSnapshotStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppConfigurationSnapshotStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string ReadyValue = "Ready"; + private const string ArchivedValue = "Archived"; + private const string FailedValue = "Failed"; + + /// Provisioning. + public static AppConfigurationSnapshotStatus Provisioning { get; } = new AppConfigurationSnapshotStatus(ProvisioningValue); + /// Ready. + public static AppConfigurationSnapshotStatus Ready { get; } = new AppConfigurationSnapshotStatus(ReadyValue); + /// Archived. + public static AppConfigurationSnapshotStatus Archived { get; } = new AppConfigurationSnapshotStatus(ArchivedValue); + /// Failed. + public static AppConfigurationSnapshotStatus Failed { get; } = new AppConfigurationSnapshotStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AppConfigurationSnapshotStatus left, AppConfigurationSnapshotStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppConfigurationSnapshotStatus left, AppConfigurationSnapshotStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AppConfigurationSnapshotStatus(string value) => new AppConfigurationSnapshotStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppConfigurationSnapshotStatus other && Equals(other); + /// + public bool Equals(AppConfigurationSnapshotStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.Serialization.cs index a96ad3e418d8..47148ab97ef2 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.Serialization.cs @@ -78,6 +78,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enablePurgeProtection"u8); writer.WriteBooleanValue(EnablePurgeProtection.Value); } + if (Optional.IsDefined(DataPlaneProxy)) + { + writer.WritePropertyName("dataPlaneProxy"u8); + writer.WriteObjectValue(DataPlaneProxy, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -123,6 +128,7 @@ internal static AppConfigurationStorePatch DeserializeAppConfigurationStorePatch bool? disableLocalAuth = default; AppConfigurationPublicNetworkAccess? publicNetworkAccess = default; bool? enablePurgeProtection = default; + AppConfigurationDataPlaneProxyProperties dataPlaneProxy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -204,6 +210,15 @@ internal static AppConfigurationStorePatch DeserializeAppConfigurationStorePatch enablePurgeProtection = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("dataPlaneProxy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataPlaneProxy = AppConfigurationDataPlaneProxyProperties.DeserializeAppConfigurationDataPlaneProxyProperties(property0.Value, options); + continue; + } } continue; } @@ -221,6 +236,7 @@ internal static AppConfigurationStorePatch DeserializeAppConfigurationStorePatch disableLocalAuth, publicNetworkAccess, enablePurgeProtection, + dataPlaneProxy, serializedAdditionalRawData); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.cs index 631d21e55d6d..570fc9b3e893 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/AppConfigurationStorePatch.cs @@ -60,8 +60,9 @@ public AppConfigurationStorePatch() /// Disables all authentication methods other than AAD authentication. /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. /// Property specifying whether protection against purge is enabled for this configuration store. + /// Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). /// Keeps track of any properties unknown to the library. - internal AppConfigurationStorePatch(ManagedServiceIdentity identity, AppConfigurationSku sku, IDictionary tags, AppConfigurationStoreEncryptionProperties encryption, bool? disableLocalAuth, AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? enablePurgeProtection, IDictionary serializedAdditionalRawData) + internal AppConfigurationStorePatch(ManagedServiceIdentity identity, AppConfigurationSku sku, IDictionary tags, AppConfigurationStoreEncryptionProperties encryption, bool? disableLocalAuth, AppConfigurationPublicNetworkAccess? publicNetworkAccess, bool? enablePurgeProtection, AppConfigurationDataPlaneProxyProperties dataPlaneProxy, IDictionary serializedAdditionalRawData) { Identity = identity; Sku = sku; @@ -70,6 +71,7 @@ internal AppConfigurationStorePatch(ManagedServiceIdentity identity, AppConfigur DisableLocalAuth = disableLocalAuth; PublicNetworkAccess = publicNetworkAccess; EnablePurgeProtection = enablePurgeProtection; + DataPlaneProxy = dataPlaneProxy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -113,5 +115,8 @@ public AppConfigurationKeyVaultProperties EncryptionKeyVaultProperties /// Property specifying whether protection against purge is enabled for this configuration store. [WirePath("properties.enablePurgeProtection")] public bool? EnablePurgeProtection { get; set; } + /// Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). + [WirePath("properties.dataPlaneProxy")] + public AppConfigurationDataPlaneProxyProperties DataPlaneProxy { get; set; } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyAuthenticationMode.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyAuthenticationMode.cs new file mode 100644 index 000000000000..063c85512416 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyAuthenticationMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The data plane proxy authentication mode. This property manages the authentication mode of request to the data plane resources. + public readonly partial struct DataPlaneProxyAuthenticationMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataPlaneProxyAuthenticationMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocalValue = "Local"; + private const string PassThroughValue = "Pass-through"; + + /// The local authentication mode. Users are not required to have data plane permissions if local authentication is not disabled. + public static DataPlaneProxyAuthenticationMode Local { get; } = new DataPlaneProxyAuthenticationMode(LocalValue); + /// The pass-through authentication mode. User identity will be passed through from Azure Resource Manager (ARM), requiring user to have data plane action permissions (Available via App Configuration Data Owner/ App Configuration Data Reader). + public static DataPlaneProxyAuthenticationMode PassThrough { get; } = new DataPlaneProxyAuthenticationMode(PassThroughValue); + /// Determines if two values are the same. + public static bool operator ==(DataPlaneProxyAuthenticationMode left, DataPlaneProxyAuthenticationMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataPlaneProxyAuthenticationMode left, DataPlaneProxyAuthenticationMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataPlaneProxyAuthenticationMode(string value) => new DataPlaneProxyAuthenticationMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataPlaneProxyAuthenticationMode other && Equals(other); + /// + public bool Equals(DataPlaneProxyAuthenticationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyPrivateLinkDelegation.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyPrivateLinkDelegation.cs new file mode 100644 index 000000000000..19a2b25e5fef --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/DataPlaneProxyPrivateLinkDelegation.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The data plane proxy private link delegation. This property manages if a request from delegated Azure Resource Manager (ARM) private link is allowed when the data plane resource requires private link. + public readonly partial struct DataPlaneProxyPrivateLinkDelegation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataPlaneProxyPrivateLinkDelegation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Azure Resource Manager (ARM) private endpoint is required if the resource requires private link. + public static DataPlaneProxyPrivateLinkDelegation Enabled { get; } = new DataPlaneProxyPrivateLinkDelegation(EnabledValue); + /// Request is denied if the resource requires private link. + public static DataPlaneProxyPrivateLinkDelegation Disabled { get; } = new DataPlaneProxyPrivateLinkDelegation(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DataPlaneProxyPrivateLinkDelegation left, DataPlaneProxyPrivateLinkDelegation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataPlaneProxyPrivateLinkDelegation left, DataPlaneProxyPrivateLinkDelegation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataPlaneProxyPrivateLinkDelegation(string value) => new DataPlaneProxyPrivateLinkDelegation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataPlaneProxyPrivateLinkDelegation other && Equals(other); + /// + public bool Equals(DataPlaneProxyPrivateLinkDelegation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotCompositionType.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotCompositionType.cs new file mode 100644 index 000000000000..1fdfc08573a5 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotCompositionType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label. + public readonly partial struct SnapshotCompositionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SnapshotCompositionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeyValue = "Key"; + private const string KeyLabelValue = "Key_Label"; + + /// Key. + public static SnapshotCompositionType Key { get; } = new SnapshotCompositionType(KeyValue); + /// Key_Label. + public static SnapshotCompositionType KeyLabel { get; } = new SnapshotCompositionType(KeyLabelValue); + /// Determines if two values are the same. + public static bool operator ==(SnapshotCompositionType left, SnapshotCompositionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SnapshotCompositionType left, SnapshotCompositionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SnapshotCompositionType(string value) => new SnapshotCompositionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SnapshotCompositionType other && Equals(other); + /// + public bool Equals(SnapshotCompositionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.Serialization.cs new file mode 100644 index 000000000000..2059ac99b7b9 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class SnapshotKeyValueFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SnapshotKeyValueFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + if (Optional.IsDefined(Label)) + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SnapshotKeyValueFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SnapshotKeyValueFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSnapshotKeyValueFilter(document.RootElement, options); + } + + internal static SnapshotKeyValueFilter DeserializeSnapshotKeyValueFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string label = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SnapshotKeyValueFilter(key, label, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Key), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Key)) + { + builder.Append(" key: "); + if (Key.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Key}'''"); + } + else + { + builder.AppendLine($"'{Key}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Label), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" label: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Label)) + { + builder.Append(" label: "); + if (Label.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Label}'''"); + } + else + { + builder.AppendLine($"'{Label}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SnapshotKeyValueFilter)} does not support writing '{options.Format}' format."); + } + } + + SnapshotKeyValueFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSnapshotKeyValueFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SnapshotKeyValueFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.cs new file mode 100644 index 000000000000..a499cae3b2b2 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SnapshotKeyValueFilter.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Enables filtering of key-values. + public partial class SnapshotKeyValueFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Filters key-values by their key field. + /// is null. + public SnapshotKeyValueFilter(string key) + { + Argument.AssertNotNull(key, nameof(key)); + + Key = key; + } + + /// Initializes a new instance of . + /// Filters key-values by their key field. + /// Filters key-values by their label field. + /// Keeps track of any properties unknown to the library. + internal SnapshotKeyValueFilter(string key, string label, IDictionary serializedAdditionalRawData) + { + Key = key; + Label = label; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SnapshotKeyValueFilter() + { + } + + /// Filters key-values by their key field. + [WirePath("key")] + public string Key { get; set; } + /// Filters key-values by their label field. + [WirePath("label")] + public string Label { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/AppConfigurationManagementRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/AppConfigurationManagementRestOperations.cs index 08465128884a..7e6c699f2e37 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/AppConfigurationManagementRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/AppConfigurationManagementRestOperations.cs @@ -32,7 +32,7 @@ public AppConfigurationManagementRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ConfigurationStoresRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ConfigurationStoresRestOperations.cs index 2671f91de358..93435cafad5a 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ConfigurationStoresRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ConfigurationStoresRestOperations.cs @@ -32,7 +32,7 @@ public ConfigurationStoresRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/KeyValuesRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/KeyValuesRestOperations.cs index fafe68197c51..a16717ff2101 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/KeyValuesRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/KeyValuesRestOperations.cs @@ -31,7 +31,7 @@ public KeyValuesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 030c106f09be..95bb00ff46f9 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 4e9901348e00..2dea3e8ad040 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ReplicasRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ReplicasRestOperations.cs index df299991aff1..66f6f4501b3a 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ReplicasRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/ReplicasRestOperations.cs @@ -32,7 +32,7 @@ public ReplicasRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-03-01"; + _apiVersion = apiVersion ?? "2024-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/SnapshotsRestOperations.cs new file mode 100644 index 000000000000..26b8de638bcf --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations/SnapshotsRestOperations.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppConfiguration +{ + internal partial class SnapshotsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SnapshotsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/snapshots/", false); + uri.AppendPath(snapshotName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/snapshots/", false); + uri.AppendPath(snapshotName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// The Microsoft Azure subscription ID. + /// The name of the resource group. The name is case insensitive. + /// The name of the configuration store. + /// The name of the snapshot. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configStoreName, nameof(configStoreName)); + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, configStoreName, snapshotName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppConfigurationSnapshotData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppConfigurationSnapshotData.DeserializeAppConfigurationSnapshotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppConfigurationSnapshotData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// The Microsoft Azure subscription ID. + /// The name of the resource group. The name is case insensitive. + /// The name of the configuration store. + /// The name of the snapshot. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configStoreName, nameof(configStoreName)); + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, configStoreName, snapshotName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppConfigurationSnapshotData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppConfigurationSnapshotData.DeserializeAppConfigurationSnapshotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppConfigurationSnapshotData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, AppConfigurationSnapshotData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/snapshots/", false); + uri.AppendPath(snapshotName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, AppConfigurationSnapshotData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/snapshots/", false); + uri.AppendPath(snapshotName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// The Microsoft Azure subscription ID. + /// The name of the resource group. The name is case insensitive. + /// The name of the configuration store. + /// The name of the snapshot. + /// The parameters for creating a snapshot. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, AppConfigurationSnapshotData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configStoreName, nameof(configStoreName)); + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, configStoreName, snapshotName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a snapshot. NOTE: This operation is intended for use in Azure Resource Manager (ARM) Template deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used instead. + /// The Microsoft Azure subscription ID. + /// The name of the resource group. The name is case insensitive. + /// The name of the configuration store. + /// The name of the snapshot. + /// The parameters for creating a snapshot. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string configStoreName, string snapshotName, AppConfigurationSnapshotData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(configStoreName, nameof(configStoreName)); + Argument.AssertNotNullOrEmpty(snapshotName, nameof(snapshotName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, configStoreName, snapshotName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md index 7b7c3465829e..934e5376a8ec 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md @@ -7,13 +7,16 @@ azure-arm: true csharp: true library-name: AppConfiguration namespace: Azure.ResourceManager.AppConfiguration -require: https://github.com/Azure/azure-rest-api-specs/blob/e8c4e082948a49ef5dc8acf6c5b9d581b603370e/specification/appconfiguration/resource-manager/readme.md -tag: package-2023-03-01 +require: https://github.com/Azure/azure-rest-api-specs/blob/b72e0199fa3242d64b0b49f38e71586066a8c048/specification/appconfiguration/resource-manager/readme.md +# tag: package-2024-05-01 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: output-folder: $(this-folder)/../samples/Generated clear-output-folder: true + skipped-operations: + # Snapshot is immutable once created, there won't be any update method on it. Skip generating the sample test on this method, so it will pass the build. + - Snapshots_Create skip-csproj: true modelerfour: flatten-payloads: false @@ -21,16 +24,22 @@ use-model-reader-writer: true enable-bicep-serialization: true deserialize-null-collection-as-null-value: true +#mgmt-debug: +# show-serialized-names: true + no-property-type-replacement: RegenerateKeyContent rename-mapping: ApiKey.lastModified: LastModifiedOn ApiKey.readOnly: IsReadOnly + AuthenticationMode: DataPlaneProxyAuthenticationMode + CompositionType: SnapshotCompositionType DeletedConfigurationStore.properties.purgeProtectionEnabled: IsPurgeProtectionEnabled DeletedConfigurationStore.properties.configurationStoreId: -|arm-id NameAvailabilityStatus.nameAvailable: IsNameAvailable KeyValue.properties.lastModified: LastModifiedOn KeyValue.properties.locked: IsLocked + KeyValueFilter: SnapshotKeyValueFilter ApiKey: AppConfigurationStoreApiKey ApiKeyListResult: AppConfigurationStoreApiKeyListResult CheckNameAvailabilityParameters: AppConfigurationNameAvailabilityContent @@ -42,18 +51,24 @@ rename-mapping: EncryptionProperties: AppConfigurationStoreEncryptionProperties NameAvailabilityStatus: AppConfigurationNameAvailabilityResult PrivateEndpointConnectionReference: AppConfigurationPrivateEndpointConnectionReference + PrivateLinkDelegation: DataPlaneProxyPrivateLinkDelegation Replica: AppConfigurationReplica ReplicaProvisioningState: AppConfigurationReplicaProvisioningState + Snapshot.properties.created: CreatedOn + Snapshot.properties.expires: ExpireOn prepend-rp-prefix: - ActionsRequired - CreateMode + - DataPlaneProxyProperties - KeyValue - KeyValueListResult - KeyVaultProperties - ProvisioningState - PublicNetworkAccess - RegenerateKeyParameters + - Snapshot + - SnapshotStatus format-by-name-rules: 'tenantId': 'uuid' @@ -89,6 +104,14 @@ acronym-mapping: request-path-to-parent: /subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores: /subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName} directive: + - from: v2/types.json + where: $.definitions.ErrorResponse + transform: > + $["x-ms-client-name"] = "ErrorResponseV2"; + - from: v5/types.json + where: $.definitions.ErrorResponse + transform: > + $["x-ms-client-name"] = "ErrorResponseV5"; - from: swagger-document where: $.definitions.EncryptionProperties transform: > @@ -100,7 +123,4 @@ directive: - rename-operation: from: Operations_CheckNameAvailability to: CheckAppConfigurationNameAvailability - -list-exception: -- /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName} -```` +``` diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/ConfigurationStoreCollectionTests.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/ConfigurationStoreCollectionTests.cs index ab273fe5abdf..bd25c75ab7cd 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/ConfigurationStoreCollectionTests.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/ConfigurationStoreCollectionTests.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Azure.Core; using Azure.Core.TestFramework; using Azure.ResourceManager.AppConfiguration.Models; using Azure.ResourceManager.Resources; @@ -50,6 +51,33 @@ public async Task CreateOrUpdateTest() Assert.IsTrue(configurationStore.Data.PublicNetworkAccess == AppConfigurationPublicNetworkAccess.Enabled); } + [Test] + public async Task CreateOrUpdateDataPlaneProxyTest() + { + string configurationStoreName = Recording.GenerateAssetName("testapp-"); + AppConfigurationStoreData configurationStoreData = new AppConfigurationStoreData(new AzureLocation("westus"), new AppConfigurationSku("Standard")) + { + DataPlaneProxy = new AppConfigurationDataPlaneProxyProperties() + { + AuthenticationMode = DataPlaneProxyAuthenticationMode.PassThrough, + PrivateLinkDelegation = DataPlaneProxyPrivateLinkDelegation.Enabled, + }, + }; + AppConfigurationStoreResource configurationStore = (await ResGroup.GetAppConfigurationStores().CreateOrUpdateAsync(WaitUntil.Completed, configurationStoreName, configurationStoreData)).Value; + + Assert.IsTrue(configurationStoreName.Equals(configurationStore.Data.Name)); + Assert.IsTrue(configurationStore.Data.DataPlaneProxy.AuthenticationMode == DataPlaneProxyAuthenticationMode.PassThrough); + Assert.IsTrue(configurationStore.Data.DataPlaneProxy.PrivateLinkDelegation == DataPlaneProxyPrivateLinkDelegation.Enabled); + + configurationStore.Data.DataPlaneProxy.AuthenticationMode = DataPlaneProxyAuthenticationMode.Local; + configurationStore.Data.DataPlaneProxy.PrivateLinkDelegation = DataPlaneProxyPrivateLinkDelegation.Disabled; + configurationStore = (await ResGroup.GetAppConfigurationStores().CreateOrUpdateAsync(WaitUntil.Completed, configurationStoreName, configurationStore.Data)).Value; + + Assert.IsTrue(configurationStoreName.Equals(configurationStore.Data.Name)); + Assert.IsTrue(configurationStore.Data.DataPlaneProxy.AuthenticationMode == DataPlaneProxyAuthenticationMode.Local); + Assert.IsTrue(configurationStore.Data.DataPlaneProxy.PrivateLinkDelegation == DataPlaneProxyPrivateLinkDelegation.Disabled); + } + [Test] public async Task GetTest() { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotCollectionTests.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotCollectionTests.cs new file mode 100644 index 000000000000..ce8481a329e7 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotCollectionTests.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Linq; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.AppConfiguration.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppConfiguration.Tests +{ + public class SnapshotCollectionTests : AppConfigurationClientBase + { + private ResourceGroupResource ResGroup { get; set; } + private AppConfigurationStoreResource ConfigStore { get; set; } + private AppConfigurationKeyValueResource KeyValue { get; set; } + + public SnapshotCollectionTests(bool isAsync) + : base(isAsync)//, RecordedTestMode.Record) + { + } + + [SetUp] + public async Task TestSetUp() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + Initialize(); + string groupName = Recording.GenerateAssetName(ResourceGroupPrefix); + ResGroup = (await ArmClient.GetDefaultSubscriptionAsync().Result.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, groupName, new ResourceGroupData(Location))).Value; + string configurationStoreName = Recording.GenerateAssetName("testapp-"); + AppConfigurationStoreData configurationStoreData = new AppConfigurationStoreData(Location, new AppConfigurationSku("Standard")) { }; + ConfigStore = (await ResGroup.GetAppConfigurationStores().CreateOrUpdateAsync(WaitUntil.Completed, configurationStoreName, configurationStoreData)).Value; + + // Prepare Key Value. + AppConfigurationKeyValueData keyValueData = new AppConfigurationKeyValueData + { + Value = "myvalue1", + ContentType = "the-content-type" + }; + keyValueData.Tags.Add("t1", "tag-1"); + KeyValue = (await ConfigStore.GetAppConfigurationKeyValues().CreateOrUpdateAsync(WaitUntil.Completed, "key1", keyValueData)).Value; + } + } + + [Test] + public async Task CreateOrUpdateTest() + { + string snapshotName = Recording.GenerateAssetName("testapp-"); + AppConfigurationSnapshotData snapshotData = new AppConfigurationSnapshotData() + { + Filters = + { + new SnapshotKeyValueFilter("key1/*") + { + Label = "app1" + } + }, + RetentionPeriod = 3600 + }; + + AppConfigurationSnapshotResource snapshot = (await ConfigStore.GetAppConfigurationSnapshots().CreateOrUpdateAsync(WaitUntil.Completed, snapshotName, snapshotData)).Value; + + Assert.IsTrue(snapshot.HasData); + Assert.IsTrue(snapshot.Data.Name.Equals(snapshotName)); + Assert.IsTrue(snapshot.Data.Filters.FirstOrDefault().Key.Equals("key1/*")); + Assert.IsTrue(snapshot.Data.RetentionPeriod?.Equals((long)3600)); + } + + [Test] + public async Task GetTest() + { + string snapshotName = Recording.GenerateAssetName("testapp-"); + AppConfigurationSnapshotData snapshotData = new AppConfigurationSnapshotData() + { + Filters = + { + new SnapshotKeyValueFilter("key1/*") + { + Label = "app1" + } + }, + RetentionPeriod = 3600 + }; + + await ConfigStore.GetAppConfigurationSnapshots().CreateOrUpdateAsync(WaitUntil.Completed, snapshotName, snapshotData); + + AppConfigurationSnapshotResource snapshot = (await ConfigStore.GetAppConfigurationSnapshots().GetAsync(snapshotName)).Value; + + Assert.IsTrue(snapshotName.Equals(snapshot.Data.Name)); + Assert.IsTrue(snapshot.Data.Filters.FirstOrDefault().Key.Equals("key1/*")); + Assert.IsTrue(snapshot.Data.RetentionPeriod?.Equals((long)3600)); + Assert.IsTrue(snapshot.Data.Status == AppConfigurationSnapshotStatus.Ready); + } + + [Test] + public async Task ExistsTest() + { + string snapshotName = Recording.GenerateAssetName("testapp-"); + AppConfigurationSnapshotData snapshotData = new AppConfigurationSnapshotData() + { + Filters = + { + new SnapshotKeyValueFilter("key1/*") + { + Label = "app1" + } + }, + RetentionPeriod = 3600 + }; + + await ConfigStore.GetAppConfigurationSnapshots().CreateOrUpdateAsync(WaitUntil.Completed, snapshotName, snapshotData); + + AppConfigurationSnapshotCollection snapshots = ConfigStore.GetAppConfigurationSnapshots(); + + string nonExistingSnapshotName = "nonExistingSnapshot"; + + Assert.IsTrue((await snapshots.ExistsAsync(snapshotName)).Value); + Assert.IsFalse((await snapshots.ExistsAsync(nonExistingSnapshotName)).Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotOperationTests.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotOperationTests.cs new file mode 100644 index 000000000000..0d16adc7b89b --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/tests/Tests/SnapshotOperationTests.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.AppConfiguration.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppConfiguration.Tests +{ + public class SnapshotOperationTests : AppConfigurationClientBase + { + private ResourceGroupResource ResGroup { get; set; } + private AppConfigurationStoreResource ConfigStore { get; set; } + private string ConfigurationStoreName { get; set; } + private AppConfigurationSnapshotResource Snapshot { get; set; } + private string SnapshotName { get; set; } + + public SnapshotOperationTests(bool isAsync) + : base(isAsync)//, RecordedTestMode.Record) + { + } + + [SetUp] + public async Task TestSetUp() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + Initialize(); + string groupName = Recording.GenerateAssetName(ResourceGroupPrefix); + ResGroup = (await ArmClient.GetDefaultSubscriptionAsync().Result.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, groupName, new ResourceGroupData(Location))).Value; + + ConfigurationStoreName = Recording.GenerateAssetName("testapp-"); + AppConfigurationStoreData configurationStoreData = new AppConfigurationStoreData(Location, new AppConfigurationSku("Standard")) { }; + ConfigStore = (await ResGroup.GetAppConfigurationStores().CreateOrUpdateAsync(WaitUntil.Completed, ConfigurationStoreName, configurationStoreData)).Value; + + // Prepare Key Value. + AppConfigurationKeyValueData keyValueData = new AppConfigurationKeyValueData + { + Value = "myvalue1", + ContentType = "the-content-type" + }; + keyValueData.Tags.Add("t1", "tag-1"); + AppConfigurationKeyValueResource KeyValue = (await ConfigStore.GetAppConfigurationKeyValues().CreateOrUpdateAsync(WaitUntil.Completed, "key1", keyValueData)).Value; + + // Prepare Snapshot. + SnapshotName = Recording.GenerateAssetName("testapp-snapshot"); + AppConfigurationSnapshotData snapshotData = new AppConfigurationSnapshotData() + { + Filters = + { + new SnapshotKeyValueFilter("key1/*") + { + Label = "app1" + } + }, + RetentionPeriod = 3600, + }; + Snapshot = (await ConfigStore.GetAppConfigurationSnapshots().CreateOrUpdateAsync(WaitUntil.Completed, SnapshotName, snapshotData)).Value; + } + } + + [Test] + public async Task GetTest() + { + AppConfigurationSnapshotResource snapshot = await Snapshot.GetAsync(); + + Assert.IsTrue(snapshot.Data.Name.Equals(SnapshotName)); + Assert.IsTrue(snapshot.Data.Filters.FirstOrDefault().Key.Equals("key1/*")); + } + } +} diff --git a/sdk/attestation/Azure.Security.Attestation/README.md b/sdk/attestation/Azure.Security.Attestation/README.md index 709f8a75ad1e..260b33682f17 100644 --- a/sdk/attestation/Azure.Security.Attestation/README.md +++ b/sdk/attestation/Azure.Security.Attestation/README.md @@ -356,5 +356,3 @@ See [CONTRIBUTING.md][contributing] for details on building, testing, and contri [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fattestation%2FAzure.Security.Attestation%2FREADME.png) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml index 105b11993153..2106f52e75e0 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml @@ -63,21 +63,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TargetDedicatedNodes = 2, - NetworkConfiguration = new NetworkConfiguration - { - EnableAcceleratedNetworking = true, - }, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -86,46 +72,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - MountConfiguration = {new MountConfiguration - { - AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") - { - AccountKey = "accountKey", - }, - }, new MountConfiguration - { - AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") - { - MountOptions = "mount options ver=1.0", - }, - }, new MountConfiguration - { - NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") - { - MountOptions = "mount options ver=1.0", - }, - }, new MountConfiguration - { - CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") - { - MountOptions = "mount options ver=1.0", - }, - }}, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -134,32 +81,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - OsDisk = new OSDisk - { - EphemeralOSDiskSettings = new DiffDiskSettings - { - Placement = DiffDiskPlacement.CacheDisk, - }, - Caching = CachingType.ReadWrite, - DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -168,22 +90,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04"), - ResourceTags = - { - ["TagName1"] = "TagValue1", - ["TagName2"] = "TagValue2" - }, - TargetDedicatedNodes = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -192,23 +99,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04") - { - SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings - { - SecureBootEnabled = false, - }), - }, - TargetDedicatedNodes = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -217,23 +108,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -242,27 +117,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "120_04-lts", - }, "batch.node.ubuntu 20.04") - { - ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) - { - ContainerImageNames = { "busybox" }, - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -271,37 +126,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") - { - TypeHandlerVersion = "2.0", - AutoUpgradeMinorVersion = true, - EnableAutomaticUpgrade = true, - Settings = - { - ["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", - ["authenticationSettingsKey"] = "authenticationSettingsValue" - }, - }}, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -310,24 +135,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64") - { - WindowsConfiguration = new WindowsConfiguration - { - EnableAutomaticUpdates = false, - }, - ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), - }, - TargetDedicatedNodes = 2, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); ]]> @@ -339,21 +147,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TargetDedicatedNodes = 2, - NetworkConfiguration = new NetworkConfiguration - { - EnableAcceleratedNetworking = true, - }, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -362,46 +156,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - MountConfiguration = {new MountConfiguration - { - AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") - { - AccountKey = "accountKey", - }, - }, new MountConfiguration - { - AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") - { - MountOptions = "mount options ver=1.0", - }, - }, new MountConfiguration - { - NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") - { - MountOptions = "mount options ver=1.0", - }, - }, new MountConfiguration - { - CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") - { - MountOptions = "mount options ver=1.0", - }, - }}, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -410,32 +165,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - OsDisk = new OSDisk - { - EphemeralOSDiskSettings = new DiffDiskSettings - { - Placement = DiffDiskPlacement.CacheDisk, - }, - Caching = CachingType.ReadWrite, - DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -444,22 +174,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04"), - ResourceTags = - { - ["TagName1"] = "TagValue1", - ["TagName2"] = "TagValue2" - }, - TargetDedicatedNodes = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -468,23 +183,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04") - { - SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings - { - SecureBootEnabled = false, - }), - }, - TargetDedicatedNodes = 1, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -493,23 +192,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -518,27 +201,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "120_04-lts", - }, "batch.node.ubuntu 20.04") - { - ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) - { - ContainerImageNames = { "busybox" }, - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -547,37 +210,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") - { - TypeHandlerVersion = "2.0", - AutoUpgradeMinorVersion = true, - EnableAutomaticUpgrade = true, - Settings = - { - ["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", - ["authenticationSettingsKey"] = "authenticationSettingsValue" - }, - }}, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -586,24 +219,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") -{ - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64") - { - WindowsConfiguration = new WindowsConfiguration - { - EnableAutomaticUpdates = false, - }, - ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), - }, - TargetDedicatedNodes = 2, -}; +BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); ]]> @@ -615,27 +231,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool01", - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - networkConfiguration = new - { - enableAcceleratedNetworking = true, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -646,74 +242,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - mountConfiguration = new object[] - { - new - { - azureBlobFileSystemConfiguration = new - { - accountName = "accountName", - containerName = "blobContainerName", - accountKey = "accountKey", - relativeMountPath = "bfusepath", - }, - }, - new - { - azureFileShareConfiguration = new - { - accountName = "accountName", - azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", - accountKey = "accountKey", - relativeMountPath = "filesharepath", - mountOptions = "mount options ver=1.0", - }, - }, - new - { - nfsMountConfiguration = new - { - source = "somesource nfs url", - relativeMountPath = "mountpath", - mountOptions = "mount options ver=1.0", - }, - }, - new - { - cifsMountConfiguration = new - { - username = "accountName", - password = "password", - source = "//myaccount.file.core.windows.net/file", - relativeMountPath = "mountpath", - mountOptions = "mount options ver=1.0", - }, - } - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -724,39 +253,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "standard_d2s_v3", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - osDisk = new - { - diskSizeGB = 100, - managedDisk = new - { - storageAccountType = "standardssd_lrs", - }, - caching = "readwrite", - ephemeralOSDiskSettings = new - { - placement = "cachedisk", - }, - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 1, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -767,28 +264,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - }, - targetDedicatedNodes = 1, - resourceTags = new - { - TagName1 = "TagValue1", - TagName2 = "TagValue2", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -799,32 +275,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - securityProfile = new - { - securityType = "trustedLaunch", - encryptionAtHost = true, - uefiSettings = new - { - secureBootEnabled = false, - }, - }, - }, - targetDedicatedNodes = 1, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -835,39 +286,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -878,38 +297,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "120_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - containerConfiguration = new - { - type = "dockerCompatible", - containerImageNames = new object[] - { - "busybox" - }, - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -920,57 +308,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - extensions = new object[] - { - new - { - name = "batchextension1", - type = "KeyVaultForLinux", - publisher = "Microsoft.Azure.KeyVault", - typeHandlerVersion = "2.0", - autoUpgradeMinorVersion = true, - enableAutomaticUpgrade = true, - settings = new - { - secretsManagementSettingsKey = "secretsManagementSettingsValue", - authenticationSettingsKey = "authenticationSettingsValue", - }, - } - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "simplified", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -981,31 +319,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool002", - vmSize = "Standard_A1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - windowsConfiguration = new - { - enableAutomaticUpdates = false, - }, - serviceArtifactReference = new - { - id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -1019,27 +333,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool01", - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - networkConfiguration = new - { - enableAcceleratedNetworking = true, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1050,74 +344,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - mountConfiguration = new object[] - { - new - { - azureBlobFileSystemConfiguration = new - { - accountName = "accountName", - containerName = "blobContainerName", - accountKey = "accountKey", - relativeMountPath = "bfusepath", - }, - }, - new - { - azureFileShareConfiguration = new - { - accountName = "accountName", - azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", - accountKey = "accountKey", - relativeMountPath = "filesharepath", - mountOptions = "mount options ver=1.0", - }, - }, - new - { - nfsMountConfiguration = new - { - source = "somesource nfs url", - relativeMountPath = "mountpath", - mountOptions = "mount options ver=1.0", - }, - }, - new - { - cifsMountConfiguration = new - { - username = "accountName", - password = "password", - source = "//myaccount.file.core.windows.net/file", - relativeMountPath = "mountpath", - mountOptions = "mount options ver=1.0", - }, - } - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1128,39 +355,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "standard_d2s_v3", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - osDisk = new - { - diskSizeGB = 100, - managedDisk = new - { - storageAccountType = "standardssd_lrs", - }, - caching = "readwrite", - ephemeralOSDiskSettings = new - { - placement = "cachedisk", - }, - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 1, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1171,28 +366,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - }, - targetDedicatedNodes = 1, - resourceTags = new - { - TagName1 = "TagValue1", - TagName2 = "TagValue2", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1203,32 +377,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - securityProfile = new - { - securityType = "trustedLaunch", - encryptionAtHost = true, - uefiSettings = new - { - secureBootEnabled = false, - }, - }, - }, - targetDedicatedNodes = 1, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1239,39 +388,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1282,38 +399,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "120_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - containerConfiguration = new - { - type = "dockerCompatible", - containerImageNames = new object[] - { - "busybox" - }, - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1324,57 +410,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - extensions = new object[] - { - new - { - name = "batchextension1", - type = "KeyVaultForLinux", - publisher = "Microsoft.Azure.KeyVault", - typeHandlerVersion = "2.0", - autoUpgradeMinorVersion = true, - enableAutomaticUpgrade = true, - settings = new - { - secretsManagementSettingsKey = "secretsManagementSettingsValue", - authenticationSettingsKey = "authenticationSettingsValue", - }, - } - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "simplified", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1385,31 +421,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "mypool002", - vmSize = "Standard_A1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - windowsConfiguration = new - { - enableAutomaticUpdates = false, - }, - serviceArtifactReference = new - { - id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1689,13 +701,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdatePoolAsync("poolId", content); Console.WriteLine(response.Status); @@ -1709,13 +715,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdatePool("poolId", content); Console.WriteLine(response.Status); @@ -1755,11 +755,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent -{ - AutoScaleFormula = "$TargetDedicated=0", - AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), -}; +BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); ]]> @@ -1771,11 +767,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent -{ - AutoScaleFormula = "$TargetDedicated=0", - AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), -}; +BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); Response response = client.EnablePoolAutoScale("poolId", content); ]]> @@ -1787,11 +779,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - autoScaleFormula = "$TargetDedicated=0", - autoScaleEvaluationInterval = "PT8M", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); Console.WriteLine(response.Status); @@ -1805,11 +793,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - autoScaleFormula = "$TargetDedicated=0", - autoScaleEvaluationInterval = "PT8M", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.EnablePoolAutoScale("poolId", content); Console.WriteLine(response.Status); @@ -1823,7 +807,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); +BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); ]]> @@ -1835,7 +819,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); +BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); Response response = client.EvaluatePoolAutoScale("poolId", content); ]]> @@ -1847,10 +831,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - autoScaleFormula = "$TargetDedicated=1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1865,10 +846,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - autoScaleFormula = "$TargetDedicated=1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.EvaluatePoolAutoScale("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1883,11 +861,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolResizeContent content = new BatchPoolResizeContent -{ - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, -}; +BatchPoolResizeContent content = new BatchPoolResizeContent(); Response response = await client.ResizePoolAsync("resizePool", content); ]]> @@ -1899,11 +873,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolResizeContent content = new BatchPoolResizeContent -{ - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, -}; +BatchPoolResizeContent content = new BatchPoolResizeContent(); Response response = client.ResizePool("resizePool", content); ]]> @@ -1915,11 +885,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.ResizePoolAsync("resizePool", content); Console.WriteLine(response.Status); @@ -1933,11 +899,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.ResizePool("resizePool", content); Console.WriteLine(response.Status); @@ -1977,10 +939,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) -{ - StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), -}; +BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); Response response = await client.ReplacePoolPropertiesAsync("poolId", pool); ]]> @@ -1992,10 +951,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) -{ - StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), -}; +BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); Response response = client.ReplacePoolProperties("poolId", pool); ]]> @@ -2007,15 +963,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - applicationPackageReferences = Array.Empty(), - metadata = Array.Empty(), -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.ReplacePoolPropertiesAsync("poolId", content); Console.WriteLine(response.Status); @@ -2029,15 +977,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - applicationPackageReferences = Array.Empty(), - metadata = Array.Empty(), -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.ReplacePoolProperties("poolId", content); Console.WriteLine(response.Status); @@ -2051,7 +991,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); +BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); Response response = await client.RemoveNodesAsync("poolId", content); ]]> @@ -2063,7 +1003,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); +BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); Response response = client.RemoveNodes("poolId", content); ]]> @@ -2075,14 +1015,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - nodeList = new object[] - { - "tvm-1695681911_1-20161122t224741z", - "tvm-1695681911_2-20161122t224741z" - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.RemoveNodesAsync("poolId", content); Console.WriteLine(response.Status); @@ -2096,14 +1029,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - nodeList = new object[] - { - "tvm-1695681911_1-20161122t224741z", - "tvm-1695681911_2-20161122t224741z" - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.RemoveNodes("poolId", content); Console.WriteLine(response.Status); @@ -2193,19 +1119,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - poolInfo = new - { - poolId = "poolId", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -2215,23 +1129,11 @@ Console.WriteLine(response.Status); This sample shows how to call UpdateJob. "); -TokenCredential credential = new DefaultAzureCredential(); -BatchClient client = new BatchClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - poolInfo = new - { - poolId = "poolId", - }, -}); +Uri endpoint = new Uri(""); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateJob("jobId", content); Console.WriteLine(response.Status); @@ -2343,7 +1245,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); +BatchJobDisableContent content = new BatchJobDisableContent(default); Response response = await client.DisableJobAsync("jobId", content); ]]> @@ -2355,7 +1257,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); +BatchJobDisableContent content = new BatchJobDisableContent(default); Response response = client.DisableJob("jobId", content); ]]> @@ -2367,10 +1269,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - disableTasks = "terminate", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.DisableJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -2384,10 +1283,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - disableTasks = "terminate", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.DisableJob("jobId", content); Console.WriteLine(response.Status); @@ -2477,13 +1373,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo -{ - PoolId = "poolId", -}) -{ - Priority = 0, -}; +BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = await client.CreateJobAsync(job); ]]> This sample shows how to call CreateJobAsync. @@ -2492,96 +1382,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo -{ - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - FilePath = "myprogram2.exe", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, -}) -{ - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - FilePath = "myprogram.exe", - }, new ResourceFile - { - StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", - FilePath = "datafolder", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = false, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - RunExclusive = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; +BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = await client.CreateJobAsync(job); ]]> @@ -2593,13 +1394,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo -{ - PoolId = "poolId", -}) -{ - Priority = 0, -}; +BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = client.CreateJob(job); ]]> This sample shows how to call CreateJob. @@ -2608,96 +1403,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo -{ - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - FilePath = "myprogram2.exe", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, -}) -{ - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - FilePath = "myprogram.exe", - }, new ResourceFile - { - StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", - FilePath = "datafolder", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = false, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - RunExclusive = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; +BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = client.CreateJob(job); ]]> @@ -2709,15 +1415,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobId", - priority = 0, - poolInfo = new - { - poolId = "poolId", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -2728,139 +1426,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobId", - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "taskId", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - filePath = "myprogram.exe", - }, - new - { - storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", - filePath = "datafolder", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = false, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "job", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - filePath = "myprogram2.exe", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -2874,15 +1440,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobId", - priority = 0, - poolInfo = new - { - poolId = "poolId", - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -2893,139 +1451,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobId", - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "taskId", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - filePath = "myprogram.exe", - }, - new - { - storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", - filePath = "datafolder", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = false, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "job", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - filePath = "myprogram2.exe", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -3183,27 +1609,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - schedule = new - { - doNotRunUntil = "2025-01-01T12:30:00Z", - }, - jobSpecification = new - { - priority = 0, - usesTaskDependencies = false, - constraints = new - { - maxWallClockTime = "P10675199DT2H48M5.4775807S", - maxTaskRetryCount = 0, - }, - poolInfo = new - { - poolId = "poolId", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateJobScheduleAsync("jobScheduleId", content); Console.WriteLine(response.Status); @@ -3217,27 +1623,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - schedule = new - { - doNotRunUntil = "2025-01-01T12:30:00Z", - }, - jobSpecification = new - { - priority = 0, - usesTaskDependencies = false, - constraints = new - { - maxWallClockTime = "P10675199DT2H48M5.4775807S", - maxTaskRetryCount = 0, - }, - poolInfo = new - { - poolId = "poolId", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateJobSchedule("jobScheduleId", content); Console.WriteLine(response.Status); @@ -3457,13 +1843,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration -{ - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), -}, new BatchJobSpecification(new BatchPoolInfo -{ - PoolId = "poolId", -})); +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = await client.CreateJobScheduleAsync(jobSchedule); ]]> This sample shows how to call CreateJobScheduleAsync. @@ -3472,228 +1852,28 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration -{ - DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), - DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), - StartWindow = XmlConvert.ToTimeSpan("PT1M"), - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), -}, new BatchJobSpecification(new BatchPoolInfo -{ - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - FilePath = "myprogram2.exe", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, -}) -{ - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - FilePath = "myprogram.exe", - }, new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", - FilePath = "test.txt", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = true, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - RunExclusive = true, - }, -}) -{ - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = await client.CreateJobScheduleAsync(jobSchedule); ]]> - - -This sample shows how to call CreateJobSchedule. -"); -TokenCredential credential = new DefaultAzureCredential(); -BatchClient client = new BatchClient(endpoint, credential); - -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration -{ - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), -}, new BatchJobSpecification(new BatchPoolInfo -{ - PoolId = "poolId", -})); -Response response = client.CreateJobSchedule(jobSchedule); -]]> -This sample shows how to call CreateJobSchedule. -"); -TokenCredential credential = new DefaultAzureCredential(); -BatchClient client = new BatchClient(endpoint, credential); - -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration -{ - DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), - DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), - StartWindow = XmlConvert.ToTimeSpan("PT1M"), - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), -}, new BatchJobSpecification(new BatchPoolInfo -{ - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - FilePath = "myprogram2.exe", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, -}) -{ - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") - { - ResourceFiles = {new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - FilePath = "myprogram.exe", - }, new ResourceFile - { - HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", - FilePath = "test.txt", - }}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") - { - Value = "myvalue", - }}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = true, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - RunExclusive = true, - }, -}) -{ - Metadata = { new MetadataItem("myproperty", "myvalue") }, -}; + + +This sample shows how to call CreateJobSchedule. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); +Response response = client.CreateJobSchedule(jobSchedule); +]]> +This sample shows how to call CreateJobSchedule. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = client.CreateJobSchedule(jobSchedule); ]]> @@ -3705,21 +1885,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobScheduleId", - schedule = new - { - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - poolInfo = new - { - poolId = "poolId", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -3730,149 +1896,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobScheduleId", - schedule = new - { - doNotRunUntil = "2014-09-10T02:30:00.000Z", - doNotRunAfter = "2014-09-10T06:30:00.000Z", - startWindow = "PT1M", - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "mytask1", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - filePath = "myprogram.exe", - }, - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", - filePath = "test.txt", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = true, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "jobschedule", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - filePath = "myprogram2.exe", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -3886,21 +1910,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobScheduleId", - schedule = new - { - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - poolInfo = new - { - poolId = "poolId", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -3911,149 +1921,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "jobScheduleId", - schedule = new - { - doNotRunUntil = "2014-09-10T02:30:00.000Z", - doNotRunAfter = "2014-09-10T06:30:00.000Z", - startWindow = "PT1M", - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "mytask1", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", - filePath = "myprogram.exe", - }, - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", - filePath = "test.txt", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = true, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "jobschedule", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { - new - { - httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", - filePath = "myprogram2.exe", - } - }, - environmentSettings = new object[] - { - new - { - name = "myvariable", - value = "myvalue", - } - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - }, - metadata = new object[] - { - new - { - name = "myproperty", - value = "myvalue", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -4067,7 +1935,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -4076,21 +1944,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") -{ - ContainerSettings = new BatchTaskContainerSettings("ubuntu") - { - ContainerRunOptions = "--rm", - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -4099,24 +1953,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") -{ - ExitConditions = new ExitConditions - { - ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions - { - JobAction = BatchJobAction.Terminate, - })}, - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -4125,10 +1962,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") -{ - RequiredSlots = 2, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); ]]> @@ -4140,7 +1974,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -4149,21 +1983,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") -{ - ContainerSettings = new BatchTaskContainerSettings("ubuntu") - { - ContainerRunOptions = "--rm", - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -4172,24 +1992,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") -{ - ExitConditions = new ExitConditions - { - ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions - { - JobAction = BatchJobAction.Terminate, - })}, - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -4198,10 +2001,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") -{ - RequiredSlots = 2, -}; +BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); ]]> @@ -4213,11 +2013,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "task1", - commandLine = "cmd /c echo task1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4228,24 +2024,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "taskId", - commandLine = "bash -c 'echo hello'", - containerSettings = new - { - imageName = "ubuntu", - containerRunOptions = "--rm", - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4256,34 +2035,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "taskId", - commandLine = "cmd /c exit 3", - exitConditions = new - { - exitCodeRanges = new object[] - { - new - { - start = 2, - end = 4, - exitOptions = new - { - jobAction = "terminate", - }, - } - }, - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4294,12 +2046,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "task1", - requiredSlots = 2, - commandLine = "cmd /c echo task1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4313,11 +2060,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "task1", - commandLine = "cmd /c echo task1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4328,24 +2071,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "taskId", - commandLine = "bash -c 'echo hello'", - containerSettings = new - { - imageName = "ubuntu", - containerRunOptions = "--rm", - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4356,34 +2082,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "taskId", - commandLine = "cmd /c exit 3", - exitConditions = new - { - exitCodeRanges = new object[] - { - new - { - start = 2, - end = 4, - exitOptions = new - { - jobAction = "terminate", - }, - } - }, - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4394,12 +2093,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - id = "task1", - requiredSlots = 2, - commandLine = "cmd /c echo task1", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4413,11 +2107,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] -{ - new BatchTaskCreateContent("simple1", "cmd /c dir /s"), - new BatchTaskCreateContent("simple2", "cmd /c dir /s") -}); +BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); ]]> This sample shows how to call CreateTaskCollectionAsync. @@ -4426,42 +2116,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] -{ - new BatchTaskCreateContent("complex1", "cmd /c dir /s") - { - ResourceFiles = {new ResourceFile - { - AutoStorageContainerName = "containerName", - FilePath = "data", - }}, - EnvironmentSettings = {new EnvironmentSetting("env1") - { - Value = "value1", - }, new EnvironmentSetting("env2") - { - Value = "value2", - }}, - AffinityInfo = new AffinityInfo("affinityId"), - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), - RetentionTime = XmlConvert.ToTimeSpan("P2D"), - MaxTaskRetryCount = 5, - }, - RequiredSlots = 2, - MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") - { - NumberOfInstances = 3, - CommonResourceFiles = {new ResourceFile - { - HttpUrl = "https://common.blob.core.windows.net/", - FilePath = "common.exe", - }}, - }, - }, - new BatchTaskCreateContent("simple3", "cmd /c dir /s") -}); +BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); ]]> @@ -4473,11 +2128,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] -{ - new BatchTaskCreateContent("simple1", "cmd /c dir /s"), - new BatchTaskCreateContent("simple2", "cmd /c dir /s") -}); +BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = client.CreateTaskCollection("jobId", taskCollection); ]]> This sample shows how to call CreateTaskCollection. @@ -4486,42 +2137,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] -{ - new BatchTaskCreateContent("complex1", "cmd /c dir /s") - { - ResourceFiles = {new ResourceFile - { - AutoStorageContainerName = "containerName", - FilePath = "data", - }}, - EnvironmentSettings = {new EnvironmentSetting("env1") - { - Value = "value1", - }, new EnvironmentSetting("env2") - { - Value = "value2", - }}, - AffinityInfo = new AffinityInfo("affinityId"), - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), - RetentionTime = XmlConvert.ToTimeSpan("P2D"), - MaxTaskRetryCount = 5, - }, - RequiredSlots = 2, - MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") - { - NumberOfInstances = 3, - CommonResourceFiles = {new ResourceFile - { - HttpUrl = "https://common.blob.core.windows.net/", - FilePath = "common.exe", - }}, - }, - }, - new BatchTaskCreateContent("simple3", "cmd /c dir /s") -}); +BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = client.CreateTaskCollection("jobId", taskCollection); ]]> @@ -4533,22 +2149,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - value = new object[] - { - new - { - id = "simple1", - commandLine = "cmd /c dir /s", - }, - new - { - id = "simple2", - commandLine = "cmd /c dir /s", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4560,67 +2161,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - value = new object[] - { - new - { - id = "complex1", - commandLine = "cmd /c dir /s", - resourceFiles = new object[] - { - new - { - autoStorageContainerName = "containerName", - filePath = "data", - } - }, - environmentSettings = new object[] - { - new - { - name = "env1", - value = "value1", - }, - new - { - name = "env2", - value = "value2", - } - }, - affinityInfo = new - { - affinityId = "affinityId", - }, - constraints = new - { - maxWallClockTime = "P1D", - retentionTime = "P2D", - maxTaskRetryCount = 5, - }, - requiredSlots = 2, - multiInstanceSettings = new - { - numberOfInstances = 3, - coordinationCommandLine = "cmd /c echo coordinating", - commonResourceFiles = new object[] - { - new - { - httpUrl = "https://common.blob.core.windows.net/", - filePath = "common.exe", - } - }, - }, - }, - new - { - id = "simple3", - commandLine = "cmd /c dir /s", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4635,22 +2176,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - value = new object[] - { - new - { - id = "simple1", - commandLine = "cmd /c dir /s", - }, - new - { - id = "simple2", - commandLine = "cmd /c dir /s", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4662,67 +2188,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - value = new object[] - { - new - { - id = "complex1", - commandLine = "cmd /c dir /s", - resourceFiles = new object[] - { - new - { - autoStorageContainerName = "containerName", - filePath = "data", - } - }, - environmentSettings = new object[] - { - new - { - name = "env1", - value = "value1", - }, - new - { - name = "env2", - value = "value2", - } - }, - affinityInfo = new - { - affinityId = "affinityId", - }, - constraints = new - { - maxWallClockTime = "P1D", - retentionTime = "P2D", - maxTaskRetryCount = 5, - }, - requiredSlots = 2, - multiInstanceSettings = new - { - numberOfInstances = 3, - coordinationCommandLine = "cmd /c echo coordinating", - commonResourceFiles = new object[] - { - new - { - httpUrl = "https://common.blob.core.windows.net/", - filePath = "common.exe", - } - }, - }, - }, - new - { - id = "simple3", - commandLine = "cmd /c dir /s", - } - }, -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -5025,12 +2491,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") -{ - IsAdmin = false, - ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), - Password = "Password", -}; +BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", user); ]]> @@ -5042,12 +2503,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") -{ - IsAdmin = false, - ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), - Password = "Password", -}; +BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", user); ]]> @@ -5059,13 +2515,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - name = "userName", - isAdmin = false, - expiryTime = "2017-08-01T00:00:00Z", - password = "Password", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -5079,13 +2529,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - name = "userName", - isAdmin = false, - expiryTime = "2017-08-01T00:00:00Z", - password = "Password", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -5125,11 +2569,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent -{ - Password = "12345", - ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), -}; +BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); ]]> @@ -5141,11 +2581,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent -{ - Password = "12345", - ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), -}; +BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); ]]> @@ -5157,11 +2593,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - password = "12345", - expiryTime = "2016-11-27T00:45:48.7320857Z", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -5175,11 +2607,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - password = "12345", - expiryTime = "2016-11-27T00:45:48.7320857Z", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -5421,7 +2849,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); +UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); ]]> @@ -5433,7 +2861,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); +UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); ]]> @@ -5445,11 +2873,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", - startTime = "2017-11-27T00:00:00Z", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -5465,11 +2889,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", - startTime = "2017-11-27T00:00:00Z", -}); +using RequestContent content = RequestContent.Create(new object()); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; diff --git a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs index 274be47c20ed..30ce0376ee75 100644 --- a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs +++ b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs @@ -80,27 +80,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool01", - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - networkConfiguration = new - { - enableAcceleratedNetworking = true, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -114,27 +94,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool01", - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - networkConfiguration = new - { - enableAcceleratedNetworking = true, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -148,21 +108,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TargetDedicatedNodes = 2, - NetworkConfiguration = new NetworkConfiguration - { - EnableAcceleratedNetworking = true, - }, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -174,21 +120,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TargetDedicatedNodes = 2, - NetworkConfiguration = new NetworkConfiguration - { - EnableAcceleratedNetworking = true, - }, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -200,74 +132,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - mountConfiguration = new object[] - { -new -{ -azureBlobFileSystemConfiguration = new -{ -accountName = "accountName", -containerName = "blobContainerName", -accountKey = "accountKey", -relativeMountPath = "bfusepath", -}, -}, -new -{ -azureFileShareConfiguration = new -{ -accountName = "accountName", -azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", -accountKey = "accountKey", -relativeMountPath = "filesharepath", -mountOptions = "mount options ver=1.0", -}, -}, -new -{ -nfsMountConfiguration = new -{ -source = "somesource nfs url", -relativeMountPath = "mountpath", -mountOptions = "mount options ver=1.0", -}, -}, -new -{ -cifsMountConfiguration = new -{ -username = "accountName", -password = "password", -source = "//myaccount.file.core.windows.net/file", -relativeMountPath = "mountpath", -mountOptions = "mount options ver=1.0", -}, -} - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -281,74 +146,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_A TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - mountConfiguration = new object[] - { -new -{ -azureBlobFileSystemConfiguration = new -{ -accountName = "accountName", -containerName = "blobContainerName", -accountKey = "accountKey", -relativeMountPath = "bfusepath", -}, -}, -new -{ -azureFileShareConfiguration = new -{ -accountName = "accountName", -azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", -accountKey = "accountKey", -relativeMountPath = "filesharepath", -mountOptions = "mount options ver=1.0", -}, -}, -new -{ -nfsMountConfiguration = new -{ -source = "somesource nfs url", -relativeMountPath = "mountpath", -mountOptions = "mount options ver=1.0", -}, -}, -new -{ -cifsMountConfiguration = new -{ -username = "accountName", -password = "password", -source = "//myaccount.file.core.windows.net/file", -relativeMountPath = "mountpath", -mountOptions = "mount options ver=1.0", -}, -} - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -362,46 +160,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Conveni TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - MountConfiguration = {new MountConfiguration -{ -AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") -{ -AccountKey = "accountKey", -}, -}, new MountConfiguration -{ -AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") -{ -MountOptions = "mount options ver=1.0", -}, -}, new MountConfiguration -{ -NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") -{ -MountOptions = "mount options ver=1.0", -}, -}, new MountConfiguration -{ -CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") -{ -MountOptions = "mount options ver=1.0", -}, -}}, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -413,46 +172,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_C TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - MountConfiguration = {new MountConfiguration -{ -AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") -{ -AccountKey = "accountKey", -}, -}, new MountConfiguration -{ -AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") -{ -MountOptions = "mount options ver=1.0", -}, -}, new MountConfiguration -{ -NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") -{ -MountOptions = "mount options ver=1.0", -}, -}, new MountConfiguration -{ -CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") -{ -MountOptions = "mount options ver=1.0", -}, -}}, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -464,39 +184,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "standard_d2s_v3", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - osDisk = new - { - diskSizeGB = 100, - managedDisk = new - { - storageAccountType = "standardssd_lrs", - }, - caching = "readwrite", - ephemeralOSDiskSettings = new - { - placement = "cachedisk", - }, - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 1, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -510,39 +198,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "standard_d2s_v3", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - osDisk = new - { - diskSizeGB = 100, - managedDisk = new - { - storageAccountType = "standardssd_lrs", - }, - caching = "readwrite", - ephemeralOSDiskSettings = new - { - placement = "cachedisk", - }, - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 1, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -556,32 +212,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - OsDisk = new OSDisk - { - EphemeralOSDiskSettings = new DiffDiskSettings - { - Placement = DiffDiskPlacement.CacheDisk, - }, - Caching = CachingType.ReadWrite, - DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -593,32 +224,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - OsDisk = new OSDisk - { - EphemeralOSDiskSettings = new DiffDiskSettings - { - Placement = DiffDiskPlacement.CacheDisk, - }, - Caching = CachingType.ReadWrite, - DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -630,28 +236,7 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - }, - targetDedicatedNodes = 1, - resourceTags = new - { - TagName1 = "TagValue1", - TagName2 = "TagValue2", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -665,28 +250,7 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_As TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - }, - targetDedicatedNodes = 1, - resourceTags = new - { - TagName1 = "TagValue1", - TagName2 = "TagValue2", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -700,22 +264,7 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Convenie TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04"), - ResourceTags = -{ -["TagName1"] = "TagValue1", -["TagName2"] = "TagValue2" -}, - TargetDedicatedNodes = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -727,22 +276,7 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Co TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04"), - ResourceTags = -{ -["TagName1"] = "TagValue1", -["TagName2"] = "TagValue2" -}, - TargetDedicatedNodes = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -754,32 +288,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - securityProfile = new - { - securityType = "trustedLaunch", - encryptionAtHost = true, - uefiSettings = new - { - secureBootEnabled = false, - }, - }, - }, - targetDedicatedNodes = 1, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -793,32 +302,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool001", - vmSize = "STANDARD_DC2s_V2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "UbuntuServer", - sku = "18_04-lts-gen2", - version = "latest", - }, - nodeAgentSKUId = "batch.node.ubuntu 18.04", - securityProfile = new - { - securityType = "trustedLaunch", - encryptionAtHost = true, - uefiSettings = new - { - secureBootEnabled = false, - }, - }, - }, - targetDedicatedNodes = 1, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -832,23 +316,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Convenience TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04") - { - SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings - { - SecureBootEnabled = false, - }), - }, - TargetDedicatedNodes = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -860,23 +328,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "UbuntuServer", - Sku = "18_04-lts-gen2", - Version = "latest", - }, "batch.node.ubuntu 18.04") - { - SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings - { - SecureBootEnabled = false, - }), - }, - TargetDedicatedNodes = 1, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -888,39 +340,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -934,39 +354,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -980,23 +368,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Con TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -1008,23 +380,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04"), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -1036,38 +392,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "120_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - containerConfiguration = new - { - type = "dockerCompatible", - containerImageNames = new object[] - { -"busybox" - }, - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1081,38 +406,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "120_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - containerConfiguration = new - { - type = "dockerCompatible", - containerImageNames = new object[] - { -"busybox" - }, - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -1126,27 +420,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "120_04-lts", - }, "batch.node.ubuntu 20.04") - { - ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) - { - ContainerImageNames = { "busybox" }, - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -1158,27 +432,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "120_04-lts", - }, "batch.node.ubuntu 20.04") - { - ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) - { - ContainerImageNames = { "busybox" }, - }, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -1190,57 +444,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - extensions = new object[] - { -new -{ -name = "batchextension1", -type = "KeyVaultForLinux", -publisher = "Microsoft.Azure.KeyVault", -typeHandlerVersion = "2.0", -autoUpgradeMinorVersion = true, -enableAutomaticUpgrade = true, -settings = new -{ -secretsManagementSettingsKey = "secretsManagementSettingsValue", -authenticationSettingsKey = "authenticationSettingsValue", -}, -} - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "simplified", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1254,57 +458,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "pool2", - vmSize = "standard_a1", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "Canonical", - offer = "0001-com-ubuntu-server-focal", - sku = "20_04-lts", - }, - nodeAgentSKUId = "batch.node.ubuntu 20.04", - extensions = new object[] - { -new -{ -name = "batchextension1", -type = "KeyVaultForLinux", -publisher = "Microsoft.Azure.KeyVault", -typeHandlerVersion = "2.0", -autoUpgradeMinorVersion = true, -enableAutomaticUpgrade = true, -settings = new -{ -secretsManagementSettingsKey = "secretsManagementSettingsValue", -authenticationSettingsKey = "authenticationSettingsValue", -}, -} - }, - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 5, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 3, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "simplified", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -1318,37 +472,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") -{ -TypeHandlerVersion = "2.0", -AutoUpgradeMinorVersion = true, -EnableAutomaticUpgrade = true, -Settings = -{ -["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", -["authenticationSettingsKey"] = "authenticationSettingsValue" -}, -}}, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -1360,37 +484,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "Canonical", - Offer = "0001-com-ubuntu-server-focal", - Sku = "20_04-lts", - }, "batch.node.ubuntu 20.04") - { - Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") -{ -TypeHandlerVersion = "2.0", -AutoUpgradeMinorVersion = true, -EnableAutomaticUpgrade = true, -Settings = -{ -["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", -["authenticationSettingsKey"] = "authenticationSettingsValue" -}, -}}, - }, - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 5, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - TaskSlotsPerNode = 3, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -1402,31 +496,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool002", - vmSize = "Standard_A1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - windowsConfiguration = new - { - enableAutomaticUpdates = false, - }, - serviceArtifactReference = new - { - id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -1440,31 +510,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "mypool002", - vmSize = "Standard_A1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - windowsConfiguration = new - { - enableAutomaticUpdates = false, - }, - serviceArtifactReference = new - { - id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - targetDedicatedNodes = 2, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -1478,24 +524,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64") - { - WindowsConfiguration = new WindowsConfiguration - { - EnableAutomaticUpdates = false, - }, - ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), - }, - TargetDedicatedNodes = 2, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = client.CreatePool(pool); } @@ -1507,24 +536,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64") - { - WindowsConfiguration = new WindowsConfiguration - { - EnableAutomaticUpdates = false, - }, - ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), - }, - TargetDedicatedNodes = 2, - }; + BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); Response response = await client.CreatePoolAsync(pool); } @@ -1862,13 +874,7 @@ public void Example_Batch_UpdatePool_PatchThePool() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdatePool("poolId", content); Console.WriteLine(response.Status); @@ -1882,13 +888,7 @@ public async Task Example_Batch_UpdatePool_PatchThePool_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdatePoolAsync("poolId", content); Console.WriteLine(response.Status); @@ -1928,11 +928,7 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - autoScaleFormula = "$TargetDedicated=0", - autoScaleEvaluationInterval = "PT8M", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.EnablePoolAutoScale("poolId", content); Console.WriteLine(response.Status); @@ -1946,11 +942,7 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - autoScaleFormula = "$TargetDedicated=0", - autoScaleEvaluationInterval = "PT8M", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); Console.WriteLine(response.Status); @@ -1964,11 +956,7 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent - { - AutoScaleFormula = "$TargetDedicated=0", - AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), - }; + BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); Response response = client.EnablePoolAutoScale("poolId", content); } @@ -1980,11 +968,7 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenie TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent - { - AutoScaleFormula = "$TargetDedicated=0", - AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), - }; + BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); } @@ -1996,10 +980,7 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - autoScaleFormula = "$TargetDedicated=1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.EvaluatePoolAutoScale("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2014,10 +995,7 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Asyn TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - autoScaleFormula = "$TargetDedicated=1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2032,7 +1010,7 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenienc TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); + BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); Response response = client.EvaluatePoolAutoScale("poolId", content); } @@ -2044,7 +1022,7 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Conv TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); + BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); } @@ -2056,11 +1034,7 @@ public void Example_Batch_ResizePool_PoolResize() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.ResizePool("resizePool", content); Console.WriteLine(response.Status); @@ -2074,11 +1048,7 @@ public async Task Example_Batch_ResizePool_PoolResize_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - targetDedicatedNodes = 1, - targetLowPriorityNodes = 0, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.ResizePoolAsync("resizePool", content); Console.WriteLine(response.Status); @@ -2092,11 +1062,7 @@ public void Example_Batch_ResizePool_PoolResize_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolResizeContent content = new BatchPoolResizeContent - { - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - }; + BatchPoolResizeContent content = new BatchPoolResizeContent(); Response response = client.ResizePool("resizePool", content); } @@ -2108,11 +1074,7 @@ public async Task Example_Batch_ResizePool_PoolResize_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolResizeContent content = new BatchPoolResizeContent - { - TargetDedicatedNodes = 1, - TargetLowPriorityNodes = 0, - }; + BatchPoolResizeContent content = new BatchPoolResizeContent(); Response response = await client.ResizePoolAsync("resizePool", content); } @@ -2150,15 +1112,7 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - applicationPackageReferences = Array.Empty(), - metadata = Array.Empty(), - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.ReplacePoolProperties("poolId", content); Console.WriteLine(response.Status); @@ -2172,15 +1126,7 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - startTask = new - { - commandLine = "/bin/bash -c 'echo start task'", - }, - applicationPackageReferences = Array.Empty(), - metadata = Array.Empty(), - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.ReplacePoolPropertiesAsync("poolId", content); Console.WriteLine(response.Status); @@ -2194,10 +1140,7 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) - { - StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), - }; + BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); Response response = client.ReplacePoolProperties("poolId", pool); } @@ -2209,10 +1152,7 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience_Asy TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) - { - StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), - }; + BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); Response response = await client.ReplacePoolPropertiesAsync("poolId", pool); } @@ -2224,14 +1164,7 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - nodeList = new object[] - { -"tvm-1695681911_1-20161122t224741z", -"tvm-1695681911_2-20161122t224741z" - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.RemoveNodes("poolId", content); Console.WriteLine(response.Status); @@ -2245,14 +1178,7 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - nodeList = new object[] - { -"tvm-1695681911_1-20161122t224741z", -"tvm-1695681911_2-20161122t224741z" - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.RemoveNodesAsync("poolId", content); Console.WriteLine(response.Status); @@ -2266,7 +1192,7 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); + BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); Response response = client.RemoveNodes("poolId", content); } @@ -2278,7 +1204,7 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); + BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); Response response = await client.RemoveNodesAsync("poolId", content); } @@ -2366,19 +1292,7 @@ public void Example_Batch_UpdateJob_JobPatch() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - poolInfo = new - { - poolId = "poolId", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateJob("jobId", content); Console.WriteLine(response.Status); @@ -2392,19 +1306,7 @@ public async Task Example_Batch_UpdateJob_JobPatch_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - poolInfo = new - { - poolId = "poolId", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -2516,10 +1418,7 @@ public void Example_Batch_DisableJob_JobDisable() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - disableTasks = "terminate", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.DisableJob("jobId", content); Console.WriteLine(response.Status); @@ -2533,10 +1432,7 @@ public async Task Example_Batch_DisableJob_JobDisable_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - disableTasks = "terminate", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.DisableJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -2550,7 +1446,7 @@ public void Example_Batch_DisableJob_JobDisable_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); + BatchJobDisableContent content = new BatchJobDisableContent(default); Response response = client.DisableJob("jobId", content); } @@ -2562,7 +1458,7 @@ public async Task Example_Batch_DisableJob_JobDisable_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); + BatchJobDisableContent content = new BatchJobDisableContent(default); Response response = await client.DisableJobAsync("jobId", content); } @@ -2650,15 +1546,7 @@ public void Example_Batch_CreateJob_CreatesABasicJob() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobId", - priority = 0, - poolInfo = new - { - poolId = "poolId", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -2672,15 +1560,7 @@ public async Task Example_Batch_CreateJob_CreatesABasicJob_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobId", - priority = 0, - poolInfo = new - { - poolId = "poolId", - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -2694,13 +1574,7 @@ public void Example_Batch_CreateJob_CreatesABasicJob_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo - { - PoolId = "poolId", - }) - { - Priority = 0, - }; + BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = client.CreateJob(job); } @@ -2708,161 +1582,23 @@ public void Example_Batch_CreateJob_CreatesABasicJob_Convenience() [Ignore("Only validating compilation of examples")] public async Task Example_Batch_CreateJob_CreatesABasicJob_Convenience_Async() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - BatchClient client = new BatchClient(endpoint, credential); - - BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo - { - PoolId = "poolId", - }) - { - Priority = 0, - }; - Response response = await client.CreateJobAsync(job); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJob_CreatesAComplexJob() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - BatchClient client = new BatchClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - id = "jobId", - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "taskId", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -filePath = "myprogram.exe", -}, -new -{ -storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", -filePath = "datafolder", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = false, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "job", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -filePath = "myprogram2.exe", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + BatchJobCreateContent job = new BatchJobCreateContent(null, null); + Response response = await client.CreateJobAsync(job); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Batch_CreateJob_CreatesAComplexJob() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -2876,139 +1612,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobId", - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "taskId", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -filePath = "myprogram.exe", -}, -new -{ -storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", -filePath = "datafolder", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = false, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "job", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -filePath = "myprogram2.exe", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -3022,96 +1626,7 @@ public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo - { - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -FilePath = "myprogram2.exe", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, - }) - { - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -FilePath = "myprogram.exe", -}, new ResourceFile -{ -StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", -FilePath = "datafolder", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = false, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - RunExclusive = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = client.CreateJob(job); } @@ -3123,96 +1638,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo - { - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -FilePath = "myprogram2.exe", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, - }) - { - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -FilePath = "myprogram.exe", -}, new ResourceFile -{ -StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", -FilePath = "datafolder", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = false, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - RunExclusive = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchJobCreateContent job = new BatchJobCreateContent(null, null); Response response = await client.CreateJobAsync(job); } @@ -3368,27 +1794,7 @@ public void Example_Batch_UpdateJobSchedule_JobSchedulePatch() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - schedule = new - { - doNotRunUntil = "2025-01-01T12:30:00Z", - }, - jobSpecification = new - { - priority = 0, - usesTaskDependencies = false, - constraints = new - { - maxWallClockTime = "P10675199DT2H48M5.4775807S", - maxTaskRetryCount = 0, - }, - poolInfo = new - { - poolId = "poolId", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateJobSchedule("jobScheduleId", content); Console.WriteLine(response.Status); @@ -3402,27 +1808,7 @@ public async Task Example_Batch_UpdateJobSchedule_JobSchedulePatch_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - schedule = new - { - doNotRunUntil = "2025-01-01T12:30:00Z", - }, - jobSpecification = new - { - priority = 0, - usesTaskDependencies = false, - constraints = new - { - maxWallClockTime = "P10675199DT2H48M5.4775807S", - maxTaskRetryCount = 0, - }, - poolInfo = new - { - poolId = "poolId", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateJobScheduleAsync("jobScheduleId", content); Console.WriteLine(response.Status); @@ -3642,21 +2028,7 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobScheduleId", - schedule = new - { - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - poolInfo = new - { - poolId = "poolId", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -3670,21 +2042,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobScheduleId", - schedule = new - { - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - poolInfo = new - { - poolId = "poolId", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -3698,13 +2056,7 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Convenience TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration - { - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), - }, new BatchJobSpecification(new BatchPoolInfo - { - PoolId = "poolId", - })); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = client.CreateJobSchedule(jobSchedule); } @@ -3716,13 +2068,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration - { - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), - }, new BatchJobSpecification(new BatchPoolInfo - { - PoolId = "poolId", - })); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = await client.CreateJobScheduleAsync(jobSchedule); } @@ -3734,149 +2080,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "jobScheduleId", - schedule = new - { - doNotRunUntil = "2014-09-10T02:30:00.000Z", - doNotRunAfter = "2014-09-10T06:30:00.000Z", - startWindow = "PT1M", - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "mytask1", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -filePath = "myprogram.exe", -}, -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", -filePath = "test.txt", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = true, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "jobschedule", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -filePath = "myprogram2.exe", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -3886,153 +2090,11 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() [Ignore("Only validating compilation of examples")] public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Async() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - BatchClient client = new BatchClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - id = "jobScheduleId", - schedule = new - { - doNotRunUntil = "2014-09-10T02:30:00.000Z", - doNotRunAfter = "2014-09-10T06:30:00.000Z", - startWindow = "PT1M", - recurrenceInterval = "PT5M", - }, - jobSpecification = new - { - priority = 100, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = -1, - }, - jobManagerTask = new - { - id = "mytask1", - commandLine = "myprogram.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -filePath = "myprogram.exe", -}, -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", -filePath = "test.txt", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - constraints = new - { - maxWallClockTime = "PT1H", - maxTaskRetryCount = 0, - retentionTime = "PT1H", - }, - requiredSlots = 2, - killJobOnCompletion = true, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - runExclusive = true, - }, - poolInfo = new - { - autoPoolSpecification = new - { - autoPoolIdPrefix = "mypool", - poolLifetimeOption = "jobschedule", - pool = new - { - vmSize = "Standard_D1_v2", - virtualMachineConfiguration = new - { - imageReference = new - { - publisher = "MicrosoftWindowsServer", - offer = "WindowsServer", - sku = "2016-datacenter-smalldisk", - version = "latest", - }, - nodeAgentSKUId = "batch.node.windows amd64", - }, - resizeTimeout = "PT15M", - targetDedicatedNodes = 3, - targetLowPriorityNodes = 0, - taskSlotsPerNode = 2, - taskSchedulingPolicy = new - { - nodeFillType = "spread", - }, - enableAutoScale = false, - enableInterNodeCommunication = true, - startTask = new - { - commandLine = "myprogram2.exe", - resourceFiles = new object[] - { -new -{ -httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -filePath = "myprogram2.exe", -} - }, - environmentSettings = new object[] - { -new -{ -name = "myvariable", -value = "myvalue", -} - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "admin", - }, - }, - maxTaskRetryCount = 2, - waitForSuccess = true, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - targetNodeCommunicationMode = "default", - }, - }, - }, - }, - metadata = new object[] - { -new -{ -name = "myproperty", -value = "myvalue", -} - }, - }); + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -4046,104 +2108,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration - { - DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), - DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), - StartWindow = XmlConvert.ToTimeSpan("PT1M"), - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), - }, new BatchJobSpecification(new BatchPoolInfo - { - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -FilePath = "myprogram2.exe", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, - }) - { - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -FilePath = "myprogram.exe", -}, new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", -FilePath = "test.txt", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = true, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - RunExclusive = true, - }, - }) - { - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = client.CreateJobSchedule(jobSchedule); } @@ -4155,104 +2120,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration - { - DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), - DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), - StartWindow = XmlConvert.ToTimeSpan("PT1M"), - RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), - }, new BatchJobSpecification(new BatchPoolInfo - { - AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) - { - AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") - { - VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference - { - Publisher = "MicrosoftWindowsServer", - Offer = "WindowsServer", - Sku = "2016-datacenter-smalldisk", - Version = "latest", - }, "batch.node.windows amd64"), - TaskSlotsPerNode = 2, - TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), - ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), - TargetDedicatedNodes = 3, - TargetLowPriorityNodes = 0, - EnableAutoScale = false, - EnableInterNodeCommunication = true, - StartTask = new BatchStartTask("myprogram2.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", -FilePath = "myprogram2.exe", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.Admin, - }, - }, - MaxTaskRetryCount = 2, - WaitForSuccess = true, - }, - Metadata = { new MetadataItem("myproperty", "myvalue") }, - TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, - }, - }, - }) - { - Priority = 100, - Constraints = new BatchJobConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = -1, - }, - JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") - { - ResourceFiles = {new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", -FilePath = "myprogram.exe", -}, new ResourceFile -{ -HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", -FilePath = "test.txt", -}}, - EnvironmentSettings = {new EnvironmentSetting("myvariable") -{ -Value = "myvalue", -}}, - Constraints = new BatchTaskConstraints - { - MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), - RetentionTime = XmlConvert.ToTimeSpan("PT1H"), - MaxTaskRetryCount = 0, - }, - RequiredSlots = 2, - KillJobOnCompletion = true, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - RunExclusive = true, - }, - }) - { - Metadata = { new MetadataItem("myproperty", "myvalue") }, - }; + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); Response response = await client.CreateJobScheduleAsync(jobSchedule); } @@ -4264,11 +2132,7 @@ public void Example_Batch_CreateTask_CreatesABasicTask() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "task1", - commandLine = "cmd /c echo task1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4282,11 +2146,7 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "task1", - commandLine = "cmd /c echo task1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4300,7 +2160,7 @@ public void Example_Batch_CreateTask_CreatesABasicTask_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); } @@ -4312,7 +2172,7 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); } @@ -4324,24 +2184,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "taskId", - commandLine = "bash -c 'echo hello'", - containerSettings = new - { - imageName = "ubuntu", - containerRunOptions = "--rm", - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4355,24 +2198,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Asy TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "taskId", - commandLine = "bash -c 'echo hello'", - containerSettings = new - { - imageName = "ubuntu", - containerRunOptions = "--rm", - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4386,21 +2212,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Convenien TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") - { - ContainerSettings = new BatchTaskContainerSettings("ubuntu") - { - ContainerRunOptions = "--rm", - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); } @@ -4412,21 +2224,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Con TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") - { - ContainerSettings = new BatchTaskContainerSettings("ubuntu") - { - ContainerRunOptions = "--rm", - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); } @@ -4438,34 +2236,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "taskId", - commandLine = "cmd /c exit 3", - exitConditions = new - { - exitCodeRanges = new object[] - { -new -{ -start = 2, -end = 4, -exitOptions = new -{ -jobAction = "terminate", -}, -} - }, - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4479,34 +2250,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Async( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "taskId", - commandLine = "cmd /c exit 3", - exitConditions = new - { - exitCodeRanges = new object[] - { -new -{ -start = 2, -end = 4, -exitOptions = new -{ -jobAction = "terminate", -}, -} - }, - }, - userIdentity = new - { - autoUser = new - { - scope = "task", - elevationLevel = "nonadmin", - }, - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4520,24 +2264,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions_Convenience( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") - { - ExitConditions = new ExitConditions - { - ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions -{ -JobAction = BatchJobAction.Terminate, -})}, - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); } @@ -4549,24 +2276,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") - { - ExitConditions = new ExitConditions - { - ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions -{ -JobAction = BatchJobAction.Terminate, -})}, - }, - UserIdentity = new UserIdentity - { - AutoUser = new AutoUserSpecification - { - Scope = AutoUserScope.Task, - ElevationLevel = ElevationLevel.NonAdmin, - }, - }, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); } @@ -4578,12 +2288,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "task1", - requiredSlots = 2, - commandLine = "cmd /c echo task1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -4597,12 +2302,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - id = "task1", - requiredSlots = 2, - commandLine = "cmd /c echo task1", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -4616,10 +2316,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") - { - RequiredSlots = 2, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = client.CreateTask("jobId", task); } @@ -4631,10 +2328,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") - { - RequiredSlots = 2, - }; + BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); Response response = await client.CreateTaskAsync("jobId", task); } @@ -4646,22 +2340,7 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - value = new object[] - { -new -{ -id = "simple1", -commandLine = "cmd /c dir /s", -}, -new -{ -id = "simple2", -commandLine = "cmd /c dir /s", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4676,22 +2355,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - value = new object[] - { -new -{ -id = "simple1", -commandLine = "cmd /c dir /s", -}, -new -{ -id = "simple2", -commandLine = "cmd /c dir /s", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4706,11 +2370,7 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Co TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] - { -new BatchTaskCreateContent("simple1", "cmd /c dir /s"), -new BatchTaskCreateContent("simple2", "cmd /c dir /s") - }); + BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = client.CreateTaskCollection("jobId", taskCollection); } @@ -4722,11 +2382,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] - { -new BatchTaskCreateContent("simple1", "cmd /c dir /s"), -new BatchTaskCreateContent("simple2", "cmd /c dir /s") - }); + BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); } @@ -4738,67 +2394,7 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - value = new object[] - { -new -{ -id = "complex1", -commandLine = "cmd /c dir /s", -resourceFiles = new object[] -{ -new -{ -autoStorageContainerName = "containerName", -filePath = "data", -} -}, -environmentSettings = new object[] -{ -new -{ -name = "env1", -value = "value1", -}, -new -{ -name = "env2", -value = "value2", -} -}, -affinityInfo = new -{ -affinityId = "affinityId", -}, -constraints = new -{ -maxWallClockTime = "P1D", -retentionTime = "P2D", -maxTaskRetryCount = 5, -}, -requiredSlots = 2, -multiInstanceSettings = new -{ -numberOfInstances = 3, -coordinationCommandLine = "cmd /c echo coordinating", -commonResourceFiles = new object[] -{ -new -{ -httpUrl = "https://common.blob.core.windows.net/", -filePath = "common.exe", -} -}, -}, -}, -new -{ -id = "simple3", -commandLine = "cmd /c dir /s", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4813,67 +2409,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - value = new object[] - { -new -{ -id = "complex1", -commandLine = "cmd /c dir /s", -resourceFiles = new object[] -{ -new -{ -autoStorageContainerName = "containerName", -filePath = "data", -} -}, -environmentSettings = new object[] -{ -new -{ -name = "env1", -value = "value1", -}, -new -{ -name = "env2", -value = "value2", -} -}, -affinityInfo = new -{ -affinityId = "affinityId", -}, -constraints = new -{ -maxWallClockTime = "P1D", -retentionTime = "P2D", -maxTaskRetryCount = 5, -}, -requiredSlots = 2, -multiInstanceSettings = new -{ -numberOfInstances = 3, -coordinationCommandLine = "cmd /c echo coordinating", -commonResourceFiles = new object[] -{ -new -{ -httpUrl = "https://common.blob.core.windows.net/", -filePath = "common.exe", -} -}, -}, -}, -new -{ -id = "simple3", -commandLine = "cmd /c dir /s", -} - }, - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -4888,42 +2424,7 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] - { -new BatchTaskCreateContent("complex1", "cmd /c dir /s") -{ -ResourceFiles = {new ResourceFile -{ -AutoStorageContainerName = "containerName", -FilePath = "data", -}}, -EnvironmentSettings = {new EnvironmentSetting("env1") -{ -Value = "value1", -}, new EnvironmentSetting("env2") -{ -Value = "value2", -}}, -AffinityInfo = new AffinityInfo("affinityId"), -Constraints = new BatchTaskConstraints -{ -MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), -RetentionTime = XmlConvert.ToTimeSpan("P2D"), -MaxTaskRetryCount = 5, -}, -RequiredSlots = 2, -MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") -{ -NumberOfInstances = 3, -CommonResourceFiles = {new ResourceFile -{ -HttpUrl = "https://common.blob.core.windows.net/", -FilePath = "common.exe", -}}, -}, -}, -new BatchTaskCreateContent("simple3", "cmd /c dir /s") - }); + BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = client.CreateTaskCollection("jobId", taskCollection); } @@ -4935,42 +2436,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] - { -new BatchTaskCreateContent("complex1", "cmd /c dir /s") -{ -ResourceFiles = {new ResourceFile -{ -AutoStorageContainerName = "containerName", -FilePath = "data", -}}, -EnvironmentSettings = {new EnvironmentSetting("env1") -{ -Value = "value1", -}, new EnvironmentSetting("env2") -{ -Value = "value2", -}}, -AffinityInfo = new AffinityInfo("affinityId"), -Constraints = new BatchTaskConstraints -{ -MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), -RetentionTime = XmlConvert.ToTimeSpan("P2D"), -MaxTaskRetryCount = 5, -}, -RequiredSlots = 2, -MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") -{ -NumberOfInstances = 3, -CommonResourceFiles = {new ResourceFile -{ -HttpUrl = "https://common.blob.core.windows.net/", -FilePath = "common.exe", -}}, -}, -}, -new BatchTaskCreateContent("simple3", "cmd /c dir /s") - }); + BatchTaskGroup taskCollection = new BatchTaskGroup(null); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); } @@ -5270,13 +2736,7 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - name = "userName", - isAdmin = false, - expiryTime = "2017-08-01T00:00:00Z", - password = "Password", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -5290,13 +2750,7 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - name = "userName", - isAdmin = false, - expiryTime = "2017-08-01T00:00:00Z", - password = "Password", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -5310,12 +2764,7 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") - { - IsAdmin = false, - ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), - Password = "Password", - }; + BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", user); } @@ -5327,12 +2776,7 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Convenience_Async( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") - { - IsAdmin = false, - ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), - Password = "Password", - }; + BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", user); } @@ -5370,11 +2814,7 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - password = "12345", - expiryTime = "2016-11-27T00:45:48.7320857Z", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -5388,11 +2828,7 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - password = "12345", - expiryTime = "2016-11-27T00:45:48.7320857Z", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -5406,11 +2842,7 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent - { - Password = "12345", - ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), - }; + BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); } @@ -5422,11 +2854,7 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent - { - Password = "12345", - ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), - }; + BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); } @@ -5666,11 +3094,7 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", - startTime = "2017-11-27T00:00:00Z", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -5686,11 +3110,7 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", - startTime = "2017-11-27T00:00:00Z", - }); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -5706,7 +3126,7 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); + UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); } @@ -5718,7 +3138,7 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenienc TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); + UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); } diff --git a/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/README.md b/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/README.md index efe9dcda420c..d3755ae1b381 100644 --- a/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/README.md +++ b/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/README.md @@ -41,15 +41,15 @@ constructors that take a job output container URL, and call the SaveAsync method var linkedStorageAccount = new CloudStorageAccount(/* credentials */); var jobId = Environment.GetEnvironmentVariable("AZ_BATCH_JOB_ID"); var taskId = Environment.GetEnvironmentVariable("AZ_BATCH_TASK_ID"); - + var taskOutputStorage = new TaskOutputStorage(linkedStorageAccount, jobId, taskId); - + await taskOutputStorage.SaveAsync(TaskOutputKind.TaskOutput, "frame_full_res.jpg"); await taskOutputStorage.SaveAsync(TaskOutputKind.TaskPreview, "frame_low_res.jpg"); - + Note that all output files from a job, including task outputs, are stored in the same container. This means that [storage throttling limits](https://azure.microsoft.com/documentation/articles/storage-performance-checklist/#blobs) -may be enforced if a large number of tasks try to persist files at the same time. +may be enforced if a large number of tasks try to persist files at the same time. ### Listing and Retrieving Files in Client Code @@ -89,7 +89,7 @@ The job output container name is formed according to the following rules: * Otherwise: * Calculate the SHA1 hash of the normalized ID, and express it as a 40-character hex string. - * Replace all underscores, colons, and sequences of one or more hyphens in + * Replace all underscores, colons, and sequences of one or more hyphens in the normalized ID by single hyphens, then remove any leading or trailing hyphens. * If the resulting string is empty, use the string "job" instead. @@ -134,6 +134,3 @@ then its path within the container is "analysis-309/$TaskLog/analytics.log". The purpose behind this structure is to enable clients to readily locate outputs based on their kind - for example, "list the main outputs of the job" or "list the log files for task analysis-309". - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fbatch%2FMicrosoft.Azure.Batch.Conventions.Files%2FREADME.png) diff --git a/sdk/batch/Microsoft.Azure.Batch/README.md b/sdk/batch/Microsoft.Azure.Batch/README.md index f91ee8a08548..0536a65788e9 100644 --- a/sdk/batch/Microsoft.Azure.Batch/README.md +++ b/sdk/batch/Microsoft.Azure.Batch/README.md @@ -24,7 +24,7 @@ Depending on the type of change you want to make, the work required varies. If y * You might want to do this to add an `[Obsolete]` attribute or to add some helper factory methods. 6. If any APIs have changed, or if new APIs have been added, you must update the following places: * The `src\IProtocolLayer.cs` interface. - * The `src\ProtocolLayer.cs` class. + * The `src\ProtocolLayer.cs` class. * The corresponding operations class, for example `PoolOperations.cs`. * The corresponding entity which the operation is performed on, for example `CloudPool.cs`. 7. Add tests for your new models and APIs into the correct test projects. @@ -75,5 +75,3 @@ If running the tests against a test tenant, you also must set: 13. `MABOM_BatchTRPExtraHeaders` to x-ms-version=2015-12-01;x-ms-client-tenant-id=microsoft.onmicrosoft.com 14. `MABOM_BatchTRPCertificateThumbprint`: The thumbprint used to authenticate with the Batch Resource Provider. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fbatch%2FMicrosoft.Azure.Batch%2FREADME.png) diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md index a6203e7ac7d7..db3e84353afd 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md @@ -23,7 +23,7 @@ use-model-reader-writer: true deserialize-null-collection-as-null-value: true # mgmt-debug: -# show-serialized-names: true +# show-serialized-names: true operation-id-mappings: CdnEndpoint: @@ -101,11 +101,73 @@ rename-mapping: CacheLevel: CdnCacheLevel SslProtocol: DeliveryRuleSslProtocol SslProtocolMatchCondition: DeliveryRuleSslProtocolMatchCondition - CdnEndpoint.properties.customDomains: DeepCreatedCustomDomains + Endpoint.properties.customDomains: DeepCreatedCustomDomains WafMetricsSeriesUnit: WafMetricsResponseSeriesItemUnit WafMetricsGranularity: WafMetricsResponseGranularity MetricsSeriesUnit: MetricsResponseSeriesItemUnit MetricsGranularity: MetricsResponseGranularity + Profile.properties.frontDoorId: -|uuid + DeepCreatedOrigin.properties.privateLinkResourceId: -|arm-id + EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink.id: -|arm-id + Origin: CdnOrigin + Origin.properties.privateLinkResourceId: -|arm-id + OriginGroup: CdnOriginGroup + CustomDomain: CdnCustomDomain + ValidateCustomDomainInput: ValidateCustomDomainContent + ValidateCustomDomainOutput: ValidateCustomDomainResult + HealthProbeParameters: HealthProbeSettings + DeliveryRuleSocketAddrCondition: DeliveryRuleSocketAddressCondition + SocketAddrMatchCondition: SocketAddressMatchCondition + CdnManagedHttpsParameters: CdnManagedHttpsContent + UserManagedHttpsParameters: UserManagedHttpsContent + ResponseBasedOriginErrorDetectionParameters: ResponseBasedOriginErrorDetectionSettings + HttpErrorRangeParameters: HttpErrorRange + CheckNameAvailabilityInput: CdnNameAvailabilityContent + CheckNameAvailabilityOutput: CdnNameAvailabilityResult + ValidateProbeOutput: ValidateProbeResult + ResourceUsage: CdnUsage + ValidateCustomDomainOutput.customDomainValidated: isCustomDomainValid + ResponseBasedOriginErrorDetectionParameters.responseBasedDetectedErrorTypes: responseBasedDetectedErrorType + CustomDomain.properties.customHttpsParameters: customDomainHttpsContent + CustomDomain.properties.customHttpsProvisioningSubstate: customHttpsAvailabilityState + SsoUri.ssoUriValue: availableSsoUri + CustomerCertificateProperties.expirationDate: -|date-time + ManagedCertificateProperties.expirationDate: -|date-time + DomainValidationProperties.expirationDate: expiresDate|date-time + FrontDoorActivatedResourceInfo.id: -|arm-id + Usage.id: -|arm-id + AfdPurgeParameters: FrontDoorPurgeParameters + AfdRouteCacheConfiguration: FrontDoorRouteCacheConfiguration + Route: FrontDoorRoute + RuleSet: FrontDoorRuleSet + Rule: FrontDoorRule + SecurityPolicy: FrontDoorSecurityPolicy + Secret: FrontDoorSecret + ValidateSecretOutput: ValidateSecretResult + LoadBalancingSettingsParameters: LoadBalancingSettings + CompressionSettings: RouteCacheCompressionSettings + UsageName: FrontDoorUsageResourceName + Usage: FrontDoorUsage + AzureFirstPartyManagedCertificateParameters: AzureFirstPartyManagedCertificateProperties + UrlSigningKeyParameters: UriSigningKeyProperties + CheckHostNameAvailabilityInput: HostNameAvailabilityContent + CheckEndpointNameAvailabilityInput: EndpointNameAvailabilityContent + CheckEndpointNameAvailabilityOutput: EndpointNameAvailabilityResult + SecurityPolicyWebApplicationFirewallParameters: SecurityPolicyWebApplicationFirewall + AFDDomain.properties.azureDnsZone: dnsZone + AFDDomainUpdateParameters.properties.azureDnsZone: DnsZone + AFDOrigin.properties.azureOrigin: origin + AFDOriginUpdateParameters.properties.azureOrigin: origin + AFDOriginGroup.properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes: trafficRestorationTimeInMinutes + AFDOriginGroupUpdateParameters.properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes: trafficRestorationTimeInMinutes + MatchCondition: CustomRuleMatchCondition + ManagedRuleSet: WafPolicyManagedRuleSet + ManagedRuleGroupOverride: ManagedRuleGroupOverrideSetting + CdnWebApplicationFirewallPolicy.properties.rateLimitRules: RateLimitSettings + ManagedRuleOverride: ManagedRuleOverrideSetting + MatchCondition.operator: matchOperator + CdnWebApplicationFirewallPolicy.properties.customRules: CustomSettings + Endpoint: CdnEndpoint directive: - from: swagger-document @@ -146,36 +208,11 @@ directive: } } } - $.ProfileProperties.properties.frontDoorId['format'] = 'uuid'; $.CacheExpirationActionParameters.properties.cacheDuration['x-ms-format'] = 'duration-constant'; $.CacheConfiguration.properties.cacheDuration['x-ms-format'] = 'duration-constant'; - $.OriginUpdatePropertiesParameters.properties.privateLinkResourceId['x-ms-format'] = 'arm-id'; - $.DeepCreatedOriginProperties.properties.privateLinkResourceId['x-ms-format'] = 'arm-id'; - $.EndpointPropertiesUpdateParameters.properties.webApplicationFirewallPolicyLink.properties.id['x-ms-format'] = 'arm-id'; - $.Endpoint['x-ms-client-name'] = 'CdnEndpoint'; - $.Origin['x-ms-client-name'] = 'CdnOrigin'; - $.OriginGroup['x-ms-client-name'] = 'CdnOriginGroup'; - $.CustomDomain['x-ms-client-name'] = 'CdnCustomDomain'; - $.ValidateCustomDomainInput['x-ms-client-name'] = 'ValidateCustomDomainContent'; - $.ValidateCustomDomainOutput['x-ms-client-name'] = 'ValidateCustomDomainResult'; - $.HealthProbeParameters['x-ms-client-name'] = 'HealthProbeSettings'; - $.DeliveryRuleSocketAddrCondition['x-ms-client-name'] = 'DeliveryRuleSocketAddressCondition'; - $.SocketAddrMatchConditionParameters['x-ms-client-name'] = 'SocketAddressMatchCondition'; - $.CdnManagedHttpsParameters['x-ms-client-name'] = 'CdnManagedHttpsContent'; - $.UserManagedHttpsParameters['x-ms-client-name'] = 'UserManagedHttpsContent'; - $.ResponseBasedOriginErrorDetectionParameters['x-ms-client-name'] = 'ResponseBasedOriginErrorDetectionSettings'; - $.HttpErrorRangeParameters['x-ms-client-name'] = 'HttpErrorRange'; - $.CheckNameAvailabilityInput['x-ms-client-name'] = 'CdnNameAvailabilityContent'; - $.CheckNameAvailabilityOutput['x-ms-client-name'] = 'CdnNameAvailabilityResult'; - $.ValidateProbeOutput['x-ms-client-name'] = 'ValidateProbeResult'; - $.ResourceUsage['x-ms-client-name'] = 'CdnUsage'; + $.HealthProbeParameters.properties.probeProtocol['x-ms-enum'].name = 'HealthProbeProtocol'; $.CustomDomainHttpsParameters.properties.protocolType['x-ms-enum'].name = 'SecureDeliveryProtocolType'; - $.ResponseBasedOriginErrorDetectionParameters.properties.responseBasedDetectedErrorTypes['x-ms-client-name'] = 'responseBasedDetectedErrorType'; - $.ValidateCustomDomainOutput.properties.customDomainValidated['x-ms-client-name'] = 'isCustomDomainValid'; - $.CustomDomainProperties.properties.customHttpsParameters['x-ms-client-name'] = 'customDomainHttpsContent'; - $.CustomDomainProperties.properties.customHttpsProvisioningSubstate['x-ms-client-name'] = 'customHttpsAvailabilityState'; - $.SsoUri.properties.ssoUriValue['x-ms-client-name'] = 'availableSsoUri'; $.CustomDomainProperties.properties.customHttpsProvisioningSubstate['x-ms-enum'].name = 'CustomHttpsAvailabilityState'; $.CacheExpirationActionParameters.properties.cacheBehavior['x-ms-enum'].name = 'cacheBehaviorSetting'; $.CacheExpirationActionParameters.properties.cacheType['x-ms-enum'].name = 'cacheLevel'; @@ -271,42 +308,15 @@ directive: - from: afdx.json where: $.definitions transform: > - $.CustomerCertificateParameters.properties.expirationDate['format'] = 'date-time'; - $.ManagedCertificateParameters.properties.expirationDate['format'] = 'date-time'; - $.DomainValidationProperties.properties.expirationDate['format'] = 'date-time'; - $.ActivatedResourceReference.properties.id['x-ms-format'] = 'arm-id'; - $.Usage.properties.id['x-ms-format'] = 'arm-id'; - $.AfdPurgeParameters['x-ms-client-name'] = 'FrontDoorPurgeParameters'; - $.AfdRouteCacheConfiguration['x-ms-client-name'] = 'FrontDoorRouteCacheConfiguration'; - $.Route['x-ms-client-name'] = 'FrontDoorRoute'; - $.RuleSet['x-ms-client-name'] = 'FrontDoorRuleSet'; - $.Rule['x-ms-client-name'] = 'FrontDoorRule'; - $.SecurityPolicy['x-ms-client-name'] = 'FrontDoorSecurityPolicy'; - $.Secret['x-ms-client-name'] = 'FrontDoorSecret'; - $.ValidateSecretOutput['x-ms-client-name'] = 'ValidateSecretResult'; - $.LoadBalancingSettingsParameters['x-ms-client-name'] = 'LoadBalancingSettings'; - $.CompressionSettings['x-ms-client-name'] = 'RouteCacheCompressionSettings'; - $.UsageName['x-ms-client-name'] = 'FrontDoorUsageResourceName'; - $.Usage['x-ms-client-name'] = 'FrontDoorUsage'; $.SecretProperties['x-ms-client-name'] = 'SecretDetails'; $.SecurityPolicyProperties['x-ms-client-name'] = 'SecurityPolicyDetails'; $.SecretParameters['x-ms-client-name'] = 'SecretProperties'; $.SecurityPolicyPropertiesParameters['x-ms-client-name'] = 'SecurityPolicyProperties'; - $.AzureFirstPartyManagedCertificateParameters['x-ms-client-name'] = 'AzureFirstPartyManagedCertificateProperties'; $.CustomerCertificateParameters['x-ms-client-name'] = 'CustomerCertificateProperties'; $.ManagedCertificateParameters['x-ms-client-name'] = 'ManagedCertificateProperties'; - $.UrlSigningKeyParameters['x-ms-client-name'] = 'UriSigningKeyProperties'; - $.CheckHostNameAvailabilityInput['x-ms-client-name'] = 'HostNameAvailabilityContent'; - $.CheckEndpointNameAvailabilityInput['x-ms-client-name'] = 'EndpointNameAvailabilityContent'; - $.CheckEndpointNameAvailabilityOutput['x-ms-client-name'] = 'EndpointNameAvailabilityResult'; - $.SecurityPolicyWebApplicationFirewallParameters['x-ms-client-name'] = 'SecurityPolicyWebApplicationFirewall'; $.ActivatedResourceReference['x-ms-client-name'] = 'FrontDoorActivatedResourceInfo'; $.CustomerCertificateParameters.properties.expirationDate['x-ms-client-name'] = 'expiresDate'; $.ManagedCertificateParameters.properties.expirationDate['x-ms-client-name'] = 'expiresDate'; - $.DomainValidationProperties.properties.expirationDate['x-ms-client-name'] = 'expiresDate'; - $.AFDDomainUpdatePropertiesParameters.properties.azureDnsZone['x-ms-client-name'] = 'dnsZone'; - $.AFDOriginUpdatePropertiesParameters.properties.azureOrigin['x-ms-client-name'] = 'origin'; - $.AFDOriginGroupUpdatePropertiesParameters.properties.trafficRestorationTimeToHealedOrNewEndpointsInMinutes['x-ms-client-name'] = 'trafficRestorationTimeInMinutes'; $.AutoGeneratedDomainNameLabelScope['x-ms-enum'].name = 'DomainNameLabelScope'; $.AFDStateProperties.properties.deploymentStatus['x-ms-enum'].name = 'FrontDoorDeploymentStatus'; $.AFDStateProperties.properties.provisioningState['x-ms-enum'].name = 'FrontDoorProvisioningState'; @@ -370,16 +380,9 @@ directive: transform: > $.CdnEndpoint['x-ms-client-name'] = 'CdnEndpointReference'; $.policySettings['x-ms-client-name'] = 'WafPolicySettings'; - $.MatchCondition['x-ms-client-name'] = 'CustomRuleMatchCondition'; $.ActionType['x-ms-enum'].name = 'OverrideActionType'; - $.ManagedRuleSet['x-ms-client-name'] = 'WafPolicyManagedRuleSet'; - $.ManagedRuleGroupOverride['x-ms-client-name'] = 'ManagedRuleGroupOverrideSetting'; - $.ManagedRuleOverride['x-ms-client-name'] = 'ManagedRuleOverrideSetting'; $.ManagedRuleOverride.properties.enabledState['x-ms-enum'].name = 'ManagedRuleSetupState'; - $.CdnWebApplicationFirewallPolicyProperties.properties.rateLimitRules['x-ms-client-name'] = 'RateLimitSettings'; - $.CdnWebApplicationFirewallPolicyProperties.properties.customRules['x-ms-client-name'] = 'CustomSettings'; $.CdnWebApplicationFirewallPolicyProperties.properties.provisioningState['x-ms-enum'].name = 'WebApplicationFirewallPolicyProvisioningState'; - $.MatchCondition.properties.operator['x-ms-client-name'] = 'matchOperator'; $.MatchCondition.properties.operator['x-ms-enum'].name = 'matchOperator'; $.policySettings.properties.defaultCustomBlockResponseStatusCode['x-nullable'] = true; $.policySettings.properties.defaultCustomBlockResponseBody['x-nullable'] = true; diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs index 696013d944e8..1d0caca35dc6 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs @@ -13,8 +13,8 @@ public static void Add(this System.Collections.Generic.List completionResult) { throw null; } - public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace, string? deploymentName = null) { throw null; } + public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace, string? deploymentName = null) { throw null; } public static void Trim(this System.Collections.Generic.List messages) { } } public partial class ChatTools @@ -48,7 +48,7 @@ public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine. public string ModelVersion { get { throw null; } } protected override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VectorbaseEntry diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs index 696013d944e8..1d0caca35dc6 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs @@ -13,8 +13,8 @@ public static void Add(this System.Collections.Generic.List completionResult) { throw null; } - public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace, string? deploymentName = null) { throw null; } + public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace, string? deploymentName = null) { throw null; } public static void Trim(this System.Collections.Generic.List messages) { } } public partial class ChatTools @@ -48,7 +48,7 @@ public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine. public string ModelVersion { get { throw null; } } protected override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VectorbaseEntry diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs index fe65791080ef..5695d6e7c275 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs @@ -20,14 +20,17 @@ public static class AzureOpenAIExtensions /// Gets the OpenAI chat client. /// /// + /// /// - public static ChatClient GetOpenAIChatClient(this ClientWorkspace workspace) + public static ChatClient GetOpenAIChatClient(this ClientWorkspace workspace, string? deploymentName = null) { + string name = deploymentName ?? "default"; + ChatClient chatClient = workspace.Subclients.Get(() => { AzureOpenAIClient aoiaClient = workspace.Subclients.Get(() => CreateAzureOpenAIClient(workspace)); - return workspace.CreateChatClient(aoiaClient); - }); + return workspace.CreateChatClient(aoiaClient, deploymentName); + }, name); return chatClient; } @@ -36,14 +39,17 @@ public static ChatClient GetOpenAIChatClient(this ClientWorkspace workspace) /// Gets the OpenAI embeddings client. /// /// + /// /// - public static EmbeddingClient GetOpenAIEmbeddingsClient(this ClientWorkspace workspace) + public static EmbeddingClient GetOpenAIEmbeddingsClient(this ClientWorkspace workspace, string? deploymentName = null) { + string name = deploymentName ?? "default"; + EmbeddingClient embeddingsClient = workspace.Subclients.Get(() => { AzureOpenAIClient aoiaClient = workspace.Subclients.Get(() => CreateAzureOpenAIClient(workspace)); - return workspace.CreateEmbeddingsClient(aoiaClient); - }); + return workspace.CreateEmbeddingsClient(aoiaClient, deploymentName); + }, name); return embeddingsClient; } @@ -99,17 +105,17 @@ private static AzureOpenAIClient CreateAzureOpenAIClient(this ClientWorkspace wo } } - private static ChatClient CreateChatClient(this ClientWorkspace workspace, AzureOpenAIClient client) + private static ChatClient CreateChatClient(this ClientWorkspace workspace, AzureOpenAIClient client, string? deploymentName = null) { ClientConnection connection = workspace.GetConnectionOptions(typeof(ChatClient).FullName); - ChatClient chat = client.GetChatClient(connection.Locator); + ChatClient chat = client.GetChatClient(deploymentName ?? connection.Locator); return chat; } - private static EmbeddingClient CreateEmbeddingsClient(this ClientWorkspace workspace, AzureOpenAIClient client) + private static EmbeddingClient CreateEmbeddingsClient(this ClientWorkspace workspace, AzureOpenAIClient client, string? deploymentName = null) { ClientConnection connection = workspace.GetConnectionOptions(typeof(EmbeddingClient).FullName); - EmbeddingClient embeddings = client.GetEmbeddingClient(connection.Locator); + EmbeddingClient embeddings = client.GetEmbeddingClient(deploymentName ?? connection.Locator); return embeddings; } diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs index 88ef347e71a1..4e9a98fcc58c 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs @@ -13,7 +13,7 @@ internal class OpenAIFeature : CloudMachineFeature public OpenAIFeature() { } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure cloudMachine) + protected override ProvisionableResource EmitResources(ProjectInfrastructure cloudMachine) { CognitiveServicesAccount cognitiveServices = CreateOpenAIAccount(cloudMachine); cloudMachine.AddResource(cognitiveServices); @@ -35,7 +35,7 @@ protected override void EmitConnections(ConnectionCollection connections, string internal void EmitConnectionsInternal(ConnectionCollection connections, string cmId) => EmitConnections(connections, cmId); - internal static CognitiveServicesAccount CreateOpenAIAccount(CloudMachineInfrastructure cm) + internal static CognitiveServicesAccount CreateOpenAIAccount(ProjectInfrastructure cm) { return new("openai") { diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs index 6a353ec01f0f..8bbdd414d90b 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs @@ -88,7 +88,7 @@ protected override void EmitConnections(ConnectionCollection connections, string /// /// /// - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure cm) + protected override ProvisionableResource EmitResources(ProjectInfrastructure cm) { if (Account == null) throw new InvalidOperationException("Account must be set before emitting"); if (Account.Resource == null) throw new InvalidOperationException("Account must be emitted before emitting"); @@ -135,7 +135,7 @@ protected override ProvisionableResource EmitResources(CloudMachineInfrastructur cm.AddResource(deployment); return deployment; - OpenAIModelFeature? FindPrevious(CloudMachineInfrastructure cm, OpenAIModelFeature current) + OpenAIModelFeature? FindPrevious(ProjectInfrastructure cm, OpenAIModelFeature current) { OpenAIModelFeature? previous = default; foreach (var feature in cm.Features) diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs index 13a77362ff81..02165ab249fc 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs @@ -34,7 +34,7 @@ public void RagDemo() "Do you think I would like the weather there?", ]; - CloudMachineClient cm = new(new MockConfiguration("cmec4615e3fdfa44e"), default); + ProjectClient cm = new(new MockConfiguration("cmec4615e3fdfa44e"), default); var chat = cm.GetOpenAIChatClient(); var embeddings = cm.GetOpenAIEmbeddingsClient(); diff --git a/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs b/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs index 15d2e1837e8b..1f59ca63ee51 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs @@ -29,7 +29,7 @@ public static class CloudMachineExtensions /// public static void MapCloudMachineApplication(this WebApplication application) where T : class { - CloudMachineClient cm = application.Services.GetRequiredService(); + ProjectClient cm = application.Services.GetRequiredService(); T service = (T)Activator.CreateInstance(typeof(T), cm)!; application.Map(service); } diff --git a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs index 28ff9a545065..7264dd91f7ec 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs @@ -1,27 +1,27 @@ namespace Azure.CloudMachine { - public partial class CloudMachineClient : Azure.Core.ClientWorkspace + public partial class AIFoundryClient : Azure.Core.ClientWorkspace { - protected CloudMachineClient() : base (default(Azure.Core.TokenCredential)) { } - public CloudMachineClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } - public CloudMachineClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + protected AIFoundryClient() : base (default(Azure.Core.TokenCredential)) { } + public AIFoundryClient(string connectionString, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ConnectionCollection Connections { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public string Id { get { throw null; } } - public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } - public Azure.CloudMachine.StorageServices Storage { get { throw null; } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static string ReadOrCreateCloudMachineId() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override string ToString() { throw null; } + } + public static partial class AzureAIProjectsExensions + { + public static Azure.AI.Projects.AgentsClient GetAgentsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Inference.ChatCompletionsClient GetChatCompletionsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Inference.EmbeddingsClient GetEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Projects.EvaluationsClient GetEvaluationsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.Search.Documents.SearchClient GetSearchClient(this Azure.Core.ClientWorkspace workspace, string indexName) { throw null; } + public static Azure.Search.Documents.Indexes.SearchIndexClient GetSearchIndexClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.Search.Documents.Indexes.SearchIndexerClient GetSearchIndexerClient(this Azure.Core.ClientWorkspace workspace) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MessagingServices @@ -32,6 +32,29 @@ public void SendJson(object serializable) { } public System.Threading.Tasks.Task SendJsonAsync(object serializable) { throw null; } public void WhenMessageReceived(System.Action received) { } } + public partial class ProjectClient : Azure.Core.ClientWorkspace + { + protected ProjectClient() : base (default(Azure.Core.TokenCredential)) { } + public ProjectClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + public ProjectClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Azure.Core.ConnectionCollection Connections { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string Id { get { throw null; } } + public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } + public Azure.CloudMachine.StorageServices Storage { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static string ReadOrCreateCloudMachineId() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override string ToString() { throw null; } + } public partial class StorageFile { internal StorageFile() { } diff --git a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs index 28ff9a545065..7264dd91f7ec 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs @@ -1,27 +1,27 @@ namespace Azure.CloudMachine { - public partial class CloudMachineClient : Azure.Core.ClientWorkspace + public partial class AIFoundryClient : Azure.Core.ClientWorkspace { - protected CloudMachineClient() : base (default(Azure.Core.TokenCredential)) { } - public CloudMachineClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } - public CloudMachineClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + protected AIFoundryClient() : base (default(Azure.Core.TokenCredential)) { } + public AIFoundryClient(string connectionString, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ConnectionCollection Connections { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public string Id { get { throw null; } } - public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } - public Azure.CloudMachine.StorageServices Storage { get { throw null; } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static string ReadOrCreateCloudMachineId() { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override string ToString() { throw null; } + } + public static partial class AzureAIProjectsExensions + { + public static Azure.AI.Projects.AgentsClient GetAgentsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Inference.ChatCompletionsClient GetChatCompletionsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Inference.EmbeddingsClient GetEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.AI.Projects.EvaluationsClient GetEvaluationsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.Search.Documents.SearchClient GetSearchClient(this Azure.Core.ClientWorkspace workspace, string indexName) { throw null; } + public static Azure.Search.Documents.Indexes.SearchIndexClient GetSearchIndexClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static Azure.Search.Documents.Indexes.SearchIndexerClient GetSearchIndexerClient(this Azure.Core.ClientWorkspace workspace) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MessagingServices @@ -32,6 +32,29 @@ public void SendJson(object serializable) { } public System.Threading.Tasks.Task SendJsonAsync(object serializable) { throw null; } public void WhenMessageReceived(System.Action received) { } } + public partial class ProjectClient : Azure.Core.ClientWorkspace + { + protected ProjectClient() : base (default(Azure.Core.TokenCredential)) { } + public ProjectClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + public ProjectClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Azure.Core.ConnectionCollection Connections { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string Id { get { throw null; } } + public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } + public Azure.CloudMachine.StorageServices Storage { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static string ReadOrCreateCloudMachineId() { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override string ToString() { throw null; } + } public partial class StorageFile { internal StorageFile() { } diff --git a/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/Program.cs b/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/Program.cs index 599c064b4307..7ff1148ecd93 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/Program.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/Program.cs @@ -3,11 +3,11 @@ using Azure.CloudMachine; using OpenAI.Chat; -CloudMachineInfrastructure infrastructure = new(); +ProjectInfrastructure infrastructure = new(); infrastructure.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); infrastructure.AddFeature(new OpenAIModelFeature("text-embedding-ada-002", "2", AIModelKind.Embedding)); infrastructure.AddFeature(new AppServiceFeature()); -CloudMachineClient client = infrastructure.GetClient(); +ProjectClient client = infrastructure.GetClient(); // the app can be called with -init switch to generate bicep and prepare for azd deployment. if (infrastructure.TryExecuteCommand(args)) return; diff --git a/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/RAGMachine.csproj b/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/RAGMachine.csproj index 95b68caa6ecc..72a47dd0586c 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/RAGMachine.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/samples/RAGMachine/RAGMachine.csproj @@ -6,7 +6,7 @@ enable true - true + false true false false @@ -15,6 +15,6 @@ - + diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AIFoundryClient.cs b/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AIFoundryClient.cs new file mode 100644 index 000000000000..16c8f4d57a92 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AIFoundryClient.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Threading; +using Azure.AI.Inference; +using Azure.AI.OpenAI; +using Azure.AI.Projects; +using Azure.Core; +using Azure.Identity; +using Azure.Search.Documents; +using Azure.Search.Documents.Indexes; +using OpenAI.Chat; +using OpenAI.Embeddings; + +namespace Azure.CloudMachine +{ + /// + /// The AI Foundry client. + /// + public class AIFoundryClient : ClientWorkspace + { + /// + /// Protects the collection from concurrent access. Separated from to reduce contention. + /// + private readonly ReaderWriterLockSlim _connectionsLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); + + /// + /// Protects the dictionary from concurrent access. Separated from to improve concurrency in read-heavy scenarios. + /// + private readonly ReaderWriterLockSlim _connectionCacheLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); + + /// + /// Subclient connections. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ConnectionCollection Connections { get; } = []; + + private readonly ConnectionsClient _connectionsClient; + + private readonly Dictionary _connectionCache = new(); + + /// + /// Initializes a new instance of the class for mocking purposes. + /// + protected AIFoundryClient() + : base(BuildCredential(default)) + { + } + +#pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + /// + /// Initializes a new instance of the class. + /// + /// The connection string for the AI Foundry client. + /// The token credential (optional). + public AIFoundryClient(string connectionString, TokenCredential credential = default) +#pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + : base(BuildCredential(credential)) + { + if (string.IsNullOrEmpty(connectionString)) + { + throw new ArgumentException("Connection string cannot be null or empty.", nameof(connectionString)); + } + + // Initialize with a basic connection for AIProjectClient. + Connections.Add(new ClientConnection(typeof(AIProjectClient).FullName, connectionString)); + _connectionsClient = new ConnectionsClient(connectionString, Credential); + } + + /// + /// Retrieves the connection options for a specified client type and instance ID. + /// + /// The connection ID. + /// The connection options for the specified client type and instance ID. + public override ClientConnection GetConnectionOptions(string connectionId) + { + // First, try to read from the Connections collection with a read lock. + _connectionsLock.EnterReadLock(); + try + { + if (Connections.Contains(connectionId)) + { + return Connections[connectionId]; + } + } + finally + { + _connectionsLock.ExitReadLock(); + } + + // Get the connection type based on the Connection ID. + ConnectionType connectionType = GetConnectionTypeFromId(connectionId); + + // Check if the connection details are already cached (read lock). + ConnectionResponse connection = null; + _connectionCacheLock.EnterReadLock(); + try + { + _connectionCache.TryGetValue(connectionType, out connection); + } + finally + { + _connectionCacheLock.ExitReadLock(); + } + + // If not in cache, acquire a write lock to populate it. + if (connection == null) + { + _connectionCacheLock.EnterWriteLock(); + try + { + // Double-check in case another thread already added it. + if (!_connectionCache.TryGetValue(connectionType, out connection)) + { + connection = _connectionsClient.GetDefaultConnection(connectionType, true); + _connectionCache[connectionType] = connection; + } + } + finally + { + _connectionCacheLock.ExitWriteLock(); + } + } + + // If the connection uses API key auth, validate and add if needed. + if (connection.Properties is ConnectionPropertiesApiKeyAuth apiKeyAuthProperties) + { + if (string.IsNullOrWhiteSpace(apiKeyAuthProperties.Target)) + { + throw new ArgumentException( + $"The API key authentication target URI is missing or invalid for {connectionId}."); + } + + if (apiKeyAuthProperties.Credentials == null + || string.IsNullOrWhiteSpace(apiKeyAuthProperties.Credentials.Key)) + { + throw new ArgumentException($"The API key is missing or invalid for {connectionId}."); + } + + // Build the new connection object. + var newConnection = new ClientConnection(connectionId, apiKeyAuthProperties.Target, apiKeyAuthProperties.Credentials.Key); + + // Now we need to re-check and possibly add to Connections under a write lock. + _connectionsLock.EnterUpgradeableReadLock(); + try + { + if (Connections.Contains(connectionId)) + { + return Connections[connectionId]; + } + else + { + _connectionsLock.EnterWriteLock(); + try + { + // Double-check again after acquiring write lock. + if (!Connections.Contains(connectionId)) + { + Connections.Add(newConnection); + return newConnection; + } + else + { + return Connections[connectionId]; // Some thread beat us to it. + } + } + finally + { + _connectionsLock.ExitWriteLock(); + } + } + } + finally + { + _connectionsLock.ExitUpgradeableReadLock(); + } + } + else + { + throw new ArgumentException( + $"Cannot connect with {connectionId}! Ensure valid API key authentication." + ); + } + } + + private ConnectionType GetConnectionTypeFromId(string connectionId) + { + switch (connectionId) + { + // AzureOpenAI + case "Azure.AI.OpenAI.AzureOpenAIClient": + case "OpenAI.Chat.ChatClient": + case "OpenAI.Embeddings.EmbeddingClient": + return ConnectionType.AzureOpenAI; + + // Inference + case "Azure.AI.Inference.ChatCompletionsClient": + case "Azure.AI.Inference.EmbeddingsClient": + return ConnectionType.Serverless; + + // AzureAISearch + case "Azure.Search.Documents.SearchClient": + case "Azure.Search.Documents.Indexes.SearchIndexClient": + case "Azure.Search.Documents.Indexes.SearchIndexerClient": + return ConnectionType.AzureAISearch; + + default: + throw new ArgumentException($"Unknown connection type for ID: {connectionId}"); + } + } + + /// + /// Retrieves all connection options. + /// + /// All connection options. + public override IEnumerable GetAllConnectionOptions() + { + _connectionsLock.EnterReadLock(); + try + { + return Connections; + } + finally + { + _connectionsLock.ExitReadLock(); + } + } + + private static TokenCredential BuildCredential(TokenCredential credential) + { + if (credential == default) + { + credential = Environment.GetEnvironmentVariable("CLOUDMACHINE_MANAGED_IDENTITY_CLIENT_ID") switch + { + string clientId when !string.IsNullOrEmpty(clientId) => new ManagedIdentityCredential(clientId), + _ => new ChainedTokenCredential(new AzureCliCredential(), new AzureDeveloperCliCredential()) + }; + } + + return credential; + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => base.Equals(obj); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); + } +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AzureAIProjectsExensions.cs b/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AzureAIProjectsExensions.cs new file mode 100644 index 000000000000..b386d3abb62a --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/src/AIFoundary/AzureAIProjectsExensions.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.AI.Inference; +using Azure.AI.Projects; +using Azure.Core; +using Azure.Search.Documents; +using Azure.Search.Documents.Indexes; + +namespace Azure.CloudMachine; + +/// +/// The Azure AI Projects extensions. +/// +public static class AzureAIProjectsExensions +{ +#region AIProjects + /// + /// Gets the agent client.BlobContainerClientBlobContainerClient + /// + /// + /// + public static AgentsClient GetAgentsClient(this ClientWorkspace workspace) + { + AgentsClient agentsClient = workspace.Subclients.Get(() => + { + AIProjectClient aiClient = workspace.Subclients.Get(() => CreateAzureAIClient(workspace)); + return aiClient.GetAgentsClient(); + }); + + return agentsClient; + } + + /// + /// Gets the evaluation client. + /// + /// + /// + public static EvaluationsClient GetEvaluationsClient(this ClientWorkspace workspace) + { + EvaluationsClient evaluationsClient = workspace.Subclients.Get(() => + { + AIProjectClient aiClient = workspace.Subclients.Get(() => CreateAzureAIClient(workspace)); + return aiClient.GetEvaluationsClient(); + }); + + return evaluationsClient; + } + + private static AIProjectClient CreateAzureAIClient(this ClientWorkspace workspace) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(AIProjectClient).FullName); + var connectionString = connection.Locator; + return new AIProjectClient(connectionString, workspace.Credential); + } +#endregion AIProjects + +#region Inference + /// + /// Gets the chat completion client. + /// + /// + /// + public static ChatCompletionsClient GetChatCompletionsClient(this ClientWorkspace workspace) + { + ChatCompletionsClient chatClient = workspace.Subclients.Get(() => CreateChatCompletionsClient(workspace)); + return chatClient; + } + + private static ChatCompletionsClient CreateChatCompletionsClient(this ClientWorkspace workspace) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(ChatCompletionsClient).FullName); + return new(connection.ToUri(), new AzureKeyCredential(connection.ApiKeyCredential!)); + } + + /// + /// Gets the embeddings client. + /// + /// + /// + public static EmbeddingsClient GetEmbeddingsClient(this ClientWorkspace workspace) + { + EmbeddingsClient embeddingsClient = workspace.Subclients.Get(() => CreateEmbeddingsClient(workspace)); + return embeddingsClient; + } + + private static EmbeddingsClient CreateEmbeddingsClient(this ClientWorkspace workspace) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(ChatCompletionsClient).FullName); + return new(connection.ToUri(), new AzureKeyCredential(connection.ApiKeyCredential!)); + } +#endregion Inference + +#region Azure AI Search + /// + /// Gets the search client. + /// + /// + /// + /// + public static SearchClient GetSearchClient(this ClientWorkspace workspace, string indexName) + { + SearchClient searchClient = workspace.Subclients.Get(() => CreateSearchClient(workspace, indexName)); + return searchClient; + } + + private static SearchClient CreateSearchClient(this ClientWorkspace workspace, string indexName) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(SearchClient).FullName); + return new(connection.ToUri(), indexName, new AzureKeyCredential(connection.ApiKeyCredential!)); + } + + /// + /// Gets the search client. + /// + /// + /// + public static SearchIndexClient GetSearchIndexClient(this ClientWorkspace workspace) + { + SearchIndexClient searchIndexClient = workspace.Subclients.Get(() => CreateSearchIndexClient(workspace)); + return searchIndexClient; + } + + private static SearchIndexClient CreateSearchIndexClient(this ClientWorkspace workspace) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(SearchIndexClient).FullName); + return new(connection.ToUri(), new AzureKeyCredential(connection.ApiKeyCredential!)); + } + + /// + /// Gets the search client. + /// + /// + /// + public static SearchIndexerClient GetSearchIndexerClient(this ClientWorkspace workspace) + { + SearchIndexerClient searchIndexerClient = workspace.Subclients.Get(() => CreateSearchIndexerClient(workspace)); + return searchIndexerClient; + } + + private static SearchIndexerClient CreateSearchIndexerClient(this ClientWorkspace workspace) + { + ClientConnection connection = workspace.GetConnectionOptions(typeof(SearchIndexClient).FullName); + return new(connection.ToUri(), new AzureKeyCredential(connection.ApiKeyCredential!)); + } +#endregion Azure AI Search +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj index 5930a01f54ae..8964cdbae4c0 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj @@ -18,6 +18,9 @@ + + + diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/MessagingServices.cs b/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/MessagingServices.cs index c8b2060de45b..5719d4bc7bbc 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/MessagingServices.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/MessagingServices.cs @@ -15,8 +15,8 @@ public readonly struct MessagingServices { internal const string DEFAULT_SB_TOPIC = "cm_servicebus_default_topic"; - private readonly CloudMachineClient _cm; - internal MessagingServices(CloudMachineClient cm) => _cm = cm; + private readonly ProjectClient _cm; + internal MessagingServices(ProjectClient cm) => _cm = cm; /// /// Sends a message to the service bus. @@ -49,7 +49,7 @@ public async Task SendJsonAsync(object serializable) public void WhenMessageReceived(Action received) { ServiceBusProcessor processor = _cm.Messaging.GetServiceBusProcessor(default); - CloudMachineClient cm = _cm; + ProjectClient cm = _cm; // TODO: How to unsubscribe? // TODO: Use a subscription filter to ignore Event Grid system events diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/StorageServices.cs b/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/StorageServices.cs index 5ab6d3c9cf16..e887a1b3b96b 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/StorageServices.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/CoreServices/StorageServices.cs @@ -21,9 +21,9 @@ namespace Azure.CloudMachine; /// public readonly struct StorageServices { - private readonly CloudMachineClient _cm; + private readonly ProjectClient _cm; - internal StorageServices(CloudMachineClient cm) => _cm = cm; + internal StorageServices(ProjectClient cm) => _cm = cm; // TODO: do we want Azure.Storage.Blobs in the public API? This would prevent us from using a custom implementation. /// @@ -36,7 +36,7 @@ public BlobContainerClient GetContainer(string containerName = default) { if (containerName == default) containerName = "default"; string blobContainerClientId = $"{typeof(BlobContainerClient).FullName}@{containerName}"; - CloudMachineClient cm = _cm; + ProjectClient cm = _cm; BlobContainerClient container = cm.Subclients.Get(() => { ClientConnection connection = cm.GetConnectionOptions(blobContainerClientId); @@ -237,7 +237,7 @@ private static string ConvertPathToBlobPath(string path, BlobContainerClient con /// public void WhenUploaded(Action function) { - CloudMachineClient cm = _cm; + ProjectClient cm = _cm; // TODO (Pri 0): once the cache gets GCed, we will stop receiving events ServiceBusProcessor processor = cm.Messaging.GetServiceBusProcessor("cm_servicebus_subscription_private"); // TODO: How to unsubscribe? diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs b/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs index 8bb710807d48..d4efa922e045 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs @@ -2,5 +2,12 @@ // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; +<<<<<<<< HEAD:sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs + +[assembly: SuppressMessage("Usage", "AZC0005:DO provide protected parameterless constructor for mocking.", Justification = "", Scope = "type", Target = "~T:Azure.CloudMachine.CloudMachineClient")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Identity.DefaultAzureCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +[assembly: SuppressMessage("AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", "Usage", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +======== [assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.Core.Rest.RestClient.#ctor")] [assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.Core.Rest.RestClient.#ctor(System.ClientModel.Primitives.PipelinePolicy)")] +>>>>>>>> main:sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/ProjectClient.cs b/sdk/cloudmachine/Azure.CloudMachine/src/ProjectClient.cs new file mode 100644 index 000000000000..38e928b52080 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/src/ProjectClient.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; +using Azure.Identity; +using Microsoft.Extensions.Configuration; + +namespace Azure.CloudMachine; + +/// +/// The cloud machine client. +/// +public partial class ProjectClient : ClientWorkspace +{ + /// + /// The cloud machine ID. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Id { get; } + + /// + /// subclient connections. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ConnectionCollection Connections { get; } = []; + + /// + /// Initializes a new instance of the class for mocking purposes.. + /// + protected ProjectClient() : + this(credential: BuildCredential(default)) + { + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); + Messaging = new MessagingServices(this); + Storage = new StorageServices(this); + } + +#pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + /// + /// Initializes a new instance of the class. + /// + /// The configuration settings. + /// The token credential. + public ProjectClient(IConfiguration configuration, TokenCredential credential = default) +#pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + : base(BuildCredential(credential)) + { + Id = configuration["CloudMachine:ID"]; + if (Id == null) + { + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); + } + + IConfigurationSection connectionsSection = configuration.GetSection("CloudMachine:Connections"); + + foreach (IConfigurationSection connection in connectionsSection.GetChildren()) + { + string id = connection["Id"]; + if (id == null) continue; + string locator = connection["Locator"]; + + Connections.Add(new ClientConnection(id, locator, ClientAuthenticationMethod.EntraId)); + } + + Messaging = new MessagingServices(this); + Storage = new StorageServices(this); + } + +#pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + /// + /// Initializes a new instance of the class. + /// + /// + /// The token credential. + // TODO: we need to combine the configuration and the connections into a single parameter. + public ProjectClient(IEnumerable connections = default, TokenCredential credential = default) +#pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + : base(BuildCredential(credential)) + { + if (connections != default) + { + Connections.AddRange(connections); + } + + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); + Messaging = new MessagingServices(this); + Storage = new StorageServices(this); + } + + /// + /// Gets the messaging services. + /// + public MessagingServices Messaging { get; } + + /// + /// Gets the storage services. + /// + public StorageServices Storage { get; } + + /// + /// Retrieves the connection options for a specified client type and instance ID. + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override ClientConnection GetConnectionOptions(string connectionId) + { + return Connections[connectionId]; + } + + private static TokenCredential BuildCredential(TokenCredential credential) + { + if (credential == default) + { + // This environment variable is set by the CloudMachine App Service feature during provisioning. + credential = Environment.GetEnvironmentVariable("CLOUDMACHINE_MANAGED_IDENTITY_CLIENT_ID") switch + { + string clientId when !string.IsNullOrEmpty(clientId) => new ManagedIdentityCredential(clientId), + _ => new ChainedTokenCredential(new AzureCliCredential(), new AzureDeveloperCliCredential()) + }; + } + + return credential; + } + + /// + /// Reads or creates the cloud machine ID. + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static string ReadOrCreateCloudMachineId() => AppConfigHelpers.ReadOrCreateCloudMachineId(); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => base.Equals(obj); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ToString() => Id; + + /// + /// Retrieves all connection options. + /// + /// + public override IEnumerable GetAllConnectionOptions() + => Connections; +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/AIFoundryTests.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/AIFoundryTests.cs new file mode 100644 index 000000000000..5d1893d3236a --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/AIFoundryTests.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.AI.Inference; +using Azure.AI.Projects; +using Azure.CloudMachine.AIFoundry; +using Azure.CloudMachine.OpenAI; +using Azure.Core.TestFramework; +using Azure.Search.Documents; +using Azure.Search.Documents.Indexes; +using NUnit.Framework; +using OpenAI.Chat; +using OpenAI.Embeddings; + +namespace Azure.CloudMachine.Tests; + +public partial class AIFoundryTests : SamplesBase +{ + [Test] + public void AIFoundryScenariosTests() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + AIFoundryClient client = new AIFoundryClient(connectionString); + + // Azure AI Project clients + AgentsClient agents = client.GetAgentsClient(); + EvaluationsClient evaluations = client.GetEvaluationsClient(); + + // Azure Inference Clients using connections API + ChatCompletionsClient chatClient = client.GetChatCompletionsClient(); + EmbeddingsClient embeddingsClient = client.GetEmbeddingsClient(); + + // Azure OpenAI Clients using connections API + ChatClient openAIChatClient = client.GetOpenAIChatClient("gpt-4o-mini"); + EmbeddingClient openAIEmbeddingsClient = client.GetOpenAIEmbeddingsClient("text-embedding-ada-002"); + + // Azure AI Search Clients using connections API + SearchClient searchClient = client.GetSearchClient("index"); + SearchIndexClient indexClient = client.GetSearchIndexClient(); + SearchIndexerClient indexerClient = client.GetSearchIndexerClient(); + } + + [Test] + public void AIFoundryAgents() + { + var connectionString = Environment.GetEnvironmentVariable("PROJECT_CONNECTION_STRING"); + AIFoundryClient client = new AIFoundryClient(connectionString); + var agentsClient = client.GetAgentsClient(); + + //// Step 2: Create a agent + Response agentResponse = agentsClient.CreateAgent( + model: "gpt-4-1106-preview", + name: "Math Tutor", + instructions: "You are a personal math tutor. Write and run code to answer math questions.", + tools: new List { new CodeInterpreterToolDefinition() }); + Agent agent = agentResponse.Value; + + //// Step 2: Create a thread + Response threadResponse = agentsClient.CreateThread(); + AgentThread thread = threadResponse.Value; + + // Step 3: Add a message to a thread + Response messageResponse = agentsClient.CreateMessage( + thread.Id, + MessageRole.User, + "I need to solve the equation `3x + 11 = 14`. Can you help me?"); + ThreadMessage message = messageResponse.Value; + + // Step 4: Run the agent + Response runResponse = agentsClient.CreateRun(thread.Id, agent.Id); + + do + { + Task.Delay(TimeSpan.FromMilliseconds(500)); + runResponse = agentsClient.GetRun(thread.Id, runResponse.Value.Id); + } + while (runResponse.Value.Status == RunStatus.Queued + || runResponse.Value.Status == RunStatus.InProgress); + + //// Step 5: Print the messages + // Note: messages iterate from newest to oldest, with the messages[0] being the most recent + foreach (ThreadMessage threadMessage in agentsClient.GetMessages(thread.Id).Value.Data) + { + Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: "); + foreach (MessageContent contentItem in threadMessage.ContentItems) + { + if (contentItem is MessageTextContent textItem) + { + Console.Write(textItem.Text); + } + else if (contentItem is MessageImageFileContent imageFileItem) + { + Console.Write($" response = chatClient.Complete(requestOptions); + Console.WriteLine(response.Value.Content); + } + + [Test] + public void AIFoundryAzureOpenAIChatCompletion() + { + var connectionString = Environment.GetEnvironmentVariable("PROJECT_CONNECTION_STRING"); + AIFoundryClient client = new AIFoundryClient(connectionString); + ChatClient chatClient = client.GetOpenAIChatClient("gpt-4o-mini"); + + ChatCompletion completion = chatClient.CompleteChat( + [ + new SystemChatMessage("You are a helpful assistant."), + new UserChatMessage("List all the colors of the rainbow"), + ]); + + Console.WriteLine($"{completion.Role}: {completion.Content[0].Text}"); + } + + [Test] + public void AIFoundryScenariosTestsUsingCMClient() + { + ProjectInfrastructure infra = new(); + + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + infra.AddFeature(new AIFoundryFeature(connectionString)); + + ProjectClient client = infra.GetClient(); + + // Azure AI Project clients + AgentsClient agents = client.GetAgentsClient(); + EvaluationsClient evaluations = client.GetEvaluationsClient(); + + // Azure Inference Clients using connections API + ChatCompletionsClient chatClient = client.GetChatCompletionsClient(); + EmbeddingsClient embeddingsClient = client.GetEmbeddingsClient(); + + // Azure OpenAI Clients using connections API + ChatClient openAIChatClient = client.GetOpenAIChatClient("gpt-4o-mini"); + EmbeddingClient openAIEmbeddingsClient = client.GetOpenAIEmbeddingsClient("text-embedding-ada-002"); + + // Azure AI Search Clients using connections API + SearchClient searchClient = client.GetSearchClient("index"); + SearchIndexClient indexClient = client.GetSearchIndexClient(); + SearchIndexerClient indexerClient = client.GetSearchIndexerClient(); + } +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj b/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj index 62bbcd8d0e93..faf1e54504bd 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj @@ -8,7 +8,9 @@ + + diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTestEnvironment.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTestEnvironment.cs new file mode 100644 index 000000000000..86d304c4bd77 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTestEnvironment.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.CloudMachine.Tests; +public class CloudMachineTestEnvironment : TestEnvironment +{ + public string AzureAICONNECTIONSTRING => GetRecordedVariable("PROJECT_CONNECTION_STRING"); +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs index 1978f8c574eb..2446d5e48c23 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs @@ -21,10 +21,10 @@ public class ConnectionTests [TestCase([new string[0]])] public void TwoClients(string[] args) { - CloudMachineInfrastructure infra = new(); + ProjectInfrastructure infra = new(); if (args.Contains("-azd")) Azd.Init(infra); - CloudMachineClient client = infra.GetClient(); + ProjectClient client = infra.GetClient(); ValidateClient(client); } @@ -35,13 +35,13 @@ public void TwoClients(string[] args) public void TwoApps() { // app 1 (with a dependency on the CDK) - CloudMachineInfrastructure infra = new(); + ProjectInfrastructure infra = new(); //if (args.Contains("-azd")) Azd.Init(infra); BinaryData serializedConnections = BinaryData.FromObjectAsJson(infra.Connections); // app 2 (no dependency on the CDK) ConnectionCollection deserializedConnections = JsonSerializer.Deserialize(serializedConnections)!; - CloudMachineClient client = new(deserializedConnections); + ProjectClient client = new(deserializedConnections); ValidateClient(client); } @@ -51,7 +51,7 @@ public void TwoApps() [TestCase([new string[0]])] public void SingleClientAdd(string[] args) { - CloudMachineClient client = new(); + ProjectClient client = new(); if (args.Contains("-azd")) Azd.Init(client); } @@ -59,13 +59,13 @@ public void SingleClientAdd(string[] args) [Test] public void ConfigurationDemo() { - CloudMachineInfrastructure infra = new(); + ProjectInfrastructure infra = new(); IConfiguration configuration = new ConfigurationBuilder() .AddCloudMachineConfiguration(infra) .Build(); - CloudMachineClient client = new(configuration); + ProjectClient client = new(configuration); } [Test] @@ -87,7 +87,7 @@ public void ConfigurationLowLevel() var id = configuration["CloudMachine:Id"]; Assert.AreEqual("aaaa-bbbb-cccc-dddd", id); - CloudMachineClient client = new(configuration); + ProjectClient client = new(configuration); Assert.AreEqual("aaaa-bbbb-cccc-dddd", client.Id); ClientConnection connection = client.Connections["Azure.AI.OpenAI.AzureOpenAIClient"]; @@ -95,7 +95,7 @@ public void ConfigurationLowLevel() Assert.AreEqual("aaaa-bbbb-cccc-dddd", client.Id); } - private static void ValidateClient(CloudMachineClient client) + private static void ValidateClient(ProjectClient client) { StorageServices storage = client.Storage; BlobContainerClient container = storage.GetContainer(default); diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs index af7b00e5592f..2e140581afec 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs @@ -2,23 +2,28 @@ namespace Azure.CloudMachine { public static partial class Azd { - public static void Init(Azure.CloudMachine.CloudMachineClient client, string? infraDirectory = null) { } - public static void Init(Azure.CloudMachine.CloudMachineInfrastructure infra, string? infraDirectory = null) { } - public static void InitDeployment(Azure.CloudMachine.CloudMachineInfrastructure infra, string? webProjectName) { } + public static void Init(Azure.CloudMachine.ProjectClient client, string? infraDirectory = null) { } + public static void Init(Azure.CloudMachine.ProjectInfrastructure infra, string? infraDirectory = null) { } + public static void InitDeployment(Azure.CloudMachine.ProjectInfrastructure infra, string? webProjectName) { } } public static partial class CloudMachineClientExtensions { - public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } + public static T AddFeature(this Azure.CloudMachine.ProjectClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.CloudMachine.CloudMachineInfrastructure GetInfrastructure(this Azure.CloudMachine.CloudMachineClient client) { throw null; } + public static Azure.CloudMachine.ProjectInfrastructure GetInfrastructure(this Azure.CloudMachine.ProjectClient client) { throw null; } } public static partial class CloudMachineCommands { - public static bool TryExecuteCommand(this Azure.CloudMachine.CloudMachineInfrastructure cmi, string[] args) { throw null; } + public static bool TryExecuteCommand(this Azure.CloudMachine.ProjectInfrastructure cmi, string[] args) { throw null; } } - public partial class CloudMachineInfrastructure + public static partial class CloudMachineInfrastructureConfiguration + { + public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } + } + public partial class ProjectInfrastructure { - public CloudMachineInfrastructure(string? cmId = null) { } + public ProjectInfrastructure(string? cmId = null) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ConnectionCollection Connections { get { throw null; } } public Azure.CloudMachine.Core.FeatureCollection Features { get { throw null; } } @@ -35,16 +40,20 @@ public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruc public Azure.Provisioning.ProvisioningPlan Build(Azure.Provisioning.ProvisioningBuildOptions? context = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } - public Azure.CloudMachine.CloudMachineClient GetClient() { throw null; } + public Azure.CloudMachine.ProjectClient GetClient() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public static partial class CloudMachineInfrastructureConfiguration +} +namespace Azure.CloudMachine.AIFoundry +{ + public partial class AIFoundryFeature : Azure.CloudMachine.Core.CloudMachineFeature { - public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + public AIFoundryFeature(string connectionString) { } + protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } } } namespace Azure.CloudMachine.AppService @@ -53,7 +62,7 @@ public partial class AppServiceFeature : Azure.CloudMachine.Core.CloudMachineFea { public AppServiceFeature() { } public Azure.Provisioning.AppService.AppServiceSkuDescription Sku { get { throw null; } set { } } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure infrastructure) { throw null; } } } namespace Azure.CloudMachine.Core @@ -66,7 +75,7 @@ protected CloudMachineFeature() { } public Azure.Provisioning.Primitives.ProvisionableResource Resource { get { throw null; } } protected internal virtual void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } protected internal virtual void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } - protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm); + protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm); protected static T EnsureEmits(Azure.CloudMachine.Core.CloudMachineFeature feature) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } @@ -91,7 +100,7 @@ public partial class KeyVaultFeature : Azure.CloudMachine.Core.CloudMachineFeatu public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure infrastructure) { throw null; } } } namespace System.ClientModel.TypeSpec diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs index af7b00e5592f..2e140581afec 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs @@ -2,23 +2,28 @@ namespace Azure.CloudMachine { public static partial class Azd { - public static void Init(Azure.CloudMachine.CloudMachineClient client, string? infraDirectory = null) { } - public static void Init(Azure.CloudMachine.CloudMachineInfrastructure infra, string? infraDirectory = null) { } - public static void InitDeployment(Azure.CloudMachine.CloudMachineInfrastructure infra, string? webProjectName) { } + public static void Init(Azure.CloudMachine.ProjectClient client, string? infraDirectory = null) { } + public static void Init(Azure.CloudMachine.ProjectInfrastructure infra, string? infraDirectory = null) { } + public static void InitDeployment(Azure.CloudMachine.ProjectInfrastructure infra, string? webProjectName) { } } public static partial class CloudMachineClientExtensions { - public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } + public static T AddFeature(this Azure.CloudMachine.ProjectClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.CloudMachine.CloudMachineInfrastructure GetInfrastructure(this Azure.CloudMachine.CloudMachineClient client) { throw null; } + public static Azure.CloudMachine.ProjectInfrastructure GetInfrastructure(this Azure.CloudMachine.ProjectClient client) { throw null; } } public static partial class CloudMachineCommands { - public static bool TryExecuteCommand(this Azure.CloudMachine.CloudMachineInfrastructure cmi, string[] args) { throw null; } + public static bool TryExecuteCommand(this Azure.CloudMachine.ProjectInfrastructure cmi, string[] args) { throw null; } } - public partial class CloudMachineInfrastructure + public static partial class CloudMachineInfrastructureConfiguration + { + public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } + } + public partial class ProjectInfrastructure { - public CloudMachineInfrastructure(string? cmId = null) { } + public ProjectInfrastructure(string? cmId = null) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ConnectionCollection Connections { get { throw null; } } public Azure.CloudMachine.Core.FeatureCollection Features { get { throw null; } } @@ -35,16 +40,20 @@ public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruc public Azure.Provisioning.ProvisioningPlan Build(Azure.Provisioning.ProvisioningBuildOptions? context = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } - public Azure.CloudMachine.CloudMachineClient GetClient() { throw null; } + public Azure.CloudMachine.ProjectClient GetClient() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public static partial class CloudMachineInfrastructureConfiguration +} +namespace Azure.CloudMachine.AIFoundry +{ + public partial class AIFoundryFeature : Azure.CloudMachine.Core.CloudMachineFeature { - public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + public AIFoundryFeature(string connectionString) { } + protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; } } } namespace Azure.CloudMachine.AppService @@ -53,7 +62,7 @@ public partial class AppServiceFeature : Azure.CloudMachine.Core.CloudMachineFea { public AppServiceFeature() { } public Azure.Provisioning.AppService.AppServiceSkuDescription Sku { get { throw null; } set { } } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure infrastructure) { throw null; } } } namespace Azure.CloudMachine.Core @@ -66,7 +75,7 @@ protected CloudMachineFeature() { } public Azure.Provisioning.Primitives.ProvisionableResource Resource { get { throw null; } } protected internal virtual void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } protected internal virtual void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } - protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm); + protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm); protected static T EnsureEmits(Azure.CloudMachine.Core.CloudMachineFeature feature) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } @@ -91,7 +100,7 @@ public partial class KeyVaultFeature : Azure.CloudMachine.Core.CloudMachineFeatu public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure infrastructure) { throw null; } } } namespace System.ClientModel.TypeSpec diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs index c735cc00e425..b3fb2b567419 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs @@ -10,9 +10,9 @@ namespace Azure.CloudMachine; public static class CloudMachineClientExtensions { - private static void Configure(this CloudMachineClient client, Action? configure = default) + private static void Configure(this ProjectClient client, Action? configure = default) { - CloudMachineInfrastructure cmi = new(client.Id); + ProjectInfrastructure cmi = new(client.Id); if (configure != default) { configure(cmi); @@ -24,20 +24,20 @@ private static void Configure(this CloudMachineClient client, Action(this CloudMachineClient client, T feature) where T : CloudMachineFeature + public static T AddFeature(this ProjectClient client, T feature) where T : CloudMachineFeature { - CloudMachineInfrastructure infra = client.GetInfrastructure(); + ProjectInfrastructure infra = client.GetInfrastructure(); infra.AddFeature(feature); CopyConnections(infra.Connections, client.Connections); return feature; } [EditorBrowsable(EditorBrowsableState.Never)] - public static CloudMachineInfrastructure GetInfrastructure(this CloudMachineClient client) + public static ProjectInfrastructure GetInfrastructure(this ProjectClient client) { return client.Subclients.Get(() => { - CloudMachineInfrastructure infra = new CloudMachineInfrastructure(client.Id); + ProjectInfrastructure infra = new ProjectInfrastructure(client.Id); return infra; }); } diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs index ef8f00503640..45800c678295 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs @@ -13,12 +13,12 @@ public abstract class CloudMachineFeature { private ProvisionableResource? _resource; - protected abstract ProvisionableResource EmitResources(CloudMachineInfrastructure cm); + protected abstract ProvisionableResource EmitResources(ProjectInfrastructure cm); protected internal virtual void EmitConnections(ConnectionCollection connections, string cmId) { } protected internal virtual void EmitFeatures(FeatureCollection features, string cmId) => features.Add(this); - internal ProvisionableResource Emit(CloudMachineInfrastructure cm) + internal ProvisionableResource Emit(ProjectInfrastructure cm) { if (_resource == null) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs index 3e8d928e1c49..01205f7ccfd1 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs @@ -49,7 +49,7 @@ void Resize() } } - internal void Emit(CloudMachineInfrastructure infrastructure) + internal void Emit(ProjectInfrastructure infrastructure) { int index = 0; while (true) diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/ProjectInfrastructure.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/ProjectInfrastructure.cs new file mode 100644 index 000000000000..5351ed329fbc --- /dev/null +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/ProjectInfrastructure.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.CloudMachine.Core; +using Azure.CloudMachine.EventGrid; +using Azure.CloudMachine.ServiceBus; +using Azure.CloudMachine.Storage; +using Azure.Core; +using Azure.Provisioning; +using Azure.Provisioning.Expressions; +using Azure.Provisioning.Primitives; +using Azure.Provisioning.Roles; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Azure.CloudMachine; + +public class ProjectInfrastructure +{ + private readonly Infrastructure _infrastructure = new("cm"); + private readonly List _constrcuts = []; + + internal List Endpoints { get; } = []; + public FeatureCollection Features { get; } = new(); + + [EditorBrowsable(EditorBrowsableState.Never)] + public ConnectionCollection Connections { get; } = []; + + [EditorBrowsable(EditorBrowsableState.Never)] + public UserAssignedIdentity Identity { get; private set; } + public string Id { get; private set; } + + public ProjectClient GetClient() + { + ProjectClient client = new(connections: Connections); + return client; + } + + /// + /// The common principalId parameter. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ProvisioningParameter PrincipalIdParameter => new("principalId", typeof(string)); + + public ProjectInfrastructure(string? cmId = default) + { + if (cmId == default) + { + cmId = ProjectClient.ReadOrCreateCloudMachineId(); + } + Id = cmId; + + // setup CM identity + Identity = new UserAssignedIdentity("cm_identity"); + Identity.Name = Id; + _infrastructure.Add(new ProvisioningOutput("cm_managed_identity_id", typeof(string)) { Value = Identity.Id }); + + // Add core features + var storage = AddFeature(new StorageAccountFeature(Id)); + var blobs = AddFeature(new BlobServiceFeature(storage)); + var defaultContainer = AddFeature(new BlobContainerFeature(blobs)); + var sbNamespace = AddFeature(new ServiceBusNamespaceFeature(Id)); + var sbTopicPrivate = AddFeature(new ServiceBusTopicFeature("cm_servicebus_topic_private", sbNamespace)); + var sbTopicDefault = AddFeature(new ServiceBusTopicFeature("cm_servicebus_default_topic", sbNamespace)); + AddFeature(new ServiceBusSubscriptionFeature("cm_servicebus_subscription_private", sbTopicPrivate)); // TODO: should private connections not be in the Connections collection? + AddFeature(new ServiceBusSubscriptionFeature("cm_servicebus_subscription_default", sbTopicDefault)); + var systemTopic = AddFeature(new EventGridSystemTopicFeature(Id, storage, "Microsoft.Storage.StorageAccounts")); + AddFeature(new SystemTopicEventSubscriptionFeature("cm-eventgrid-subscription-blob", systemTopic, sbTopicPrivate, sbNamespace)); + } + + public T AddFeature(T feature) where T: CloudMachineFeature + { + feature.EmitFeatures(Features, Id); + feature.EmitConnections(Connections, Id); + return feature; + } + + public void AddEndpoints() + { + Type endpointsType = typeof(T); + if (!endpointsType.IsInterface) + throw new InvalidOperationException("Endpoints type must be an interface."); + Endpoints.Add(endpointsType); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddResource(NamedProvisionableConstruct resource) + { + _constrcuts.Add(resource); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public ProvisioningPlan Build(ProvisioningBuildOptions? context = default) + { + Features.Emit(this); + + // Always add a default location parameter. + // azd assumes there will be a location parameter for every module. + // The Infrastructure location resolver will resolve unset Location properties to this parameter. + _infrastructure.Add(new ProvisioningParameter("location", typeof(string)) + { + Description = "The location for the resource(s) to be deployed.", + Value = BicepFunction.GetResourceGroup().Location + }); + + _infrastructure.Add(new ProvisioningParameter("principalId", typeof(string)) + { + Description = "The objectId of the current user principal.", + }); + + _infrastructure.Add(Identity); + + // Add any add-on resources to the infrastructure. + foreach (Provisionable resource in _constrcuts) + { + _infrastructure.Add(resource); + } + + context ??= new ProvisioningBuildOptions(); + // This must occur after the features have been emitted. + context.InfrastructureResolvers.Add(new RoleResolver(Id, Features.RoleAnnotations, [Identity], [PrincipalIdParameter])); + return _infrastructure.Build(context); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ToString() => Id; + + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); + + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object? obj) => base.Equals(obj); +} + +public static class CloudMachineInfrastructureConfiguration +{ + /// + /// Adds a connections and CM ID to the config system. + /// + /// + /// + /// + public static IConfigurationBuilder AddCloudMachineConfiguration(this IConfigurationBuilder builder, ProjectInfrastructure cm) + { + builder.AddCloudMachineConnections(cm.Connections); + builder.AddCloudMachineId(cm.Id); + return builder; + } + + /// + /// Adds the CloudMachine to DI. + /// + /// + /// + /// + public static IHostApplicationBuilder AddCloudMachine(this IHostApplicationBuilder builder, ProjectInfrastructure cm) + { + builder.Services.AddSingleton(new ProjectClient(cm.Connections)); + return builder; + } +} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryConnections.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryConnections.cs new file mode 100644 index 000000000000..60222f68d0bf --- /dev/null +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryConnections.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading; +using Azure.AI.Projects; +using Azure.Core; + +namespace Azure.CloudMachine.AIFoundry +{ + /// + /// Provides concurrency-safe caching of Foundry connection responses + /// and transforms them into objects. + /// + internal class AIFoundryConnections + { + private readonly ConnectionsClient _connectionsClient; + private readonly ReaderWriterLockSlim _cacheLock = new(LockRecursionPolicy.NoRecursion); + private readonly Dictionary _connectionCache = new(); + + /// + /// Creates a new that uses the specified + /// Foundry connection string and token credential for authentication. + /// + /// The Foundry connection string. + /// The token credential to use for authentication. + public AIFoundryConnections(string foundryConnectionString, TokenCredential credential) + { + _connectionsClient = new ConnectionsClient(foundryConnectionString, credential); + } + + /// + /// Returns a for the specified connectionId, + /// retrieving or caching it from the Foundry . + /// + /// The well-known ID of the Foundry connection. + /// A representing the Foundry resource. + /// + /// Thrown if the Foundry connection is not found, or if it doesn’t use a valid API key auth. + /// + public ClientConnection GetConnection(string connectionId) + { + // 1) Get ConnectionType + ConnectionType connectionType = GetConnectionTypeFromId(connectionId); + + // 2) Check cache + ConnectionResponse? response; + _cacheLock.EnterReadLock(); + try + { + _connectionCache.TryGetValue(connectionType, out response); + } + finally + { + _cacheLock.ExitReadLock(); + } + + // 3) If not cached, retrieve from Foundry + if (response == null) + { + _cacheLock.EnterWriteLock(); + try + { + if (!_connectionCache.TryGetValue(connectionType, out response)) + { + response = _connectionsClient.GetDefaultConnection(connectionType, true); + _connectionCache[connectionType] = response; + } + } + finally + { + _cacheLock.ExitWriteLock(); + } + } + + // 4) Validate response, build a ClientConnection + if (response.Properties is ConnectionPropertiesApiKeyAuth apiKeyAuth) + { + if (string.IsNullOrWhiteSpace(apiKeyAuth.Target)) + { + throw new ArgumentException($"The API key target URI is missing or invalid for '{connectionId}'."); + } + if (apiKeyAuth.Credentials?.Key is null or { Length: 0 }) + { + throw new ArgumentException($"The API key is missing or invalid for '{connectionId}'."); + } + + return new ClientConnection(connectionId, apiKeyAuth.Target, apiKeyAuth.Credentials.Key); + } + else + { + throw new ArgumentException( + $"Connection '{connectionId}' does not use valid API key authentication." + ); + } + } + + /// + /// Converts a Foundry-style connection ID into an enum . + /// + /// The known string ID (e.g. "Azure.AI.OpenAI.AzureOpenAIClient"). + /// A indicating which Foundry connection to retrieve. + /// Thrown if the is unknown. + private ConnectionType GetConnectionTypeFromId(string connectionId) + { + switch (connectionId) + { + // AzureOpenAI + case "Azure.AI.OpenAI.AzureOpenAIClient": + case "OpenAI.Chat.ChatClient": + case "OpenAI.Embeddings.EmbeddingClient": + return ConnectionType.AzureOpenAI; + + // Inference + case "Azure.AI.Inference.ChatCompletionsClient": + case "Azure.AI.Inference.EmbeddingsClient": + return ConnectionType.Serverless; + + // AzureAISearch + case "Azure.Search.Documents.SearchClient": + case "Azure.Search.Documents.Indexes.SearchIndexClient": + case "Azure.Search.Documents.Indexes.SearchIndexerClient": + return ConnectionType.AzureAISearch; + + default: + throw new ArgumentException($"Unknown connection type for ID: {connectionId}"); + } + } + } +} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryFeature.cs new file mode 100644 index 000000000000..ba0a0fdfab99 --- /dev/null +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/AIFoundryFeature.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.CloudMachine.Core; +using Azure.Core; +using Azure.Identity; +using Azure.Provisioning.Primitives; + +namespace Azure.CloudMachine.AIFoundry +{ + /// + /// A CloudMachine feature that configures an AI Foundry project and optionally prepares resources for provisioning in the future. + /// + public class AIFoundryFeature : CloudMachineFeature + { + private readonly string _connectionString; + + /// + /// Initializes a new instance of the class. + /// + /// + /// The Foundry connection string for the AI Project endpoint. + /// + /// + /// Thrown if is null or empty. + /// + public AIFoundryFeature(string connectionString) + { + if (string.IsNullOrEmpty(connectionString)) + { + throw new ArgumentException("Connection string cannot be null or empty.", nameof(connectionString)); + } + + _connectionString = connectionString; + } + + /// + /// Emit the Foundry connection(s) into the shared . + /// + /// The global collection of objects for this CloudMachine. + /// The unique CloudMachine ID + protected internal override void EmitConnections(ConnectionCollection connections, string cmId) + { + const string foundryId = "Azure.AI.Projects.AIProjectClient"; + connections.Add(new ClientConnection(foundryId, _connectionString)); + + var foundryConnections = new AIFoundryConnections(_connectionString, new DefaultAzureCredential()); + + // Add OpenAI connections + connections.Add(foundryConnections.GetConnection("Azure.AI.OpenAI.AzureOpenAIClient")); + connections.Add(foundryConnections.GetConnection("OpenAI.Chat.ChatClient")); + connections.Add(foundryConnections.GetConnection("OpenAI.Embeddings.EmbeddingClient")); + + // Add Inference connections + connections.Add(foundryConnections.GetConnection("Azure.AI.Inference.ChatCompletionsClient")); + connections.Add(foundryConnections.GetConnection("Azure.AI.Inference.EmbeddingsClient")); + + // Add Search connections + connections.Add(foundryConnections.GetConnection("Azure.Search.Documents.SearchClient")); + connections.Add(foundryConnections.GetConnection("Azure.Search.Documents.Indexes.SearchIndexClient")); + connections.Add(foundryConnections.GetConnection("Azure.Search.Documents.Indexes.SearchIndexerClient")); + } + + /// + /// Emit any necessary resources for provisioning (currently no-op). + /// + /// The ProjectInfrastructure context. + /// A placeholder or no-op resource, as provisioning is out-of-band for now. + protected override ProvisionableResource EmitResources(ProjectInfrastructure cm) + { + // In the future, generate real provisioning resources for Foundry + return new NoOpResource(); + } + } +} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs index 14723c51c54d..0f6e562abade 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs @@ -14,7 +14,7 @@ internal class EventGridSystemTopicFeature(string topicName, CloudMachineFeature { internal const string EventGridTopicVersion = "2022-06-15"; - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { var topic = new SystemTopic("cm_eventgrid_topic", EventGridTopicVersion) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/NoOpResource.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/NoOpResource.cs new file mode 100644 index 000000000000..a162ad086dd2 --- /dev/null +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/NoOpResource.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Provisioning.Primitives; + +namespace Azure.CloudMachine.AIFoundry; + +/// +/// Simple no-op resource that satisfies the base class contract without actually deploying anything. +/// +internal sealed class NoOpResource : ProvisionableResource +{ + public NoOpResource() + : base(bicepIdentifier: "noOpFoundry", resourceType: new Azure.Core.ResourceType("No Op")) + { + // no-op + } +} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs index 9df3f86fa3bc..6dec67d8f699 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs @@ -10,7 +10,7 @@ namespace Azure.CloudMachine.ServiceBus; internal class ServiceBusNamespaceFeature(string name, ServiceBusSkuName sku = ServiceBusSkuName.Standard, ServiceBusSkuTier tier = ServiceBusSkuTier.Standard) : CloudMachineFeature { - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { var _serviceBusNamespace = new ServiceBusNamespace("cm_servicebus") { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs index 72bacde5671f..38ac9622d65f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs @@ -11,7 +11,7 @@ namespace Azure.CloudMachine.ServiceBus; internal class ServiceBusSubscriptionFeature(string name, ServiceBusTopicFeature parent) : CloudMachineFeature { - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { var subscription = new ServiceBusSubscription(name, "2021-11-01") { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs index 77a72f98b500..c6bc01bdcbb2 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs @@ -17,7 +17,7 @@ public ServiceBusTopicFeature(string name, ServiceBusNamespaceFeature parent) _parent = parent; } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { var topic = new ServiceBusTopic(Name, "2021-11-01") { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs index 74db1ff14bfb..cf3cee9d38f1 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs @@ -21,7 +21,7 @@ public StorageAccountFeature(string accountName, StorageSkuName sku = StorageSku Name = accountName; } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { var storage = new StorageAccount("cm_storage", StorageAccount.ResourceVersions.V2023_01_01) { @@ -60,7 +60,7 @@ public BlobContainerFeature(BlobServiceFeature parent, string? containerName = d ContainerName = containerName; Parent = parent; } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure cm) + protected override ProvisionableResource EmitResources(ProjectInfrastructure cm) { BlobContainer container = new($"cm_storage_blobs_container_{ContainerName}", "2023-01-01") { @@ -89,7 +89,7 @@ public BlobServiceFeature(StorageAccountFeature account) { Account = account; } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure cm) + protected override ProvisionableResource EmitResources(ProjectInfrastructure cm) { BlobService blobs = new("cm_storage_blobs") { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs index 3a5d158980e5..37298398858e 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs @@ -13,7 +13,7 @@ namespace Azure.CloudMachine.EventGrid; internal class SystemTopicEventSubscriptionFeature(string name, EventGridSystemTopicFeature parent, ServiceBusTopicFeature destination, ServiceBusNamespaceFeature parentNamespace) : CloudMachineFeature { - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { ServiceBusNamespace serviceBusNamespace = EnsureEmits(parentNamespace); diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs index 4f9a308b1b6e..ad90005621f0 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs @@ -18,7 +18,7 @@ public AppServiceFeature() Sku = new AppServiceSkuDescription { Tier = "Free", Name = "F1" }; } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { //Add a App Service to the CloudMachine infrastructure. AppServicePlan hostingPlan = new("cm_hosting_plan") diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs index 6b366260ec53..9be815af2559 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs @@ -24,7 +24,7 @@ protected internal override void EmitConnections(ConnectionCollection connection connections.Add(new ClientConnection("Azure.Security.KeyVault.Secrets.SecretClient", $"https://{cmId}.vault.azure.net/")); } - protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) + protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure) { // Add a KeyVault to the CloudMachine infrastructure. KeyVaultService keyVaultResource = new("cm_kv") diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs index af70f99778e7..4ec24c5fb5e9 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs @@ -3,6 +3,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Usage", "AZC0005:DO provide protected parameterless constructor for mocking.", Justification = "", Scope = "type", Target = "~T:Azure.CloudMachine.CloudMachineClient")] -[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Identity.DefaultAzureCredential,Microsoft.Extensions.Configuration.IConfiguration)")] -[assembly: SuppressMessage("AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", "Usage", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +[assembly: SuppressMessage("Usage", "AZC0005:DO provide protected parameterless constructor for mocking.", Justification = "", Scope = "type", Target = "~T:Azure.CloudMachine.ProjectClient")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.ProjectClient.#ctor(Azure.Identity.DefaultAzureCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +[assembly: SuppressMessage("AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", "Usage", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.ProjectClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs index ce5ce5675935..7700a4462d03 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs @@ -20,13 +20,13 @@ public static class Azd private const string MainBicepName = "main"; private const string ResourceGroupVersion = "2024-03-01"; - public static void Init(CloudMachineClient client, string? infraDirectory = default) + public static void Init(ProjectClient client, string? infraDirectory = default) { - CloudMachineInfrastructure infra = client.GetInfrastructure(); + ProjectInfrastructure infra = client.GetInfrastructure(); Init(infra, infraDirectory); } - public static void Init(CloudMachineInfrastructure infra, string? infraDirectory = default) + public static void Init(ProjectInfrastructure infra, string? infraDirectory = default) { if (infraDirectory == default) infraDirectory = Path.Combine(".", "infra"); @@ -34,7 +34,7 @@ public static void Init(CloudMachineInfrastructure infra, string? infraDirectory Directory.CreateDirectory(infraDirectory); infra.Build().Save(infraDirectory); - var cmid = CloudMachineClient.ReadOrCreateCloudMachineId(); + var cmid = ProjectClient.ReadOrCreateCloudMachineId(); // main.bicep var location = new ProvisioningParameter("location", typeof(string)); @@ -67,7 +67,7 @@ public static void Init(CloudMachineInfrastructure infra, string? infraDirectory WriteMainParametersFile(infraDirectory); } - public static void InitDeployment(CloudMachineInfrastructure infra, string? webProjectName) + public static void InitDeployment(ProjectInfrastructure infra, string? webProjectName) { var webCsproj = webProjectName switch { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs index 9419d1d65a6f..39100d8186a0 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs @@ -15,12 +15,12 @@ namespace Azure.CloudMachine; public static class CloudMachineCommands { - public static bool TryExecuteCommand(this CloudMachineInfrastructure cmi, string[] args) + public static bool TryExecuteCommand(this ProjectInfrastructure cmi, string[] args) { if (args.Length < 1) return false; - string cmid = CloudMachineClient.ReadOrCreateCloudMachineId(); + string cmid = ProjectClient.ReadOrCreateCloudMachineId(); if (args[0] == "-bicep") { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs index c0bd9d479a06..d71188d47d77 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs @@ -12,14 +12,14 @@ public class CommandsTests [Test] public void ListModels() { - CloudMachineInfrastructure cm = new(); + ProjectInfrastructure cm = new(); cm.TryExecuteCommand(["-ai", "chat"]); } [Test] public void GenerateBicep() { - CloudMachineInfrastructure cm = new(); + ProjectInfrastructure cm = new(); cm.AddFeature(new KeyVaultFeature()); cm.TryExecuteCommand(["-bicep"]); } @@ -27,7 +27,7 @@ public void GenerateBicep() [Test] public void DoInit() { - CloudMachineInfrastructure cm = new(); + ProjectInfrastructure cm = new(); cm.TryExecuteCommand(["-init", "demo.csproj"]); } } diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/ProvisioningTests.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/ProvisioningTests.cs index 3645cf2c7ccf..6b34f9bcb773 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/ProvisioningTests.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/ProvisioningTests.cs @@ -20,7 +20,7 @@ public class ProvisioningTests [Test] public void JustCloudMachine() { - CloudMachineInfrastructure infra = new("cm0c420d2f21084cd"); + ProjectInfrastructure infra = new("cm0c420d2f21084cd"); string actualBicep = infra.Build().Compile().FirstOrDefault().Value; string expectedBicep = LoadTestFile("JustCloudMachine.bicep"); Assert.AreEqual(expectedBicep, actualBicep); @@ -29,7 +29,7 @@ public void JustCloudMachine() [Test] public void OpenAI() { - CloudMachineInfrastructure infra = new("cm0c420d2f21084cd"); + ProjectInfrastructure infra = new("cm0c420d2f21084cd"); infra.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); infra.AddFeature(new OpenAIModelFeature("text-embedding-ada-002", "2", AIModelKind.Embedding)); @@ -41,7 +41,7 @@ public void OpenAI() [Test] public void GenerateBicep() { - CloudMachineInfrastructure infra = new("cm0c420d2f21084cd"); + ProjectInfrastructure infra = new("cm0c420d2f21084cd"); infra.AddFeature(new KeyVaultFeature()); infra.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); infra.AddFeature(new OpenAIModelFeature("text-embedding-ada-002", "2", AIModelKind.Embedding)); diff --git a/sdk/cloudmachine/README.md b/sdk/cloudmachine/README.md index 7899b1603498..86dec22fdb7f 100644 --- a/sdk/cloudmachine/README.md +++ b/sdk/cloudmachine/README.md @@ -50,8 +50,8 @@ Open `Program.cs` file and add the following two lines of code to the top of the ```csharp using Azure.CloudMachine; -CloudMachineInfrastructure infrastrucutre = new(); -if (infrastrucutre.TryExecuteCommand(args)) return; +ProjectInfrastructure infrastructure = new(); +if (infrastructure.TryExecuteCommand(args)) return; ``` The `TryExecuteCommand` call allows running the app with a `-init` switch, which will generate bicep files required to provision CloudMachine resources in Azure. Let's generate these bicep files now. @@ -78,9 +78,9 @@ az resource list --resource-group --output ta #### Use CDK to add resources to the CloudMachine -Since we are writing an AI application, we need to provision Azure OpenAI resources. To do this, add the follwoing line of code right below where the infrastructure instance is created: +Since we are writing an AI application, we need to provision Azure OpenAI resources. To do this, add the following line of code right below where the infrastructure instance is created: ```csharp -infrastrucutre.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); +infrastructure.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); ``` Now regenerate the bicep files and re-provision ```dotnetcli @@ -88,17 +88,17 @@ dotnet run -init azd provision ``` -#### Add CloudMachineClient to ASP.NET DI Container -You will be using `CloudMachineClient` to access rources provisioned in the cloud machine. Let's add such client to the DI container such that it is avaliable to ASP.NET handlers +#### Add ProjectClient to ASP.NET DI Container +You will be using `ProjectClient` to access resources provisioned in the cloud machine. Let's add such client to the DI container such that it is avaliable to ASP.NET handlers ```dotnetcli -builder.AddCloudMachine(infrastrucutre); +builder.AddCloudMachine(infrastructure); ``` #### Call CloudMachine APIs You are now ready to call Azure OpenAI service from the app. To do this, change the line of code that maps the application root to the following: ```csharp -app.MapGet("/", (CloudMachineClient cm) => cm.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); +app.MapGet("/", (ProjectClient client) => client.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); ``` The full program should now look like the following: @@ -106,16 +106,16 @@ The full program should now look like the following: using Azure.CloudMachine; using Azure.CloudMachine.OpenAI; -CloudMachineInfrastructure infrastrucutre = new(); -infrastrucutre.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); -if (infrastrucutre.TryExecuteCommand(args)) return; +ProjectInfrastructure infrastructure = new(); +infrastructure.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); +if (infrastructure.TryExecuteCommand(args)) return; var builder = WebApplication.CreateBuilder(args); -builder.AddCloudMachine(infrastrucutre); +builder.AddCloudMachine(infrastructure); var app = builder.Build(); -app.MapGet("/", (CloudMachineClient cm) => cm.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); +app.MapGet("/", (ProjectClient client) => client.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); app.Run(); ``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md index 89fca2f4b976..92a7d8f4a057 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md @@ -275,4 +275,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_cli]: https://docs.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/CHANGELOG.md index 8f1715702251..bcd60f7e9c59 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/CHANGELOG.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 2.0.0-beta.2 (Unreleased) +## 2.0.0-beta.3 (Unreleased) ### Features Added @@ -12,6 +12,20 @@ ### Other Changes +## 2.0.0-beta.2 (2025-02-03) + +### Features Added + +- Added three differenct type of Redaction Policy `CharacterMaskPolicyType`, `EntityMaskTypePolicyType` and `NoMaskPolicyType` for the function `AnalyzeConversations` +- Added support for analyze-conversation API Versions + - 2024-11-01 + - 2024-11-15-preview + +### Other Changes + +- Changed property `CreditCardNumberValue` to `CreditCardValue` and `PhoneNumberValue` to `PhoneValue` for class `ConversationPiiCategoryExclusions` +- Added a new `Instruction` property to class `ConversationSummarizationActionContent` + ## 2.0.0-beta.1 (2024-08-01) - Added support for service version 2024-05-01. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md index b4c9ac591b90..f8e04eceda6f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md @@ -482,6 +482,225 @@ foreach (AnalyzeConversationOperationResult operationResult in operationState.Ac } ``` +### Extract PII from a conversation With Character Mask Policy + +To detect and redact PII in a conversation using Character Mask Policy, you can use the `AnalyzeConversationsAsync` method overload with an action of type `PiiOperationAction` and utilize `CharacterMaskPolicyType` to define the RedactionCharacter (e.g., an asterisk *) to replace sensitive information. The method returns a `Response`:: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy +var redactionPolicy = new CharacterMaskPolicyType +{ + RedactionCharacter = RedactionCharacter.Asterisk +}; + +// Simulate input conversation +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with CharacterMaskPolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Character Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + Assert.That(redactedText, Does.Contain("*"), + $"Expected redacted text to contain '*' but got: {redactedText}"); + } + } + } + } + } +} +``` + +### Extract PII from a conversation With Entity Mask Policy + +To detect and redact PII in a conversation using Character Mask Policy, you can use the `AnalyzeConversationsAsync` method overload with an action of type `PiiOperationAction` and utilize `EntityMaskTypePolicyType` as Mask Policy to replace sensitive information. The method returns a `Response`:: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithEntityMaskPolicy +var redactionPolicy = new EntityMaskTypePolicyType(); + +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with EntityMaskTypePolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Entity Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + // Case-insensitive pattern to match entity mask variations + string expectedMaskPattern = $@"\[{entity.Category}-?\d*\]"; + + // Perform case-insensitive regex match + StringAssert.IsMatch("(?i)" + expectedMaskPattern, redactedText, + $"Expected redacted text to contain an entity mask similar to '[{entity.Category}]' but got: {redactedText}"); + } + } + } + } + } +} +``` + +### Extract PII from a conversation With Character Mask Policy + +To detect and redact PII in a conversation using No Mask Policy, you can use the `AnalyzeConversationsAsync` method overload with an action of type `PiiOperationAction` and utilize `NoMaskPolicyType` as Mask Policy. The method returns a `Response`:: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithNoMaskPolicy +var redactionPolicy = new NoMaskPolicyType(); + +// Simulate input conversation +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with NoMaskPolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with No Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string originalText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Original Text: {originalText}"); + + // Ensure PII is detected + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + detectedEntities.Add(entity.Text); + Assert.That(originalText, Does.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be present but was not found in: {originalText}"); + } + } + } + } + } +} +``` + ### Additional samples Browse our [samples][conversationanalysis_samples] for more examples of how to analyze conversations. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.net8.0.cs index 2a590fb10e78..b5187574dcd9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.net8.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.net8.0.cs @@ -30,13 +30,14 @@ public ConversationAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredentia } public partial class ConversationsClientOptions : Azure.Core.ClientOptions { - public ConversationsClientOptions(Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion.V2024_05_15_Preview) { } + public ConversationsClientOptions(Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview) { } public enum ServiceVersion { V2022_05_01 = 1, V2023_04_01 = 2, V2024_05_01 = 3, - V2024_05_15_Preview = 4, + V2024_11_01 = 4, + V2024_11_15_Preview = 5, } } public static partial class ConversationsModelFactory @@ -89,7 +90,7 @@ public static partial class ConversationsModelFactory public static Azure.AI.Language.Conversations.Models.ListKey ListKey(string key = null) { throw null; } public static Azure.AI.Language.Conversations.Models.LuisResult LuisResult(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } public static Azure.AI.Language.Conversations.Models.LuisTargetIntentResult LuisTargetIntentResult(string apiVersion = null, double confidence = 0, Azure.AI.Language.Conversations.Models.LuisResult result = null) { throw null; } - public static Azure.AI.Language.Conversations.Models.NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = 0, int length = 0, double confidenceScore = 0) { throw null; } + public static Azure.AI.Language.Conversations.Models.NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = 0, int length = 0, double confidenceScore = 0, string mask = null, int? maskOffset = default(int?), int? maskLength = default(int?)) { throw null; } public static Azure.AI.Language.Conversations.Models.NoneLinkedTargetIntentResult NoneLinkedTargetIntentResult(string apiVersion = null, double confidence = 0, Azure.AI.Language.Conversations.Models.ConversationResult result = null) { throw null; } public static Azure.AI.Language.Conversations.Models.NumberResolution NumberResolution(Azure.AI.Language.Conversations.Models.NumberKind numberKind = default(Azure.AI.Language.Conversations.Models.NumberKind), double value = 0) { throw null; } public static Azure.AI.Language.Conversations.Models.NumericRangeResolution NumericRangeResolution(Azure.AI.Language.Conversations.Models.RangeKind rangeKind = default(Azure.AI.Language.Conversations.Models.RangeKind), double minimum = 0, double maximum = 0) { throw null; } @@ -407,6 +408,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class BaseRedactionPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected BaseRedactionPolicy() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.BaseRedactionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.BaseRedactionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class BooleanResolution : Azure.AI.Language.Conversations.Models.ResolutionBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal BooleanResolution() { } @@ -418,6 +429,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CharacterMaskPolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CharacterMaskPolicyType() { } + public Azure.AI.Language.Conversations.Models.RedactionCharacter? RedactionCharacter { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.CharacterMaskPolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.CharacterMaskPolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConversationActionResult : Azure.AI.Language.Conversations.Models.AnalyzeConversationActionResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ConversationActionResult() { } @@ -686,6 +708,7 @@ public ConversationPiiActionContent() { } public System.Collections.Generic.IList PiiCategories { get { throw null; } } public bool? RedactAudioTiming { get { throw null; } set { } } public Azure.AI.Language.Conversations.Models.RedactionCharacter? RedactionCharacter { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Models.BaseRedactionPolicy RedactionPolicy { get { throw null; } set { } } public Azure.AI.Language.Conversations.Models.TranscriptContentType? RedactionSource { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Language.Conversations.Models.ConversationPiiActionContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -702,13 +725,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public ConversationPiiCategories(string value) { throw null; } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Address { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories All { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories CreditCardNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories CreditCard { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Default { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Email { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Miscellaneous { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories NumericIdentifier { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Person { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories PhoneNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Phone { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories UsSocialSecurityNumber { get { throw null; } } public bool Equals(Azure.AI.Language.Conversations.Models.ConversationPiiCategories other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -727,11 +749,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ConversationPiiCategoryExclusions(string value) { throw null; } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Address { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions CreditCardNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions CreditCard { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Email { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions NumericIdentifier { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Person { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions PhoneNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Phone { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions UsSocialSecurityNumber { get { throw null; } } public bool Equals(Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -851,6 +873,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ConversationSummarizationActionContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConversationSummarizationActionContent(System.Collections.Generic.IEnumerable summaryAspects) { } + public string Instruction { get { throw null; } set { } } public bool? LoggingOptOut { get { throw null; } set { } } public string ModelVersion { get { throw null; } set { } } public int? SentenceCount { get { throw null; } set { } } @@ -989,6 +1012,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class EntityMaskTypePolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntityMaskTypePolicyType() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.EntityMaskTypePolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.EntityMaskTypePolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class EntitySubtype : Azure.AI.Language.Conversations.Models.ConversationEntityExtraInformation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal EntitySubtype() { } @@ -1363,6 +1396,9 @@ internal NamedEntity() { } public string Category { get { throw null; } } public double ConfidenceScore { get { throw null; } } public int Length { get { throw null; } } + public string Mask { get { throw null; } } + public int? MaskLength { get { throw null; } } + public int? MaskOffset { get { throw null; } } public int Offset { get { throw null; } } public string Subcategory { get { throw null; } } public string Text { get { throw null; } } @@ -1373,6 +1409,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NoMaskPolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoMaskPolicyType() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.NoMaskPolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.NoMaskPolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NoneLinkedTargetIntentResult : Azure.AI.Language.Conversations.Models.TargetIntentResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NoneLinkedTargetIntentResult() : base (default(double)) { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs index 2a590fb10e78..b5187574dcd9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs @@ -30,13 +30,14 @@ public ConversationAnalysisClient(System.Uri endpoint, Azure.Core.TokenCredentia } public partial class ConversationsClientOptions : Azure.Core.ClientOptions { - public ConversationsClientOptions(Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion.V2024_05_15_Preview) { } + public ConversationsClientOptions(Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview) { } public enum ServiceVersion { V2022_05_01 = 1, V2023_04_01 = 2, V2024_05_01 = 3, - V2024_05_15_Preview = 4, + V2024_11_01 = 4, + V2024_11_15_Preview = 5, } } public static partial class ConversationsModelFactory @@ -89,7 +90,7 @@ public static partial class ConversationsModelFactory public static Azure.AI.Language.Conversations.Models.ListKey ListKey(string key = null) { throw null; } public static Azure.AI.Language.Conversations.Models.LuisResult LuisResult(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } public static Azure.AI.Language.Conversations.Models.LuisTargetIntentResult LuisTargetIntentResult(string apiVersion = null, double confidence = 0, Azure.AI.Language.Conversations.Models.LuisResult result = null) { throw null; } - public static Azure.AI.Language.Conversations.Models.NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = 0, int length = 0, double confidenceScore = 0) { throw null; } + public static Azure.AI.Language.Conversations.Models.NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = 0, int length = 0, double confidenceScore = 0, string mask = null, int? maskOffset = default(int?), int? maskLength = default(int?)) { throw null; } public static Azure.AI.Language.Conversations.Models.NoneLinkedTargetIntentResult NoneLinkedTargetIntentResult(string apiVersion = null, double confidence = 0, Azure.AI.Language.Conversations.Models.ConversationResult result = null) { throw null; } public static Azure.AI.Language.Conversations.Models.NumberResolution NumberResolution(Azure.AI.Language.Conversations.Models.NumberKind numberKind = default(Azure.AI.Language.Conversations.Models.NumberKind), double value = 0) { throw null; } public static Azure.AI.Language.Conversations.Models.NumericRangeResolution NumericRangeResolution(Azure.AI.Language.Conversations.Models.RangeKind rangeKind = default(Azure.AI.Language.Conversations.Models.RangeKind), double minimum = 0, double maximum = 0) { throw null; } @@ -407,6 +408,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class BaseRedactionPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected BaseRedactionPolicy() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.BaseRedactionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.BaseRedactionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class BooleanResolution : Azure.AI.Language.Conversations.Models.ResolutionBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal BooleanResolution() { } @@ -418,6 +429,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CharacterMaskPolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CharacterMaskPolicyType() { } + public Azure.AI.Language.Conversations.Models.RedactionCharacter? RedactionCharacter { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.CharacterMaskPolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.CharacterMaskPolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConversationActionResult : Azure.AI.Language.Conversations.Models.AnalyzeConversationActionResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ConversationActionResult() { } @@ -686,6 +708,7 @@ public ConversationPiiActionContent() { } public System.Collections.Generic.IList PiiCategories { get { throw null; } } public bool? RedactAudioTiming { get { throw null; } set { } } public Azure.AI.Language.Conversations.Models.RedactionCharacter? RedactionCharacter { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Models.BaseRedactionPolicy RedactionPolicy { get { throw null; } set { } } public Azure.AI.Language.Conversations.Models.TranscriptContentType? RedactionSource { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Language.Conversations.Models.ConversationPiiActionContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -702,13 +725,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public ConversationPiiCategories(string value) { throw null; } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Address { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories All { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories CreditCardNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories CreditCard { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Default { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Email { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Miscellaneous { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories NumericIdentifier { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Person { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories PhoneNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories Phone { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategories UsSocialSecurityNumber { get { throw null; } } public bool Equals(Azure.AI.Language.Conversations.Models.ConversationPiiCategories other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -727,11 +749,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ConversationPiiCategoryExclusions(string value) { throw null; } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Address { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions CreditCardNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions CreditCard { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Email { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions NumericIdentifier { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Person { get { throw null; } } - public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions PhoneNumber { get { throw null; } } + public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions Phone { get { throw null; } } public static Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions UsSocialSecurityNumber { get { throw null; } } public bool Equals(Azure.AI.Language.Conversations.Models.ConversationPiiCategoryExclusions other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -851,6 +873,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ConversationSummarizationActionContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConversationSummarizationActionContent(System.Collections.Generic.IEnumerable summaryAspects) { } + public string Instruction { get { throw null; } set { } } public bool? LoggingOptOut { get { throw null; } set { } } public string ModelVersion { get { throw null; } set { } } public int? SentenceCount { get { throw null; } set { } } @@ -989,6 +1012,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class EntityMaskTypePolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntityMaskTypePolicyType() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.EntityMaskTypePolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.EntityMaskTypePolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class EntitySubtype : Azure.AI.Language.Conversations.Models.ConversationEntityExtraInformation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal EntitySubtype() { } @@ -1363,6 +1396,9 @@ internal NamedEntity() { } public string Category { get { throw null; } } public double ConfidenceScore { get { throw null; } } public int Length { get { throw null; } } + public string Mask { get { throw null; } } + public int? MaskLength { get { throw null; } } + public int? MaskOffset { get { throw null; } } public int Offset { get { throw null; } } public string Subcategory { get { throw null; } } public string Text { get { throw null; } } @@ -1373,6 +1409,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NoMaskPolicyType : Azure.AI.Language.Conversations.Models.BaseRedactionPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoMaskPolicyType() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.NoMaskPolicyType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Models.NoMaskPolicyType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NoneLinkedTargetIntentResult : Azure.AI.Language.Conversations.Models.TargetIntentResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NoneLinkedTargetIntentResult() : base (default(double)) { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/assets.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/assets.json index cad3d9bffbe8..4830adbbf46c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/assets.json +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/cognitivelanguage/Azure.AI.Language.Conversations", - "Tag": "net/cognitivelanguage/Azure.AI.Language.Conversations_1e1b47540c" + "Tag": "net/cognitivelanguage/Azure.AI.Language.Conversations_26c3361e25" } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample10_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample10_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.md new file mode 100644 index 000000000000..1623030b04e5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample10_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.md @@ -0,0 +1,103 @@ +# Analyze a Conversation for PII Using Entity Masking + +This sample demonstrates how to detect and redact personally identifiable information (PII) in a conversation using Entity Mask Policy with Conversation PII analysis. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +Start by importing the namespace for the `ConversationAnalysisClient` and related classes: + +```C# Snippet:ConversationAnalysisClient_Namespaces +using Azure.Core; +using Azure.Core.Serialization; +using Azure.AI.Language.Conversations; +``` + +To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# Snippet:ConversationAnalysisClient_Create +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. + +## Asynchronous + +```C# Snippet:AnalyzeConversation_ConversationPiiWithEntityMaskPolicy +var redactionPolicy = new EntityMaskTypePolicyType(); + +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with EntityMaskTypePolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Entity Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + // Case-insensitive pattern to match entity mask variations + string expectedMaskPattern = $@"\[{entity.Category}-?\d*\]"; + + // Perform case-insensitive regex match + StringAssert.IsMatch("(?i)" + expectedMaskPattern, redactedText, + $"Expected redacted text to contain an entity mask similar to '[{entity.Category}]' but got: {redactedText}"); + } + } + } + } + } +} +``` + +## Synchronous + +Using the same `data` definition above, you can make a synchronous request by calling `AnalyzeConversationOperation`: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithEntityMaskPolicySync +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample11_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample11_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.md new file mode 100644 index 000000000000..c5f16283d99c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample11_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.md @@ -0,0 +1,98 @@ +# Analyze a Conversation for PII With No Masking + +This sample demonstrates how to detect and redact personally identifiable information (PII) in a conversation using No Mask Policy with Conversation PII analysis. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +Start by importing the namespace for the `ConversationAnalysisClient` and related classes: + +```C# Snippet:ConversationAnalysisClient_Namespaces +using Azure.Core; +using Azure.Core.Serialization; +using Azure.AI.Language.Conversations; +``` + +To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# Snippet:ConversationAnalysisClient_Create +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. + +## Asynchronous + +```C# Snippet:AnalyzeConversation_ConversationPiiWithNoMaskPolicy +var redactionPolicy = new NoMaskPolicyType(); + +// Simulate input conversation +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with NoMaskPolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with No Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string originalText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Original Text: {originalText}"); + + // Ensure PII is detected + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + detectedEntities.Add(entity.Text); + Assert.That(originalText, Does.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be present but was not found in: {originalText}"); + } + } + } + } + } +} +``` + +## Synchronous + +Using the same `data` definition above, you can make a synchronous request by calling `AnalyzeConversationOperation`: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithNoMaskPolicySync +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample9_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample9_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.md new file mode 100644 index 000000000000..4bda60468416 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample9_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.md @@ -0,0 +1,102 @@ +# Analyze a Conversation for PII Using Character Masking + +This sample demonstrates how to detect and redact personally identifiable information (PII) in a conversation using Character Mask Policy with Conversation PII analysis. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +Start by importing the namespace for the `ConversationAnalysisClient` and related classes: + +```C# Snippet:ConversationAnalysisClient_Namespaces +using Azure.Core; +using Azure.Core.Serialization; +using Azure.AI.Language.Conversations; +``` + +To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# Snippet:ConversationAnalysisClient_Create +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. + +## Asynchronous + +```C# Snippet:AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy +var redactionPolicy = new CharacterMaskPolicyType +{ + RedactionCharacter = RedactionCharacter.Asterisk +}; + +// Simulate input conversation +MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + +// Add action with CharacterMaskPolicyType +List actions = new List +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Character Mask Policy" + } +}; + +// Create input for analysis +AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + +// Act: Perform the PII analysis +Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; +// Assert: Validate the results +foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) +{ + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + Assert.That(redactedText, Does.Contain("*"), + $"Expected redacted text to contain '*' but got: {redactedText}"); + } + } + } + } + } +} +``` + +## Synchronous + +Using the same `data` definition above, you can make a synchronous request by calling `AnalyzeConversationOperation`: + +```C# Snippet:AnalyzeConversation_ConversationPiiWithCharacterMaskPolicySync +AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Azure.AI.Language.Conversations.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Azure.AI.Language.Conversations.csproj index 7b185a5ee76a..15c4f3dadaa4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Azure.AI.Language.Conversations.csproj +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Azure.AI.Language.Conversations.csproj @@ -2,7 +2,7 @@ This is the client library for the Conversations service, a cloud-based conversational AI service that applies custom machine-learning intelligence to a user's conversational, natural language text to predict overall meaning, and pull out relevant, detailed information. Microsoft Azure.AI.Language.Conversations client library - 2.0.0-beta.2 + 2.0.0-beta.3 1.1.0 Azure AI Language Conversations diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs index 87f2eba66e91..d44da9f8c426 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Language.Conversations /// Client options for ConversationAnalysisClient. public partial class ConversationsClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_05_15_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview; /// The version of the service to use. public enum ServiceVersion @@ -24,8 +24,10 @@ public enum ServiceVersion V2023_04_01 = 2, /// Service version "2024-05-01". V2024_05_01 = 3, - /// Service version "2024-05-15-preview". - V2024_05_15_Preview = 4, + /// Service version "2024-11-01". + V2024_11_01 = 4, + /// Service version "2024-11-15-preview". + V2024_11_15_Preview = 5, } internal string Version { get; } @@ -38,7 +40,8 @@ public ConversationsClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2022_05_01 => "2022-05-01", ServiceVersion.V2023_04_01 => "2023-04-01", ServiceVersion.V2024_05_01 => "2024-05-01", - ServiceVersion.V2024_05_15_Preview => "2024-05-15-preview", + ServiceVersion.V2024_11_01 => "2024-11-01", + ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs index ade8de3ca4ea..969afa1b41ec 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs @@ -352,7 +352,7 @@ public static ListKey ListKey(string key = null) /// Initializes a new instance of . /// The key of the regex pattern used in extracting the entity. - /// The .NET regex pattern used in extracting the entity. Please visit https://docs.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. + /// The .NET regex pattern used in extracting the entity. Please visit https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. /// A new instance for mocking. public static RegexKey RegexKey(string key = null, string regexPattern = null) { @@ -384,36 +384,6 @@ public static TargetIntentResult TargetIntentResult(string targetProjectKind = n return new UnknownTargetIntentResult(targetProjectKind == null ? default : new TargetProjectKind(targetProjectKind), apiVersion, confidence, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The API version used to call a target service. - /// The prediction score and it ranges from 0.0 to 1.0. - /// The actual response from a Conversation project. - /// A new instance for mocking. - public static NoneLinkedTargetIntentResult NoneLinkedTargetIntentResult(string apiVersion = null, double confidence = default, ConversationResult result = null) - { - return new NoneLinkedTargetIntentResult(TargetProjectKind.NonLinked, apiVersion, confidence, serializedAdditionalRawData: null, result); - } - - /// Initializes a new instance of . - /// The same query given in request. - /// The detected language from the query in BCP 47 language representation. - /// The predicted result for the query. - /// A new instance for mocking. - public static ConversationResult ConversationResult(string query = null, string detectedLanguage = null, ConversationPrediction prediction = null) - { - return new ConversationResult(query, detectedLanguage, prediction, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The API version used to call a target service. - /// The prediction score and it ranges from 0.0 to 1.0. - /// The actual response from a Conversation project. - /// A new instance for mocking. - public static ConversationTargetIntentResult ConversationTargetIntentResult(string apiVersion = null, double confidence = default, ConversationResult result = null) - { - return new ConversationTargetIntentResult(TargetProjectKind.Conversation, apiVersion, confidence, serializedAdditionalRawData: null, result); - } - /// Initializes a new instance of . /// The API version used to call a target service. /// The prediction score and it ranges from 0.0 to 1.0. @@ -513,6 +483,36 @@ public static AnswerSpan AnswerSpan(string text = null, double? confidenceScore return new AnswerSpan(text, confidenceScore, offset, length, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The API version used to call a target service. + /// The prediction score and it ranges from 0.0 to 1.0. + /// The actual response from a Conversation project. + /// A new instance for mocking. + public static NoneLinkedTargetIntentResult NoneLinkedTargetIntentResult(string apiVersion = null, double confidence = default, ConversationResult result = null) + { + return new NoneLinkedTargetIntentResult(TargetProjectKind.NonLinked, apiVersion, confidence, serializedAdditionalRawData: null, result); + } + + /// Initializes a new instance of . + /// The same query given in request. + /// The detected language from the query in BCP 47 language representation. + /// The predicted result for the query. + /// A new instance for mocking. + public static ConversationResult ConversationResult(string query = null, string detectedLanguage = null, ConversationPrediction prediction = null) + { + return new ConversationResult(query, detectedLanguage, prediction, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The API version used to call a target service. + /// The prediction score and it ranges from 0.0 to 1.0. + /// The actual response from a Conversation project. + /// A new instance for mocking. + public static ConversationTargetIntentResult ConversationTargetIntentResult(string apiVersion = null, double confidence = default, ConversationResult result = null) + { + return new ConversationTargetIntentResult(TargetProjectKind.Conversation, apiVersion, confidence, serializedAdditionalRawData: null, result); + } + /// Initializes a new instance of . /// One of a server-defined set of error codes. /// A human-readable representation of the error. @@ -618,35 +618,89 @@ public static AnalyzeConversationOperationResult AnalyzeConversationOperationRes return new UnknownAnalyzeConversationOperationResult(lastUpdateDateTime, status, name, kind == null ? default : new AnalyzeConversationOperationResultsKind(kind), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The last updated time in UTC for the task. /// The status of the task at the mentioned last update time. /// task name. /// results. - /// A new instance for mocking. - public static ConversationPiiOperationResult ConversationPiiOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, ConversationPiiResults results = null) + /// A new instance for mocking. + public static SummarizationOperationResult SummarizationOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, SummaryResult results = null) { - return new ConversationPiiOperationResult( + return new SummarizationOperationResult( lastUpdateDateTime, status, name, - AnalyzeConversationOperationResultsKind.PiiOperationResults, + AnalyzeConversationOperationResultsKind.SummarizationOperationResults, serializedAdditionalRawData: null, results); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// array of conversations. /// Errors by document id. /// statistics. /// This field indicates which model is used for scoring. - /// array of conversations. - /// A new instance for mocking. - public static ConversationPiiResults ConversationPiiResults(IEnumerable errors = null, RequestStatistics statistics = null, string modelVersion = null, IEnumerable conversations = null) + /// A new instance for mocking. + public static SummaryResult SummaryResult(IEnumerable conversations = null, IEnumerable errors = null, RequestStatistics statistics = null, string modelVersion = null) { + conversations ??= new List(); errors ??= new List(); - conversations ??= new List(); - return new ConversationPiiResults(errors?.ToList(), statistics, modelVersion, conversations?.ToList(), serializedAdditionalRawData: null); + return new SummaryResult(conversations?.ToList(), errors?.ToList(), statistics, modelVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique, non-empty conversation identifier. + /// Warnings encountered in processing the document. + /// If showStats=true was specified in the request this field will contain information about the conversation payload. + /// array of summaries. + /// A new instance for mocking. + public static ConversationsSummaryResult ConversationsSummaryResult(string id = null, IEnumerable warnings = null, ConversationStatistics statistics = null, IEnumerable summaries = null) + { + warnings ??= new List(); + summaries ??= new List(); + + return new ConversationsSummaryResult(id, warnings?.ToList(), statistics, summaries?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Warning code. + /// Warning message. + /// A JSON pointer reference indicating the target object. + /// A new instance for mocking. + public static InputWarning InputWarning(string code = null, string message = null, string targetRef = null) + { + return new InputWarning(code, message, targetRef, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Number of text units for the request. + /// A new instance for mocking. + public static ConversationStatistics ConversationStatistics(int transactionsCount = default) + { + return new ConversationStatistics(transactionsCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// aspect. + /// text. + /// Context list of the summary. + /// A new instance for mocking. + public static SummaryResultItem SummaryResultItem(string aspect = null, string text = null, IEnumerable contexts = null) + { + contexts ??= new List(); + + return new SummaryResultItem(aspect, text, contexts?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start position for the context. Use of different 'stringIndexType' values can affect the offset returned. + /// The length of the context. Use of different 'stringIndexType' values can affect the length returned. + /// Reference to the ID of ConversationItem. + /// A new instance for mocking. + public static ItemizedSummaryContext ItemizedSummaryContext(int offset = default, int length = default, string conversationItemId = null) + { + return new ItemizedSummaryContext(offset, length, conversationItemId, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -669,6 +723,75 @@ public static RequestStatistics RequestStatistics(int documentsCount = default, return new RequestStatistics(documentsCount, validDocumentsCount, erroneousDocumentsCount, transactionsCount, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The last updated time in UTC for the task. + /// The status of the task at the mentioned last update time. + /// task name. + /// Custom Summary Result. + /// A new instance for mocking. + public static CustomSummarizationOperationResult CustomSummarizationOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, CustomSummaryResult results = null) + { + return new CustomSummarizationOperationResult( + lastUpdateDateTime, + status, + name, + AnalyzeConversationOperationResultsKind.CustomSummarizationOperationResults, + serializedAdditionalRawData: null, + results); + } + + /// Initializes a new instance of . + /// array of conversations. + /// Errors by document id. + /// if showStats=true was specified in the request this field will contain information about the request payload. + /// This field indicates the project name for the model. + /// This field indicates the deployment name for the model. + /// A new instance for mocking. + public static CustomSummaryResult CustomSummaryResult(IEnumerable conversations = null, IEnumerable errors = null, RequestStatistics statistics = null, string projectName = null, string deploymentName = null) + { + conversations ??= new List(); + errors ??= new List(); + + return new CustomSummaryResult( + conversations?.ToList(), + errors?.ToList(), + statistics, + projectName, + deploymentName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The last updated time in UTC for the task. + /// The status of the task at the mentioned last update time. + /// task name. + /// results. + /// A new instance for mocking. + public static ConversationPiiOperationResult ConversationPiiOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, ConversationPiiResults results = null) + { + return new ConversationPiiOperationResult( + lastUpdateDateTime, + status, + name, + AnalyzeConversationOperationResultsKind.PiiOperationResults, + serializedAdditionalRawData: null, + results); + } + + /// Initializes a new instance of . + /// Errors by document id. + /// statistics. + /// This field indicates which model is used for scoring. + /// array of conversations. + /// A new instance for mocking. + public static ConversationPiiResults ConversationPiiResults(IEnumerable errors = null, RequestStatistics statistics = null, string modelVersion = null, IEnumerable conversations = null) + { + errors ??= new List(); + conversations ??= new List(); + + return new ConversationPiiResults(errors?.ToList(), statistics, modelVersion, conversations?.ToList(), serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Unique, non-empty conversation identifier. /// Warnings encountered in processing the document. @@ -683,24 +806,6 @@ public static ConversationalPiiResult ConversationalPiiResult(string id = null, return new ConversationalPiiResult(id, warnings?.ToList(), statistics, conversationItems?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Warning code. - /// Warning message. - /// A JSON pointer reference indicating the target object. - /// A new instance for mocking. - public static InputWarning InputWarning(string code = null, string message = null, string targetRef = null) - { - return new InputWarning(code, message, targetRef, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Number of text units for the request. - /// A new instance for mocking. - public static ConversationStatistics ConversationStatistics(int transactionsCount = default) - { - return new ConversationStatistics(transactionsCount, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Id of the result. /// Transcript content response that the service generates, with all necessary personally identifiable information redacted. @@ -749,8 +854,11 @@ public static AudioTiming AudioTiming(long? offset = null, long? duration = null /// Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned. /// Length for the entity text. Use of different 'stringIndexType' values can affect the length returned. /// Confidence score between 0 and 1 of the extracted entity. + /// Exact mask text to mask the PII entity. + /// Offset of the mask text. + /// Length of the mask text. /// A new instance for mocking. - public static NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = default, int length = default, double confidenceScore = default) + public static NamedEntity NamedEntity(string text = null, string category = null, string subcategory = null, int offset = default, int length = default, double confidenceScore = default, string mask = null, int? maskOffset = null, int? maskLength = null) { return new NamedEntity( text, @@ -759,111 +867,9 @@ public static NamedEntity NamedEntity(string text = null, string category = null offset, length, confidenceScore, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The last updated time in UTC for the task. - /// The status of the task at the mentioned last update time. - /// task name. - /// results. - /// A new instance for mocking. - public static SummarizationOperationResult SummarizationOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, SummaryResult results = null) - { - return new SummarizationOperationResult( - lastUpdateDateTime, - status, - name, - AnalyzeConversationOperationResultsKind.SummarizationOperationResults, - serializedAdditionalRawData: null, - results); - } - - /// Initializes a new instance of . - /// array of conversations. - /// Errors by document id. - /// statistics. - /// This field indicates which model is used for scoring. - /// A new instance for mocking. - public static SummaryResult SummaryResult(IEnumerable conversations = null, IEnumerable errors = null, RequestStatistics statistics = null, string modelVersion = null) - { - conversations ??= new List(); - errors ??= new List(); - - return new SummaryResult(conversations?.ToList(), errors?.ToList(), statistics, modelVersion, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Unique, non-empty conversation identifier. - /// Warnings encountered in processing the document. - /// If showStats=true was specified in the request this field will contain information about the conversation payload. - /// array of summaries. - /// A new instance for mocking. - public static ConversationsSummaryResult ConversationsSummaryResult(string id = null, IEnumerable warnings = null, ConversationStatistics statistics = null, IEnumerable summaries = null) - { - warnings ??= new List(); - summaries ??= new List(); - - return new ConversationsSummaryResult(id, warnings?.ToList(), statistics, summaries?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// aspect. - /// text. - /// Context list of the summary. - /// A new instance for mocking. - public static SummaryResultItem SummaryResultItem(string aspect = null, string text = null, IEnumerable contexts = null) - { - contexts ??= new List(); - - return new SummaryResultItem(aspect, text, contexts?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Start position for the context. Use of different 'stringIndexType' values can affect the offset returned. - /// The length of the context. Use of different 'stringIndexType' values can affect the length returned. - /// Reference to the ID of ConversationItem. - /// A new instance for mocking. - public static ItemizedSummaryContext ItemizedSummaryContext(int offset = default, int length = default, string conversationItemId = null) - { - return new ItemizedSummaryContext(offset, length, conversationItemId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The last updated time in UTC for the task. - /// The status of the task at the mentioned last update time. - /// task name. - /// Custom Summary Result. - /// A new instance for mocking. - public static CustomSummarizationOperationResult CustomSummarizationOperationResult(DateTimeOffset lastUpdateDateTime = default, ConversationActionState status = default, string name = null, CustomSummaryResult results = null) - { - return new CustomSummarizationOperationResult( - lastUpdateDateTime, - status, - name, - AnalyzeConversationOperationResultsKind.CustomSummarizationOperationResults, - serializedAdditionalRawData: null, - results); - } - - /// Initializes a new instance of . - /// array of conversations. - /// Errors by document id. - /// if showStats=true was specified in the request this field will contain information about the request payload. - /// This field indicates the project name for the model. - /// This field indicates the deployment name for the model. - /// A new instance for mocking. - public static CustomSummaryResult CustomSummaryResult(IEnumerable conversations = null, IEnumerable errors = null, RequestStatistics statistics = null, string projectName = null, string deploymentName = null) - { - conversations ??= new List(); - errors ??= new List(); - - return new CustomSummaryResult( - conversations?.ToList(), - errors?.ToList(), - statistics, - projectName, - deploymentName, + mask, + maskOffset, + maskLength, serializedAdditionalRawData: null); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml index 9a307ff5dc86..572bedf8b8a2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml @@ -369,6 +369,30 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); ]]> This sample shows how to call GetAnalyzeConversationJobStatusAsync. @@ -420,6 +444,30 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); ]]> This sample shows how to call GetAnalyzeConversationJobStatus. @@ -501,6 +549,60 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -612,6 +714,60 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -714,9 +870,13 @@ AnalyzeConversationOperationInput analyzeConversationOperationInput = new Analyz ActionContent = new ConversationPiiActionContent { ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, - ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, + RedactionPolicy = new CharacterMaskPolicyType + { + RedactionCharacter = RedactionCharacter.Minus, + }, }, Name = "Conversation PII", } @@ -780,7 +940,7 @@ AnalyzeConversationOperationInput analyzeConversationOperationInput = new Analyz PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, - RedactionCharacter = RedactionCharacter.Minus, + RedactionPolicy = new EntityMaskTypePolicyType(), }, Name = "Conversation PII", } @@ -841,9 +1001,9 @@ AnalyzeConversationOperationInput analyzeConversationOperationInput = new Analyz ActionContent = new ConversationPiiActionContent { ModelVersion = "latest", - PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, + ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, }, Name = "Conversation PII", } @@ -865,57 +1025,55 @@ AnalyzeConversationOperationInput analyzeConversationOperationInput = new Analyz { new TranscriptConversationItem( "1", - "speaker 1", - "", - "", - "Let's get started.", - "") + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") { - ConversationItemLevelTiming = new ConversationItemLevelTiming + WordLevelTimings = {new WordLevelTiming { - Offset = 0L, - Duration = 20000000L, - }, - }, - new TranscriptConversationItem( - "2", - "speaker 2", - "", - "", - "OK. How many remaining bugs do we have now?", - "") - { - ConversationItemLevelTiming = new ConversationItemLevelTiming + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming { - Offset = 20000000L, - Duration = 50000000L, - }, - }, - new TranscriptConversationItem( - "3", - "speaker 3", - "", - "", - "Only 3.", - "") - { - ConversationItemLevelTiming = new ConversationItemLevelTiming + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming { - Offset = 50000000L, - Duration = 60000000L, - }, + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, } }) + { + Domain = ConversationDomain.Generic, + } }), new AnalyzeConversationOperationAction[] { - new SummarizationOperationAction + new PiiOperationAction { - ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), - Name = "Conversation Summarization Task 1", + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionPolicy = new NoMaskPolicyType(), + }, + Name = "Conversation PII", } }) { - DisplayName = "Conversation Summarization Example", + DisplayName = "Redacting PII data from transcribed audio", }; Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); ]]> @@ -927,17 +1085,210 @@ ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, cre AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] { - new TextConversation("20220101meeting", "en", new TextConversationItem[] + new TranscriptConversation("1", "en", new TranscriptConversationItem[] { - new TextConversationItem("1", "user", "Hi!") - { - Role = ParticipantRole.Customer, - }, - new TextConversationItem("2", "agent", "Hello, how can I help you?") - { - Role = ParticipantRole.Agent, - }, - new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionCharacter = RedactionCharacter.Minus, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 0L, + Duration = 20000000L, + }, + }, + new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 20000000L, + Duration = 50000000L, + }, + }, + new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 50000000L, + Duration = 60000000L, + }, + } + }) +}), new AnalyzeConversationOperationAction[] +{ + new SummarizationOperationAction + { + ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), + Name = "Conversation Summarization Task 1", + } +}) +{ + DisplayName = "Conversation Summarization Example", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TextConversation("20220101meeting", "en", new TextConversationItem[] + { + new TextConversationItem("1", "user", "Hi!") + { + Role = ParticipantRole.Customer, + }, + new TextConversationItem("2", "agent", "Hello, how can I help you?") + { + Role = ParticipantRole.Agent, + }, + new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") { Role = ParticipantRole.Customer, } @@ -1081,9 +1432,204 @@ AnalyzeConversationOperationInput analyzeConversationOperationInput = new Analyz ActionContent = new ConversationPiiActionContent { ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionPolicy = new CharacterMaskPolicyType + { + RedactionCharacter = RedactionCharacter.Minus, + }, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionPolicy = new EntityMaskTypePolicyType(), + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000L, + Duration = 2700000L, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000L, + Duration = 920000L, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000L, + Duration = 2700000L, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000L, + Duration = 920000L, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, - ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, + RedactionPolicy = new NoMaskPolicyType(), }, Name = "Conversation PII", } @@ -1403,6 +1949,179 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "characterMask", + redactionCharacter = "-", + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "entityMask", + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + using RequestContent content = RequestContent.Create(new { displayName = "Redacting PII data from transcribed audio", @@ -1469,7 +2188,93 @@ using RequestContent content = RequestContent.Create(new modelVersion = "latest", excludePiiCategories = new object[] { - "Person" + "Person" + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "noMask", }, redactionSource = "lexical", redactAudioTiming = true, @@ -1890,6 +2695,179 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "characterMask", + redactionCharacter = "-", + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "entityMask", + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + using RequestContent content = RequestContent.Create(new { displayName = "Redacting PII data from transcribed audio", @@ -1972,6 +2950,92 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000L, + duration = 2700000L, + }, + new + { + word = "morning", + offset = 4500000L, + duration = 920000L, + }, + new + { + word = "john", + offset = 590000L, + duration = 2700000L, + }, + new + { + word = "doe", + offset = 6300000L, + duration = 920000L, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionPolicy = new + { + policyKind = "noMask", + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + using RequestContent content = RequestContent.Create(new { displayName = "Redacting PII data from transcribed audio", diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.Serialization.cs new file mode 100644 index 000000000000..a288f89dcb70 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Models +{ + [PersistableModelProxy(typeof(UnknownBaseRedactionPolicy))] + public partial class BaseRedactionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("policyKind"u8); + writer.WriteStringValue(PolicyKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BaseRedactionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBaseRedactionPolicy(document.RootElement, options); + } + + internal static BaseRedactionPolicy DeserializeBaseRedactionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("policyKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "characterMask": return CharacterMaskPolicyType.DeserializeCharacterMaskPolicyType(element, options); + case "entityMask": return EntityMaskTypePolicyType.DeserializeEntityMaskTypePolicyType(element, options); + case "noMask": return NoMaskPolicyType.DeserializeNoMaskPolicyType(element, options); + } + } + return UnknownBaseRedactionPolicy.DeserializeUnknownBaseRedactionPolicy(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support writing '{options.Format}' format."); + } + } + + BaseRedactionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBaseRedactionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BaseRedactionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBaseRedactionPolicy(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.cs new file mode 100644 index 000000000000..2396509fe391 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/BaseRedactionPolicy.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Models +{ + /// + /// The abstract base class for RedactionPolicy. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class BaseRedactionPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected BaseRedactionPolicy() + { + } + + /// Initializes a new instance of . + /// The entity RedactionPolicy object kind. + /// Keeps track of any properties unknown to the library. + internal BaseRedactionPolicy(RedactionPolicyKind policyKind, IDictionary serializedAdditionalRawData) + { + PolicyKind = policyKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The entity RedactionPolicy object kind. + internal RedactionPolicyKind PolicyKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.Serialization.cs new file mode 100644 index 000000000000..33b75230a156 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Models +{ + public partial class CharacterMaskPolicyType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharacterMaskPolicyType)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(RedactionCharacter)) + { + writer.WritePropertyName("redactionCharacter"u8); + writer.WriteStringValue(RedactionCharacter.Value.ToString()); + } + } + + CharacterMaskPolicyType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CharacterMaskPolicyType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCharacterMaskPolicyType(document.RootElement, options); + } + + internal static CharacterMaskPolicyType DeserializeCharacterMaskPolicyType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RedactionCharacter? redactionCharacter = default; + RedactionPolicyKind policyKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("redactionCharacter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redactionCharacter = new RedactionCharacter(property.Value.GetString()); + continue; + } + if (property.NameEquals("policyKind"u8)) + { + policyKind = new RedactionPolicyKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CharacterMaskPolicyType(policyKind, serializedAdditionalRawData, redactionCharacter); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CharacterMaskPolicyType)} does not support writing '{options.Format}' format."); + } + } + + CharacterMaskPolicyType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCharacterMaskPolicyType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CharacterMaskPolicyType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CharacterMaskPolicyType FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCharacterMaskPolicyType(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.cs new file mode 100644 index 000000000000..141dee29a3d2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/CharacterMaskPolicyType.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Models +{ + /// Represents the policy of masking with a redaction character. + public partial class CharacterMaskPolicyType : BaseRedactionPolicy + { + /// Initializes a new instance of . + public CharacterMaskPolicyType() + { + PolicyKind = RedactionPolicyKind.CharacterMask; + } + + /// Initializes a new instance of . + /// The entity RedactionPolicy object kind. + /// Keeps track of any properties unknown to the library. + /// Optional parameter to use a Custom Character to be used for redaction in PII responses. Default character will be * as before. We allow specific ascii characters for redaction. + internal CharacterMaskPolicyType(RedactionPolicyKind policyKind, IDictionary serializedAdditionalRawData, RedactionCharacter? redactionCharacter) : base(policyKind, serializedAdditionalRawData) + { + RedactionCharacter = redactionCharacter; + } + + /// Optional parameter to use a Custom Character to be used for redaction in PII responses. Default character will be * as before. We allow specific ascii characters for redaction. + public RedactionCharacter? RedactionCharacter { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.Serialization.cs index 5b5f0e66c881..88fa41fba49e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.Serialization.cs @@ -79,6 +79,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(RedactionPolicy)) + { + writer.WritePropertyName("redactionPolicy"u8); + writer.WriteObjectValue(RedactionPolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -123,6 +128,7 @@ internal static ConversationPiiActionContent DeserializeConversationPiiActionCon TranscriptContentType? redactionSource = default; RedactionCharacter? redactionCharacter = default; IList excludePiiCategories = default; + BaseRedactionPolicy redactionPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -196,6 +202,15 @@ internal static ConversationPiiActionContent DeserializeConversationPiiActionCon excludePiiCategories = array; continue; } + if (property.NameEquals("redactionPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redactionPolicy = BaseRedactionPolicy.DeserializeBaseRedactionPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -210,6 +225,7 @@ internal static ConversationPiiActionContent DeserializeConversationPiiActionCon redactionSource, redactionCharacter, excludePiiCategories ?? new ChangeTrackingList(), + redactionPolicy, serializedAdditionalRawData); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.cs index fc962a138448..d1e3038d7711 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiActionContent.cs @@ -60,8 +60,13 @@ public ConversationPiiActionContent() /// For transcript conversations, this parameter provides information regarding which content type (ITN, Text, Lexical, Masked ITN) should be used for entity detection. The details of the entities detected - like the offset, length and the text itself - will correspond to the text type selected here. /// Optional parameter to use a Custom Character to be used for redaction in PII responses. Default character will be * as before. We allow specific ascii characters for redaction. /// List of categories that need to be excluded instead of included. + /// + /// Optional parameter determine what type of redaction to use. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// /// Keeps track of any properties unknown to the library. - internal ConversationPiiActionContent(bool? loggingOptOut, string modelVersion, IList piiCategories, bool? redactAudioTiming, TranscriptContentType? redactionSource, RedactionCharacter? redactionCharacter, IList excludePiiCategories, IDictionary serializedAdditionalRawData) + internal ConversationPiiActionContent(bool? loggingOptOut, string modelVersion, IList piiCategories, bool? redactAudioTiming, TranscriptContentType? redactionSource, RedactionCharacter? redactionCharacter, IList excludePiiCategories, BaseRedactionPolicy redactionPolicy, IDictionary serializedAdditionalRawData) { LoggingOptOut = loggingOptOut; ModelVersion = modelVersion; @@ -70,6 +75,7 @@ internal ConversationPiiActionContent(bool? loggingOptOut, string modelVersion, RedactionSource = redactionSource; RedactionCharacter = redactionCharacter; ExcludePiiCategories = excludePiiCategories; + RedactionPolicy = redactionPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,5 +93,11 @@ internal ConversationPiiActionContent(bool? loggingOptOut, string modelVersion, public RedactionCharacter? RedactionCharacter { get; set; } /// List of categories that need to be excluded instead of included. public IList ExcludePiiCategories { get; } + /// + /// Optional parameter determine what type of redaction to use. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public BaseRedactionPolicy RedactionPolicy { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategories.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategories.cs index 39882f7570de..faa8d28a24fd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategories.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategories.cs @@ -23,32 +23,29 @@ public ConversationPiiCategories(string value) } private const string AddressValue = "Address"; - private const string CreditCardNumberValue = "CreditCardNumber"; + private const string CreditCardValue = "CreditCard"; private const string EmailValue = "Email"; private const string PersonValue = "Person"; private const string NumericIdentifierValue = "NumericIdentifier"; - private const string PhoneNumberValue = "PhoneNumber"; + private const string PhoneValue = "Phone"; private const string UsSocialSecurityNumberValue = "USSocialSecurityNumber"; - private const string MiscellaneousValue = "Miscellaneous"; private const string AllValue = "All"; private const string DefaultValue = "Default"; /// Address category. public static ConversationPiiCategories Address { get; } = new ConversationPiiCategories(AddressValue); - /// Credit card number category. - public static ConversationPiiCategories CreditCardNumber { get; } = new ConversationPiiCategories(CreditCardNumberValue); + /// Credit card category. + public static ConversationPiiCategories CreditCard { get; } = new ConversationPiiCategories(CreditCardValue); /// Email category. public static ConversationPiiCategories Email { get; } = new ConversationPiiCategories(EmailValue); /// Person category. public static ConversationPiiCategories Person { get; } = new ConversationPiiCategories(PersonValue); /// Numeric identifier category. public static ConversationPiiCategories NumericIdentifier { get; } = new ConversationPiiCategories(NumericIdentifierValue); - /// Phone number category. - public static ConversationPiiCategories PhoneNumber { get; } = new ConversationPiiCategories(PhoneNumberValue); + /// Phone category. + public static ConversationPiiCategories Phone { get; } = new ConversationPiiCategories(PhoneValue); /// US social security number category. public static ConversationPiiCategories UsSocialSecurityNumber { get; } = new ConversationPiiCategories(UsSocialSecurityNumberValue); - /// Miscellaneous category. - public static ConversationPiiCategories Miscellaneous { get; } = new ConversationPiiCategories(MiscellaneousValue); /// All categories. public static ConversationPiiCategories All { get; } = new ConversationPiiCategories(AllValue); /// Default categories. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategoryExclusions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategoryExclusions.cs index a7cf7787186b..3ba61006b2ad 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategoryExclusions.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationPiiCategoryExclusions.cs @@ -23,25 +23,25 @@ public ConversationPiiCategoryExclusions(string value) } private const string AddressValue = "Address"; - private const string CreditCardNumberValue = "CreditCardNumber"; + private const string CreditCardValue = "CreditCard"; private const string EmailValue = "Email"; private const string PersonValue = "Person"; private const string NumericIdentifierValue = "NumericIdentifier"; - private const string PhoneNumberValue = "PhoneNumber"; + private const string PhoneValue = "Phone"; private const string UsSocialSecurityNumberValue = "USSocialSecurityNumber"; /// Address category. public static ConversationPiiCategoryExclusions Address { get; } = new ConversationPiiCategoryExclusions(AddressValue); - /// Credit card number category. - public static ConversationPiiCategoryExclusions CreditCardNumber { get; } = new ConversationPiiCategoryExclusions(CreditCardNumberValue); + /// Credit card category. + public static ConversationPiiCategoryExclusions CreditCard { get; } = new ConversationPiiCategoryExclusions(CreditCardValue); /// Email category. public static ConversationPiiCategoryExclusions Email { get; } = new ConversationPiiCategoryExclusions(EmailValue); /// Person category. public static ConversationPiiCategoryExclusions Person { get; } = new ConversationPiiCategoryExclusions(PersonValue); /// Numeric identifier category. public static ConversationPiiCategoryExclusions NumericIdentifier { get; } = new ConversationPiiCategoryExclusions(NumericIdentifierValue); - /// Phone number category. - public static ConversationPiiCategoryExclusions PhoneNumber { get; } = new ConversationPiiCategoryExclusions(PhoneNumberValue); + /// Phone category. + public static ConversationPiiCategoryExclusions Phone { get; } = new ConversationPiiCategoryExclusions(PhoneValue); /// US social security number category. public static ConversationPiiCategoryExclusions UsSocialSecurityNumber { get; } = new ConversationPiiCategoryExclusions(UsSocialSecurityNumberValue); /// Determines if two values are the same. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.Serialization.cs index 3f164373f622..5fe1c4007498 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.Serialization.cs @@ -66,6 +66,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); + if (Optional.IsDefined(Instruction)) + { + writer.WritePropertyName("instruction"u8); + writer.WriteStringValue(Instruction); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -109,6 +114,7 @@ internal static ConversationSummarizationActionContent DeserializeConversationSu StringIndexType? stringIndexType = default; SummaryLengthBucket? summaryLength = default; IList summaryAspects = default; + string instruction = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -164,6 +170,11 @@ internal static ConversationSummarizationActionContent DeserializeConversationSu summaryAspects = array; continue; } + if (property.NameEquals("instruction"u8)) + { + instruction = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -177,6 +188,7 @@ internal static ConversationSummarizationActionContent DeserializeConversationSu stringIndexType, summaryLength, summaryAspects, + instruction, serializedAdditionalRawData); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.cs index 30e6964d7584..178dadaf413f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationSummarizationActionContent.cs @@ -63,8 +63,9 @@ public ConversationSummarizationActionContent(IEnumerable summary /// String index type. /// (NOTE: Recommended to use summaryLength over sentenceCount) Controls the approximate length of the output summaries. /// Array of Summary Aspects. + /// a text field to allow customers to use natural language to describe their needs for summarization. /// Keeps track of any properties unknown to the library. - internal ConversationSummarizationActionContent(bool? loggingOptOut, string modelVersion, int? sentenceCount, StringIndexType? stringIndexType, SummaryLengthBucket? summaryLength, IList summaryAspects, IDictionary serializedAdditionalRawData) + internal ConversationSummarizationActionContent(bool? loggingOptOut, string modelVersion, int? sentenceCount, StringIndexType? stringIndexType, SummaryLengthBucket? summaryLength, IList summaryAspects, string instruction, IDictionary serializedAdditionalRawData) { LoggingOptOut = loggingOptOut; ModelVersion = modelVersion; @@ -72,6 +73,7 @@ internal ConversationSummarizationActionContent(bool? loggingOptOut, string mode StringIndexType = stringIndexType; SummaryLength = summaryLength; SummaryAspects = summaryAspects; + Instruction = instruction; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -92,5 +94,7 @@ internal ConversationSummarizationActionContent() public SummaryLengthBucket? SummaryLength { get; set; } /// Array of Summary Aspects. public IList SummaryAspects { get; } + /// a text field to allow customers to use natural language to describe their needs for summarization. + public string Instruction { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.Serialization.cs new file mode 100644 index 000000000000..05ac369ffc42 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Models +{ + public partial class EntityMaskTypePolicyType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityMaskTypePolicyType)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + EntityMaskTypePolicyType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityMaskTypePolicyType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityMaskTypePolicyType(document.RootElement, options); + } + + internal static EntityMaskTypePolicyType DeserializeEntityMaskTypePolicyType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RedactionPolicyKind policyKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyKind"u8)) + { + policyKind = new RedactionPolicyKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityMaskTypePolicyType(policyKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityMaskTypePolicyType)} does not support writing '{options.Format}' format."); + } + } + + EntityMaskTypePolicyType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityMaskTypePolicyType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityMaskTypePolicyType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new EntityMaskTypePolicyType FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityMaskTypePolicyType(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.cs new file mode 100644 index 000000000000..2345cff7d3f5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/EntityMaskTypePolicyType.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Models +{ + /// Represents the policy of masking PII with the entity type. + public partial class EntityMaskTypePolicyType : BaseRedactionPolicy + { + /// Initializes a new instance of . + public EntityMaskTypePolicyType() + { + PolicyKind = RedactionPolicyKind.EntityMask; + } + + /// Initializes a new instance of . + /// The entity RedactionPolicy object kind. + /// Keeps track of any properties unknown to the library. + internal EntityMaskTypePolicyType(RedactionPolicyKind policyKind, IDictionary serializedAdditionalRawData) : base(policyKind, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.Serialization.cs index d5bb88576ca7..6f9b007511c6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.Serialization.cs @@ -49,6 +49,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNumberValue(Length); writer.WritePropertyName("confidenceScore"u8); writer.WriteNumberValue(ConfidenceScore); + if (Optional.IsDefined(Mask)) + { + writer.WritePropertyName("mask"u8); + writer.WriteStringValue(Mask); + } + if (Optional.IsDefined(MaskOffset)) + { + writer.WritePropertyName("maskOffset"u8); + writer.WriteNumberValue(MaskOffset.Value); + } + if (Optional.IsDefined(MaskLength)) + { + writer.WritePropertyName("maskLength"u8); + writer.WriteNumberValue(MaskLength.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -92,6 +107,9 @@ internal static NamedEntity DeserializeNamedEntity(JsonElement element, ModelRea int offset = default; int length = default; double confidenceScore = default; + string mask = default; + int? maskOffset = default; + int? maskLength = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -126,6 +144,29 @@ internal static NamedEntity DeserializeNamedEntity(JsonElement element, ModelRea confidenceScore = property.Value.GetDouble(); continue; } + if (property.NameEquals("mask"u8)) + { + mask = property.Value.GetString(); + continue; + } + if (property.NameEquals("maskOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maskOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maskLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maskLength = property.Value.GetInt32(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -139,6 +180,9 @@ internal static NamedEntity DeserializeNamedEntity(JsonElement element, ModelRea offset, length, confidenceScore, + mask, + maskOffset, + maskLength, serializedAdditionalRawData); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.cs index f8079487a0a5..3e60776d7584 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NamedEntity.cs @@ -71,8 +71,11 @@ internal NamedEntity(string text, string category, int offset, int length, doubl /// Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned. /// Length for the entity text. Use of different 'stringIndexType' values can affect the length returned. /// Confidence score between 0 and 1 of the extracted entity. + /// Exact mask text to mask the PII entity. + /// Offset of the mask text. + /// Length of the mask text. /// Keeps track of any properties unknown to the library. - internal NamedEntity(string text, string category, string subcategory, int offset, int length, double confidenceScore, IDictionary serializedAdditionalRawData) + internal NamedEntity(string text, string category, string subcategory, int offset, int length, double confidenceScore, string mask, int? maskOffset, int? maskLength, IDictionary serializedAdditionalRawData) { Text = text; Category = category; @@ -80,6 +83,9 @@ internal NamedEntity(string text, string category, string subcategory, int offse Offset = offset; Length = length; ConfidenceScore = confidenceScore; + Mask = mask; + MaskOffset = maskOffset; + MaskLength = maskLength; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -100,5 +106,11 @@ internal NamedEntity() public int Length { get; } /// Confidence score between 0 and 1 of the extracted entity. public double ConfidenceScore { get; } + /// Exact mask text to mask the PII entity. + public string Mask { get; } + /// Offset of the mask text. + public int? MaskOffset { get; } + /// Length of the mask text. + public int? MaskLength { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.Serialization.cs new file mode 100644 index 000000000000..dfad59816695 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Models +{ + public partial class NoMaskPolicyType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NoMaskPolicyType)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + NoMaskPolicyType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NoMaskPolicyType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNoMaskPolicyType(document.RootElement, options); + } + + internal static NoMaskPolicyType DeserializeNoMaskPolicyType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RedactionPolicyKind policyKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyKind"u8)) + { + policyKind = new RedactionPolicyKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NoMaskPolicyType(policyKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NoMaskPolicyType)} does not support writing '{options.Format}' format."); + } + } + + NoMaskPolicyType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNoMaskPolicyType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NoMaskPolicyType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new NoMaskPolicyType FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNoMaskPolicyType(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.cs new file mode 100644 index 000000000000..2ccc30399781 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/NoMaskPolicyType.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Models +{ + /// Represents the policy of not masking found PII. + public partial class NoMaskPolicyType : BaseRedactionPolicy + { + /// Initializes a new instance of . + public NoMaskPolicyType() + { + PolicyKind = RedactionPolicyKind.NoMask; + } + + /// Initializes a new instance of . + /// The entity RedactionPolicy object kind. + /// Keeps track of any properties unknown to the library. + internal NoMaskPolicyType(RedactionPolicyKind policyKind, IDictionary serializedAdditionalRawData) : base(policyKind, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RedactionPolicyKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RedactionPolicyKind.cs new file mode 100644 index 000000000000..18f75a5d2d9a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RedactionPolicyKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Models +{ + /// Kinds of redaction policies supported. + internal readonly partial struct RedactionPolicyKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RedactionPolicyKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoMaskValue = "noMask"; + private const string CharacterMaskValue = "characterMask"; + private const string EntityMaskValue = "entityMask"; + + /// Do not mask detected entities. + public static RedactionPolicyKind NoMask { get; } = new RedactionPolicyKind(NoMaskValue); + /// Mask detected entities with redaction character. + public static RedactionPolicyKind CharacterMask { get; } = new RedactionPolicyKind(CharacterMaskValue); + /// Mask detected entities with entity type. + public static RedactionPolicyKind EntityMask { get; } = new RedactionPolicyKind(EntityMaskValue); + /// Determines if two values are the same. + public static bool operator ==(RedactionPolicyKind left, RedactionPolicyKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RedactionPolicyKind left, RedactionPolicyKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RedactionPolicyKind(string value) => new RedactionPolicyKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RedactionPolicyKind other && Equals(other); + /// + public bool Equals(RedactionPolicyKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RegexKey.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RegexKey.cs index d0c65e7179d8..0df90d9a22ac 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RegexKey.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/RegexKey.cs @@ -23,7 +23,7 @@ internal RegexKey() /// The extra information object kind. /// Keeps track of any properties unknown to the library. /// The key of the regex pattern used in extracting the entity. - /// The .NET regex pattern used in extracting the entity. Please visit https://docs.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. + /// The .NET regex pattern used in extracting the entity. Please visit https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. internal RegexKey(ExtraInformationKind extraInformationKind, IDictionary serializedAdditionalRawData, string key, string regexPattern) : base(extraInformationKind, serializedAdditionalRawData) { Key = key; @@ -32,7 +32,7 @@ internal RegexKey(ExtraInformationKind extraInformationKind, IDictionary The key of the regex pattern used in extracting the entity. public string Key { get; } - /// The .NET regex pattern used in extracting the entity. Please visit https://docs.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. + /// The .NET regex pattern used in extracting the entity. Please visit https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions for more information about .NET regular expressions. public string RegexPattern { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.Serialization.cs new file mode 100644 index 000000000000..a4d01a2e7014 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Models +{ + internal partial class UnknownBaseRedactionPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + BaseRedactionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBaseRedactionPolicy(document.RootElement, options); + } + + internal static UnknownBaseRedactionPolicy DeserializeUnknownBaseRedactionPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RedactionPolicyKind policyKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyKind"u8)) + { + policyKind = new RedactionPolicyKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownBaseRedactionPolicy(policyKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support writing '{options.Format}' format."); + } + } + + BaseRedactionPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBaseRedactionPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BaseRedactionPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownBaseRedactionPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownBaseRedactionPolicy(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.cs new file mode 100644 index 000000000000..07561d15dc2c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/UnknownBaseRedactionPolicy.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Models +{ + /// Unknown version of BaseRedactionPolicy. + internal partial class UnknownBaseRedactionPolicy : BaseRedactionPolicy + { + /// Initializes a new instance of . + /// The entity RedactionPolicy object kind. + /// Keeps track of any properties unknown to the library. + internal UnknownBaseRedactionPolicy(RedactionPolicyKind policyKind, IDictionary serializedAdditionalRawData) : base(policyKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownBaseRedactionPolicy() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationsClientLiveTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationsClientLiveTests.cs index 6caf207cc0fd..7bd55533ac52 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationsClientLiveTests.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/ConversationsClientLiveTests.cs @@ -322,5 +322,248 @@ public async Task AnalyzeConversation_ConversationSummarization() } } } + + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithCharacterMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + // Create a CharacterMaskPolicyType with a custom masking character + var redactionPolicy = new CharacterMaskPolicyType + { + RedactionCharacter = RedactionCharacter.Asterisk + }; + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with CharacterMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Character Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + Assert.That(redactedText, Does.Contain("*"), + $"Expected redacted text to contain '*' but got: {redactedText}"); + } + } + } + } + } + } + + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithEntityMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + // Create an EntityMaskTypePolicyType + var redactionPolicy = new EntityMaskTypePolicyType(); + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with EntityMaskTypePolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Entity Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + // Case-insensitive pattern to match entity mask variations + string expectedMaskPattern = $@"\[{entity.Category}-?\d*\]"; + + // Perform case-insensitive regex match + StringAssert.IsMatch("(?i)" + expectedMaskPattern, redactedText, + $"Expected redacted text to contain an entity mask similar to '[{entity.Category}]' but got: {redactedText}"); + } + } + } + } + } + } + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithNoMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List detectedEntities = new(); + + // Create a NoMaskPolicyType (PII should be detected but not redacted) + var redactionPolicy = new NoMaskPolicyType(); + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with NoMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with No Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string originalText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Original Text: {originalText}"); + + // Ensure PII is detected + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + detectedEntities.Add(entity.Text); + Assert.That(originalText, Does.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be present but was not found in: {originalText}"); + } + } + } + } + } + } + // Ensure PII was detected + Assert.NotZero(detectedEntities.Count); + + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs index 1ba9ef786043..3f584ad613a7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs @@ -377,6 +377,134 @@ public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeCon Response response = await client.AnalyzeConversationAsync(analyzeConversationInput); } + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIICharacterMaskTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIICharacterMaskTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIICharacterMaskTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIICharacterMaskTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIEntityMaskTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIEntityMaskTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIEntityMaskTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIEntityMaskTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + [Test] [Ignore("Only validating compilation of examples")] public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIExclusionTaskStatusRequest() @@ -441,6 +569,70 @@ public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobS Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); } + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIINoMaskTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIINoMaskTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIINoMaskTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIINoMaskTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + [Test] [Ignore("Only validating compilation of examples")] public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIRedactionCharTaskStatusRequest() @@ -763,7 +955,7 @@ public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobS [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIICharacterMask() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -833,9 +1025,14 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulC parameters = new { modelVersion = "latest", -excludePiiCategories = new object[] +piiCategories = new object[] { -"Person" +"All" +}, +redactionPolicy = new +{ +policyKind = "characterMask", +redactionCharacter = "-", }, redactionSource = "lexical", redactAudioTiming = true, @@ -848,7 +1045,7 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulC [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIICharacterMask_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -918,9 +1115,14 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_Succe parameters = new { modelVersion = "latest", -excludePiiCategories = new object[] +piiCategories = new object[] { -"Person" +"All" +}, +redactionPolicy = new +{ +policyKind = "characterMask", +redactionCharacter = "-", }, redactionSource = "lexical", redactAudioTiming = true, @@ -933,7 +1135,7 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_Succe [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIICharacterMask_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -984,9 +1186,13 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulC ActionContent = new ConversationPiiActionContent { ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, -ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +RedactionPolicy = new CharacterMaskPolicyType +{ +RedactionCharacter = RedactionCharacter.Minus, +}, }, Name = "Conversation PII", } @@ -999,7 +1205,7 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulC [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIICharacterMask_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -1050,9 +1256,939 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_Succe ActionContent = new ConversationPiiActionContent { ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, RedactAudioTiming = true, RedactionSource = TranscriptContentType.Lexical, -ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +RedactionPolicy = new CharacterMaskPolicyType +{ +RedactionCharacter = RedactionCharacter.Minus, +}, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIEntityMask() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionPolicy = new +{ +policyKind = "entityMask", +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIEntityMask_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionPolicy = new +{ +policyKind = "entityMask", +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIEntityMask_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionPolicy = new EntityMaskTypePolicyType(), +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIEntityMask_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionPolicy = new EntityMaskTypePolicyType(), +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +excludePiiCategories = new object[] +{ +"Person" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +excludePiiCategories = new object[] +{ +"Person" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIINoMask() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionPolicy = new +{ +policyKind = "noMask", +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIINoMask_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000L, +duration = 2700000L, +}, +new +{ +word = "morning", +offset = 4500000L, +duration = 920000L, +}, +new +{ +word = "john", +offset = 590000L, +duration = 2700000L, +}, +new +{ +word = "doe", +offset = 6300000L, +duration = 920000L, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionPolicy = new +{ +policyKind = "noMask", +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIINoMask_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionPolicy = new NoMaskPolicyType(), +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIINoMask_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000L, +Duration = 2700000L, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000L, +Duration = 920000L, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000L, +Duration = 2700000L, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000L, +Duration = 920000L, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionPolicy = new NoMaskPolicyType(), }, Name = "Conversation PII", } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisTestBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisTestBase.cs index d0df1d8b64b1..5294493fc073 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisTestBase.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisTestBase.cs @@ -11,6 +11,8 @@ namespace Azure.AI.Language.Conversations.Tests /// /// The type of client being tested. [ClientTestFixture( + ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview, + ConversationsClientOptions.ServiceVersion.V2024_11_01, ConversationsClientOptions.ServiceVersion.V2024_05_01, ConversationsClientOptions.ServiceVersion.V2023_04_01, ConversationsClientOptions.ServiceVersion.V2022_05_01)] diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample7_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample7_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.cs new file mode 100644 index 000000000000..b22a01809b70 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample7_AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Models; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Tests.Samples +{ + public partial class ConversationAnalysisClientSamples + { + [SyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public void AnalyzeConversation_ConversationPii_WithCharacterMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + // Create a CharacterMaskPolicyType with a custom masking character + var redactionPolicy = new CharacterMaskPolicyType + { + RedactionCharacter = RedactionCharacter.Asterisk + }; + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with CharacterMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Character Mask Policy" + } + }; + + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + Response analyzeConversationOperation = client.AnalyzeConversations(data); + + #region Snippet:AnalyzeConversation_ConversationPiiWithCharacterMaskPolicySync + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + #endregion + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + Assert.That(redactedText, Does.Contain("*"), + $"Expected redacted text to contain '*' but got: {redactedText}"); + } + } + } + } + } + } + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + + [AsyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithCharacterMaskPolicy() + { + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + #region Snippet:AnalyzeConversation_ConversationPiiWithCharacterMaskPolicy + var redactionPolicy = new CharacterMaskPolicyType + { + RedactionCharacter = RedactionCharacter.Asterisk + }; + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with CharacterMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Character Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + Assert.That(redactedText, Does.Contain("*"), + $"Expected redacted text to contain '*' but got: {redactedText}"); + } + } + } + } + } + } + #endregion + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample8_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample8_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.cs new file mode 100644 index 000000000000..25106b4c7dab --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample8_AnalyzeConversation_ConversationPiiWithEntityMaskPolicy.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Models; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Tests.Samples +{ + public partial class ConversationAnalysisClientSamples + { + [SyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public void AnalyzeConversation_ConversationPii_WithEntityMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + // Create an EntityMaskTypePolicyType + var redactionPolicy = new EntityMaskTypePolicyType(); + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with EntityMaskTypePolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Entity Mask Policy" + } + }; + + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + Response analyzeConversationOperation = client.AnalyzeConversations(data); + #region Snippet:AnalyzeConversation_ConversationPiiWithEntityMaskPolicySync + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + #endregion + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + // Case-insensitive pattern to match entity mask variations + string expectedMaskPattern = $@"\[{entity.Category}-?\d*\]"; + + // Perform case-insensitive regex match + StringAssert.IsMatch("(?i)" + expectedMaskPattern, redactedText, + $"Expected redacted text to contain an entity mask similar to '[{entity.Category}]' but got: {redactedText}"); + } + } + } + } + } + } + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + + [AsyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithEntityMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List redactedTexts = new(); + + #region Snippet:AnalyzeConversation_ConversationPiiWithEntityMaskPolicy + var redactionPolicy = new EntityMaskTypePolicyType(); + + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with EntityMaskTypePolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with Entity Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string redactedText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Redacted Text: {redactedText}"); + + // Only verify redaction if the original sentence had PII + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + Assert.That(redactedText, Does.Not.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be redacted but found in: {redactedText}"); + + // Case-insensitive pattern to match entity mask variations + string expectedMaskPattern = $@"\[{entity.Category}-?\d*\]"; + + // Perform case-insensitive regex match + StringAssert.IsMatch("(?i)" + expectedMaskPattern, redactedText, + $"Expected redacted text to contain an entity mask similar to '[{entity.Category}]' but got: {redactedText}"); + } + } + } + } + } + } + #endregion + + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample9_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample9_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.cs new file mode 100644 index 000000000000..240993c18938 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Sample9_AnalyzeConversation_ConversationPiiWithNoMaskPolicy.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Models; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Tests.Samples +{ + public partial class ConversationAnalysisClientSamples + { + [SyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public void AnalyzeConversation_ConversationPii_WithNoMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List detectedEntities = new(); + + // Create a NoMaskPolicyType (PII should be detected but not redacted) + var redactionPolicy = new NoMaskPolicyType(); + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with NoMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with No Mask Policy" + } + }; + + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + Response analyzeConversationOperation = client.AnalyzeConversations(data); + + #region Snippet:AnalyzeConversation_ConversationPiiWithNoMaskPolicySync + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + #endregion + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string originalText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Original Text: {originalText}"); + + // Ensure PII is detected + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + detectedEntities.Add(entity.Text); + Assert.That(originalText, Does.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be present but was not found in: {originalText}"); + } + } + } + } + } + } + // Ensure PII was detected + Assert.NotZero(detectedEntities.Count); + + // Verify the HTTP response is successful + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + + [AsyncOnly] + [RecordedTest] + [ServiceVersion(Min = ConversationsClientOptions.ServiceVersion.V2024_11_15_Preview)] + public async Task AnalyzeConversationAsync_ConversationPii_WithNoMaskPolicy() + { + // Arrange: Initialize client and input + ConversationAnalysisClient client = Client; + List detectedEntities = new(); + + #region Snippet:AnalyzeConversation_ConversationPiiWithNoMaskPolicy + var redactionPolicy = new NoMaskPolicyType(); + + // Simulate input conversation + MultiLanguageConversationInput input = new MultiLanguageConversationInput( + new List + { + new TextConversation("1", "en", new List + { + new TextConversationItem(id: "1", participantId: "Agent_1", text: "Can you provide your name?"), + new TextConversationItem(id: "2", participantId: "Customer_1", text: "Hi, my name is John Doe."), + new TextConversationItem(id: "3", participantId: "Agent_1", text: "Thank you John, that has been updated in our system.") + }) + }); + + // Add action with NoMaskPolicyType + List actions = new List + { + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + RedactionPolicy = redactionPolicy + }, + Name = "Conversation PII with No Mask Policy" + } + }; + + // Create input for analysis + AnalyzeConversationOperationInput data = new AnalyzeConversationOperationInput(input, actions); + + // Act: Perform the PII analysis + Response analyzeConversationOperation = await client.AnalyzeConversationsAsync(data); + AnalyzeConversationOperationState operationState = analyzeConversationOperation.Value; + + // Assert: Validate the results + foreach (AnalyzeConversationOperationResult operationResult in operationState.Actions.Items) + { + Console.WriteLine($"Operation action name: {operationResult.Name}"); + + if (operationResult is ConversationPiiOperationResult piiOperationResult) + { + foreach (ConversationalPiiResult conversation in piiOperationResult.Results.Conversations) + { + Console.WriteLine($"Conversation: #{conversation.Id}"); + foreach (ConversationPiiItemResult item in conversation.ConversationItems) + { + string originalText = item.RedactedContent?.Text ?? string.Empty; + Console.WriteLine($"Original Text: {originalText}"); + + // Ensure PII is detected + if (item.Entities.Any()) + { + foreach (var entity in item.Entities) + { + detectedEntities.Add(entity.Text); + Assert.That(originalText, Does.Contain(entity.Text), + $"Expected entity '{entity.Text}' to be present but was not found in: {originalText}"); + } + } + } + } + } + } + #endregion + + Assert.NotZero(detectedEntities.Count); + Assert.That(analyzeConversationOperation.GetRawResponse().Status, Is.EqualTo(200)); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tsp-location.yaml index 5d1e84c0222b..ee690a9b1f05 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/Language.Conversations -commit: 36651c812f1816316250b4ee3c02433e6d60576f +commit: c9a4dc04527f7fdb4a944e2c392f2de280ef7cae repo: Azure/azure-rest-api-specs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md index 49d972499e80..1866c3493f82 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md @@ -367,5 +367,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [questionanswering_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/README.md [migration_guide]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/MigrationGuide.md [questionansweringauthoring_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringAuthoringClient.cs - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcognitivelanguage%2FAzure.AI.Language.QuestionAnswering%2FREADME.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md index 02503f2ac0d3..2b52a4092eb5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -272,4 +272,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_cli]: https://docs.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs index d24cda3766b3..9aff1eb0d6b0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs @@ -13,19 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - public partial class ChatCompletionsNamedToolChoiceFunction : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) -======== public partial class DocumentEntityRecognitionEvaluationResult : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -36,16 +28,6 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); -======== var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { @@ -59,7 +41,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,21 +58,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - ChatCompletionsNamedToolChoiceFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatCompletionsNamedToolChoiceFunction(document.RootElement, options); - } - - internal static ChatCompletionsNamedToolChoiceFunction DeserializeChatCompletionsNamedToolChoiceFunction(JsonElement element, ModelReaderWriterOptions options = null) -======== DocumentEntityRecognitionEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -105,7 +71,6 @@ DocumentEntityRecognitionEvaluationResult IJsonModel>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -113,20 +78,11 @@ internal static DocumentEntityRecognitionEvaluationResult DeserializeDocumentEnt { return null; } -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - string name = default; -======== IReadOnlyList entities = default; ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); -======== if (property.NameEquals("entities"u8)) { List array = new List(); @@ -135,7 +91,6 @@ internal static DocumentEntityRecognitionEvaluationResult DeserializeDocumentEnt array.Add(DocumentEntityRegionEvaluationResult.DeserializeDocumentEntityRegionEvaluationResult(item, options)); } entities = array; ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs continue; } if (options.Format != "W") @@ -144,36 +99,18 @@ internal static DocumentEntityRecognitionEvaluationResult DeserializeDocumentEnt } } serializedAdditionalRawData = rawDataDictionary; -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - return new ChatCompletionsNamedToolChoiceFunction(name, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; -======== return new DocumentEntityRecognitionEvaluationResult(entities, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support writing '{options.Format}' format."); - } - } - - ChatCompletionsNamedToolChoiceFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; -======== throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support writing '{options.Format}' format."); } } @@ -181,30 +118,12 @@ ChatCompletionsNamedToolChoiceFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); -<<<<<<<< HEAD:sdk/ai/Azure.AI.Inference/src/Generated/ChatCompletionsNamedToolChoiceFunction.Serialization.cs - return DeserializeChatCompletionsNamedToolChoiceFunction(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ChatCompletionsNamedToolChoiceFunction)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ChatCompletionsNamedToolChoiceFunction FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatCompletionsNamedToolChoiceFunction(document.RootElement); -======== return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement, options); } default: @@ -220,7 +139,6 @@ internal static DocumentEntityRecognitionEvaluationResult FromResponse(Response { using var document = JsonDocument.Parse(response.Content); return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement); ->>>>>>>> main:sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md index 1875ec19d9ed..4453dd46d339 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md @@ -275,4 +275,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_cli]: https://learn.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Text/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs new file mode 100644 index 000000000000..b6163bdd929f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/AnalyzeTextDynamicClassificationResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text +{ + public partial class AnalyzeTextDynamicClassificationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeTextDynamicClassificationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("results"u8); + writer.WriteObjectValue(Results, options); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AnalyzeTextDynamicClassificationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeTextDynamicClassificationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnalyzeTextDynamicClassificationResult(document.RootElement, options); + } + + internal static AnalyzeTextDynamicClassificationResult DeserializeAnalyzeTextDynamicClassificationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DynamicClassificationResult results = default; + AnalyzeTextResultsKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("results"u8)) + { + results = DynamicClassificationResult.DeserializeDynamicClassificationResult(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new AnalyzeTextResultsKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnalyzeTextDynamicClassificationResult(kind, serializedAdditionalRawData, results); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnalyzeTextDynamicClassificationResult)} does not support writing '{options.Format}' format."); + } + } + + AnalyzeTextDynamicClassificationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAnalyzeTextDynamicClassificationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnalyzeTextDynamicClassificationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AnalyzeTextDynamicClassificationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAnalyzeTextDynamicClassificationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitiveservices/Language.TextAnalytics/src/README.md b/sdk/cognitiveservices/Language.TextAnalytics/src/README.md index fa7b9a4bea4d..b28344c4c641 100644 --- a/sdk/cognitiveservices/Language.TextAnalytics/src/README.md +++ b/sdk/cognitiveservices/Language.TextAnalytics/src/README.md @@ -12,6 +12,3 @@ * .NET Framework 4.5.2 * Netstandard 1.4, based on the NetCore framework - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcognitiveservices%2FLanguage.TextAnalytics%2Fsrc%2FReadme.png) diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs index bc1af3c39780..f9a7f189061f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs @@ -32,14 +32,14 @@ public async Task CreateCallToACSGetCallAndHangUpCallTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -84,7 +84,7 @@ public async Task CreateCallToACSGetCallAndHangUpCallTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -102,14 +102,14 @@ public async Task CreateCallAndReject() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions( @@ -155,7 +155,7 @@ public async Task CreateCallAndReject() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -177,14 +177,14 @@ public async Task CreateCallToAcsConnectCallAndHangupForEveryoneTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -256,7 +256,7 @@ public async Task CreateCallToAcsConnectCallAndHangupForEveryoneTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -278,14 +278,14 @@ public async Task CreateCallToAcsConnectCallAndHangupTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -353,7 +353,7 @@ public async Task CreateCallToAcsConnectCallAndHangupTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs index e1510b77b487..ba4b98ac3899 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs @@ -32,14 +32,14 @@ public async Task RemoveAUserCallTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -105,7 +105,7 @@ public async Task RemoveAUserCallTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -128,12 +128,12 @@ public async Task CancelAddParticipantTest() var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); var client = CreateInstrumentedCallAutomationClientWithConnectionString(user); var targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -189,7 +189,7 @@ public async Task CancelAddParticipantTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs index e350085b5fb5..1ff94f966960 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs @@ -126,7 +126,7 @@ public async Task DialogOperationsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -248,7 +248,7 @@ public async Task DifferingConcurrentDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -359,7 +359,7 @@ public async Task IdenticalDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -483,7 +483,7 @@ public async Task SubsequentDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -571,7 +571,7 @@ public async Task StopNonexistingDialogTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs index ad73a890449f..209409544920 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs @@ -138,7 +138,7 @@ public async Task continuousDtmfDetectionAndSendDtmfTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -150,13 +150,13 @@ public async Task HoldUnholdParticipantInACallTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId); callConnectionId = result.CallerCallConnectionId; var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); @@ -216,7 +216,7 @@ public async Task HoldUnholdParticipantInACallTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -235,14 +235,14 @@ public async Task CreateCallWithMediaStreamingTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( @@ -281,7 +281,7 @@ public async Task CreateCallWithMediaStreamingTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -300,14 +300,14 @@ public async Task AnswerCallWithMediaStreamingTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( @@ -346,7 +346,7 @@ public async Task AnswerCallWithMediaStreamingTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -414,7 +414,7 @@ public async Task CreateCallWithMediaStreamingWithAudioFormatPcm24KMonoTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -482,7 +482,7 @@ public async Task AnswerCallWithMediaStreamingWithAudioFormatPcm24KMonoTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -501,14 +501,14 @@ public async Task AnswerCallWithMediaStreamingUnmixedTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( @@ -547,7 +547,7 @@ public async Task AnswerCallWithMediaStreamingUnmixedTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs index 4d0c83e66829..ff6a54549ddd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs @@ -18,7 +18,7 @@ public CallRecordingAutomatedLiveTests(bool isAsync) : base(isAsync) { } - [Ignore (reason: "Recording is currently broken with error Removing modality controller as this conversation has ended. Waiting on fix for this")] + [Ignore(reason: "Recording is currently broken with error Removing modality controller as this conversation has ended. Waiting on fix for this")] [RecordedTest] public async Task RecordingOperationsTest() { @@ -31,7 +31,7 @@ public async Task RecordingOperationsTest() bool stopRecording = false; // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + string uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -111,7 +111,7 @@ public async Task RecordingOperationsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -134,14 +134,14 @@ public async Task CreateACSCallAndUnmixedAudioTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -209,7 +209,7 @@ public async Task CreateACSCallAndUnmixedAudioTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -231,14 +231,14 @@ public async Task CreateACSCallUnmixedAudioAffinityTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -309,7 +309,7 @@ public async Task CreateACSCallUnmixedAudioAffinityTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingTests.cs index e8f90df0f85f..98faaf2f5a69 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingTests.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using System.Net; using System.Threading.Tasks; -using NUnit.Framework; using Azure.Communication.CallAutomation.Tests.Infrastructure; +using NUnit.Framework; namespace Azure.Communication.CallAutomation.Tests.CallRecordings { @@ -176,7 +176,7 @@ private CallRecording getMockCallRecording(int statusCode, string? responseConte { return new[] { - new Func?[] + new Func?[] { callRecording => () => callRecording.Start( diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs index d68039e99f48..d91089a40d73 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs @@ -25,7 +25,7 @@ internal class EventRecordPlayer : IDisposable, IAsyncDisposable public bool IsRecording { get; private set; } public IEnumerable Entries => _recording.Entries; - public List KeysToSanitize { get; } = new List() { "rawId", "id", "botAppId", "ivrContext" }; + public List KeysToSanitize { get; } = new List() { "rawId", "id", "botAppId", "ivrContext", "callerDisplayName", "incomingCallContext" }; public EventRecordPlayer(string sessionFilePath) { @@ -151,7 +151,14 @@ private string SanitizeRecordedEvent(string message) var result = new Dictionary(); while (objEnumerator.MoveNext()) { - result.Add(objEnumerator.Current.Name, Scrub(objEnumerator.Current.Value, 0, MaxDepth)); + if (KeysToSanitize.Contains(objEnumerator.Current.Name)) + { + result.Add(objEnumerator.Current.Name, "Sanitized"); + } + else + { + result.Add(objEnumerator.Current.Name, Scrub(objEnumerator.Current.Value, 0, MaxDepth)); + } } var resultAsString = JsonSerializer.Serialize(result); diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs index f5213d19c912..cb7e5b8fdd27 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs @@ -268,6 +268,35 @@ public void CallConnectedEventParsed_Test() } } + //[Test] + //public void ConnectFailedEventParsed_Test() + //{ + // // arrange + // var callConnectionId = "callConnectionId"; + // var serverCallId = "serverCallId"; + // var correlationId = "correlationId"; + // var @event = CallAutomationModelFactory.ConnectFailed(callConnectionId, serverCallId, correlationId); + // JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + // string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); + + // // act + // var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.ConnectFailed"); + + // // assert + // if (parsedEvent is ConnectFailed connectFailed) + // { + // Assert.AreEqual(callConnectionId, connectFailed.CallConnectionId); + // Assert.AreEqual(serverCallId, connectFailed.ServerCallId); + // Assert.AreEqual(correlationId, connectFailed.CorrelationId); + // Assert.IsNull(connectFailed.OperationContext); + // Assert.IsNull(connectFailed.ResultInformation); + // } + // else + // { + // Assert.Fail("Event parsed wrongfully"); + // } + //} + [Test] public void CallDisconnectedEventParsed_Test() { @@ -710,7 +739,7 @@ public void GetRecognizeResultFromRecognizeCompletedWithChoice_Test() Assert.AreEqual("correlationId", recognizeCompleted.CorrelationId); Assert.AreEqual("correlationId", recognizeCompleted.CorrelationId); Assert.AreEqual("serverCallId", recognizeCompleted.ServerCallId); - // Assert.AreEqual(200, recognizeCompleted.ResultInformation?.Code); + // Assert.AreEqual(200, recognizeCompleted.ResultInformation?.Code); if (recognizeResult is ChoiceResult choiceRecongizedResult) { Assert.AreEqual("testLabel", choiceRecongizedResult.Label); @@ -1030,7 +1059,6 @@ public void CreateCallFailedEventParsed_Test() JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.CreateCallFailed"); - if (parsedEvent is CreateCallFailed createCallFailed) { Assert.AreEqual("operationContext", createCallFailed.OperationContext); @@ -1045,33 +1073,6 @@ public void CreateCallFailedEventParsed_Test() } } - [Test] - public void AnswerFailedEventParsed_Test() - { - AnswerFailed @event = CallAutomationModelFactory.AnswerFailed( - callConnectionId: "callConnectionId", - serverCallId: "serverCallId", - correlationId: "correlationId", - resultInformation: new ResultInformation(code: 400, subCode: 8510, message: "Action failed, some error."), - operationContext: "operationContext"); - JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); - var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.AnswerFailed"); - - if (parsedEvent is AnswerFailed answerFailed) - { - Assert.AreEqual("operationContext", answerFailed.OperationContext); - Assert.AreEqual("callConnectionId", answerFailed.CallConnectionId); - Assert.AreEqual("correlationId", answerFailed.CorrelationId); - Assert.AreEqual("serverCallId", answerFailed.ServerCallId); - Assert.AreEqual(400, answerFailed.ResultInformation?.Code); - } - else - { - Assert.Fail("Event parsed wrongfully"); - } - } - [Test] public void TranscriptionStartedEventParsed_Test() { diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs index 3fa9b72529ff..b3f41637098a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs @@ -199,7 +199,7 @@ protected async Task WaitForOperationCompletion(int milliSeconds = 10000) await Task.Delay(milliSeconds); } - protected async Task CleanUpCall(CallAutomationClient client, string? callConnectionId) + protected async Task CleanUpCall(CallAutomationClient client, string? callConnectionId, string? uniqueId) { try { @@ -213,6 +213,11 @@ protected async Task CleanUpCall(CallAutomationClient client, string? callConnec } } } + + if (!string.IsNullOrEmpty(uniqueId)) + { + await DeRegisterCallBackWithDispatcher(uniqueId); + } } catch { @@ -353,7 +358,7 @@ private async Task RegisterCallBackWithDispatcher(string uniqueId) } } - private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(IEnumerable ids) + private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(string uniqueId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -362,25 +367,22 @@ private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(IEnumerable TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLAUTOMATION_INTERACTION_LIVE_TESTS")== "TRUE"; - - /// - /// Creates a - /// - /// The instrumented . - protected CallAutomationClient CreateInstrumentedCallAutomationClientWithConnectionString() - { - var connectionString = TestEnvironment.LiveTestStaticConnectionString; - - CallAutomationClient callAutomationClient; - if (TestEnvironment.PMAEndpoint == null || TestEnvironment.PMAEndpoint.Length == 0) - { - callAutomationClient = new CallAutomationClient(connectionString, CreateServerCallingClientOptionsWithCorrelationVectorLogs()); - } - else - { - callAutomationClient = new CallAutomationClient(new Uri(TestEnvironment.PMAEndpoint), connectionString, CreateServerCallingClientOptionsWithCorrelationVectorLogs()); - } - - return InstrumentClient(callAutomationClient); - } + => TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLAUTOMATION_INTERACTION_LIVE_TESTS") == "TRUE"; /// /// Creates a @@ -82,7 +61,8 @@ protected CommunicationIdentityClient CreateInstrumentedCommunicationIdentityCli TestEnvironment.LiveTestStaticConnectionString, InstrumentClientOptions(new CommunicationIdentityClientOptions(CommunicationIdentityClientOptions.ServiceVersion.V2023_10_01)))); - protected async Task CreateIdentityUserAsync() { + protected async Task CreateIdentityUserAsync() + { CommunicationIdentityClient communicationIdentityClient = CreateInstrumentedCommunicationIdentityClient(); return await communicationIdentityClient.CreateUserAsync().ConfigureAwait(false); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs index 8c9498d9c0c3..d9dd10d40a44 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs @@ -25,12 +25,15 @@ public abstract class CallAutomationEventProcessorTestBase protected const string TargetUser = "TARGET_USER_ID"; protected const string TransfereeUser = "TRANSFEREE_USER_ID"; protected const int defaultTestTimeout = 3; - private const string NoneMediaSubscriptionId = "null"; - private const string MediaSubscriptionId = "\"mediaSubscriptionId\""; - protected string CreateOrAnswerCallOrGetCallConnectionPayload = string.Format(DummyPayload, NoneMediaSubscriptionId); - protected string CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionPayload = string.Format(DummyPayload, MediaSubscriptionId); + private const string NoneMediaSubscription = "null"; + private const string MediaStreamingSubscription = "{" + + " \"id\": \"22c3a25a-aed5-47df-9ef9-5ba5c7b6d08e\"," + + "\"state\": \"disabled\",\"subscribedContentTypes\": [" + + "\"audio\"] }"; + protected string CreateOrAnswerCallOrGetCallConnectionPayload = string.Format(DummyPayload, NoneMediaSubscription); + protected string CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionPayload = string.Format(DummyPayload, MediaStreamingSubscription); - protected const string DummyPayload = "{{\"callConnectionId\": \"someCallConnectionId\",\"serverCallId\": \"someServerCallId\",\"targets\": [{{\"rawId\":\"targetId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"targetId\"}}}}],\"source\":{{\"rawId\":\"sourceId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"sourceId\"}}}},\"callConnectionState\": \"connecting\",\"subject\": \"dummySubject\",\"callbackUri\": \"https://bot.contoso.com/callback\",\"mediaSubscriptionId\": {0}}}"; + protected const string DummyPayload = "{{\"callConnectionId\": \"someCallConnectionId\",\"serverCallId\": \"someServerCallId\",\"targets\": [{{\"rawId\":\"targetId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"targetId\"}}}}],\"source\":{{\"rawId\":\"sourceId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"sourceId\"}}}},\"callConnectionState\": \"connecting\",\"subject\": \"dummySubject\",\"callbackUri\": \"https://bot.contoso.com/callback\",\"mediaStreamingSubscription\": {0}}}"; protected const string TransferCallOrRemoveParticipantsPayload = "{\"operationContext\": \"someOperationContext\"}"; @@ -52,7 +55,7 @@ public abstract class CallAutomationEventProcessorTestBase "\"invitationId\": \"invitationId\"" + "}"; - internal CallAutomationClient CreateMockCallAutomationClient(int responseCode, object? responseContent = null, HttpHeader[]? httpHeaders = null, CallAutomationClientOptions ? options = default) + internal CallAutomationClient CreateMockCallAutomationClient(int responseCode, object? responseContent = null, HttpHeader[]? httpHeaders = null, CallAutomationClientOptions? options = default) { var mockResponse = new MockResponse(responseCode); @@ -111,7 +114,7 @@ protected IEnumerable CreateMoakTargets(IEnumerable, System.ClientModel.Primitives.IPersistableModel + { + protected ActionBindings() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroup(string title, System.Collections.Generic.IEnumerable items) { } + public System.Collections.Generic.IList Items { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupContent(string title, System.Collections.Generic.IEnumerable groups) { } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Title { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupItem(string id, string title, string description) { } + public string Description { get { throw null; } } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AudioNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AudioNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -11,20 +58,50 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ButtonContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonContent(string id, string title) { } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ButtonSetContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonSetContent(System.Collections.Generic.IEnumerable buttons) { } + public System.Collections.Generic.IList Buttons { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CommunicationMessagesClientOptions : Azure.Core.ClientOptions { - public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2024_08_30) { } + public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2025_01_15_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_01_15_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.ActionGroupContent ActionGroupContent(string title = null, System.Collections.Generic.IEnumerable groups = null) { throw null; } public static Azure.Communication.Messages.AudioNotificationContent AudioNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.DocumentMessageContent DocumentMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.DocumentNotificationContent DocumentNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, string fileName = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.ImageMessageContent ImageMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.ImageNotificationContent ImageNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.InteractiveMessage InteractiveMessage(Azure.Communication.Messages.MessageContent header = null, Azure.Communication.Messages.TextMessageContent body = null, Azure.Communication.Messages.TextMessageContent footer = null, Azure.Communication.Messages.ActionBindings action = null) { throw null; } + public static Azure.Communication.Messages.InteractiveNotificationContent InteractiveNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.InteractiveMessage interactiveMessage = null) { throw null; } + public static Azure.Communication.Messages.LinkContent LinkContent(string title = null, System.Uri uri = null) { throw null; } public static Azure.Communication.Messages.MediaNotificationContent MediaNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.MessageReceipt MessageReceipt(string messageId = null, string to = null) { throw null; } public static Azure.Communication.Messages.MessageTemplate MessageTemplate(string name = null, string language = null, System.Collections.Generic.IEnumerable values = null, Azure.Communication.Messages.MessageTemplateBindings bindings = null) { throw null; } @@ -36,11 +113,29 @@ public static partial class CommunicationMessagesModelFactory public static Azure.Communication.Messages.MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) { throw null; } public static Azure.Communication.Messages.MessageTemplateVideo MessageTemplateVideo(string name = null, System.Uri uri = null, string caption = null, string fileName = null) { throw null; } public static Azure.Communication.Messages.NotificationContent NotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ReactionNotificationContent ReactionNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string emoji = null, string messageId = null) { throw null; } public static Azure.Communication.Messages.SendMessageResult SendMessageResult(System.Collections.Generic.IEnumerable receipts = null) { throw null; } + public static Azure.Communication.Messages.StickerNotificationContent StickerNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.TemplateNotificationContent TemplateNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.MessageTemplate template = null) { throw null; } + public static Azure.Communication.Messages.TextMessageContent TextMessageContent(string text = null) { throw null; } public static Azure.Communication.Messages.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null) { throw null; } + public static Azure.Communication.Messages.VideoMessageContent VideoMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.VideoNotificationContent VideoNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content = null) { throw null; } public static Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateItem WhatsAppMessageTemplateItem(string name = null, string language = null, Azure.Communication.Messages.MessageTemplateStatus status = default(Azure.Communication.Messages.MessageTemplateStatus), System.BinaryData content = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content = null) { throw null; } + } + public partial class DocumentMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -55,6 +150,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ImageNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -67,6 +173,43 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InteractiveMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveMessage(Azure.Communication.Messages.TextMessageContent body, Azure.Communication.Messages.ActionBindings action) { } + public Azure.Communication.Messages.ActionBindings Action { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Body { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Footer { get { throw null; } set { } } + public Azure.Communication.Messages.MessageContent Header { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InteractiveNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.InteractiveMessage interactiveMessage) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public Azure.Communication.Messages.InteractiveMessage InteractiveMessage { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkContent(string title, System.Uri uri) { } + public string Title { get { throw null; } } + public System.Uri Uri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ObsoleteAttribute("`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.")] public partial class MediaNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -80,6 +223,16 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class MessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected MessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MessageReceipt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageReceipt() { } @@ -283,6 +436,18 @@ public NotificationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredentia public virtual System.Threading.Tasks.Task> SendAsync(Azure.Communication.Messages.NotificationContent notificationContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task SendAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class ReactionNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReactionNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string emoji, string messageId) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public string Emoji { get { throw null; } } + public string MessageId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SendMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SendMessageResult() { } @@ -294,6 +459,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StickerNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StickerNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TemplateNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TemplateNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.MessageTemplate template) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -305,6 +481,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextMessageContent(string text) { } + public string Text { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TextNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string content) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -316,6 +503,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VideoMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VideoNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VideoNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -331,6 +529,28 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } namespace Azure.Communication.Messages.Models.Channels { + public partial class WhatsAppButtonActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content) { } + public Azure.Communication.Messages.ButtonSetContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppListActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content) { } + public Azure.Communication.Messages.ActionGroupContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WhatsAppMessageButtonSubType : System.IEquatable { @@ -397,6 +617,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class WhatsAppUrlActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content) { } + public Azure.Communication.Messages.LinkContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Microsoft.Extensions.Azure { diff --git a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs index d93a3a55747a..f9da96ea9481 100644 --- a/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.Messages/api/Azure.Communication.Messages.netstandard2.0.cs @@ -1,5 +1,52 @@ namespace Azure.Communication.Messages { + public abstract partial class ActionBindings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ActionBindings() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroup(string title, System.Collections.Generic.IEnumerable items) { } + public System.Collections.Generic.IList Items { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupContent(string title, System.Collections.Generic.IEnumerable groups) { } + public System.Collections.Generic.IList Groups { get { throw null; } } + public string Title { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ActionGroupItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionGroupItem(string id, string title, string description) { } + public string Description { get { throw null; } } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ActionGroupItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AudioNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AudioNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -11,20 +58,50 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ButtonContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonContent(string id, string title) { } + public string Id { get { throw null; } } + public string Title { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ButtonSetContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ButtonSetContent(System.Collections.Generic.IEnumerable buttons) { } + public System.Collections.Generic.IList Buttons { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ButtonSetContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CommunicationMessagesClientOptions : Azure.Core.ClientOptions { - public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2024_08_30) { } + public CommunicationMessagesClientOptions(Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion version = Azure.Communication.Messages.CommunicationMessagesClientOptions.ServiceVersion.V2025_01_15_Preview) { } public enum ServiceVersion { V2024_02_01 = 1, V2024_08_30 = 2, + V2025_01_15_Preview = 3, } } public static partial class CommunicationMessagesModelFactory { + public static Azure.Communication.Messages.ActionGroupContent ActionGroupContent(string title = null, System.Collections.Generic.IEnumerable groups = null) { throw null; } public static Azure.Communication.Messages.AudioNotificationContent AudioNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.DocumentMessageContent DocumentMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.DocumentNotificationContent DocumentNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, string fileName = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.ImageMessageContent ImageMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.ImageNotificationContent ImageNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.InteractiveMessage InteractiveMessage(Azure.Communication.Messages.MessageContent header = null, Azure.Communication.Messages.TextMessageContent body = null, Azure.Communication.Messages.TextMessageContent footer = null, Azure.Communication.Messages.ActionBindings action = null) { throw null; } + public static Azure.Communication.Messages.InteractiveNotificationContent InteractiveNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.InteractiveMessage interactiveMessage = null) { throw null; } + public static Azure.Communication.Messages.LinkContent LinkContent(string title = null, System.Uri uri = null) { throw null; } public static Azure.Communication.Messages.MediaNotificationContent MediaNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.MessageReceipt MessageReceipt(string messageId = null, string to = null) { throw null; } public static Azure.Communication.Messages.MessageTemplate MessageTemplate(string name = null, string language = null, System.Collections.Generic.IEnumerable values = null, Azure.Communication.Messages.MessageTemplateBindings bindings = null) { throw null; } @@ -36,11 +113,29 @@ public static partial class CommunicationMessagesModelFactory public static Azure.Communication.Messages.MessageTemplateValue MessageTemplateValue(string name = null, string kind = null) { throw null; } public static Azure.Communication.Messages.MessageTemplateVideo MessageTemplateVideo(string name = null, System.Uri uri = null, string caption = null, string fileName = null) { throw null; } public static Azure.Communication.Messages.NotificationContent NotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string kind = null) { throw null; } + public static Azure.Communication.Messages.ReactionNotificationContent ReactionNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string emoji = null, string messageId = null) { throw null; } public static Azure.Communication.Messages.SendMessageResult SendMessageResult(System.Collections.Generic.IEnumerable receipts = null) { throw null; } + public static Azure.Communication.Messages.StickerNotificationContent StickerNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.TemplateNotificationContent TemplateNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, Azure.Communication.Messages.MessageTemplate template = null) { throw null; } + public static Azure.Communication.Messages.TextMessageContent TextMessageContent(string text = null) { throw null; } public static Azure.Communication.Messages.TextNotificationContent TextNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string content = null) { throw null; } + public static Azure.Communication.Messages.VideoMessageContent VideoMessageContent(System.Uri mediaUri = null) { throw null; } public static Azure.Communication.Messages.VideoNotificationContent VideoNotificationContent(System.Guid channelRegistrationId = default(System.Guid), System.Collections.Generic.IEnumerable to = null, string caption = null, System.Uri mediaUri = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content = null) { throw null; } public static Azure.Communication.Messages.Models.Channels.WhatsAppMessageTemplateItem WhatsAppMessageTemplateItem(string name = null, string language = null, Azure.Communication.Messages.MessageTemplateStatus status = default(Azure.Communication.Messages.MessageTemplateStatus), System.BinaryData content = null) { throw null; } + public static Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content = null) { throw null; } + } + public partial class DocumentMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.DocumentMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -55,6 +150,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ImageMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImageMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ImageMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ImageNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -67,6 +173,43 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class InteractiveMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveMessage(Azure.Communication.Messages.TextMessageContent body, Azure.Communication.Messages.ActionBindings action) { } + public Azure.Communication.Messages.ActionBindings Action { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Body { get { throw null; } } + public Azure.Communication.Messages.TextMessageContent Footer { get { throw null; } set { } } + public Azure.Communication.Messages.MessageContent Header { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class InteractiveNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InteractiveNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.InteractiveMessage interactiveMessage) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public Azure.Communication.Messages.InteractiveMessage InteractiveMessage { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.InteractiveNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LinkContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LinkContent(string title, System.Uri uri) { } + public string Title { get { throw null; } } + public System.Uri Uri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.LinkContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ObsoleteAttribute("`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.")] public partial class MediaNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -80,6 +223,16 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public abstract partial class MessageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected MessageContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.MessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MessageReceipt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageReceipt() { } @@ -283,6 +436,18 @@ public NotificationMessagesClient(System.Uri endpoint, Azure.Core.TokenCredentia public virtual System.Threading.Tasks.Task> SendAsync(Azure.Communication.Messages.NotificationContent notificationContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task SendAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class ReactionNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReactionNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string emoji, string messageId) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public string Emoji { get { throw null; } } + public string MessageId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.ReactionNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SendMessageResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SendMessageResult() { } @@ -294,6 +459,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StickerNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StickerNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.StickerNotificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TemplateNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TemplateNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, Azure.Communication.Messages.MessageTemplate template) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -305,6 +481,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TextMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TextMessageContent(string text) { } + public string Text { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.TextMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class TextNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public TextNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, string content) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -316,6 +503,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VideoMessageContent : Azure.Communication.Messages.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VideoMessageContent(System.Uri mediaUri) { } + public System.Uri MediaUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.VideoMessageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VideoNotificationContent : Azure.Communication.Messages.NotificationContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VideoNotificationContent(System.Guid channelRegistrationId, System.Collections.Generic.IEnumerable to, System.Uri mediaUri) : base (default(System.Guid), default(System.Collections.Generic.IEnumerable)) { } @@ -331,6 +529,28 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } namespace Azure.Communication.Messages.Models.Channels { + public partial class WhatsAppButtonActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppButtonActionBindings(Azure.Communication.Messages.ButtonSetContent content) { } + public Azure.Communication.Messages.ButtonSetContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppButtonActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WhatsAppListActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppListActionBindings(Azure.Communication.Messages.ActionGroupContent content) { } + public Azure.Communication.Messages.ActionGroupContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppListActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct WhatsAppMessageButtonSubType : System.IEquatable { @@ -397,6 +617,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class WhatsAppUrlActionBindings : Azure.Communication.Messages.ActionBindings, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WhatsAppUrlActionBindings(Azure.Communication.Messages.LinkContent content) { } + public Azure.Communication.Messages.LinkContent Content { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.Messages.Models.Channels.WhatsAppUrlActionBindings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Microsoft.Extensions.Azure { diff --git a/sdk/communication/Azure.Communication.Messages/assets.json b/sdk/communication/Azure.Communication.Messages/assets.json index 303d5aa7d3d6..b69405ffee0c 100644 --- a/sdk/communication/Azure.Communication.Messages/assets.json +++ b/sdk/communication/Azure.Communication.Messages/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/communication/Azure.Communication.Messages", - "Tag": "net/communication/Azure.Communication.Messages_a672ff69b3" -} + "Tag": "net/communication/Azure.Communication.Messages_52c3e6b22c" +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj index c0822883c897..0b3a60016641 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj +++ b/sdk/communication/Azure.Communication.Messages/src/Azure.Communication.Messages.csproj @@ -5,7 +5,7 @@ This client library enables working with the Microsoft Azure Communication Messages service. Azure Communication Messages Service - 1.2.0-beta.1 + 1.2.0-beta.2 1.1.0 Microsoft Azure Communication Messages Service;Microsoft;Azure;Azure Communication Service;Azure Communication Messages Service;Messages;Communication diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs new file mode 100644 index 000000000000..3773341a0a6b --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Communication.Messages.Models.Channels; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [PersistableModelProxy(typeof(UnknownActionBindings))] + public partial class ActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionBindings(document.RootElement, options); + } + + internal static ActionBindings DeserializeActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "whatsAppButtonAction": return WhatsAppButtonActionBindings.DeserializeWhatsAppButtonActionBindings(element, options); + case "whatsAppListAction": return WhatsAppListActionBindings.DeserializeWhatsAppListActionBindings(element, options); + case "whatsAppUrlAction": return WhatsAppUrlActionBindings.DeserializeWhatsAppUrlActionBindings(element, options); + } + } + return UnknownActionBindings.DeserializeUnknownActionBindings(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{options.Format}' format."); + } + } + + ActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionBindings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs new file mode 100644 index 000000000000..179c68f10ad6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionBindings.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Communication.Messages.Models.Channels; + +namespace Azure.Communication.Messages +{ + /// + /// Binding actions to the interactive message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class ActionBindings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ActionBindings() + { + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + internal ActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Kind of the MessageActionBinding. + internal MessageActionBindingKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs new file mode 100644 index 000000000000..9c8cb78ca93f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroup : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroup)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("items"u8); + writer.WriteStartArray(); + foreach (var item in Items) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroup)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroup(document.RootElement, options); + } + + internal static ActionGroup DeserializeActionGroup(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + IList items = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("items"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ActionGroupItem.DeserializeActionGroupItem(item, options)); + } + items = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroup(title, items, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroup)} does not support writing '{options.Format}' format."); + } + } + + ActionGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroup(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroup)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionGroup FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroup(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs new file mode 100644 index 000000000000..3f3b38a21c4f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroup.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The Action Group content. + public partial class ActionGroup + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Title of the ActionGroup. + /// Array of items in ActionGroup. + /// or is null. + public ActionGroup(string title, IEnumerable items) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(items, nameof(items)); + + Title = title; + Items = items.ToList(); + } + + /// Initializes a new instance of . + /// Title of the ActionGroup. + /// Array of items in ActionGroup. + /// Keeps track of any properties unknown to the library. + internal ActionGroup(string title, IList items, IDictionary serializedAdditionalRawData) + { + Title = title; + Items = items; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroup() + { + } + + /// Title of the ActionGroup. + public string Title { get; } + /// Array of items in ActionGroup. + public IList Items { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs new file mode 100644 index 000000000000..e4b45a901c43 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroupContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + ActionGroupContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroupContent(document.RootElement, options); + } + + internal static ActionGroupContent DeserializeActionGroupContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + IList groups = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ActionGroup.DeserializeActionGroup(item, options)); + } + groups = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroupContent(kind, serializedAdditionalRawData, title, groups); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support writing '{options.Format}' format."); + } + } + + ActionGroupContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroupContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroupContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ActionGroupContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroupContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs new file mode 100644 index 000000000000..5acb5286f34a --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupContent.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The action content of type ActionGroup. + public partial class ActionGroupContent : MessageContent + { + /// Initializes a new instance of . + /// Title of the actionGroup content. + /// Set or group of actions. + /// or is null. + public ActionGroupContent(string title, IEnumerable groups) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(groups, nameof(groups)); + + Kind = MessageContentKind.Group; + Title = title; + Groups = groups.ToList(); + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Title of the actionGroup content. + /// Set or group of actions. + internal ActionGroupContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string title, IList groups) : base(kind, serializedAdditionalRawData) + { + Title = title; + Groups = groups; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroupContent() + { + } + + /// Title of the actionGroup content. + public string Title { get; } + /// Set or group of actions. + public IList Groups { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs new file mode 100644 index 000000000000..7fa2ac487dfd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ActionGroupItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionGroupItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionGroupItem(document.RootElement, options); + } + + internal static ActionGroupItem DeserializeActionGroupItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string title = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionGroupItem(id, title, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support writing '{options.Format}' format."); + } + } + + ActionGroupItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionGroupItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionGroupItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionGroupItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeActionGroupItem(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs new file mode 100644 index 000000000000..ad2701d6511d --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ActionGroupItem.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The Action group item in the content. + public partial class ActionGroupItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Id of the Item. + /// Title of the Item. + /// Description of the Item. + /// , or is null. + public ActionGroupItem(string id, string title, string description) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(description, nameof(description)); + + Id = id; + Title = title; + Description = description; + } + + /// Initializes a new instance of . + /// Id of the Item. + /// Title of the Item. + /// Description of the Item. + /// Keeps track of any properties unknown to the library. + internal ActionGroupItem(string id, string title, string description, IDictionary serializedAdditionalRawData) + { + Id = id; + Title = title; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActionGroupItem() + { + } + + /// Id of the Item. + public string Id { get; } + /// Title of the Item. + public string Title { get; } + /// Description of the Item. + public string Description { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs new file mode 100644 index 000000000000..7f979855610e --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs +namespace Azure.AI.Projects +{ + public partial class AgentsApiResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.Communication.Messages +{ + public partial class ButtonContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentsApiResponseFormat)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + AgentsApiResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentsApiResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentsApiResponseFormat(document.RootElement, options); + } + + internal static AgentsApiResponseFormat DeserializeAgentsApiResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) +======== + ButtonContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeButtonContent(document.RootElement, options); + } + + internal static ButtonContent DeserializeButtonContent(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + ResponseFormat? type = default; +======== + string id = default; + string title = default; +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResponseFormat(property.Value.GetString()); +======== + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + return new AgentsApiResponseFormat(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new ButtonContent(id, title, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + throw new FormatException($"The model {nameof(AgentsApiResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + AgentsApiResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ButtonContent)} does not support writing '{options.Format}' format."); + } + } + + ButtonContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs + return DeserializeAgentsApiResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentsApiResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AgentsApiResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAgentsApiResponseFormat(document.RootElement); +======== + return DeserializeButtonContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ButtonContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ButtonContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeButtonContent(document.RootElement); +>>>>>>>> main:sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.Serialization.cs + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs new file mode 100644 index 000000000000..33b08cdda8bb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonContent.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type Button information. + public partial class ButtonContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Unique Id of the button content. + /// Title of the button content. + /// or is null. + public ButtonContent(string id, string title) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(title, nameof(title)); + + Id = id; + Title = title; + } + + /// Initializes a new instance of . + /// Unique Id of the button content. + /// Title of the button content. + /// Keeps track of any properties unknown to the library. + internal ButtonContent(string id, string title, IDictionary serializedAdditionalRawData) + { + Id = id; + Title = title; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ButtonContent() + { + } + + /// Unique Id of the button content. + public string Id { get; } + /// Title of the button content. + public string Title { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs new file mode 100644 index 000000000000..d8a2c7668311 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ButtonSetContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("buttons"u8); + writer.WriteStartArray(); + foreach (var item in Buttons) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + ButtonSetContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeButtonSetContent(document.RootElement, options); + } + + internal static ButtonSetContent DeserializeButtonSetContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList buttons = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("buttons"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ButtonContent.DeserializeButtonContent(item, options)); + } + buttons = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ButtonSetContent(kind, serializedAdditionalRawData, buttons); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support writing '{options.Format}' format."); + } + } + + ButtonSetContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeButtonSetContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ButtonSetContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ButtonSetContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeButtonSetContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs new file mode 100644 index 000000000000..330216be54e6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ButtonSetContent.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.Messages +{ + /// The message content of type ButtonSet/ List of buttons information. + public partial class ButtonSetContent : MessageContent + { + /// Initializes a new instance of . + /// Unique Id of the button content. + /// is null. + public ButtonSetContent(IEnumerable buttons) + { + Argument.AssertNotNull(buttons, nameof(buttons)); + + Kind = MessageContentKind.ButtonSet; + Buttons = buttons.ToList(); + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Unique Id of the button content. + internal ButtonSetContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, IList buttons) : base(kind, serializedAdditionalRawData) + { + Buttons = buttons; + } + + /// Initializes a new instance of for deserialization. + internal ButtonSetContent() + { + } + + /// Unique Id of the button content. + public IList Buttons { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs index 6183b42f3e9f..8f44d43631b6 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessageKind.cs @@ -29,6 +29,9 @@ public CommunicationMessageKind(string value) private const string VideoValue = "video"; private const string AudioValue = "audio"; private const string TemplateValue = "template"; + private const string StickerValue = "sticker"; + private const string ReactionValue = "reaction"; + private const string InteractiveValue = "interactive"; /// Text message type. public static CommunicationMessageKind Text { get; } = new CommunicationMessageKind(TextValue); @@ -44,6 +47,12 @@ public CommunicationMessageKind(string value) public static CommunicationMessageKind Audio { get; } = new CommunicationMessageKind(AudioValue); /// Template message type. public static CommunicationMessageKind Template { get; } = new CommunicationMessageKind(TemplateValue); + /// Sticker message type. + public static CommunicationMessageKind Sticker { get; } = new CommunicationMessageKind(StickerValue); + /// Reaction message type. + public static CommunicationMessageKind Reaction { get; } = new CommunicationMessageKind(ReactionValue); + /// Interactive Actionable message type. + public static CommunicationMessageKind Interactive { get; } = new CommunicationMessageKind(InteractiveValue); /// Determines if two values are the same. public static bool operator ==(CommunicationMessageKind left, CommunicationMessageKind right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs index 58b29e477642..9322a32fee38 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesClientOptions.cs @@ -13,7 +13,7 @@ namespace Azure.Communication.Messages /// Client options for Azure.Communication.Messages library clients. public partial class CommunicationMessagesClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_08_30; + private const ServiceVersion LatestVersion = ServiceVersion.V2025_01_15_Preview; /// The version of the service to use. public enum ServiceVersion @@ -22,6 +22,8 @@ public enum ServiceVersion V2024_02_01 = 1, /// Service version "2024-08-30". V2024_08_30 = 2, + /// Service version "2025-01-15-preview". + V2025_01_15_Preview = 3, } internal string Version { get; } @@ -33,6 +35,7 @@ public CommunicationMessagesClientOptions(ServiceVersion version = LatestVersion { ServiceVersion.V2024_02_01 => "2024-02-01", ServiceVersion.V2024_08_30 => "2024-08-30", + ServiceVersion.V2025_01_15_Preview => "2025-01-15-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs index 8d1a11241d35..75228e42aea8 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/CommunicationMessagesModelFactory.cs @@ -110,6 +110,144 @@ public static AudioNotificationContent AudioNotificationContent(Guid channelRegi return new AudioNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Audio, serializedAdditionalRawData: null, mediaUri); } + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + /// A new instance for mocking. + public static ReactionNotificationContent ReactionNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, string emoji = null, string messageId = null) + { + to ??= new List(); + + return new ReactionNotificationContent( + channelRegistrationId, + to?.ToList(), + CommunicationMessageKind.Reaction, + serializedAdditionalRawData: null, + emoji, + messageId); + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// A new instance for mocking. + public static StickerNotificationContent StickerNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, Uri mediaUri = null) + { + to ??= new List(); + + return new StickerNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Sticker, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The interactive message content. + /// A new instance for mocking. + public static InteractiveNotificationContent InteractiveNotificationContent(Guid channelRegistrationId = default, IEnumerable to = null, InteractiveMessage interactiveMessage = null) + { + to ??= new List(); + + return new InteractiveNotificationContent(channelRegistrationId, to?.ToList(), CommunicationMessageKind.Interactive, serializedAdditionalRawData: null, interactiveMessage); + } + + /// Initializes a new instance of . + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static InteractiveMessage InteractiveMessage(MessageContent header = null, TextMessageContent body = null, TextMessageContent footer = null, ActionBindings action = null) + { + return new InteractiveMessage(header, body, footer, action, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text value. + /// A new instance for mocking. + public static TextMessageContent TextMessageContent(string text = null) + { + return new TextMessageContent(MessageContentKind.Text, serializedAdditionalRawData: null, text); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static DocumentMessageContent DocumentMessageContent(Uri mediaUri = null) + { + return new DocumentMessageContent(MessageContentKind.Document, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static ImageMessageContent ImageMessageContent(Uri mediaUri = null) + { + return new ImageMessageContent(MessageContentKind.Image, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// MediaUri of the media content. + /// A new instance for mocking. + public static VideoMessageContent VideoMessageContent(Uri mediaUri = null) + { + return new VideoMessageContent(MessageContentKind.Video, serializedAdditionalRawData: null, mediaUri); + } + + /// Initializes a new instance of . + /// Title of the url content. + /// The url in the content. + /// A new instance for mocking. + public static LinkContent LinkContent(string title = null, Uri uri = null) + { + return new LinkContent(MessageContentKind.Url, serializedAdditionalRawData: null, title, uri); + } + + /// Initializes a new instance of . + /// Title of the actionGroup content. + /// Set or group of actions. + /// A new instance for mocking. + public static ActionGroupContent ActionGroupContent(string title = null, IEnumerable groups = null) + { + groups ??= new List(); + + return new ActionGroupContent(MessageContentKind.Group, serializedAdditionalRawData: null, title, groups?.ToList()); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppListActionBindings WhatsAppListActionBindings(ActionGroupContent content = null) + { + return new WhatsAppListActionBindings(MessageActionBindingKind.WhatsAppListAction, serializedAdditionalRawData: null, content); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppButtonActionBindings WhatsAppButtonActionBindings(ButtonSetContent content = null) + { + return new WhatsAppButtonActionBindings(MessageActionBindingKind.WhatsAppButtonAction, serializedAdditionalRawData: null, content); + } + + /// Initializes a new instance of . + /// Action content of Interactive message. + /// A new instance for mocking. + public static WhatsAppUrlActionBindings WhatsAppUrlActionBindings(LinkContent content = null) + { + return new WhatsAppUrlActionBindings(MessageActionBindingKind.WhatsAppUrlAction, serializedAdditionalRawData: null, content); + } + /// Initializes a new instance of . /// The Channel Registration ID for the Business Identifier. /// The native external platform user identifiers of the recipient. diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs new file mode 100644 index 000000000000..0c14527386fd --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class DocumentMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + DocumentMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentMessageContent(document.RootElement, options); + } + + internal static DocumentMessageContent DeserializeDocumentMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support writing '{options.Format}' format."); + } + } + + DocumentMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DocumentMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs new file mode 100644 index 000000000000..03e671f0e1ce --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/DocumentMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type document information. + public partial class DocumentMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public DocumentMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Document; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal DocumentMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal DocumentMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs new file mode 100644 index 000000000000..47a86890f011 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ImageMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + ImageMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageMessageContent(document.RootElement, options); + } + + internal static ImageMessageContent DeserializeImageMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support writing '{options.Format}' format."); + } + } + + ImageMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ImageMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs new file mode 100644 index 000000000000..5a4a0016ef09 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ImageMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type image information. + public partial class ImageMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public ImageMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Image; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal ImageMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal ImageMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs new file mode 100644 index 000000000000..663d9ff1bfe2 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class InteractiveMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Header)) + { + writer.WritePropertyName("header"u8); + writer.WriteObjectValue(Header, options); + } + writer.WritePropertyName("body"u8); + writer.WriteObjectValue(Body, options); + if (Optional.IsDefined(Footer)) + { + writer.WritePropertyName("footer"u8); + writer.WriteObjectValue(Footer, options); + } + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InteractiveMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInteractiveMessage(document.RootElement, options); + } + + internal static InteractiveMessage DeserializeInteractiveMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageContent header = default; + TextMessageContent body = default; + TextMessageContent footer = default; + ActionBindings action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("header"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + header = MessageContent.DeserializeMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("body"u8)) + { + body = TextMessageContent.DeserializeTextMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("footer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + footer = TextMessageContent.DeserializeTextMessageContent(property.Value, options); + continue; + } + if (property.NameEquals("action"u8)) + { + action = ActionBindings.DeserializeActionBindings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InteractiveMessage(header, body, footer, action, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support writing '{options.Format}' format."); + } + } + + InteractiveMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInteractiveMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InteractiveMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InteractiveMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInteractiveMessage(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs new file mode 100644 index 000000000000..7b58752ff477 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveMessage.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Communication.Messages.Models.Channels; + +namespace Azure.Communication.Messages +{ + /// The Interactive message content to which user can read and respond. + public partial class InteractiveMessage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// or is null. + public InteractiveMessage(TextMessageContent body, ActionBindings action) + { + Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNull(action, nameof(action)); + + Body = body; + Action = action; + } + + /// Initializes a new instance of . + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Keeps track of any properties unknown to the library. + internal InteractiveMessage(MessageContent header, TextMessageContent body, TextMessageContent footer, ActionBindings action, IDictionary serializedAdditionalRawData) + { + Header = header; + Body = body; + Footer = footer; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InteractiveMessage() + { + } + + /// + /// Gets or Sets Header content. Supports the following types:text, images etc. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MessageContent Header { get; set; } + /// Gets or Sets Message body content. Emojis, markdown, and links are supported. + public TextMessageContent Body { get; } + /// Gets or Sets Message footer content. Emojis, markdown, and links are supported. + public TextMessageContent Footer { get; set; } + /// + /// The binding object to get or set Action which describes options user have to respond to message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public ActionBindings Action { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs new file mode 100644 index 000000000000..75ee75d90f80 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class InteractiveNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("interactiveMessage"u8); + writer.WriteObjectValue(InteractiveMessage, options); + } + + InteractiveNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInteractiveNotificationContent(document.RootElement, options); + } + + internal static InteractiveNotificationContent DeserializeInteractiveNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InteractiveMessage interactiveMessage = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("interactiveMessage"u8)) + { + interactiveMessage = InteractiveMessage.DeserializeInteractiveMessage(property.Value, options); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InteractiveNotificationContent(channelRegistrationId, to, kind, serializedAdditionalRawData, interactiveMessage); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + InteractiveNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInteractiveNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InteractiveNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new InteractiveNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInteractiveNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs new file mode 100644 index 000000000000..c7c60c7fbdc1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/InteractiveNotificationContent.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send an Interactive message notification. + public partial class InteractiveNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The interactive message content. + /// or is null. + public InteractiveNotificationContent(Guid channelRegistrationId, IEnumerable to, InteractiveMessage interactiveMessage) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(interactiveMessage, nameof(interactiveMessage)); + + Kind = CommunicationMessageKind.Interactive; + InteractiveMessage = interactiveMessage; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// The interactive message content. + internal InteractiveNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, InteractiveMessage interactiveMessage) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + InteractiveMessage = interactiveMessage; + } + + /// Initializes a new instance of for deserialization. + internal InteractiveNotificationContent() + { + } + + /// The interactive message content. + public InteractiveMessage InteractiveMessage { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs new file mode 100644 index 000000000000..50233e91ff71 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class LinkContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + + LinkContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkContent(document.RootElement, options); + } + + internal static LinkContent DeserializeLinkContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string title = default; + Uri url = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkContent(kind, serializedAdditionalRawData, title, url); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LinkContent)} does not support writing '{options.Format}' format."); + } + } + + LinkContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLinkContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LinkContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLinkContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs new file mode 100644 index 000000000000..eb9f674d1936 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/LinkContent.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type Url information. + public partial class LinkContent : MessageContent + { + /// Initializes a new instance of . + /// Title of the url content. + /// The url in the content. + /// or is null. + public LinkContent(string title, Uri uri) + { + Argument.AssertNotNull(title, nameof(title)); + Argument.AssertNotNull(uri, nameof(uri)); + + Kind = MessageContentKind.Url; + Title = title; + Uri = uri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// Title of the url content. + /// The url in the content. + internal LinkContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string title, Uri uri) : base(kind, serializedAdditionalRawData) + { + Title = title; + Uri = uri; + } + + /// Initializes a new instance of for deserialization. + internal LinkContent() + { + } + + /// Title of the url content. + public string Title { get; } + /// The url in the content. + public Uri Uri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs new file mode 100644 index 000000000000..862ceb70f5de --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageActionBindingKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The Kind of interactive message channel action binding like WhatsAppListAction. + internal readonly partial struct MessageActionBindingKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageActionBindingKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WhatsAppListActionValue = "whatsAppListAction"; + private const string WhatsAppButtonActionValue = "whatsAppButtonAction"; + private const string WhatsAppUrlActionValue = "whatsAppUrlAction"; + + /// The WhatsApp List action binding kind. + public static MessageActionBindingKind WhatsAppListAction { get; } = new MessageActionBindingKind(WhatsAppListActionValue); + /// The WhatsApp Button action binding kind. + public static MessageActionBindingKind WhatsAppButtonAction { get; } = new MessageActionBindingKind(WhatsAppButtonActionValue); + /// The WhatsApp Url action binding kind. + public static MessageActionBindingKind WhatsAppUrlAction { get; } = new MessageActionBindingKind(WhatsAppUrlActionValue); + /// Determines if two values are the same. + public static bool operator ==(MessageActionBindingKind left, MessageActionBindingKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageActionBindingKind left, MessageActionBindingKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MessageActionBindingKind(string value) => new MessageActionBindingKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageActionBindingKind other && Equals(other); + /// + public bool Equals(MessageActionBindingKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs new file mode 100644 index 000000000000..2ca15f3b5a84 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + [PersistableModelProxy(typeof(UnknownMessageContent))] + public partial class MessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageContent(document.RootElement, options); + } + + internal static MessageContent DeserializeMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "buttonSet": return ButtonSetContent.DeserializeButtonSetContent(element, options); + case "document": return DocumentMessageContent.DeserializeDocumentMessageContent(element, options); + case "group": return ActionGroupContent.DeserializeActionGroupContent(element, options); + case "image": return ImageMessageContent.DeserializeImageMessageContent(element, options); + case "text": return TextMessageContent.DeserializeTextMessageContent(element, options); + case "url": return LinkContent.DeserializeLinkContent(element, options); + case "video": return VideoMessageContent.DeserializeVideoMessageContent(element, options); + } + } + return UnknownMessageContent.DeserializeUnknownMessageContent(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{options.Format}' format."); + } + } + + MessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMessageContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs new file mode 100644 index 000000000000..1c807fdacda6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// + /// The message content object used to create interactive messages components. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public abstract partial class MessageContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected MessageContent() + { + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + internal MessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Kind of MessageContent. + internal MessageContentKind Kind { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs new file mode 100644 index 000000000000..df01e1a492fc --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/MessageContentKind.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.Messages +{ + /// The kind of Interactive message content. + internal readonly partial struct MessageContentKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MessageContentKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextValue = "text"; + private const string ImageValue = "image"; + private const string VideoValue = "video"; + private const string DocumentValue = "document"; + private const string GroupValue = "group"; + private const string ButtonSetValue = "buttonSet"; + private const string UrlValue = "url"; + + /// The text content type. + public static MessageContentKind Text { get; } = new MessageContentKind(TextValue); + /// The image content type. + public static MessageContentKind Image { get; } = new MessageContentKind(ImageValue); + /// The video content type. + public static MessageContentKind Video { get; } = new MessageContentKind(VideoValue); + /// The document content type. + public static MessageContentKind Document { get; } = new MessageContentKind(DocumentValue); + /// The ActionSet content type. + public static MessageContentKind Group { get; } = new MessageContentKind(GroupValue); + /// The ButtonSet content type. + public static MessageContentKind ButtonSet { get; } = new MessageContentKind(ButtonSetValue); + /// The Url content type. + public static MessageContentKind Url { get; } = new MessageContentKind(UrlValue); + /// Determines if two values are the same. + public static bool operator ==(MessageContentKind left, MessageContentKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MessageContentKind left, MessageContentKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MessageContentKind(string value) => new MessageContentKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MessageContentKind other && Equals(other); + /// + public bool Equals(MessageContentKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs index 68f1f22e3469..dfc45e35fc3f 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/NotificationContent.cs @@ -14,7 +14,7 @@ namespace Azure.Communication.Messages /// /// Details of the message to send. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , , , , and . /// public abstract partial class NotificationContent { diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs new file mode 100644 index 000000000000..eb19413dcbed --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class ReactionNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("emoji"u8); + writer.WriteStringValue(Emoji); + writer.WritePropertyName("messageId"u8); + writer.WriteStringValue(MessageId); + } + + ReactionNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReactionNotificationContent(document.RootElement, options); + } + + internal static ReactionNotificationContent DeserializeReactionNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string emoji = default; + string messageId = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("emoji"u8)) + { + emoji = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageId"u8)) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReactionNotificationContent( + channelRegistrationId, + to, + kind, + serializedAdditionalRawData, + emoji, + messageId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + ReactionNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReactionNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReactionNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ReactionNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReactionNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs new file mode 100644 index 000000000000..a06858477fbe --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/ReactionNotificationContent.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send a Reaction notification. + public partial class ReactionNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + /// , or is null. + public ReactionNotificationContent(Guid channelRegistrationId, IEnumerable to, string emoji, string messageId) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(emoji, nameof(emoji)); + Argument.AssertNotNull(messageId, nameof(messageId)); + + Kind = CommunicationMessageKind.Reaction; + Emoji = emoji; + MessageId = messageId; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// emoji content like \uD83D\uDE00. + /// ID of the previous message you want to reply to. + internal ReactionNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, string emoji, string messageId) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + Emoji = emoji; + MessageId = messageId; + } + + /// Initializes a new instance of for deserialization. + internal ReactionNotificationContent() + { + } + + /// emoji content like \uD83D\uDE00. + public string Emoji { get; } + /// ID of the previous message you want to reply to. + public string MessageId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs new file mode 100644 index 000000000000..e00d50c93f77 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class StickerNotificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + StickerNotificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStickerNotificationContent(document.RootElement, options); + } + + internal static StickerNotificationContent DeserializeStickerNotificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + Guid channelRegistrationId = default; + IList to = default; + CommunicationMessageKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("channelRegistrationId"u8)) + { + channelRegistrationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("to"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + to = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CommunicationMessageKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StickerNotificationContent(channelRegistrationId, to, kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support writing '{options.Format}' format."); + } + } + + StickerNotificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStickerNotificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StickerNotificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new StickerNotificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeStickerNotificationContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs new file mode 100644 index 000000000000..b90c6584db92 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/StickerNotificationContent.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// A request to send a Sticker notification. + public partial class StickerNotificationContent : NotificationContent + { + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + /// or is null. + public StickerNotificationContent(Guid channelRegistrationId, IEnumerable to, Uri mediaUri) : base(channelRegistrationId, to) + { + Argument.AssertNotNull(to, nameof(to)); + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = CommunicationMessageKind.Sticker; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// The Channel Registration ID for the Business Identifier. + /// The native external platform user identifiers of the recipient. + /// The type discriminator describing a notification type. + /// Keeps track of any properties unknown to the library. + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + internal StickerNotificationContent(Guid channelRegistrationId, IList to, CommunicationMessageKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(channelRegistrationId, to, kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal StickerNotificationContent() + { + } + + /// A media url for the file. Required if the type is one of the supported media types, e.g. image. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs new file mode 100644 index 000000000000..1e250ef6c9b1 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class TextMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + + TextMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextMessageContent(document.RootElement, options); + } + + internal static TextMessageContent DeserializeTextMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextMessageContent(kind, serializedAdditionalRawData, text); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextMessageContent)} does not support writing '{options.Format}' format."); + } + } + + TextMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new TextMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs new file mode 100644 index 000000000000..5bb81059ded6 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/TextMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type text information. + public partial class TextMessageContent : MessageContent + { + /// Initializes a new instance of . + /// The text value. + /// is null. + public TextMessageContent(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Kind = MessageContentKind.Text; + Text = text; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// The text value. + internal TextMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, string text) : base(kind, serializedAdditionalRawData) + { + Text = text; + } + + /// Initializes a new instance of for deserialization. + internal TextMessageContent() + { + } + + /// The text value. + public string Text { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs new file mode 100644 index 000000000000..5a57e9e89df4 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class UnknownActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionBindings(document.RootElement, options); + } + + internal static UnknownActionBindings DeserializeUnknownActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageActionBindingKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownActionBindings(kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support writing '{options.Format}' format."); + } + } + + ActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs new file mode 100644 index 000000000000..a6a3ee87536f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownActionBindings.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Unknown version of ActionBindings. + internal partial class UnknownActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + internal UnknownActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownActionBindings() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs new file mode 100644 index 000000000000..21f7dfbf5383 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + internal partial class UnknownMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + MessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageContent(document.RootElement, options); + } + + internal static UnknownMessageContent DeserializeUnknownMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageContentKind kind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownMessageContent(kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support writing '{options.Format}' format."); + } + } + + MessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs new file mode 100644 index 000000000000..b41ad6a768fb --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/UnknownMessageContent.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// Unknown version of MessageContent. + internal partial class UnknownMessageContent : MessageContent + { + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + internal UnknownMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownMessageContent() + { + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs new file mode 100644 index 000000000000..c4787e3c5944 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages +{ + public partial class VideoMessageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("mediaUri"u8); + writer.WriteStringValue(MediaUri.AbsoluteUri); + } + + VideoMessageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVideoMessageContent(document.RootElement, options); + } + + internal static VideoMessageContent DeserializeVideoMessageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri mediaUri = default; + MessageContentKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mediaUri"u8)) + { + mediaUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageContentKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VideoMessageContent(kind, serializedAdditionalRawData, mediaUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support writing '{options.Format}' format."); + } + } + + VideoMessageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVideoMessageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VideoMessageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new VideoMessageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeVideoMessageContent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs new file mode 100644 index 000000000000..acc98d909c2c --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/VideoMessageContent.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages +{ + /// The message content of type video information. + public partial class VideoMessageContent : MessageContent + { + /// Initializes a new instance of . + /// MediaUri of the media content. + /// is null. + public VideoMessageContent(Uri mediaUri) + { + Argument.AssertNotNull(mediaUri, nameof(mediaUri)); + + Kind = MessageContentKind.Video; + MediaUri = mediaUri; + } + + /// Initializes a new instance of . + /// Kind of MessageContent. + /// Keeps track of any properties unknown to the library. + /// MediaUri of the media content. + internal VideoMessageContent(MessageContentKind kind, IDictionary serializedAdditionalRawData, Uri mediaUri) : base(kind, serializedAdditionalRawData) + { + MediaUri = mediaUri; + } + + /// Initializes a new instance of for deserialization. + internal VideoMessageContent() + { + } + + /// MediaUri of the media content. + public Uri MediaUri { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs new file mode 100644 index 000000000000..020878d98331 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages.Models.Channels +{ + public partial class WhatsAppButtonActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppButtonActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppButtonActionBindings(document.RootElement, options); + } + + internal static WhatsAppButtonActionBindings DeserializeWhatsAppButtonActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ButtonSetContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = ButtonSetContent.DeserializeButtonSetContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppButtonActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppButtonActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppButtonActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppButtonActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppButtonActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppButtonActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs new file mode 100644 index 000000000000..94ae4bdf09ec --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppButtonActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages.Models.Channels +{ + /// WhatsApp Binding actions to the interactive message. + public partial class WhatsAppButtonActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppButtonActionBindings(ButtonSetContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppButtonAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppButtonActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, ButtonSetContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppButtonActionBindings() + { + } + + /// Action content of Interactive message. + public ButtonSetContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs new file mode 100644 index 000000000000..98e24457595f --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages.Models.Channels +{ + public partial class WhatsAppListActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppListActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppListActionBindings(document.RootElement, options); + } + + internal static WhatsAppListActionBindings DeserializeWhatsAppListActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ActionGroupContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = ActionGroupContent.DeserializeActionGroupContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppListActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppListActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppListActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppListActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppListActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppListActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs new file mode 100644 index 000000000000..4f6a37e5e284 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppListActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages.Models.Channels +{ + /// WhatsApp List Binding actions to the interactive message. + public partial class WhatsAppListActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppListActionBindings(ActionGroupContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppListAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppListActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, ActionGroupContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppListActionBindings() + { + } + + /// Action content of Interactive message. + public ActionGroupContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs new file mode 100644 index 000000000000..0a75f63c3213 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.Messages.Models.Channels +{ + public partial class WhatsAppUrlActionBindings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content, options); + } + + WhatsAppUrlActionBindings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWhatsAppUrlActionBindings(document.RootElement, options); + } + + internal static WhatsAppUrlActionBindings DeserializeWhatsAppUrlActionBindings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LinkContent content = default; + MessageActionBindingKind kind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = LinkContent.DeserializeLinkContent(property.Value, options); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new MessageActionBindingKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WhatsAppUrlActionBindings(kind, serializedAdditionalRawData, content); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support writing '{options.Format}' format."); + } + } + + WhatsAppUrlActionBindings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWhatsAppUrlActionBindings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WhatsAppUrlActionBindings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new WhatsAppUrlActionBindings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWhatsAppUrlActionBindings(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs new file mode 100644 index 000000000000..bab6ebbe3591 --- /dev/null +++ b/sdk/communication/Azure.Communication.Messages/src/Generated/WhatsAppUrlActionBindings.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.Messages.Models.Channels +{ + /// WhatsApp Binding actions to the interactive message. + public partial class WhatsAppUrlActionBindings : ActionBindings + { + /// Initializes a new instance of . + /// Action content of Interactive message. + /// is null. + public WhatsAppUrlActionBindings(LinkContent content) + { + Argument.AssertNotNull(content, nameof(content)); + + Kind = MessageActionBindingKind.WhatsAppUrlAction; + Content = content; + } + + /// Initializes a new instance of . + /// Kind of the MessageActionBinding. + /// Keeps track of any properties unknown to the library. + /// Action content of Interactive message. + internal WhatsAppUrlActionBindings(MessageActionBindingKind kind, IDictionary serializedAdditionalRawData, LinkContent content) : base(kind, serializedAdditionalRawData) + { + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal WhatsAppUrlActionBindings() + { + } + + /// Action content of Interactive message. + public LinkContent Content { get; } + } +} diff --git a/sdk/communication/Azure.Communication.Messages/src/Models/Channels/WhatsAppModels.cs b/sdk/communication/Azure.Communication.Messages/src/Models/Channels/WhatsAppModels.cs index 90d3ccac6ab1..1e8a00005251 100644 --- a/sdk/communication/Azure.Communication.Messages/src/Models/Channels/WhatsAppModels.cs +++ b/sdk/communication/Azure.Communication.Messages/src/Models/Channels/WhatsAppModels.cs @@ -25,5 +25,14 @@ public partial class WhatsAppMessageTemplateBindingsComponent { } [CodeGenModel("WhatsAppMessageTemplateItem")] public partial class WhatsAppMessageTemplateItem { } + + [CodeGenModel("WhatsAppButtonActionBindings")] + public partial class WhatsAppButtonActionBindings { } + + [CodeGenModel("WhatsAppListActionBindings")] + public partial class WhatsAppListActionBindings { } + + [CodeGenModel("WhatsAppUrlActionBindings")] + public partial class WhatsAppUrlActionBindings { } } #pragma warning restore SA1402 // File may only contain a single type diff --git a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs index 5a5d28ac26e5..c5ee4268363e 100644 --- a/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs +++ b/sdk/communication/Azure.Communication.Messages/tests/NotificationMessagesClient/NotificationMessagesClientLiveTests.cs @@ -21,6 +21,7 @@ public NotificationMessagesClientLiveTests(bool isAsync) : base(isAsync) public static readonly Uri DocumentUrl = new Uri("https://filesamples.com/samples/document/pdf/sample2.pdf"); public static readonly Uri VideoUrl = new Uri("https://filesamples.com/samples/video/3gp/sample_640x360.3gp"); public static readonly Uri AudioUrl = new Uri("https://filesamples.com/samples/audio/mp3/sample3.mp3"); + public static readonly Uri StickUrl = new Uri("https://img-06.stickers.cloud/packs/5df297e3-a7f0-44e0-a6d1-43bdb09b793c/webp/8709a42d-0579-4314-b659-9c2cdb979305.webp"); [Test] public async Task SendTextMessage_ShouldSucceed() @@ -106,6 +107,256 @@ public async Task SendDocumentMessage_ShouldSucceed() validateResponse(response); } + [Test] + public async Task SendStickerMessage_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var content = new StickerNotificationContent(new Guid(TestEnvironment.SenderChannelRegistrationId), recipients, StickUrl); + + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(content); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendReactionMessage_ShouldSucceed() + { + // Arrange + NotificationMessagesClient notificationMessagesClient = CreateInstrumentedNotificationMessagesClient(); + TextNotificationContent textContent = new(new Guid(TestEnvironment.SenderChannelRegistrationId), new List { TestEnvironment.RecipientIdentifier }, "LiveTest"); + Response textResponse = await notificationMessagesClient.SendAsync(textContent); + var messageId = textResponse.Value.Receipts[0].MessageId; + ReactionNotificationContent reactionContent = new(new Guid(TestEnvironment.SenderChannelRegistrationId), new List { TestEnvironment.RecipientIdentifier }, "\uD83D\uDE00", messageId); + + // Act + Response response = await notificationMessagesClient.SendAsync(reactionContent); + + // Assert + validateResponse(textResponse); + } + + [Test] + public async Task SendInteractiveMessageWithButtonAction_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var buttonActions = new List + { + new ButtonContent("no", "No"), + new ButtonContent("yes", "Yes") + }; + var buttonSet = new ButtonSetContent(buttonActions); + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Do you want to proceed?"), + new WhatsAppButtonActionBindings(buttonSet)); + + var content = new InteractiveNotificationContent(new Guid(TestEnvironment.SenderChannelRegistrationId), recipients, interactiveMessage); + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(content); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendInteractiveMessageWithImageHeader_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var buttonActions = new List + { + new ButtonContent("no", "No"), + new ButtonContent("yes", "Yes") + }; + var buttonSet = new ButtonSetContent(buttonActions); + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Do you want to proceed?"), + new WhatsAppButtonActionBindings(buttonSet)); + interactiveMessage.Header = new ImageMessageContent(ImageUrl); + + var content = new InteractiveNotificationContent(new Guid(TestEnvironment.SenderChannelRegistrationId), recipients, interactiveMessage); + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(content); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendInteractiveMessageWithDocumentHeader_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var buttonActions = new List + { + new ButtonContent("no", "No"), + new ButtonContent("yes", "Yes") + }; + var buttonSet = new ButtonSetContent(buttonActions); + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Do you want to proceed?"), + new WhatsAppButtonActionBindings(buttonSet)); + interactiveMessage.Header = new DocumentMessageContent(DocumentUrl); + + var content = new InteractiveNotificationContent(new Guid(TestEnvironment.SenderChannelRegistrationId), recipients, interactiveMessage); + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(content); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendInteractiveMessageWithVideoHeader_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var buttonActions = new List + { + new ButtonContent("no", "No"), + new ButtonContent("yes", "Yes") + }; + var buttonSet = new ButtonSetContent(buttonActions); + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Do you like it?"), + new WhatsAppButtonActionBindings(buttonSet)); + interactiveMessage.Header = new VideoMessageContent(VideoUrl); + + var content = new InteractiveNotificationContent(new Guid(TestEnvironment.SenderChannelRegistrationId), recipients, interactiveMessage); + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(content); + + // Assert + validateResponse(response); + } + + [Test] + + public async Task SendInteractiveListMessage_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var channelRegistrationId = new Guid(TestEnvironment.SenderChannelRegistrationId); + + var actionItemsList1 = new List + { + new ActionGroupItem("priority_express", "Priority Mail Express", "Next Day to 2 Days"), + new ActionGroupItem("priority_mail", "Priority Mail", "1–3 Days") + }; + + var actionItemsList2 = new List + { + new ActionGroupItem("usps_ground_advantage", "USPS Ground Advantage", "2-5 Days"), + new ActionGroupItem("media_mail", "Media Mail", "2-8 Days") + }; + + var groups = new List + { + new ActionGroup("I want it ASAP!", actionItemsList1), + new ActionGroup("I can wait a bit", actionItemsList2) + }; + + var actionGroupContent = new ActionGroupContent("Shipping Options", groups); + + var interactionMessage = new InteractiveMessage( + new TextMessageContent("Test Body"), + new WhatsAppListActionBindings(actionGroupContent) + ); + interactionMessage.Header = new TextMessageContent("Test Header"); + interactionMessage.Footer = new TextMessageContent("Test Footer"); + + var interactiveMessageContent = new InteractiveNotificationContent( + channelRegistrationId, + recipients, + interactionMessage + ); + + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(interactiveMessageContent); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendInteractiveReplyButtonMessage_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var channelRegistrationId = new Guid(TestEnvironment.SenderChannelRegistrationId); + + var replyButtonActionList = new List + { + new ButtonContent("cancel", "Cancel"), + new ButtonContent("agree", "Agree") + }; + + var buttonSet = new ButtonSetContent(replyButtonActionList); + + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Test Body"), + new WhatsAppButtonActionBindings(buttonSet) + ); + interactiveMessage.Header = new TextMessageContent("Test Header"); + interactiveMessage.Footer = new TextMessageContent("Test Footer"); + + var interactiveMessageContent = new InteractiveNotificationContent( + channelRegistrationId, + recipients, + interactiveMessage + ); + + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(interactiveMessageContent); + + // Assert + validateResponse(response); + } + + [Test] + public async Task SendInteractiveClickToActionMessage_ShouldSucceed() + { + // Arrange + var recipients = new List { TestEnvironment.RecipientIdentifier }; + var channelRegistrationId = new Guid(TestEnvironment.SenderChannelRegistrationId); + + var urlAction = new LinkContent("Test Url", AudioUrl); + + var interactiveMessage = new InteractiveMessage( + new TextMessageContent("Test Body"), + new WhatsAppUrlActionBindings(urlAction) + ); + interactiveMessage.Header = new TextMessageContent("Test Header"); + interactiveMessage.Footer = new TextMessageContent("Test Footer"); + + var interactiveMessageContent = new InteractiveNotificationContent(channelRegistrationId, recipients, interactiveMessage); + + NotificationMessagesClient messagesClient = CreateInstrumentedNotificationMessagesClient(); + + // Act + var response = await messagesClient.SendAsync(interactiveMessageContent); + + // Assert + validateResponse(response); + } + [Test] public async Task SendShippingConfirmationTemplateMessage_ShouldSucceed() { diff --git a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml index 9c9e66f49dcd..9a5d58ac3e5c 100644 --- a/sdk/communication/Azure.Communication.Messages/tsp-location.yaml +++ b/sdk/communication/Azure.Communication.Messages/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: abe3209e7c6924a58ab560ebab2349bc8fde6aa7 +commit: 7797d20dce4f18ee2b3709b894f22634d6fb8b1e directory: specification/communication/Communication.Messages additionalDirectories: [] repo: Azure/azure-rest-api-specs diff --git a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json index 17188dcef382..3bfdede55980 100644 --- a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json +++ b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json @@ -3,7 +3,8 @@ "Name": "Azure.Communication.MessagesService", "ApiVersions": [ "2024-02-01", - "2024-08-30" + "2024-08-30", + "2025-01-15-preview" ], "Enums": [ { @@ -144,8 +145,63 @@ }, "doc": "Template message type.", "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "sticker", + "value": "sticker", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Sticker message type.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "reaction", + "value": "reaction", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Reaction message type.", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "interactive", + "value": "interactive", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Interactive Actionable message type.", + "decorators": [] } ], + "clientNamespace": "Azure.Communication.MessagesService", "doc": "The type of message.", "isFixed": false, "isFlags": false, @@ -153,12 +209,12 @@ "decorators": [] }, { - "$id": "18", + "$id": "24", "kind": "enum", - "name": "MessageTemplateValueKind", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValueKind", + "name": "MessageContentKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContentKind", "valueType": { - "$id": "19", + "$id": "25", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -166,127 +222,146 @@ }, "values": [ { - "$id": "20", + "$id": "26", "kind": "enumvalue", "name": "text", "value": "text", "valueType": { - "$id": "21", + "$id": "27", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The text template parameter type.", + "doc": "The text content type.", "decorators": [] }, { - "$id": "22", + "$id": "28", "kind": "enumvalue", "name": "image", "value": "image", "valueType": { - "$id": "23", + "$id": "29", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The image template parameter type.", + "doc": "The image content type.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "video", + "value": "video", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "24" + }, + "doc": "The video content type.", "decorators": [] }, { - "$id": "24", + "$id": "32", "kind": "enumvalue", "name": "document", "value": "document", "valueType": { - "$id": "25", + "$id": "33", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The document template parameter type.", + "doc": "The document content type.", "decorators": [] }, { - "$id": "26", + "$id": "34", "kind": "enumvalue", - "name": "video", - "value": "video", + "name": "group", + "value": "group", "valueType": { - "$id": "27", + "$id": "35", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The video template parameter type.", + "doc": "The ActionSet content type.", "decorators": [] }, { - "$id": "28", + "$id": "36", "kind": "enumvalue", - "name": "location", - "value": "location", + "name": "buttonSet", + "value": "buttonSet", "valueType": { - "$id": "29", + "$id": "37", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The location template parameter type.", + "doc": "The ButtonSet content type.", "decorators": [] }, { - "$id": "30", + "$id": "38", "kind": "enumvalue", - "name": "quickAction", - "value": "quickAction", + "name": "url", + "value": "url", "valueType": { - "$id": "31", + "$id": "39", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "18" + "$ref": "24" }, - "doc": "The quick action template parameter type.", + "doc": "The Url content type.", "decorators": [] } ], - "doc": "The type of the template parameter.", + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The kind of Interactive message content.", "isFixed": false, "isFlags": false, "usage": "Input,Json", "decorators": [] }, { - "$id": "32", + "$id": "40", "kind": "enum", - "name": "MessageTemplateBindingsKind", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindingsKind", + "name": "MessageActionBindingKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageActionBindingKind", "valueType": { - "$id": "33", + "$id": "41", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -294,93 +369,74 @@ }, "values": [ { - "$id": "34", + "$id": "42", "kind": "enumvalue", - "name": "whatsApp", - "value": "whatsApp", + "name": "whatsAppListAction", + "value": "whatsAppListAction", "valueType": { - "$id": "35", + "$id": "43", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "32" + "$ref": "40" }, - "doc": "The WhatsApp template type.", + "doc": "The WhatsApp List action binding kind.", "decorators": [] - } - ], - "doc": "The type of the message template.", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "36", - "kind": "enum", - "name": "WhatsAppMessageButtonSubType", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageButtonSubType", - "valueType": { - "$id": "37", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ + }, { - "$id": "38", + "$id": "44", "kind": "enumvalue", - "name": "quickReply", - "value": "quickReply", + "name": "whatsAppButtonAction", + "value": "whatsAppButtonAction", "valueType": { - "$id": "39", + "$id": "45", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "36" + "$ref": "40" }, - "doc": "The WhatsApp button sub type is quick reply.", + "doc": "The WhatsApp Button action binding kind.", "decorators": [] }, { - "$id": "40", + "$id": "46", "kind": "enumvalue", - "name": "url", - "value": "url", + "name": "whatsAppUrlAction", + "value": "whatsAppUrlAction", "valueType": { - "$id": "41", + "$id": "47", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "36" + "$ref": "40" }, - "doc": "The WhatsApp button sub type is url.", + "doc": "The WhatsApp Url action binding kind.", "decorators": [] } ], - "doc": "The WhatsApp button sub type.", + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The Kind of interactive message channel action binding like WhatsAppListAction.", "isFixed": false, "isFlags": false, "usage": "Input,Json", "decorators": [] }, { - "$id": "42", + "$id": "48", "kind": "enum", - "name": "Versions", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Versions", + "name": "MessageTemplateValueKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValueKind", "valueType": { - "$id": "43", + "$id": "49", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -388,68 +444,48 @@ }, "values": [ { - "$id": "44", + "$id": "50", "kind": "enumvalue", - "name": "c2024_02_01", - "value": "2024-02-01", + "name": "text", + "value": "text", "valueType": { - "$id": "45", + "$id": "51", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "42" + "$ref": "48" }, - "doc": "Azure Communication Messages 2024-02-01 api version", + "doc": "The text template parameter type.", "decorators": [] }, { - "$id": "46", + "$id": "52", "kind": "enumvalue", - "name": "c2024_08_30", - "value": "2024-08-30", + "name": "image", + "value": "image", "valueType": { - "$id": "47", + "$id": "53", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "42" + "$ref": "48" }, - "doc": "Azure Communication Messages 2024-08-30 api version", + "doc": "The image template parameter type.", "decorators": [] - } - ], - "doc": "Azure Communication Messages Versions", - "isFixed": true, - "isFlags": false, - "usage": "ApiVersionEnum", - "decorators": [] - }, - { - "$id": "48", - "kind": "enum", - "name": "MessageTemplateStatus", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateStatus", - "valueType": { - "$id": "49", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ + }, { - "$id": "50", + "$id": "54", "kind": "enumvalue", - "name": "approved", - "value": "approved", + "name": "document", + "value": "document", "valueType": { - "$id": "51", + "$id": "55", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -458,16 +494,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is approved.", + "doc": "The document template parameter type.", "decorators": [] }, { - "$id": "52", + "$id": "56", "kind": "enumvalue", - "name": "rejected", - "value": "rejected", + "name": "video", + "value": "video", "valueType": { - "$id": "53", + "$id": "57", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -476,16 +512,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is rejected.", + "doc": "The video template parameter type.", "decorators": [] }, { - "$id": "54", + "$id": "58", "kind": "enumvalue", - "name": "pending", - "value": "pending", + "name": "location", + "value": "location", "valueType": { - "$id": "55", + "$id": "59", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -494,16 +530,16 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is pending.", + "doc": "The location template parameter type.", "decorators": [] }, { - "$id": "56", + "$id": "60", "kind": "enumvalue", - "name": "paused", - "value": "paused", + "name": "quickAction", + "value": "quickAction", "valueType": { - "$id": "57", + "$id": "61", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -512,23 +548,24 @@ "enumType": { "$ref": "48" }, - "doc": "Message template is paused.", + "doc": "The quick action template parameter type.", "decorators": [] } ], - "doc": "The aggregated template status.", + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The type of the template parameter.", "isFixed": false, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Json", "decorators": [] }, { - "$id": "58", + "$id": "62", "kind": "enum", - "name": "CommunicationMessagesChannel", - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationMessagesChannel", + "name": "MessageTemplateBindingsKind", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindingsKind", "valueType": { - "$id": "59", + "$id": "63", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -536,37 +573,38 @@ }, "values": [ { - "$id": "60", + "$id": "64", "kind": "enumvalue", "name": "whatsApp", "value": "whatsApp", "valueType": { - "$id": "61", + "$id": "65", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "58" + "$ref": "62" }, - "doc": "The WhatsApp communication messages channel type.", + "doc": "The WhatsApp template type.", "decorators": [] } ], - "doc": "The type of the communication messages channel.", + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The type of the message template.", "isFixed": false, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Json", "decorators": [] }, { - "$id": "62", + "$id": "66", "kind": "enum", - "name": "RepeatabilityResult", - "crossLanguageDefinitionId": "Azure.Core.RepeatabilityResult", + "name": "WhatsAppMessageButtonSubType", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageButtonSubType", "valueType": { - "$id": "63", + "$id": "67", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -574,42 +612,307 @@ }, "values": [ { - "$id": "64", + "$id": "68", "kind": "enumvalue", - "name": "accepted", - "value": "accepted", + "name": "quickReply", + "value": "quickReply", "valueType": { - "$id": "65", + "$id": "69", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "66" + }, + "doc": "The WhatsApp button sub type is quick reply.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "url", + "value": "url", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "The WhatsApp button sub type is url.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The WhatsApp button sub type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "72", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.Versions", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "74", + "kind": "enumvalue", + "name": "c2024_02_01", + "value": "2024-02-01", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2024-02-01 api version", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "c2024_08_30", + "value": "2024-08-30", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2024-08-30 api version", + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "c2025_01_15_Preview", + "value": "2025-01-15-preview", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Azure Communication Messages 2025-01-15-preview api version", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "Azure Communication Messages Versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + }, + { + "$id": "80", + "kind": "enum", + "name": "MessageTemplateStatus", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateStatus", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "82", + "kind": "enumvalue", + "name": "approved", + "value": "approved", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is approved.", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "rejected", + "value": "rejected", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is rejected.", + "decorators": [] + }, + { + "$id": "86", + "kind": "enumvalue", + "name": "pending", + "value": "pending", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is pending.", + "decorators": [] + }, + { + "$id": "88", + "kind": "enumvalue", + "name": "paused", + "value": "paused", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Message template is paused.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The aggregated template status.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "90", + "kind": "enum", + "name": "CommunicationMessagesChannel", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.CommunicationMessagesChannel", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "92", + "kind": "enumvalue", + "name": "whatsApp", + "value": "whatsApp", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "90" + }, + "doc": "The WhatsApp communication messages channel type.", + "decorators": [] + } + ], + "clientNamespace": "Azure.Communication.MessagesService", + "doc": "The type of the communication messages channel.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "94", + "kind": "enum", + "name": "RepeatabilityResult", + "crossLanguageDefinitionId": "Azure.Core.RepeatabilityResult", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "96", + "kind": "enumvalue", + "name": "accepted", + "value": "accepted", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "94" }, "doc": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation.", "decorators": [] }, { - "$id": "66", + "$id": "98", "kind": "enumvalue", "name": "rejected", "value": "rejected", "valueType": { - "$id": "67", + "$id": "99", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "enumType": { - "$ref": "62" + "$ref": "94" }, "doc": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server.", "decorators": [] } ], + "clientNamespace": "Azure.Core", "doc": "Repeatability Result header options", "isFixed": true, "isFlags": false, @@ -619,15 +922,16 @@ ], "Models": [ { - "$id": "68", + "$id": "100", "kind": "model", "name": "NotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent", "usage": "Input,Json", "doc": "Details of the message to send.", "decorators": [], "discriminatorProperty": { - "$id": "69", + "$id": "101", "kind": "property", "name": "kind", "serializedName": "kind", @@ -640,22 +944,29 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.kind", + "serializationOptions": { + "$id": "102", + "json": { + "$id": "103", + "name": "kind" + } + } }, "properties": [ { - "$id": "70", + "$id": "104", "kind": "property", "name": "channelRegistrationId", "serializedName": "channelRegistrationId", "doc": "The Channel Registration ID for the Business Identifier.", "type": { - "$id": "71", + "$id": "105", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "72", + "$id": "106", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -668,20 +979,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.channelRegistrationId" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.channelRegistrationId", + "serializationOptions": { + "$id": "107", + "json": { + "$id": "108", + "name": "channelRegistrationId" + } + } }, { - "$id": "73", + "$id": "109", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifiers of the recipient.", "type": { - "$id": "74", + "$id": "110", "kind": "array", "name": "Array", "valueType": { - "$id": "75", + "$id": "111", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -695,38 +1013,46 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.to" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent.to", + "serializationOptions": { + "$id": "112", + "json": { + "$id": "113", + "name": "to" + } + } }, { - "$ref": "69" + "$ref": "101" } ], "discriminatedSubtypes": { - "$id": "76", + "$id": "114", "text": { - "$id": "77", + "$id": "115", "kind": "model", "name": "TextNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent", "usage": "Input,Json", "doc": "A request to send a text notification.", "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "78", + "$id": "116", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is text.", "type": { - "$id": "79", + "$id": "117", "kind": "constant", "valueType": { - "$id": "80", + "$id": "118", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -740,16 +1066,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.kind", + "serializationOptions": { + "$id": "119", + "json": { + "$id": "120", + "name": "kind" + } + } }, { - "$id": "81", + "$id": "121", "kind": "property", "name": "content", "serializedName": "content", "doc": "Message content.", "type": { - "$id": "82", + "$id": "122", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -760,14 +1093,22 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.content" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent.content", + "serializationOptions": { + "$id": "123", + "json": { + "$id": "124", + "name": "content" + } + } } ] }, "image_v0": { - "$id": "83", + "$id": "125", "kind": "model", "name": "MediaNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent", "usage": "Input,Json", "deprecation": "`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.", @@ -775,20 +1116,20 @@ "discriminatorValue": "image_v0", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "84", + "$id": "126", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "85", + "$id": "127", "kind": "constant", "valueType": { - "$id": "86", + "$id": "128", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -802,16 +1143,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.kind", + "serializationOptions": { + "$id": "129", + "json": { + "$id": "130", + "name": "kind" + } + } }, { - "$id": "87", + "$id": "131", "kind": "property", "name": "content", "serializedName": "content", "doc": "Optional text content.", "type": { - "$id": "88", + "$id": "132", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -822,16 +1170,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.content" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.content", + "serializationOptions": { + "$id": "133", + "json": { + "$id": "134", + "name": "content" + } + } }, { - "$id": "89", + "$id": "135", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "90", + "$id": "136", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -842,34 +1197,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.mediaUri" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent.mediaUri", + "serializationOptions": { + "$id": "137", + "json": { + "$id": "138", + "name": "mediaUri" + } + } } ] }, "image": { - "$id": "91", + "$id": "139", "kind": "model", "name": "ImageNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent", "usage": "Input,Json", "doc": "A request to send an image notification.", "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "92", + "$id": "140", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "93", + "$id": "141", "kind": "constant", "valueType": { - "$id": "94", + "$id": "142", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -883,16 +1246,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.kind", + "serializationOptions": { + "$id": "143", + "json": { + "$id": "144", + "name": "kind" + } + } }, { - "$id": "95", + "$id": "145", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "96", + "$id": "146", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -903,16 +1273,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.caption", + "serializationOptions": { + "$id": "147", + "json": { + "$id": "148", + "name": "caption" + } + } }, { - "$id": "97", + "$id": "149", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "98", + "$id": "150", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -923,34 +1300,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.mediaUri" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent.mediaUri", + "serializationOptions": { + "$id": "151", + "json": { + "$id": "152", + "name": "mediaUri" + } + } } ] }, "document": { - "$id": "99", + "$id": "153", "kind": "model", "name": "DocumentNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent", "usage": "Input,Json", "doc": "A request to send a document notification.", "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "100", + "$id": "154", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "101", + "$id": "155", "kind": "constant", "valueType": { - "$id": "102", + "$id": "156", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -964,16 +1349,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.kind", + "serializationOptions": { + "$id": "157", + "json": { + "$id": "158", + "name": "kind" + } + } }, { - "$id": "103", + "$id": "159", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "104", + "$id": "160", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -984,16 +1376,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.caption", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "caption" + } + } }, { - "$id": "105", + "$id": "163", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "Optional name for the file.", "type": { - "$id": "106", + "$id": "164", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1004,16 +1403,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.fileName" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.fileName", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "fileName" + } + } }, { - "$id": "107", + "$id": "167", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "108", + "$id": "168", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1024,34 +1430,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.mediaUri" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent.mediaUri", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "mediaUri" + } + } } ] }, "video": { - "$id": "109", + "$id": "171", "kind": "model", "name": "VideoNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent", "usage": "Input,Json", "doc": "A request to send a video notification.", "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "110", + "$id": "172", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is image.", "type": { - "$id": "111", + "$id": "173", "kind": "constant", "valueType": { - "$id": "112", + "$id": "174", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1065,16 +1479,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.kind", + "serializationOptions": { + "$id": "175", + "json": { + "$id": "176", + "name": "kind" + } + } }, { - "$id": "113", + "$id": "177", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "Optional text content.", "type": { - "$id": "114", + "$id": "178", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1085,16 +1506,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.caption", + "serializationOptions": { + "$id": "179", + "json": { + "$id": "180", + "name": "caption" + } + } }, { - "$id": "115", + "$id": "181", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "116", + "$id": "182", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1105,34 +1533,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.mediaUri" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent.mediaUri", + "serializationOptions": { + "$id": "183", + "json": { + "$id": "184", + "name": "mediaUri" + } + } } ] }, "audio": { - "$id": "117", + "$id": "185", "kind": "model", "name": "AudioNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent", "usage": "Input,Json", "doc": "A request to send an audio notification.", "discriminatorValue": "audio", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "118", + "$id": "186", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is audio.", "type": { - "$id": "119", + "$id": "187", "kind": "constant", "valueType": { - "$id": "120", + "$id": "188", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1146,16 +1582,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.kind", + "serializationOptions": { + "$id": "189", + "json": { + "$id": "190", + "name": "kind" + } + } }, { - "$id": "121", + "$id": "191", "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { - "$id": "122", + "$id": "192", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1166,34 +1609,1497 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.mediaUri" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent.mediaUri", + "serializationOptions": { + "$id": "193", + "json": { + "$id": "194", + "name": "mediaUri" + } + } + } + ] + }, + "reaction": { + "$id": "195", + "kind": "model", + "name": "ReactionNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent", + "usage": "Input,Json", + "doc": "A request to send a Reaction notification.", + "discriminatorValue": "reaction", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is reaction.", + "type": { + "$id": "197", + "kind": "constant", + "valueType": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "reaction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.kind", + "serializationOptions": { + "$id": "199", + "json": { + "$id": "200", + "name": "kind" + } + } + }, + { + "$id": "201", + "kind": "property", + "name": "emoji", + "serializedName": "emoji", + "doc": "emoji content like \\uD83D\\uDE00.", + "type": { + "$id": "202", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.emoji", + "serializationOptions": { + "$id": "203", + "json": { + "$id": "204", + "name": "emoji" + } + } + }, + { + "$id": "205", + "kind": "property", + "name": "messageId", + "serializedName": "messageId", + "doc": "ID of the previous message you want to reply to.", + "type": { + "$id": "206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ReactionNotificationContent.messageId", + "serializationOptions": { + "$id": "207", + "json": { + "$id": "208", + "name": "messageId" + } + } + } + ] + }, + "sticker": { + "$id": "209", + "kind": "model", + "name": "StickerNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent", + "usage": "Input,Json", + "doc": "A request to send a Sticker notification.", + "discriminatorValue": "sticker", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "210", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is sticker.", + "type": { + "$id": "211", + "kind": "constant", + "valueType": { + "$id": "212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "sticker", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent.kind", + "serializationOptions": { + "$id": "213", + "json": { + "$id": "214", + "name": "kind" + } + } + }, + { + "$id": "215", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "type": { + "$id": "216", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.StickerNotificationContent.mediaUri", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "mediaUri" + } + } + } + ] + }, + "interactive": { + "$id": "219", + "kind": "model", + "name": "InteractiveNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent", + "usage": "Input,Json", + "doc": "A request to send an Interactive message notification.", + "discriminatorValue": "interactive", + "decorators": [], + "baseModel": { + "$ref": "100" + }, + "properties": [ + { + "$id": "220", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message notification type is Interactive.", + "type": { + "$id": "221", + "kind": "constant", + "valueType": { + "$id": "222", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "interactive", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent.kind", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "kind" + } + } + }, + { + "$id": "225", + "kind": "property", + "name": "interactiveMessage", + "serializedName": "interactiveMessage", + "doc": "The interactive message content.", + "type": { + "$id": "226", + "kind": "model", + "name": "InteractiveMessage", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage", + "usage": "Input,Json", + "doc": "The Interactive message content to which user can read and respond.", + "decorators": [], + "properties": [ + { + "$id": "227", + "kind": "property", + "name": "header", + "serializedName": "header", + "doc": "Gets or Sets Header content. Supports the following types:text, images etc.", + "type": { + "$id": "228", + "kind": "model", + "name": "MessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContent", + "usage": "Input,Json", + "doc": "The message content object used to create interactive messages components.", + "decorators": [], + "discriminatorProperty": { + "$id": "229", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind of MessageContent.", + "type": { + "$ref": "24" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageContent.kind", + "serializationOptions": { + "$id": "230", + "json": { + "$id": "231", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "229" + } + ], + "discriminatedSubtypes": { + "$id": "232", + "text": { + "$id": "233", + "kind": "model", + "name": "TextMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent", + "usage": "Input,Json", + "doc": "The message content of type text information.", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is text.", + "type": { + "$id": "235", + "kind": "constant", + "valueType": { + "$id": "236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent.kind", + "serializationOptions": { + "$id": "237", + "json": { + "$id": "238", + "name": "kind" + } + } + }, + { + "$id": "239", + "kind": "property", + "name": "text", + "serializedName": "text", + "doc": "The text value.", + "type": { + "$id": "240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextMessageContent.text", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "text" + } + } + } + ] + }, + "document": { + "$id": "243", + "kind": "model", + "name": "DocumentMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent", + "usage": "Input,Json", + "doc": "The message content of type document information.", + "discriminatorValue": "document", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "244", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is document.", + "type": { + "$id": "245", + "kind": "constant", + "valueType": { + "$id": "246", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "document", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent.kind", + "serializationOptions": { + "$id": "247", + "json": { + "$id": "248", + "name": "kind" + } + } + }, + { + "$id": "249", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "250", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentMessageContent.mediaUri", + "serializationOptions": { + "$id": "251", + "json": { + "$id": "252", + "name": "mediaUri" + } + } + } + ] + }, + "image": { + "$id": "253", + "kind": "model", + "name": "ImageMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent", + "usage": "Input,Json", + "doc": "The message content of type image information.", + "discriminatorValue": "image", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "254", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is image.", + "type": { + "$id": "255", + "kind": "constant", + "valueType": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "image", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent.kind", + "serializationOptions": { + "$id": "257", + "json": { + "$id": "258", + "name": "kind" + } + } + }, + { + "$id": "259", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "260", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageMessageContent.mediaUri", + "serializationOptions": { + "$id": "261", + "json": { + "$id": "262", + "name": "mediaUri" + } + } + } + ] + }, + "video": { + "$id": "263", + "kind": "model", + "name": "VideoMessageContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent", + "usage": "Input,Json", + "doc": "The message content of type video information.", + "discriminatorValue": "video", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "264", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is video.", + "type": { + "$id": "265", + "kind": "constant", + "valueType": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "video", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent.kind", + "serializationOptions": { + "$id": "267", + "json": { + "$id": "268", + "name": "kind" + } + } + }, + { + "$id": "269", + "kind": "property", + "name": "mediaUri", + "serializedName": "mediaUri", + "doc": "MediaUri of the media content.", + "type": { + "$id": "270", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoMessageContent.mediaUri", + "serializationOptions": { + "$id": "271", + "json": { + "$id": "272", + "name": "mediaUri" + } + } + } + ] + }, + "buttonSet": { + "$id": "273", + "kind": "model", + "name": "ButtonSetContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent", + "usage": "Input,Json", + "doc": "The message content of type ButtonSet/ List of buttons information.", + "discriminatorValue": "buttonSet", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "274", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is Button.", + "type": { + "$id": "275", + "kind": "constant", + "valueType": { + "$id": "276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "buttonSet", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent.kind", + "serializationOptions": { + "$id": "277", + "json": { + "$id": "278", + "name": "kind" + } + } + }, + { + "$id": "279", + "kind": "property", + "name": "buttons", + "serializedName": "buttons", + "doc": "Unique Id of the button content.", + "type": { + "$id": "280", + "kind": "array", + "name": "ArrayButtonContent", + "valueType": { + "$id": "281", + "kind": "model", + "name": "ButtonContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent", + "usage": "Input,Json", + "doc": "The message content of type Button information.", + "decorators": [], + "properties": [ + { + "$id": "282", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Unique Id of the button content.", + "type": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent.id", + "serializationOptions": { + "$id": "284", + "json": { + "$id": "285", + "name": "id" + } + } + }, + { + "$id": "286", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the button content.", + "type": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonContent.title", + "serializationOptions": { + "$id": "288", + "json": { + "$id": "289", + "name": "title" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ButtonSetContent.buttons", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "buttons" + } + } + } + ] + }, + "url": { + "$id": "292", + "kind": "model", + "name": "LinkContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent", + "usage": "Input,Json", + "doc": "The message content of type Url information.", + "discriminatorValue": "url", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "293", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is url.", + "type": { + "$id": "294", + "kind": "constant", + "valueType": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.kind", + "serializationOptions": { + "$id": "296", + "json": { + "$id": "297", + "name": "kind" + } + } + }, + { + "$id": "298", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the url content.", + "type": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.title", + "serializationOptions": { + "$id": "300", + "json": { + "$id": "301", + "name": "title" + } + } + }, + { + "$id": "302", + "kind": "property", + "name": "uri", + "serializedName": "url", + "doc": "The url in the content.", + "type": { + "$id": "303", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.LinkContent.url", + "serializationOptions": { + "$id": "304", + "json": { + "$id": "305", + "name": "url" + } + } + } + ] + }, + "group": { + "$id": "306", + "kind": "model", + "name": "ActionGroupContent", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent", + "usage": "Input,Json", + "doc": "The action content of type ActionGroup.", + "discriminatorValue": "group", + "decorators": [], + "baseModel": { + "$ref": "228" + }, + "properties": [ + { + "$id": "307", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message content kind is actionGroup.", + "type": { + "$id": "308", + "kind": "constant", + "valueType": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "group", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.kind", + "serializationOptions": { + "$id": "310", + "json": { + "$id": "311", + "name": "kind" + } + } + }, + { + "$id": "312", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the actionGroup content.", + "type": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.title", + "serializationOptions": { + "$id": "314", + "json": { + "$id": "315", + "name": "title" + } + } + }, + { + "$id": "316", + "kind": "property", + "name": "groups", + "serializedName": "groups", + "doc": "Set or group of actions.", + "type": { + "$id": "317", + "kind": "array", + "name": "ArrayActionGroup", + "valueType": { + "$id": "318", + "kind": "model", + "name": "ActionGroup", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup", + "usage": "Input,Json", + "doc": "The Action Group content.", + "decorators": [], + "properties": [ + { + "$id": "319", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the ActionGroup.", + "type": { + "$id": "320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup.title", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "title" + } + } + }, + { + "$id": "323", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "Array of items in ActionGroup.", + "type": { + "$id": "324", + "kind": "array", + "name": "ArrayActionGroupItem", + "valueType": { + "$id": "325", + "kind": "model", + "name": "ActionGroupItem", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem", + "usage": "Input,Json", + "doc": "The Action group item in the content.", + "decorators": [], + "properties": [ + { + "$id": "326", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Id of the Item.", + "type": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.id", + "serializationOptions": { + "$id": "328", + "json": { + "$id": "329", + "name": "id" + } + } + }, + { + "$id": "330", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "Title of the Item.", + "type": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.title", + "serializationOptions": { + "$id": "332", + "json": { + "$id": "333", + "name": "title" + } + } + }, + { + "$id": "334", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Description of the Item.", + "type": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupItem.description", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "description" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroup.items", + "serializationOptions": { + "$id": "338", + "json": { + "$id": "339", + "name": "items" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionGroupContent.groups", + "serializationOptions": { + "$id": "340", + "json": { + "$id": "341", + "name": "groups" + } + } + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.header", + "serializationOptions": { + "$id": "342", + "json": { + "$id": "343", + "name": "header" + } + } + }, + { + "$id": "344", + "kind": "property", + "name": "body", + "serializedName": "body", + "doc": "Gets or Sets Message body content. Emojis, markdown, and links are supported.", + "type": { + "$ref": "233" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.body", + "serializationOptions": { + "$id": "345", + "json": { + "$id": "346", + "name": "body" + } + } + }, + { + "$id": "347", + "kind": "property", + "name": "footer", + "serializedName": "footer", + "doc": "Gets or Sets Message footer content. Emojis, markdown, and links are supported.", + "type": { + "$ref": "233" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.footer", + "serializationOptions": { + "$id": "348", + "json": { + "$id": "349", + "name": "footer" + } + } + }, + { + "$id": "350", + "kind": "property", + "name": "action", + "serializedName": "action", + "doc": "The binding object to get or set Action which describes options user have to respond to message.", + "type": { + "$id": "351", + "kind": "model", + "name": "ActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionBindings", + "usage": "Input,Json", + "doc": "Binding actions to the interactive message.", + "decorators": [], + "discriminatorProperty": { + "$id": "352", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Kind of the MessageActionBinding.", + "type": { + "$ref": "40" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ActionBindings.kind", + "serializationOptions": { + "$id": "353", + "json": { + "$id": "354", + "name": "kind" + } + } + }, + "properties": [ + { + "$ref": "352" + } + ], + "discriminatedSubtypes": { + "$id": "355", + "whatsAppListAction": { + "$id": "356", + "kind": "model", + "name": "WhatsAppListActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp List Binding actions to the interactive message.", + "discriminatorValue": "whatsAppListAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "357", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppListAction.", + "type": { + "$id": "358", + "kind": "constant", + "valueType": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppListAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings.kind", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "kind" + } + } + }, + { + "$id": "362", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "306" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppListActionBindings.content", + "serializationOptions": { + "$id": "363", + "json": { + "$id": "364", + "name": "content" + } + } + } + ] + }, + "whatsAppButtonAction": { + "$id": "365", + "kind": "model", + "name": "WhatsAppButtonActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp Binding actions to the interactive message.", + "discriminatorValue": "whatsAppButtonAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "366", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppButtonAction.", + "type": { + "$id": "367", + "kind": "constant", + "valueType": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppButtonAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings.kind", + "serializationOptions": { + "$id": "369", + "json": { + "$id": "370", + "name": "kind" + } + } + }, + { + "$id": "371", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "273" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppButtonActionBindings.content", + "serializationOptions": { + "$id": "372", + "json": { + "$id": "373", + "name": "content" + } + } + } + ] + }, + "whatsAppUrlAction": { + "$id": "374", + "kind": "model", + "name": "WhatsAppUrlActionBindings", + "clientNamespace": "Azure.Communication.MessagesService", + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings", + "usage": "Input,Json", + "doc": "WhatsApp Binding actions to the interactive message.", + "discriminatorValue": "whatsAppUrlAction", + "decorators": [], + "baseModel": { + "$ref": "351" + }, + "properties": [ + { + "$id": "375", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "Message action binding type is WhatsAppUrlAction.", + "type": { + "$id": "376", + "kind": "constant", + "valueType": { + "$id": "377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "whatsAppUrlAction", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings.kind", + "serializationOptions": { + "$id": "378", + "json": { + "$id": "379", + "name": "kind" + } + } + }, + { + "$id": "380", + "kind": "property", + "name": "content", + "serializedName": "content", + "doc": "Action content of Interactive message.", + "type": { + "$ref": "292" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppUrlActionBindings.content", + "serializationOptions": { + "$id": "381", + "json": { + "$id": "382", + "name": "content" + } + } + } + ] + } + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveMessage.action", + "serializationOptions": { + "$id": "383", + "json": { + "$id": "384", + "name": "action" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.InteractiveNotificationContent.interactiveMessage", + "serializationOptions": { + "$id": "385", + "json": { + "$id": "386", + "name": "interactiveMessage" + } + } } ] }, "template": { - "$id": "123", + "$id": "387", "kind": "model", "name": "TemplateNotificationContent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent", "usage": "Input,Json", "doc": "A request to send a template notification.", "discriminatorValue": "template", "decorators": [], "baseModel": { - "$ref": "68" + "$ref": "100" }, "properties": [ { - "$id": "124", + "$id": "388", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message notification type is template.", "type": { - "$id": "125", + "$id": "389", "kind": "constant", "valueType": { - "$id": "126", + "$id": "390", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1207,31 +3113,39 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.kind", + "serializationOptions": { + "$id": "391", + "json": { + "$id": "392", + "name": "kind" + } + } }, { - "$id": "127", + "$id": "393", "kind": "property", "name": "template", "serializedName": "template", "doc": "The template object used to create templates.", "type": { - "$id": "128", + "$id": "394", "kind": "model", "name": "MessageTemplate", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate", "usage": "Input,Json", "doc": "The template object used to create templates.", "decorators": [], "properties": [ { - "$id": "129", + "$id": "395", "kind": "property", "name": "name", "serializedName": "name", "doc": "Name of the template.", "type": { - "$id": "130", + "$id": "396", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1242,16 +3156,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.name" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.name", + "serializationOptions": { + "$id": "397", + "json": { + "$id": "398", + "name": "name" + } + } }, { - "$id": "131", + "$id": "399", "kind": "property", "name": "language", "serializedName": "language", "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { - "$id": "132", + "$id": "400", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1262,51 +3183,66 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.language" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.language", + "serializationOptions": { + "$id": "401", + "json": { + "$id": "402", + "name": "language" + } + } }, { - "$id": "133", + "$id": "403", "kind": "property", "name": "values", "serializedName": "values", "doc": "The template values.", "type": { - "$id": "134", + "$id": "404", "kind": "array", "name": "ArrayMessageTemplateValue", "valueType": { - "$id": "135", + "$id": "405", "kind": "model", "name": "MessageTemplateValue", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue", "usage": "Input,Json", "doc": "The class describes a parameter of a template.", "decorators": [], "discriminatorProperty": { - "$id": "136", + "$id": "406", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template parameter type.", "type": { - "$ref": "18" + "$ref": "48" }, "optional": false, "readOnly": false, "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.kind", + "serializationOptions": { + "$id": "407", + "json": { + "$id": "408", + "name": "kind" + } + } }, "properties": [ { - "$id": "137", + "$id": "409", "kind": "property", "name": "name", "serializedName": "name", "doc": "Template binding reference name", "type": { - "$id": "138", + "$id": "410", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1317,38 +3253,46 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.name" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue.name", + "serializationOptions": { + "$id": "411", + "json": { + "$id": "412", + "name": "name" + } + } }, { - "$ref": "136" + "$ref": "406" } ], "discriminatedSubtypes": { - "$id": "139", + "$id": "413", "text": { - "$id": "140", + "$id": "414", "kind": "model", "name": "MessageTemplateText", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText", "usage": "Input,Json", "doc": "The message template's text value information.", "discriminatorValue": "text", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "141", + "$id": "415", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is text.", "type": { - "$id": "142", + "$id": "416", "kind": "constant", "valueType": { - "$id": "143", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1362,16 +3306,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.kind", + "serializationOptions": { + "$id": "418", + "json": { + "$id": "419", + "name": "kind" + } + } }, { - "$id": "144", + "$id": "420", "kind": "property", "name": "text", "serializedName": "text", "doc": "The text value.", "type": { - "$id": "145", + "$id": "421", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1382,34 +3333,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.text" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText.text", + "serializationOptions": { + "$id": "422", + "json": { + "$id": "423", + "name": "text" + } + } } ] }, "image": { - "$id": "146", + "$id": "424", "kind": "model", "name": "MessageTemplateImage", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage", "usage": "Input,Json", "doc": "The message template's image value information.", "discriminatorValue": "image", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "147", + "$id": "425", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is image.", "type": { - "$id": "148", + "$id": "426", "kind": "constant", "valueType": { - "$id": "149", + "$id": "427", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1423,16 +3382,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.kind", + "serializationOptions": { + "$id": "428", + "json": { + "$id": "429", + "name": "kind" + } + } }, { - "$id": "150", + "$id": "430", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "151", + "$id": "431", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1443,16 +3409,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.url" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.url", + "serializationOptions": { + "$id": "432", + "json": { + "$id": "433", + "name": "url" + } + } }, { - "$id": "152", + "$id": "434", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "153", + "$id": "435", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1463,16 +3436,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.caption", + "serializationOptions": { + "$id": "436", + "json": { + "$id": "437", + "name": "caption" + } + } }, { - "$id": "154", + "$id": "438", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "155", + "$id": "439", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1483,34 +3463,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.fileName" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage.fileName", + "serializationOptions": { + "$id": "440", + "json": { + "$id": "441", + "name": "fileName" + } + } } ] }, "document": { - "$id": "156", + "$id": "442", "kind": "model", "name": "MessageTemplateDocument", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument", "usage": "Input,Json", "doc": "The message template's document value information.", "discriminatorValue": "document", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "157", + "$id": "443", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is document.", "type": { - "$id": "158", + "$id": "444", "kind": "constant", "valueType": { - "$id": "159", + "$id": "445", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1524,16 +3512,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.kind", + "serializationOptions": { + "$id": "446", + "json": { + "$id": "447", + "name": "kind" + } + } }, { - "$id": "160", + "$id": "448", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "161", + "$id": "449", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1544,16 +3539,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.url" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.url", + "serializationOptions": { + "$id": "450", + "json": { + "$id": "451", + "name": "url" + } + } }, { - "$id": "162", + "$id": "452", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "163", + "$id": "453", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1564,16 +3566,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.caption", + "serializationOptions": { + "$id": "454", + "json": { + "$id": "455", + "name": "caption" + } + } }, { - "$id": "164", + "$id": "456", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "165", + "$id": "457", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1584,34 +3593,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.fileName" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument.fileName", + "serializationOptions": { + "$id": "458", + "json": { + "$id": "459", + "name": "fileName" + } + } } ] }, "video": { - "$id": "166", + "$id": "460", "kind": "model", "name": "MessageTemplateVideo", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo", "usage": "Input,Json", "doc": "The message template's video value information.", "discriminatorValue": "video", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "167", + "$id": "461", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is video.", "type": { - "$id": "168", + "$id": "462", "kind": "constant", "valueType": { - "$id": "169", + "$id": "463", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1625,16 +3642,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.kind", + "serializationOptions": { + "$id": "464", + "json": { + "$id": "465", + "name": "kind" + } + } }, { - "$id": "170", + "$id": "466", "kind": "property", "name": "uri", "serializedName": "url", "doc": "The (public) URL of the media.", "type": { - "$id": "171", + "$id": "467", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -1645,16 +3669,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.url" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.url", + "serializationOptions": { + "$id": "468", + "json": { + "$id": "469", + "name": "url" + } + } }, { - "$id": "172", + "$id": "470", "kind": "property", "name": "caption", "serializedName": "caption", "doc": "The [optional] caption of the media object.", "type": { - "$id": "173", + "$id": "471", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1665,16 +3696,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.caption" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.caption", + "serializationOptions": { + "$id": "472", + "json": { + "$id": "473", + "name": "caption" + } + } }, { - "$id": "174", + "$id": "474", "kind": "property", "name": "fileName", "serializedName": "fileName", "doc": "The [optional] filename of the media file.", "type": { - "$id": "175", + "$id": "475", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1685,34 +3723,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.fileName" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo.fileName", + "serializationOptions": { + "$id": "476", + "json": { + "$id": "477", + "name": "fileName" + } + } } ] }, "location": { - "$id": "176", + "$id": "478", "kind": "model", "name": "MessageTemplateLocation", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation", "usage": "Input,Json", "doc": "The message template's location value information.", "discriminatorValue": "location", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "177", + "$id": "479", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is location.", "type": { - "$id": "178", + "$id": "480", "kind": "constant", "valueType": { - "$id": "179", + "$id": "481", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1726,16 +3772,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.kind", + "serializationOptions": { + "$id": "482", + "json": { + "$id": "483", + "name": "kind" + } + } }, { - "$id": "180", + "$id": "484", "kind": "property", "name": "locationName", "serializedName": "locationName", "doc": "The [Optional] name of the location.", "type": { - "$id": "181", + "$id": "485", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1746,16 +3799,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.locationName" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.locationName", + "serializationOptions": { + "$id": "486", + "json": { + "$id": "487", + "name": "locationName" + } + } }, { - "$id": "182", + "$id": "488", "kind": "property", "name": "address", "serializedName": "address", "doc": "The [Optional] address of the location.", "type": { - "$id": "183", + "$id": "489", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1766,16 +3826,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.address" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.address", + "serializationOptions": { + "$id": "490", + "json": { + "$id": "491", + "name": "address" + } + } }, { - "$id": "184", + "$id": "492", "kind": "property", "name": "latitude", "serializedName": "latitude", "doc": "The latitude of the location.", "type": { - "$id": "185", + "$id": "493", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1786,16 +3853,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.latitude" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.latitude", + "serializationOptions": { + "$id": "494", + "json": { + "$id": "495", + "name": "latitude" + } + } }, { - "$id": "186", + "$id": "496", "kind": "property", "name": "longitude", "serializedName": "longitude", "doc": "The longitude of the location.", "type": { - "$id": "187", + "$id": "497", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -1806,34 +3880,42 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.longitude" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation.longitude", + "serializationOptions": { + "$id": "498", + "json": { + "$id": "499", + "name": "longitude" + } + } } ] }, "quickAction": { - "$id": "188", + "$id": "500", "kind": "model", "name": "MessageTemplateQuickAction", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction", "usage": "Input,Json", "doc": "The message template's quick action value information.", "discriminatorValue": "quickAction", "decorators": [], "baseModel": { - "$ref": "135" + "$ref": "405" }, "properties": [ { - "$id": "189", + "$id": "501", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message parameter type is quick action.", "type": { - "$id": "190", + "$id": "502", "kind": "constant", "valueType": { - "$id": "191", + "$id": "503", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1847,16 +3929,23 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.kind", + "serializationOptions": { + "$id": "504", + "json": { + "$id": "505", + "name": "kind" + } + } }, { - "$id": "192", + "$id": "506", "kind": "property", "name": "text", "serializedName": "text", "doc": "The [Optional] quick action text", "type": { - "$id": "193", + "$id": "507", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1867,16 +3956,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.text" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.text", + "serializationOptions": { + "$id": "508", + "json": { + "$id": "509", + "name": "text" + } + } }, { - "$id": "194", + "$id": "510", "kind": "property", "name": "payload", "serializedName": "payload", "doc": "The [Optional] quick action payload", "type": { - "$id": "195", + "$id": "511", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1887,7 +3983,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.payload" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction.payload", + "serializationOptions": { + "$id": "512", + "json": { + "$id": "513", + "name": "payload" + } + } } ] } @@ -1901,69 +4004,85 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.values" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.values", + "serializationOptions": { + "$id": "514", + "json": { + "$id": "515", + "name": "values" + } + } }, { - "$id": "196", + "$id": "516", "kind": "property", "name": "bindings", "serializedName": "bindings", "doc": "The binding object to link values to the template specific locations", "type": { - "$id": "197", + "$id": "517", "kind": "model", "name": "MessageTemplateBindings", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings", "usage": "Input,Json", "doc": "The binding object to link values to the template specific locations", "decorators": [], "discriminatorProperty": { - "$id": "198", + "$id": "518", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template bindings type.", "type": { - "$ref": "32" + "$ref": "62" }, "optional": false, "readOnly": false, "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings.kind", + "serializationOptions": { + "$id": "519", + "json": { + "$id": "520", + "name": "kind" + } + } }, "properties": [ { - "$ref": "198" + "$ref": "518" } ], "discriminatedSubtypes": { - "$id": "199", + "$id": "521", "whatsApp": { - "$id": "200", + "$id": "522", "kind": "model", "name": "WhatsAppMessageTemplateBindings", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings", "usage": "Input,Json", "doc": "The template bindings for WhatsApp", "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "197" + "$ref": "517" }, "properties": [ { - "$id": "201", + "$id": "523", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "MessageTemplateBindings is whatsApp", "type": { - "$id": "202", + "$id": "524", "kind": "constant", "valueType": { - "$id": "203", + "$id": "525", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1977,35 +4096,43 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.kind", + "serializationOptions": { + "$id": "526", + "json": { + "$id": "527", + "name": "kind" + } + } }, { - "$id": "204", + "$id": "528", "kind": "property", "name": "header", "serializedName": "header", "doc": "The header template bindings", "type": { - "$id": "205", + "$id": "529", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$id": "206", + "$id": "530", "kind": "model", "name": "WhatsAppMessageTemplateBindingsComponent", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent", "usage": "Input,Json", "doc": "The template bindings component for WhatsApp", "decorators": [], "properties": [ { - "$id": "207", + "$id": "531", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "208", + "$id": "532", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2016,7 +4143,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent.refValue" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent.refValue", + "serializationOptions": { + "$id": "533", + "json": { + "$id": "534", + "name": "refValue" + } + } } ] }, @@ -2028,20 +4162,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.header" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.header", + "serializationOptions": { + "$id": "535", + "json": { + "$id": "536", + "name": "header" + } + } }, { - "$id": "209", + "$id": "537", "kind": "property", "name": "body", "serializedName": "body", "doc": "The body template bindings", "type": { - "$id": "210", + "$id": "538", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "206" + "$ref": "530" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2051,20 +4192,27 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.body" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.body", + "serializationOptions": { + "$id": "539", + "json": { + "$id": "540", + "name": "body" + } + } }, { - "$id": "211", + "$id": "541", "kind": "property", "name": "footer", "serializedName": "footer", "doc": "The footer template bindings", "type": { - "$id": "212", + "$id": "542", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsComponent", "valueType": { - "$ref": "206" + "$ref": "530" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2074,51 +4222,66 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.footer" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.footer", + "serializationOptions": { + "$id": "543", + "json": { + "$id": "544", + "name": "footer" + } + } }, { - "$id": "213", + "$id": "545", "kind": "property", "name": "buttons", "serializedName": "buttons", "doc": "The button template bindings", "type": { - "$id": "214", + "$id": "546", "kind": "array", "name": "ArrayWhatsAppMessageTemplateBindingsButton", "valueType": { - "$id": "215", + "$id": "547", "kind": "model", "name": "WhatsAppMessageTemplateBindingsButton", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton", "usage": "Input,Json", "doc": "The template bindings component button for WhatsApp", "decorators": [], "properties": [ { - "$id": "216", + "$id": "548", "kind": "property", "name": "subType", "serializedName": "subType", "doc": "The WhatsApp button sub type", "type": { - "$ref": "36" + "$ref": "66" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.subType" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.subType", + "serializationOptions": { + "$id": "549", + "json": { + "$id": "550", + "name": "subType" + } + } }, { - "$id": "217", + "$id": "551", "kind": "property", "name": "refValue", "serializedName": "refValue", "doc": "The name of the referenced item in the template values.", "type": { - "$id": "218", + "$id": "552", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2129,7 +4292,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.refValue" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton.refValue", + "serializationOptions": { + "$id": "553", + "json": { + "$id": "554", + "name": "refValue" + } + } } ] }, @@ -2141,7 +4311,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.buttons" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings.buttons", + "serializationOptions": { + "$id": "555", + "json": { + "$id": "556", + "name": "buttons" + } + } } ] } @@ -2152,7 +4329,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.bindings" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate.bindings", + "serializationOptions": { + "$id": "557", + "json": { + "$id": "558", + "name": "bindings" + } + } } ] }, @@ -2161,105 +4345,171 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.template" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent.template", + "serializationOptions": { + "$id": "559", + "json": { + "$id": "560", + "name": "template" + } + } } ] } } }, { - "$ref": "77" + "$ref": "115" + }, + { + "$ref": "125" + }, + { + "$ref": "139" + }, + { + "$ref": "153" + }, + { + "$ref": "171" + }, + { + "$ref": "185" + }, + { + "$ref": "195" + }, + { + "$ref": "209" + }, + { + "$ref": "219" + }, + { + "$ref": "226" }, { - "$ref": "83" + "$ref": "228" }, { - "$ref": "91" + "$ref": "233" }, { - "$ref": "99" + "$ref": "243" }, { - "$ref": "109" + "$ref": "253" }, { - "$ref": "117" + "$ref": "263" }, { - "$ref": "123" + "$ref": "273" }, { - "$ref": "128" + "$ref": "281" }, { - "$ref": "135" + "$ref": "292" }, { - "$ref": "140" + "$ref": "306" }, { - "$ref": "146" + "$ref": "318" }, { - "$ref": "156" + "$ref": "325" }, { - "$ref": "166" + "$ref": "351" }, { - "$ref": "176" + "$ref": "356" }, { - "$ref": "188" + "$ref": "365" }, { - "$ref": "197" + "$ref": "374" }, { - "$ref": "200" + "$ref": "387" }, { - "$ref": "206" + "$ref": "394" }, { - "$ref": "215" + "$ref": "405" }, { - "$id": "219", + "$ref": "414" + }, + { + "$ref": "424" + }, + { + "$ref": "442" + }, + { + "$ref": "460" + }, + { + "$ref": "478" + }, + { + "$ref": "500" + }, + { + "$ref": "517" + }, + { + "$ref": "522" + }, + { + "$ref": "530" + }, + { + "$ref": "547" + }, + { + "$id": "561", "kind": "model", "name": "SendMessageResult", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult", "usage": "Output,Json", "doc": "Result of the send message operation.", "decorators": [], "properties": [ { - "$id": "220", + "$id": "562", "kind": "property", "name": "receipts", "serializedName": "receipts", "doc": "Receipts of the send message operation.", "type": { - "$id": "221", + "$id": "563", "kind": "array", "name": "ArrayMessageReceipt", "valueType": { - "$id": "222", + "$id": "564", "kind": "model", "name": "MessageReceipt", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt", "usage": "Output,Json", "doc": "Receipt of the sending one message.", "decorators": [], "properties": [ { - "$id": "223", + "$id": "565", "kind": "property", "name": "messageId", "serializedName": "messageId", "doc": "The message id.", "type": { - "$id": "224", + "$id": "566", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2270,16 +4520,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.messageId" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.messageId", + "serializationOptions": { + "$id": "567", + "json": { + "$id": "568", + "name": "messageId" + } + } }, { - "$id": "225", + "$id": "569", "kind": "property", "name": "to", "serializedName": "to", "doc": "The native external platform user identifier of the recipient.", "type": { - "$id": "226", + "$id": "570", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2290,7 +4547,14 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.to" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt.to", + "serializationOptions": { + "$id": "571", + "json": { + "$id": "572", + "name": "to" + } + } } ] }, @@ -2302,46 +4566,61 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult.receipts" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult.receipts", + "serializationOptions": { + "$id": "573", + "json": { + "$id": "574", + "name": "receipts" + } + } } ] }, { - "$ref": "222" + "$ref": "564" }, { - "$id": "227", + "$id": "575", "kind": "model", "name": "MessageTemplateItem", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem", "usage": "Output,Json", "doc": "The message template as returned from the service.", "decorators": [], "discriminatorProperty": { - "$id": "228", + "$id": "576", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "The type discriminator describing a template type.", "type": { - "$ref": "58" + "$ref": "90" }, "optional": false, "readOnly": false, "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.kind", + "serializationOptions": { + "$id": "577", + "json": { + "$id": "578", + "name": "kind" + } + } }, "properties": [ { - "$id": "229", + "$id": "579", "kind": "property", "name": "name", "serializedName": "name", "doc": "The template's name.", "type": { - "$id": "230", + "$id": "580", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2352,16 +4631,23 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.name" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.name", + "serializationOptions": { + "$id": "581", + "json": { + "$id": "582", + "name": "name" + } + } }, { - "$id": "231", + "$id": "583", "kind": "property", "name": "language", "serializedName": "language", "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { - "$id": "232", + "$id": "584", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2372,51 +4658,66 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.language" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.language", + "serializationOptions": { + "$id": "585", + "json": { + "$id": "586", + "name": "language" + } + } }, { - "$id": "233", + "$id": "587", "kind": "property", "name": "status", "serializedName": "status", "doc": "The aggregated template status.", "type": { - "$ref": "48" + "$ref": "80" }, "optional": false, "readOnly": false, "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.status" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem.status", + "serializationOptions": { + "$id": "588", + "json": { + "$id": "589", + "name": "status" + } + } }, { - "$ref": "228" + "$ref": "576" } ], "discriminatedSubtypes": { - "$id": "234", + "$id": "590", "whatsApp": { - "$id": "235", + "$id": "591", "kind": "model", "name": "WhatsAppMessageTemplateItem", + "clientNamespace": "Azure.Communication.MessagesService", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem", "usage": "Output,Json", "doc": "The WhatsApp-specific template response contract", "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { - "$ref": "227" + "$ref": "575" }, "properties": [ { - "$id": "236", + "$id": "592", "kind": "property", "name": "content", "serializedName": "content", "doc": "WhatsApp platform's template content. This is the payload returned from WhatsApp API.", "type": { - "$id": "237", + "$id": "593", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -2427,19 +4728,26 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.content" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.content", + "serializationOptions": { + "$id": "594", + "json": { + "$id": "595", + "name": "content" + } + } }, { - "$id": "238", + "$id": "596", "kind": "property", "name": "kind", "serializedName": "kind", "doc": "Message template response type is whatsApp.", "type": { - "$id": "239", + "$id": "597", "kind": "constant", "valueType": { - "$id": "240", + "$id": "598", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2453,36 +4761,44 @@ "discriminator": true, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.kind" + "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem.kind", + "serializationOptions": { + "$id": "599", + "json": { + "$id": "600", + "name": "kind" + } + } } ] } } }, { - "$ref": "235" + "$ref": "591" }, { - "$id": "241", + "$id": "601", "kind": "model", "name": "PagedMessageTemplateItem", + "clientNamespace": "Azure.Core.Foundations", "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", "usage": "Output,Json", "doc": "Paged collection of MessageTemplateItem items", "decorators": [], "properties": [ { - "$id": "242", + "$id": "602", "kind": "property", "name": "value", "serializedName": "value", "doc": "The MessageTemplateItem items on this page", "type": { - "$id": "243", + "$id": "603", "kind": "array", "name": "ArrayMessageTemplateItem", "valueType": { - "$ref": "227" + "$ref": "575" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -2492,21 +4808,28 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value", + "serializationOptions": { + "$id": "604", + "json": { + "$id": "605", + "name": "value" + } + } }, { - "$id": "244", + "$id": "606", "kind": "property", "name": "nextLink", "serializedName": "nextLink", "doc": "The link to the next page of items", "type": { - "$id": "245", + "$id": "607", "kind": "url", "name": "ResourceLocation", "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", "baseType": { - "$id": "246", + "$id": "608", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -2519,30 +4842,38 @@ "discriminator": false, "flatten": false, "decorators": [], - "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink", + "serializationOptions": { + "$id": "609", + "json": { + "$id": "610", + "name": "nextLink" + } + } } ] } ], "Clients": [ { - "$id": "247", + "$id": "611", "Name": "NotificationMessagesClient", + "ClientNamespace": "ClientForAcsMessages", "Operations": [ { - "$id": "248", + "$id": "612", "Name": "send", "ResourceName": "NotificationMessagesClient", "Doc": "Sends a notification message from Business to User.", "Accessibility": "public", "Parameters": [ { - "$id": "249", + "$id": "613", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "250", + "$id": "614", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2556,25 +4887,25 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "251", + "$id": "615", "Type": { - "$id": "252", + "$id": "616", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "253", + "$id": "617", "Name": "repeatabilityRequestId", "NameInRequest": "Repeatability-Request-ID", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "254", + "$id": "618", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2591,17 +4922,17 @@ "SkipUrlEncoding": false }, { - "$id": "255", + "$id": "619", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", "Doc": "Specifies the date and time at which the request was first created.", "Type": { - "$id": "256", + "$id": "620", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "257", + "$id": "621", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2621,17 +4952,17 @@ "SkipUrlEncoding": false }, { - "$id": "258", + "$id": "622", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "259", + "$id": "623", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "260", + "$id": "624", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2650,15 +4981,15 @@ "SkipUrlEncoding": false }, { - "$id": "261", + "$id": "625", "Name": "contentType", "NameInRequest": "Content-Type", "Doc": "Body parameter's content type. Known values are application/json", "Type": { - "$id": "262", + "$id": "626", "kind": "constant", "valueType": { - "$id": "263", + "$id": "627", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2678,14 +5009,14 @@ "SkipUrlEncoding": false }, { - "$id": "264", + "$id": "628", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "265", + "$id": "629", "kind": "constant", "valueType": { - "$id": "266", + "$id": "630", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2705,12 +5036,12 @@ "SkipUrlEncoding": false }, { - "$id": "267", + "$id": "631", "Name": "notificationContent", "NameInRequest": "notificationContent", "Doc": "Details of the message to send.", "Type": { - "$ref": "68" + "$ref": "100" }, "Location": "Body", "IsApiVersion": false, @@ -2725,36 +5056,36 @@ ], "Responses": [ { - "$id": "268", + "$id": "632", "StatusCodes": [ 202 ], "BodyType": { - "$ref": "219" + "$ref": "561" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "269", + "$id": "633", "Name": "repeatabilityResult", "NameInResponse": "Repeatability-Result", "Doc": "Indicates whether the repeatable request was accepted or rejected.", "Type": { - "$ref": "62" + "$ref": "94" } }, { - "$id": "270", + "$id": "634", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "271", + "$id": "635", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "272", + "$id": "636", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2784,19 +5115,19 @@ "Decorators": [] }, { - "$id": "273", + "$id": "637", "Name": "downloadMediaInternal", "ResourceName": "MessageDataStream", "Doc": "Download the Media payload from a User to Business message.", "Accessibility": "internal", "Parameters": [ { - "$id": "274", + "$id": "638", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "275", + "$id": "639", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2810,25 +5141,25 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "276", + "$id": "640", "Type": { - "$id": "277", + "$id": "641", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "278", + "$id": "642", "Name": "id", "NameInRequest": "id", "Doc": "The stream ID.", "Type": { - "$id": "279", + "$id": "643", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2845,17 +5176,17 @@ "SkipUrlEncoding": false }, { - "$id": "280", + "$id": "644", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "281", + "$id": "645", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "282", + "$id": "646", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2874,14 +5205,14 @@ "SkipUrlEncoding": false }, { - "$id": "283", + "$id": "647", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "284", + "$id": "648", "kind": "constant", "valueType": { - "$id": "285", + "$id": "649", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2903,12 +5234,12 @@ ], "Responses": [ { - "$id": "286", + "$id": "650", "StatusCodes": [ 200 ], "BodyType": { - "$id": "287", + "$id": "651", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "TypeSpec.bytes", @@ -2917,17 +5248,17 @@ "BodyMediaType": "Json", "Headers": [ { - "$id": "288", + "$id": "652", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "289", + "$id": "653", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "290", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2937,15 +5268,15 @@ } }, { - "$id": "291", + "$id": "655", "Name": "contentType", "NameInResponse": "content-type", "Doc": "The stream content type.", "Type": { - "$id": "292", + "$id": "656", "kind": "constant", "valueType": { - "$id": "293", + "$id": "657", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2973,36 +5304,36 @@ "Decorators": [], "Examples": [ { - "$id": "294", + "$id": "658", "kind": "http", "name": "Download media", "description": "Download media", - "filePath": "2024-08-30/Stream_GetMedia.json", + "filePath": "2025-01-15-preview/Stream_GetMedia.json", "parameters": [ { - "$id": "295", + "$id": "659", "parameter": { - "$ref": "274" + "$ref": "638" }, "value": { - "$id": "296", + "$id": "660", "kind": "string", "type": { - "$ref": "275" + "$ref": "639" }, - "value": "2024-08-30" + "value": "2025-01-15-preview" } }, { - "$id": "297", + "$id": "661", "parameter": { - "$ref": "278" + "$ref": "642" }, "value": { - "$id": "298", + "$id": "662", "kind": "string", "type": { - "$ref": "279" + "$ref": "643" }, "value": "d19e68ec-bdd6-4a50-8dfb-cbb1642df6ab" } @@ -3010,16 +5341,16 @@ ], "responses": [ { - "$id": "299", + "$id": "663", "response": { - "$ref": "286" + "$ref": "650" }, "statusCode": 200, "bodyValue": { - "$id": "300", + "$id": "664", "kind": "string", "type": { - "$ref": "287" + "$ref": "651" }, "value": "" } @@ -3030,16 +5361,16 @@ } ], "Protocol": { - "$id": "301" + "$id": "665" }, "Parameters": [ { - "$id": "302", + "$id": "666", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { - "$id": "303", + "$id": "667", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3058,23 +5389,24 @@ "Decorators": [] }, { - "$id": "304", + "$id": "668", "Name": "MessageTemplateClient", + "ClientNamespace": "ClientForAcsMessages", "Operations": [ { - "$id": "305", + "$id": "669", "Name": "getTemplates", "ResourceName": "MessageTemplateItem", "Doc": "List all templates for given Azure Communication Services channel", "Accessibility": "public", "Parameters": [ { - "$id": "306", + "$id": "670", "Name": "apiVersion", "NameInRequest": "api-version", "Doc": "The API version to use for this operation.", "Type": { - "$id": "307", + "$id": "671", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3088,30 +5420,30 @@ "IsRequired": true, "Kind": "Client", "DefaultValue": { - "$id": "308", + "$id": "672", "Type": { - "$id": "309", + "$id": "673", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" }, - "Value": "2024-08-30" + "Value": "2025-01-15-preview" }, "Decorators": [], "SkipUrlEncoding": false }, { - "$id": "310", + "$id": "674", "Name": "channelId", "NameInRequest": "channelId", "Doc": "The registration ID of the channel.", "Type": { - "$id": "311", + "$id": "675", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "312", + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3130,12 +5462,12 @@ "SkipUrlEncoding": false }, { - "$id": "313", + "$id": "677", "Name": "maxpagesize", "NameInRequest": "maxpagesize", "Doc": "Number of objects to return per page.", "Type": { - "$id": "314", + "$id": "678", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3152,17 +5484,17 @@ "SkipUrlEncoding": false }, { - "$id": "315", + "$id": "679", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "316", + "$id": "680", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "317", + "$id": "681", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3181,14 +5513,14 @@ "SkipUrlEncoding": false }, { - "$id": "318", + "$id": "682", "Name": "accept", "NameInRequest": "Accept", "Type": { - "$id": "319", + "$id": "683", "kind": "constant", "valueType": { - "$id": "320", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3210,27 +5542,27 @@ ], "Responses": [ { - "$id": "321", + "$id": "685", "StatusCodes": [ 200 ], "BodyType": { - "$ref": "241" + "$ref": "601" }, "BodyMediaType": "Json", "Headers": [ { - "$id": "322", + "$id": "686", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { - "$id": "323", + "$id": "687", "kind": "string", "name": "uuid", "crossLanguageDefinitionId": "Azure.Core.uuid", "baseType": { - "$id": "324", + "$id": "688", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3252,7 +5584,7 @@ "Path": "/messages/channels/{channelId}/templates", "BufferResponse": true, "Paging": { - "$id": "325", + "$id": "689", "ItemName": "value", "NextLinkName": "nextLink" }, @@ -3263,16 +5595,16 @@ } ], "Protocol": { - "$id": "326" + "$id": "690" }, "Parameters": [ { - "$id": "327", + "$id": "691", "Name": "endpoint", "NameInRequest": "endpoint", "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { - "$id": "328", + "$id": "692", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3292,15 +5624,15 @@ } ], "Auth": { - "$id": "329", + "$id": "693", "OAuth2": { - "$id": "330", + "$id": "694", "Scopes": [ "https://communication.azure.com/.default" ] }, "ApiKey": { - "$id": "331", + "$id": "695", "Name": "Authorization", "In": "header" } diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md b/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md index 65d8684ed902..2048568ed337 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.3.0-beta.6 (Unreleased) +## 1.4.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,16 @@ ### Other Changes +## 1.3.0 (2025-02-11) + +### Features Added + +- GA release of Number Insight. +- API version `(2025-02-11)` is the default + +### Bugs Fixed +- OperatorDetails.Name is now optional in OperatorInformation Response. + ## 1.3.0-beta.5 (2024-03-01) ### Features Added diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.net8.0.cs b/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.net8.0.cs index 9de9bd788625..b52687f3e5e7 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.net8.0.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.net8.0.cs @@ -182,14 +182,15 @@ public PhoneNumbersClient(System.Uri endpoint, Azure.Core.TokenCredential tokenC } public partial class PhoneNumbersClientOptions : Azure.Core.ClientOptions { - public PhoneNumbersClientOptions(Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion version = Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion.V2024_03_01_Preview) { } + public PhoneNumbersClientOptions(Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion version = Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion.V2025_02_11) { } public string? AcceptedLanguage { get { throw null; } set { } } public enum ServiceVersion { V2021_03_07 = 1, + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] V2022_01_11_Preview_2 = 2, V2022_12_01 = 3, - V2024_03_01_Preview = 4, + V2025_02_11 = 4, } } public partial class PhoneNumberSearchOptions diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.netstandard2.0.cs b/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.netstandard2.0.cs index 9de9bd788625..b52687f3e5e7 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/api/Azure.Communication.PhoneNumbers.netstandard2.0.cs @@ -182,14 +182,15 @@ public PhoneNumbersClient(System.Uri endpoint, Azure.Core.TokenCredential tokenC } public partial class PhoneNumbersClientOptions : Azure.Core.ClientOptions { - public PhoneNumbersClientOptions(Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion version = Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion.V2024_03_01_Preview) { } + public PhoneNumbersClientOptions(Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion version = Azure.Communication.PhoneNumbers.PhoneNumbersClientOptions.ServiceVersion.V2025_02_11) { } public string? AcceptedLanguage { get { throw null; } set { } } public enum ServiceVersion { V2021_03_07 = 1, + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] V2022_01_11_Preview_2 = 2, V2022_12_01 = 3, - V2024_03_01_Preview = 4, + V2025_02_11 = 4, } } public partial class PhoneNumberSearchOptions diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/assets.json b/sdk/communication/Azure.Communication.PhoneNumbers/assets.json index e0cc69b55160..6fa8e6c9dac5 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/assets.json +++ b/sdk/communication/Azure.Communication.PhoneNumbers/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/communication/Azure.Communication.PhoneNumbers", - "Tag": "net/communication/Azure.Communication.PhoneNumbers_ab86664f5c" + "Tag": "net/communication/Azure.Communication.PhoneNumbers_e59e79351e" } diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/Azure.Communication.PhoneNumbers.csproj b/sdk/communication/Azure.Communication.PhoneNumbers/src/Azure.Communication.PhoneNumbers.csproj index d93208307694..d485ffc3e270 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/Azure.Communication.PhoneNumbers.csproj +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/Azure.Communication.PhoneNumbers.csproj @@ -5,9 +5,9 @@ For this release, see notes - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.PhoneNumbers/README.md and https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md. Azure Communication Phone Numbers Service - 1.3.0-beta.6 + 1.4.0-beta.1 - 1.1.0 + 1.3.0 Microsoft Azure Communication Phone Numbers Service;Microsoft;Azure;Azure Communication Service;Azure Communication Phone Numbers Service;Phone Numbers;Communication;$(PackageCommonTags) $(RequiredTargetFrameworks) true diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersClient.cs b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersClient.cs index 3b5bd52bca9b..1924a04a1a40 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersClient.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersClient.cs @@ -33,7 +33,7 @@ protected InternalPhoneNumbersClient() /// The communication resource, for example https://resourcename.communication.azure.com. /// Api Version. /// , , or is null. - internal InternalPhoneNumbersClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2024-03-01-preview") + internal InternalPhoneNumbersClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2025-02-11") { RestClient = new InternalPhoneNumbersRestClient(clientDiagnostics, pipeline, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersRestClient.cs b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersRestClient.cs index 66de19218263..e2e462eb9881 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersRestClient.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/InternalPhoneNumbersRestClient.cs @@ -31,7 +31,7 @@ internal partial class InternalPhoneNumbersRestClient /// The communication resource, for example https://resourcename.communication.azure.com. /// Api Version. /// , , or is null. - public InternalPhoneNumbersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2024-03-01-preview") + public InternalPhoneNumbersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2025-02-11") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/Models/OperatorDetails.cs b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/Models/OperatorDetails.cs index 14c150252d81..86bd5e275aa5 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/Models/OperatorDetails.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/Models/OperatorDetails.cs @@ -5,27 +5,20 @@ #nullable disable -using System; - namespace Azure.Communication.PhoneNumbers { /// Represents metadata describing the operator of a phone number. public partial class OperatorDetails { /// Initializes a new instance of . - /// Name of the phone operator. - /// is null. - internal OperatorDetails(string name) + internal OperatorDetails() { - Argument.AssertNotNull(name, nameof(name)); - - Name = name; } /// Initializes a new instance of . /// Name of the phone operator. - /// Mobile Network Code. - /// Mobile Country Code. + /// Mobile Network Code, 2 or 3 decimal digits that identify mobile networks within a country/region. + /// Mobile Country Code, 3 decimal digits that identify a country/region. internal OperatorDetails(string name, string mobileNetworkCode, string mobileCountryCode) { Name = name; @@ -35,9 +28,9 @@ internal OperatorDetails(string name, string mobileNetworkCode, string mobileCou /// Name of the phone operator. public string Name { get; } - /// Mobile Network Code. + /// Mobile Network Code, 2 or 3 decimal digits that identify mobile networks within a country/region. public string MobileNetworkCode { get; } - /// Mobile Country Code. + /// Mobile Country Code, 3 decimal digits that identify a country/region. public string MobileCountryCode { get; } } } diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/PhoneNumbersModelFactory.cs b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/PhoneNumbersModelFactory.cs index cbf5f54695ca..82577d24edf6 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/PhoneNumbersModelFactory.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/Generated/PhoneNumbersModelFactory.cs @@ -157,8 +157,8 @@ public static OperatorInformation OperatorInformation(string phoneNumber = null, /// Initializes a new instance of . /// Name of the phone operator. - /// Mobile Network Code. - /// Mobile Country Code. + /// Mobile Network Code, 2 or 3 decimal digits that identify mobile networks within a country/region. + /// Mobile Country Code, 3 decimal digits that identify a country/region. /// A new instance for mocking. public static OperatorDetails OperatorDetails(string name = null, string mobileNetworkCode = null, string mobileCountryCode = null) { diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/PhoneNumbersClientOptions.cs b/sdk/communication/Azure.Communication.PhoneNumbers/src/PhoneNumbersClientOptions.cs index 062e93a64723..08e98f612aa9 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/PhoneNumbersClientOptions.cs +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/PhoneNumbersClientOptions.cs @@ -5,6 +5,7 @@ using System; using Azure.Core; +using System.ComponentModel; [assembly: CodeGenSuppressType("PhoneNumbersClientOptions")] namespace Azure.Communication.PhoneNumbers @@ -12,7 +13,7 @@ namespace Azure.Communication.PhoneNumbers /// Client options for PhoneNumbersClient. public class PhoneNumbersClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_03_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2025_02_11; /// The version of the service to use. public enum ServiceVersion @@ -21,11 +22,12 @@ public enum ServiceVersion /// Service version "2021-03-07". V2021_03_07 = 1, /// Service version "2022-01-11-preview". + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] V2022_01_11_Preview_2 = 2, /// Service version "2022-12-01. V2022_12_01 = 3, - /// Service version "2024-03-01-preview". - V2024_03_01_Preview = 4, + /// Service version "2025-02-11". + V2025_02_11 = 4, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -47,7 +49,7 @@ public PhoneNumbersClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2021_03_07 => "2021-03-07", ServiceVersion.V2022_01_11_Preview_2 => "2022-01-11-preview2", ServiceVersion.V2022_12_01 => "2022-12-01", - ServiceVersion.V2024_03_01_Preview => "2024-03-01-preview", + ServiceVersion.V2025_02_11 => "2025-02-11", _ => throw new NotSupportedException() }; } diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/src/autorest.md b/sdk/communication/Azure.Communication.PhoneNumbers/src/autorest.md index a8962470ae71..d036f71a15c8 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/src/autorest.md +++ b/sdk/communication/Azure.Communication.PhoneNumbers/src/autorest.md @@ -7,10 +7,10 @@ Run `dotnet msbuild /t:GenerateCode` to generate code. ``` yaml public-clients: true -tag: package-phonenumber-2024-03-01-preview +tag: package-phonenumber-2025-02-11 model-namespace: false require: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b56afb26c5450157006a3a1d9be57bae429051a2/specification/communication/data-plane/PhoneNumbers/readme.md + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a3d9c16f14fbfa814d6315a4972517cec77c6bfb/specification/communication/data-plane/PhoneNumbers/readme.md title: Phone numbers payload-flattening-threshold: 3 generation1-convenience-client: true diff --git a/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md b/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md index 0a02178d4ac0..34b9499562e4 100644 --- a/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md +++ b/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md @@ -88,5 +88,3 @@ For more information about Microsoft Azure SDK, see [this website](https://azure ## Contributing APC is currently not accepting/expecting contributions for this codebase. Suggestions/issues are welcome. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%communication%2FAzure.Communication.ProgrammableConnectivity%2FREADME.png) diff --git a/sdk/communication/Azure.Communication.Sms/src/Models/SmsRecipient.cs b/sdk/communication/Azure.Communication.Sms/src/Models/SmsRecipient.cs new file mode 100644 index 000000000000..743cd3356039 --- /dev/null +++ b/sdk/communication/Azure.Communication.Sms/src/Models/SmsRecipient.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.Sms.Models +{ + [CodeGenModel("SmsRecipient")] + internal partial class SmsRecipient + { + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.net8.0.cs b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.net8.0.cs index 3cf7e7c96b7e..d442e16a8b92 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.net8.0.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.net8.0.cs @@ -303,7 +303,8 @@ public static partial class ArmCommunicationModelFactory public static Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityResult CommunicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason? reason = default(Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason?), string message = null) { throw null; } public static Azure.ResourceManager.Communication.Models.CommunicationServiceKeys CommunicationServiceKeys(string primaryKey = null, string secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } - public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, Azure.Core.ResourceIdentifier notificationHubId, string version, System.Guid? immutableResourceId, System.Collections.Generic.IEnumerable linkedDomains) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationRecords DomainPropertiesVerificationRecords(Azure.ResourceManager.Communication.Models.VerificationDnsRecord domain = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord spf = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim2 = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dmarc = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationStates DomainPropertiesVerificationStates(Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord domain = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord spf = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim2 = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dmarc = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord DomainVerificationStatusRecord(Azure.ResourceManager.Communication.Models.DomainRecordVerificationStatus? status = default(Azure.ResourceManager.Communication.Models.DomainRecordVerificationStatus?), string errorCode = null) { throw null; } diff --git a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs index 3cf7e7c96b7e..d442e16a8b92 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/api/Azure.ResourceManager.Communication.netstandard2.0.cs @@ -303,7 +303,8 @@ public static partial class ArmCommunicationModelFactory public static Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityResult CommunicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason? reason = default(Azure.ResourceManager.Communication.Models.CommunicationNameAvailabilityReason?), string message = null) { throw null; } public static Azure.ResourceManager.Communication.Models.CommunicationServiceKeys CommunicationServiceKeys(string primaryKey = null, string secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } - public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState = default(Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState?), string hostName = null, string dataLocation = null, Azure.Core.ResourceIdentifier notificationHubId = null, string version = null, System.Guid? immutableResourceId = default(System.Guid?), System.Collections.Generic.IEnumerable linkedDomains = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Communication.CommunicationServiceResourceData CommunicationServiceResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Communication.Models.CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, Azure.Core.ResourceIdentifier notificationHubId, string version, System.Guid? immutableResourceId, System.Collections.Generic.IEnumerable linkedDomains) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationRecords DomainPropertiesVerificationRecords(Azure.ResourceManager.Communication.Models.VerificationDnsRecord domain = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord spf = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dkim2 = null, Azure.ResourceManager.Communication.Models.VerificationDnsRecord dmarc = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainPropertiesVerificationStates DomainPropertiesVerificationStates(Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord domain = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord spf = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dkim2 = null, Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord dmarc = null) { throw null; } public static Azure.ResourceManager.Communication.Models.DomainVerificationStatusRecord DomainVerificationStatusRecord(Azure.ResourceManager.Communication.Models.DomainRecordVerificationStatus? status = default(Azure.ResourceManager.Communication.Models.DomainRecordVerificationStatus?), string errorCode = null) { throw null; } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs deleted file mode 100644 index e507d0fbc55a..000000000000 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Customize/ArmCommunicationModelFactory.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Communication.Models -{ - /// Model factory for models. - public static partial class ArmCommunicationModelFactory - { - /// Initializes a new instance of CommunicationServiceResourceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Provisioning state of the resource. - /// FQDN of the CommunicationService instance. - /// The location where the communication service stores its data at rest. - /// Resource ID of an Azure Notification Hub linked to this resource. - /// Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. - /// The immutable resource Id of the communication service. - /// List of email Domain resource Ids. - /// A new instance for mocking. - public static CommunicationServiceResourceData CommunicationServiceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, Azure.ResourceManager.Models.SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CommunicationServicesProvisioningState? provisioningState = null, string hostName = null, string dataLocation = null, ResourceIdentifier notificationHubId = null, string version = null, Guid? immutableResourceId = null, IEnumerable linkedDomains = null) - { - tags ??= new Dictionary(); - linkedDomains ??= new List(); - - return new CommunicationServiceResourceData(id, name, resourceType, systemData, tags, location, provisioningState, hostName, dataLocation, notificationHubId, version, immutableResourceId, linkedDomains?.ToList()); - } - } -} diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs index 79f0edd27ec2..d696004ee96e 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/ArmCommunicationModelFactory.cs @@ -228,5 +228,26 @@ public static SenderUsernameResourceData SenderUsernameResourceData(ResourceIden provisioningState, serializedAdditionalRawData: null); } + + /// Initializes a new instance of CommunicationServiceResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the resource. + /// FQDN of the CommunicationService instance. + /// The location where the communication service stores its data at rest. + /// Resource ID of an Azure Notification Hub linked to this resource. + /// Version of the CommunicationService resource. Probably you need the same or higher version of client SDKs. + /// The immutable resource Id of the communication service. + /// List of email Domain resource Ids. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static CommunicationServiceResourceData CommunicationServiceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CommunicationServicesProvisioningState? provisioningState, string hostName, string dataLocation, ResourceIdentifier notificationHubId, string version, Guid? immutableResourceId, IEnumerable linkedDomains) + { + return CommunicationServiceResourceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, identity: default, provisioningState: provisioningState, hostName: hostName, dataLocation: dataLocation, notificationHubId: notificationHubId, version: version, immutableResourceId: immutableResourceId, linkedDomains: linkedDomains); + } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/assets.json b/sdk/compute/Azure.ResourceManager.Compute/assets.json index 52096c54981b..d21824b12488 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/assets.json +++ b/sdk/compute/Azure.ResourceManager.Compute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/compute/Azure.ResourceManager.Compute", - "Tag": "net/compute/Azure.ResourceManager.Compute_5f424f6784" + "Tag": "net/compute/Azure.ResourceManager.Compute_8a82b9815c" } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/ArmComputeModelFactory.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/ArmComputeModelFactory.cs index ccaa46e8e335..563d42ef8bf5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/ArmComputeModelFactory.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/ArmComputeModelFactory.cs @@ -143,50 +143,10 @@ public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIden etag: etag); } - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualMachineScaleSetVmData VirtualMachineScaleSetVmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string instanceId, ComputeSku sku, ComputePlan plan, IEnumerable resources, IEnumerable zones, ManagedServiceIdentity identity, bool? latestModelApplied, string vmId, VirtualMachineScaleSetVmInstanceView instanceView, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile, SecurityProfile securityProfile, VirtualMachineNetworkProfile networkProfile, IEnumerable networkInterfaceConfigurations, BootDiagnostics bootDiagnostics, ResourceIdentifier availabilitySetId, string provisioningState, string licenseType, string modelDefinitionApplied, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy, string userData, DateTimeOffset? timeCreated) - => VirtualMachineScaleSetVmData(id, name, resourceType, systemData, tags, location, instanceId, sku, plan, resources, zones, identity, null, latestModelApplied, vmId, instanceView, hardwareProfile, storageProfile, additionalCapabilities, osProfile, securityProfile, networkProfile, networkInterfaceConfigurations, bootDiagnostics, availabilitySetId, provisioningState, licenseType, modelDefinitionApplied, protectionPolicy, userData, timeCreated); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualMachineData VirtualMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputePlan plan, IEnumerable resources, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile , VirtualMachineNetworkProfile networkProfile, SecurityProfile securityProfile, BootDiagnostics bootDiagnostics, ResourceIdentifier availabilitySetId, ResourceIdentifier virtualMachineScaleSetId, ResourceIdentifier proximityPlacementGroupId, VirtualMachinePriorityType? priority, VirtualMachineEvictionPolicyType? evictionPolicy, double? billingMaxPrice, ResourceIdentifier hostId, ResourceIdentifier hostGroupId, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int? platformFaultDomain, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, ResourceIdentifier capacityReservationGroupId, IEnumerable galleryApplications, DateTimeOffset? timeCreated) - => VirtualMachineData(id, name, resourceType, systemData, tags, location, plan, resources, identity, zones, extendedLocation, null, null, hardwareProfile, storageProfile, additionalCapabilities, osProfile, networkProfile, securityProfile, bootDiagnostics, availabilitySetId, virtualMachineScaleSetId, proximityPlacementGroupId, priority, evictionPolicy, billingMaxPrice, hostId, hostGroupId, provisioningState, instanceView, licenseType, vmId, extensionsTimeBudget, platformFaultDomain, scheduledEventsProfile, userData, capacityReservationGroupId, galleryApplications, timeCreated); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualMachineInstanceView VirtualMachineInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string computerName, string osName, string osVersion, HyperVGeneration? hyperVGeneration, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IEnumerable disks, IEnumerable extensions, InstanceViewStatus vmHealthStatus, BootDiagnosticsInstanceView bootDiagnostics, string assignedHost, IEnumerable statuses, VirtualMachinePatchStatus patchStatus) - => VirtualMachineInstanceView(platformUpdateDomain, platformFaultDomain, computerName, osName, osVersion, hyperVGeneration, rdpThumbPrint, vmAgent, maintenanceRedeployStatus, disks, extensions, vmHealthStatus, bootDiagnostics, assignedHost, statuses, patchStatus, null); - [EditorBrowsable(EditorBrowsableState.Never)] public static CapacityReservationGroupData CapacityReservationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable zones, IEnumerable capacityReservations, IEnumerable virtualMachinesAssociated, IEnumerable instanceViewCapacityReservations) => CapacityReservationGroupData(id, name, resourceType, systemData, tags, location, zones, capacityReservations, virtualMachinesAssociated, null, null); - [EditorBrowsable(EditorBrowsableState.Never)] - public static GalleryImageVersionData GalleryImageVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GalleryImageVersionPublishingProfile publishingProfile, GalleryProvisioningState? provisioningState, GalleryImageVersionStorageProfile storageProfile, GalleryImageVersionSafetyProfile safetyProfile, ReplicationStatus replicationStatus) - => GalleryImageVersionData(id, name, resourceType, systemData, tags, location, publishingProfile, provisioningState, storageProfile, safetyProfile, replicationStatus, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static SharedGalleryData SharedGalleryData(string name, AzureLocation? location, string uniqueId) - => SharedGalleryData(name, location, uniqueId, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static SharedGalleryImageData SharedGalleryImageData(string name, AzureLocation? location, string uniqueId, SupportedOperatingSystemType? osType, OperatingSystemStateType? osState, DateTimeOffset? endOfLifeOn, GalleryImageIdentifier identifier, RecommendedMachineConfiguration recommended, IEnumerable disallowedDiskTypes, HyperVGeneration? hyperVGeneration, IEnumerable features, ImagePurchasePlan purchasePlan, ArchitectureType? architecture, Uri privacyStatementUri, string eula) - => SharedGalleryImageData(name, location, uniqueId, osType, osState, endOfLifeOn, identifier, recommended, disallowedDiskTypes, hyperVGeneration, features, purchasePlan, architecture, privacyStatementUri, eula, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static SharedGalleryImageVersionData SharedGalleryImageVersionData(string name, AzureLocation? location, string uniqueId, DateTimeOffset? publishedOn, DateTimeOffset? endOfLifeOn, bool? isExcludedFromLatest, SharedGalleryImageVersionStorageProfile storageProfile) - => SharedGalleryImageVersionData(name, location, uniqueId, publishedOn, endOfLifeOn, isExcludedFromLatest, storageProfile, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static CommunityGalleryData CommunityGalleryData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId) - => CommunityGalleryData(name, location, resourceType, uniqueId, null, null, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static CommunityGalleryImageData CommunityGalleryImageData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId, SupportedOperatingSystemType? osType, OperatingSystemStateType? osState, DateTimeOffset? endOfLifeOn, CommunityGalleryImageIdentifier imageIdentifier, RecommendedMachineConfiguration recommended, IEnumerable disallowedDiskTypes, HyperVGeneration? hyperVGeneration, IEnumerable features, ImagePurchasePlan purchasePlan, ArchitectureType? architecture, Uri privacyStatementUri, string eula) - => CommunityGalleryImageData(name, location, resourceType, uniqueId, osType, osState, endOfLifeOn, imageIdentifier, recommended, disallowedDiskTypes, hyperVGeneration, features, purchasePlan, architecture, privacyStatementUri, eula, null, null); - - [EditorBrowsable(EditorBrowsableState.Never)] - public static CommunityGalleryImageVersionData CommunityGalleryImageVersionData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId, DateTimeOffset? publishedOn, DateTimeOffset? endOfLifeOn, bool? isExcludedFromLatest, SharedGalleryImageVersionStorageProfile storageProfile) - => CommunityGalleryImageVersionData(name, location, resourceType, uniqueId, publishedOn, endOfLifeOn, isExcludedFromLatest, storageProfile, null, null); - [EditorBrowsable(EditorBrowsableState.Never)] public static CommunityGalleryInfo CommunityGalleryInfo(Uri publisherUri = null, string publisherContact = null, string eula = null, string publicNamePrefix = null, bool? communityGalleryEnabled = null, IEnumerable publicNames = null) => CommunityGalleryInfo(publisherUri.AbsoluteUri, publisherContact, eula, publicNamePrefix, communityGalleryEnabled, publicNames?.ToList()); diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs index e49ecacf3624..576fefc19a4e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs @@ -4456,6 +4456,66 @@ public static OSVersionPropertiesBase OSVersionPropertiesBase(string version = n return new OSVersionPropertiesBase(version, label, isDefault, isActive, serializedAdditionalRawData: null); } + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualMachineScaleSetVmData VirtualMachineScaleSetVmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string instanceId, ComputeSku sku, ComputePlan plan, IEnumerable resources, IEnumerable zones, ManagedServiceIdentity identity, bool? latestModelApplied, string vmId, VirtualMachineScaleSetVmInstanceView instanceView, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile, SecurityProfile securityProfile, VirtualMachineNetworkProfile networkProfile, IEnumerable networkInterfaceConfigurations, BootDiagnostics bootDiagnostics, ResourceIdentifier availabilitySetId, string provisioningState, string licenseType, string modelDefinitionApplied, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy, string userData, DateTimeOffset? timeCreated) + { + return VirtualMachineScaleSetVmData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, instanceId: instanceId, sku: sku, plan: plan, resources: resources, zones: zones, identity: identity, etag: default, latestModelApplied: latestModelApplied, vmId: vmId, instanceView: instanceView, hardwareProfile: hardwareProfile, storageProfile: storageProfile, additionalCapabilities: additionalCapabilities, osProfile: osProfile, securityProfile: securityProfile, networkProfile: networkProfile, networkInterfaceConfigurations: networkInterfaceConfigurations, bootDiagnostics: bootDiagnostics, availabilitySetId: availabilitySetId, provisioningState: provisioningState, licenseType: licenseType, modelDefinitionApplied: modelDefinitionApplied, protectionPolicy: protectionPolicy, userData: userData, timeCreated: timeCreated); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualMachineData VirtualMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputePlan plan, IEnumerable resources, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile, VirtualMachineNetworkProfile networkProfile, SecurityProfile securityProfile, BootDiagnostics bootDiagnostics, ResourceIdentifier availabilitySetId, ResourceIdentifier virtualMachineScaleSetId, ResourceIdentifier proximityPlacementGroupId, VirtualMachinePriorityType? priority, VirtualMachineEvictionPolicyType? evictionPolicy, double? billingMaxPrice, ResourceIdentifier hostId, ResourceIdentifier hostGroupId, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int? platformFaultDomain, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, ResourceIdentifier capacityReservationGroupId, IEnumerable galleryApplications, DateTimeOffset? timeCreated) + { + return VirtualMachineData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, plan: plan, resources: resources, identity: identity, zones: zones, extendedLocation: extendedLocation, managedBy: default, etag: default, hardwareProfile: hardwareProfile, scheduledEventsPolicy: default, storageProfile: storageProfile, additionalCapabilities: additionalCapabilities, osProfile: osProfile, networkProfile: networkProfile, securityProfile: securityProfile, bootDiagnostics: bootDiagnostics, availabilitySetId: availabilitySetId, virtualMachineScaleSetId: virtualMachineScaleSetId, proximityPlacementGroupId: proximityPlacementGroupId, priority: priority, evictionPolicy: evictionPolicy, billingMaxPrice: billingMaxPrice, hostId: hostId, hostGroupId: hostGroupId, provisioningState: provisioningState, instanceView: instanceView, licenseType: licenseType, vmId: vmId, extensionsTimeBudget: extensionsTimeBudget, platformFaultDomain: platformFaultDomain, scheduledEventsProfile: scheduledEventsProfile, userData: userData, capacityReservationGroupId: capacityReservationGroupId, galleryApplications: galleryApplications, timeCreated: timeCreated); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualMachineInstanceView VirtualMachineInstanceView(int? platformUpdateDomain, int? platformFaultDomain, string computerName, string osName, string osVersion, HyperVGeneration? hyperVGeneration, string rdpThumbPrint, VirtualMachineAgentInstanceView vmAgent, MaintenanceRedeployStatus maintenanceRedeployStatus, IEnumerable disks, IEnumerable extensions, InstanceViewStatus vmHealthStatus, BootDiagnosticsInstanceView bootDiagnostics, string assignedHost, IEnumerable statuses, VirtualMachinePatchStatus patchStatus) + { + return VirtualMachineInstanceView(platformUpdateDomain: platformUpdateDomain, platformFaultDomain: platformFaultDomain, computerName: computerName, osName: osName, osVersion: osVersion, hyperVGeneration: hyperVGeneration, rdpThumbPrint: rdpThumbPrint, vmAgent: vmAgent, maintenanceRedeployStatus: maintenanceRedeployStatus, disks: disks, extensions: extensions, vmHealthStatus: vmHealthStatus, bootDiagnostics: bootDiagnostics, assignedHost: assignedHost, statuses: statuses, patchStatus: patchStatus, isVmInStandbyPool: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static GalleryImageVersionData GalleryImageVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GalleryImageVersionPublishingProfile publishingProfile, GalleryProvisioningState? provisioningState, GalleryImageVersionStorageProfile storageProfile, GalleryImageVersionSafetyProfile safetyProfile, ReplicationStatus replicationStatus) + { + return GalleryImageVersionData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, publishingProfile: publishingProfile, provisioningState: provisioningState, storageProfile: storageProfile, safetyProfile: safetyProfile, replicationStatus: replicationStatus, securityUefiSettings: default, isRestoreEnabled: default, validationsProfile: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static SharedGalleryData SharedGalleryData(string name, AzureLocation? location, string uniqueId) + { + return SharedGalleryData(name: name, location: location, uniqueId: uniqueId, artifactTags: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static SharedGalleryImageData SharedGalleryImageData(string name, AzureLocation? location, string uniqueId, SupportedOperatingSystemType? osType, OperatingSystemStateType? osState, DateTimeOffset? endOfLifeOn, GalleryImageIdentifier identifier, RecommendedMachineConfiguration recommended, IEnumerable disallowedDiskTypes, HyperVGeneration? hyperVGeneration, IEnumerable features, ImagePurchasePlan purchasePlan, ArchitectureType? architecture, Uri privacyStatementUri, string eula) + { + return SharedGalleryImageData(name: name, location: location, uniqueId: uniqueId, osType: osType, osState: osState, endOfLifeOn: endOfLifeOn, identifier: identifier, recommended: recommended, disallowedDiskTypes: disallowedDiskTypes, hyperVGeneration: hyperVGeneration, features: features, purchasePlan: purchasePlan, architecture: architecture, privacyStatementUri: privacyStatementUri, eula: eula, artifactTags: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static SharedGalleryImageVersionData SharedGalleryImageVersionData(string name, AzureLocation? location, string uniqueId, DateTimeOffset? publishedOn, DateTimeOffset? endOfLifeOn, bool? isExcludedFromLatest, SharedGalleryImageVersionStorageProfile storageProfile) + { + return SharedGalleryImageVersionData(name: name, location: location, uniqueId: uniqueId, publishedOn: publishedOn, endOfLifeOn: endOfLifeOn, isExcludedFromLatest: isExcludedFromLatest, storageProfile: storageProfile, artifactTags: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static CommunityGalleryData CommunityGalleryData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId) + { + return CommunityGalleryData(name: name, location: location, resourceType: resourceType, uniqueId: uniqueId, disclaimer: default, artifactTags: default, communityMetadata: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static CommunityGalleryImageData CommunityGalleryImageData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId, SupportedOperatingSystemType? osType, OperatingSystemStateType? osState, DateTimeOffset? endOfLifeOn, CommunityGalleryImageIdentifier imageIdentifier, RecommendedMachineConfiguration recommended, IEnumerable disallowedDiskTypes, HyperVGeneration? hyperVGeneration, IEnumerable features, ImagePurchasePlan purchasePlan, ArchitectureType? architecture, Uri privacyStatementUri, string eula) + { + return CommunityGalleryImageData(name: name, location: location, resourceType: resourceType, uniqueId: uniqueId, osType: osType, osState: osState, endOfLifeOn: endOfLifeOn, imageIdentifier: imageIdentifier, recommended: recommended, disallowedDiskTypes: disallowedDiskTypes, hyperVGeneration: hyperVGeneration, features: features, purchasePlan: purchasePlan, architecture: architecture, privacyStatementUri: privacyStatementUri, eula: eula, disclaimer: default, artifactTags: default); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public static CommunityGalleryImageVersionData CommunityGalleryImageVersionData(string name, AzureLocation? location, ResourceType? resourceType, string uniqueId, DateTimeOffset? publishedOn, DateTimeOffset? endOfLifeOn, bool? isExcludedFromLatest, SharedGalleryImageVersionStorageProfile storageProfile) + { + return CommunityGalleryImageVersionData(name: name, location: location, resourceType: resourceType, uniqueId: uniqueId, publishedOn: publishedOn, endOfLifeOn: endOfLifeOn, isExcludedFromLatest: isExcludedFromLatest, storageProfile: storageProfile, disclaimer: default, artifactTags: default); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/AvailabilitySetOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/AvailabilitySetOperationsTests.cs index 03aee1fdf62e..6f1650c2b672 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/AvailabilitySetOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/AvailabilitySetOperationsTests.cs @@ -129,7 +129,6 @@ public async Task PlacementGroupId() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostGroupOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostGroupOperationsTests.cs index 48370fb402a5..163be8f7568e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostGroupOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostGroupOperationsTests.cs @@ -48,7 +48,6 @@ public async Task Get() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostOperationsTests.cs index 55b868969c47..656516a5588b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DedicatedHostOperationsTests.cs @@ -75,7 +75,6 @@ public async Task Update() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DiskAccessOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DiskAccessOperationsTests.cs index a5072fbe1956..2c5525a83e0f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DiskAccessOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/DiskAccessOperationsTests.cs @@ -48,7 +48,6 @@ public async Task Get() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryImageOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryImageOperationsTests.cs index f3a7e98086a6..87fea8338704 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryImageOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryImageOperationsTests.cs @@ -85,7 +85,6 @@ public async Task Update() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryOperationsTests.cs index aa79f38beb45..43f5ebf5528b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/GalleryOperationsTests.cs @@ -71,7 +71,6 @@ public async Task Update() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs index 03ad6425f101..fda220380177 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs @@ -67,7 +67,6 @@ public async Task Update() [TestCase(null)] [TestCase(true)] [TestCase(false)] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/36714")] public async Task SetTags(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md index 30d258143c0d..6f4be06a9baf 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2025-01-24) ### Features Added diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj index c2270b634694..4fc6fd8ec7c8 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Azure.ResourceManager.ComputeSchedule.csproj @@ -1,6 +1,8 @@ - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 Azure.ResourceManager.ComputeSchedule Azure Resource Manager client SDK for Azure resource provider ComputeSchedule. azure;management;arm;resource manager;computeschedule diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml index 4a3963af7c5d..43a99ae83111 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: edcf57995e73f9662a4060586f0308bb999d7493 +commit: 62e3312e67873d702fb2c6e5c7717d99cf4d369b repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.CodeTransparency/README.md b/sdk/confidentialledger/Azure.Security.CodeTransparency/README.md index 6ea9ec6e3afd..7203b8f074c6 100644 --- a/sdk/confidentialledger/Azure.Security.CodeTransparency/README.md +++ b/sdk/confidentialledger/Azure.Security.CodeTransparency/README.md @@ -103,5 +103,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [ccf]: https://github.com/Microsoft/CCF [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fconfidentialledger%2FAzure.Security.CodeTransparency%2FREADME.png) diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md index abaa9b433dc1..a36a3790ec61 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.4.2-beta.1 (Unreleased) +## 1.4.1-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,11 @@ ### Other Changes +## 1.4.1-beta.1 (2025-01-27) + +### Features Added +- Added the ability to list users and roles. + ## 1.3.0 (2023-12-05) ### Features Added diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md index c7aeb5614685..fbe8c6dcf07d 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md @@ -403,5 +403,3 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq [cla]: https://cla.microsoft.com [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fconfidentialledger%2FAzure.Template%2FREADME.png) diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.net8.0.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.net8.0.cs index 54f71c70cf73..f1278fa41532 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.net8.0.cs +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.net8.0.cs @@ -10,20 +10,10 @@ public ConfidentialLedgerClient(System.Uri ledgerEndpoint, System.Security.Crypt public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } public virtual Azure.Response CreateLedgerEntry(Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task CreateLedgerEntryAsync(Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateOrUpdateLedgerUser(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateOrUpdateLedgerUserAsync(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateOrUpdateUser(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task CreateOrUpdateUserAsync(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateUserDefinedEndpoint(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateUserDefinedEndpointAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateUserDefinedRole(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateUserDefinedRoleAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteLedgerUser(string userId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteLedgerUserAsync(string userId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteUser(string userId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteUserDefinedRole(string roleName, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteUserDefinedRoleAsync(string roleName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetCollections(Azure.RequestContext context = null) { throw null; } public virtual Azure.AsyncPageable GetCollectionsAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetConsortiumMembers(Azure.RequestContext context = null) { throw null; } @@ -38,32 +28,16 @@ public ConfidentialLedgerClient(System.Uri ledgerEndpoint, System.Security.Crypt public virtual Azure.AsyncPageable GetLedgerEntriesAsync(string collectionId = null, string fromTransactionId = null, string toTransactionId = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetLedgerEntry(string transactionId, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetLedgerEntryAsync(string transactionId, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetLedgerUser(string userId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetLedgerUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetLedgerUsers(Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetLedgerUsersAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetReceipt(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetReceiptAsync(string transactionId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetRuntimeOptions(Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetRuntimeOptionsAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetTransactionStatus(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetTransactionStatusAsync(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetUser(string userId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedEndpoint(Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedEndpointAsync(Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedEndpointsModule(string module, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedEndpointsModuleAsync(string module, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedRole(string roleName, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedRoleAsync(string roleName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetUsers(Azure.RequestContext context = null) { throw null; } public virtual Azure.AsyncPageable GetUsersAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation PostLedgerEntry(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task PostLedgerEntryAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateRuntimeOptions(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task UpdateRuntimeOptionsAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateUserDefinedRole(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task UpdateUserDefinedRoleAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } public partial class ConfidentialLedgerClientOptions : Azure.Core.ClientOptions { diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.netstandard2.0.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.netstandard2.0.cs index 54f71c70cf73..f1278fa41532 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.netstandard2.0.cs +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/api/Azure.Security.ConfidentialLedger.netstandard2.0.cs @@ -10,20 +10,10 @@ public ConfidentialLedgerClient(System.Uri ledgerEndpoint, System.Security.Crypt public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } public virtual Azure.Response CreateLedgerEntry(Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task CreateLedgerEntryAsync(Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateOrUpdateLedgerUser(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateOrUpdateLedgerUserAsync(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateOrUpdateUser(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task CreateOrUpdateUserAsync(string userId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateUserDefinedEndpoint(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateUserDefinedEndpointAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateUserDefinedRole(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task CreateUserDefinedRoleAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteLedgerUser(string userId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteLedgerUserAsync(string userId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteUser(string userId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteUserDefinedRole(string roleName, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteUserDefinedRoleAsync(string roleName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetCollections(Azure.RequestContext context = null) { throw null; } public virtual Azure.AsyncPageable GetCollectionsAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetConsortiumMembers(Azure.RequestContext context = null) { throw null; } @@ -38,32 +28,16 @@ public ConfidentialLedgerClient(System.Uri ledgerEndpoint, System.Security.Crypt public virtual Azure.AsyncPageable GetLedgerEntriesAsync(string collectionId = null, string fromTransactionId = null, string toTransactionId = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetLedgerEntry(string transactionId, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetLedgerEntryAsync(string transactionId, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetLedgerUser(string userId, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetLedgerUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Pageable GetLedgerUsers(Azure.RequestContext context = null) { throw null; } - public virtual Azure.AsyncPageable GetLedgerUsersAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetReceipt(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetReceiptAsync(string transactionId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetRuntimeOptions(Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetRuntimeOptionsAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetTransactionStatus(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetTransactionStatusAsync(string transactionId, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response GetUser(string userId, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task GetUserAsync(string userId, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedEndpoint(Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedEndpointAsync(Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedEndpointsModule(string module, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedEndpointsModuleAsync(string module, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetUserDefinedRole(string roleName, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task GetUserDefinedRoleAsync(string roleName, Azure.RequestContext context = null) { throw null; } public virtual Azure.Pageable GetUsers(Azure.RequestContext context = null) { throw null; } public virtual Azure.AsyncPageable GetUsersAsync(Azure.RequestContext context = null) { throw null; } public virtual Azure.Operation PostLedgerEntry(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task PostLedgerEntryAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string collectionId = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateRuntimeOptions(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task UpdateRuntimeOptionsAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateUserDefinedRole(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task UpdateUserDefinedRoleAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } public partial class ConfidentialLedgerClientOptions : Azure.Core.ClientOptions { diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj index ed2c452fb3d0..e02abe06b65e 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj @@ -2,7 +2,7 @@ Client SDK for the Azure Confidential Ledger service Azure Confidential Ledger - 1.4.2-beta.1 + 1.4.1-beta.2 1.3.0 Azure ConfidentialLedger diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/ConfidentialLedgerClient.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/ConfidentialLedgerClient.cs index dc78d19a1e62..26535501ffbc 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/ConfidentialLedgerClient.cs +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/ConfidentialLedgerClient.cs @@ -706,810 +706,6 @@ public virtual Response CreateOrUpdateUser(string userId, RequestContent content } } - /// - /// [Protocol Method] Deletes a user with multiple roles from the Confidential Ledger. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteLedgerUserAsync(string userId, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.DeleteLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteLedgerUserRequest(userId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Deletes a user with multiple roles from the Confidential Ledger. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteLedgerUser(string userId, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.DeleteLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteLedgerUserRequest(userId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets a user with multiple roles. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetLedgerUserAsync(string userId, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLedgerUserRequest(userId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets a user with multiple roles. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetLedgerUser(string userId, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLedgerUserRequest(userId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Adds a user or updates a user's fields. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CreateOrUpdateLedgerUserAsync(string userId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateOrUpdateLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateLedgerUserRequest(userId, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Adds a user or updates a user's fields. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The user id, either an AAD object ID or certificate fingerprint. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CreateOrUpdateLedgerUser(string userId, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(userId, nameof(userId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateOrUpdateLedgerUser"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateLedgerUserRequest(userId, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets a user defined endpoint. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetUserDefinedEndpointAsync(RequestContext context = null) - { - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedEndpoint"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedEndpointRequest(context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets a user defined endpoint. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetUserDefinedEndpoint(RequestContext context = null) - { - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedEndpoint"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedEndpointRequest(context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a user defined endpoint. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CreateUserDefinedEndpointAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateUserDefinedEndpoint"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateUserDefinedEndpointRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a user defined endpoint. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CreateUserDefinedEndpoint(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateUserDefinedEndpoint"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateUserDefinedEndpointRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Runtime options for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetRuntimeOptionsAsync(RequestContext context = null) - { - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetRuntimeOptions"); - scope.Start(); - try - { - using HttpMessage message = CreateGetRuntimeOptionsRequest(context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Runtime options for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetRuntimeOptions(RequestContext context = null) - { - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetRuntimeOptions"); - scope.Start(); - try - { - using HttpMessage message = CreateGetRuntimeOptionsRequest(context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Runtime options for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task UpdateRuntimeOptionsAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.UpdateRuntimeOptions"); - scope.Start(); - try - { - using HttpMessage message = CreateUpdateRuntimeOptionsRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Runtime options for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response UpdateRuntimeOptions(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.UpdateRuntimeOptions"); - scope.Start(); - try - { - using HttpMessage message = CreateUpdateRuntimeOptionsRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Module for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// module name of the user defined endpoint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetUserDefinedEndpointsModuleAsync(string module, RequestContext context = null) - { - Argument.AssertNotNull(module, nameof(module)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedEndpointsModule"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedEndpointsModuleRequest(module, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Module for user defined endpoints. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// module name of the user defined endpoint. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetUserDefinedEndpointsModule(string module, RequestContext context = null) - { - Argument.AssertNotNull(module, nameof(module)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedEndpointsModule"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedEndpointsModuleRequest(module, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets role actions for user defined roles - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// user defined role name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetUserDefinedRoleAsync(string roleName, RequestContext context = null) - { - Argument.AssertNotNull(roleName, nameof(roleName)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedRoleRequest(roleName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets role actions for user defined roles - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// user defined role name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetUserDefinedRole(string roleName, RequestContext context = null) - { - Argument.AssertNotNull(roleName, nameof(roleName)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.GetUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUserDefinedRoleRequest(roleName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates new roles and their actions - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CreateUserDefinedRoleAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateUserDefinedRoleRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates new roles and their actions - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CreateUserDefinedRole(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.CreateUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateUserDefinedRoleRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must be deleted and recreated. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task UpdateUserDefinedRoleAsync(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.UpdateUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateUpdateUserDefinedRoleRequest(content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must be deleted and recreated. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response UpdateUserDefinedRole(RequestContent content, RequestContext context = null) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.UpdateUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateUpdateUserDefinedRoleRequest(content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Deletes user defined roles - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// user defined role name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteUserDefinedRoleAsync(string roleName, RequestContext context = null) - { - Argument.AssertNotNull(roleName, nameof(roleName)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.DeleteUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteUserDefinedRoleRequest(roleName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Deletes user defined roles - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// user defined role name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteUserDefinedRole(string roleName, RequestContext context = null) - { - Argument.AssertNotNull(roleName, nameof(roleName)); - - using var scope = ClientDiagnostics.CreateScope("ConfidentialLedgerClient.DeleteUserDefinedRole"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteUserDefinedRoleRequest(roleName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// [Protocol Method] Lists the consortium members. /// @@ -1684,48 +880,6 @@ public virtual Pageable GetUsers(RequestContext context = null) return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConfidentialLedgerClient.GetUsers", "ledgerUsers", "nextLink", context); } - /// - /// [Protocol Method] Gets details on a list of users. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetLedgerUsersAsync(RequestContext context = null) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLedgerUsersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLedgerUsersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConfidentialLedgerClient.GetLedgerUsers", "ledgerUsers", "nextLink", context); - } - - /// - /// [Protocol Method] Gets details on a list of users. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetLedgerUsers(RequestContext context = null) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLedgerUsersRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLedgerUsersNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConfidentialLedgerClient.GetLedgerUsers", "ledgerUsers", "nextLink", context); - } - internal HttpMessage CreateGetConstitutionRequest(RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -1911,20 +1065,6 @@ internal HttpMessage CreateGetUsersRequest(RequestContext context) return message; } - internal HttpMessage CreateGetLedgerUsersRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/ledgerUsers", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - internal HttpMessage CreateDeleteUserRequest(string userId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier204); @@ -1972,190 +1112,6 @@ internal HttpMessage CreateCreateOrUpdateUserRequest(string userId, RequestConte return message; } - internal HttpMessage CreateDeleteLedgerUserRequest(string userId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/ledgerUsers/", false); - uri.AppendPath(userId, false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetLedgerUserRequest(string userId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/ledgerUsers/", false); - uri.AppendPath(userId, false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateOrUpdateLedgerUserRequest(string userId, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/ledgerUsers/", false); - uri.AppendPath(userId, false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/merge-patch+json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetUserDefinedEndpointRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/userDefinedEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateUserDefinedEndpointRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier201); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/userDefinedEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetRuntimeOptionsRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/userDefinedEndpoints/runTimeOptions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateUpdateRuntimeOptionsRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/userDefinedEndpoints/runTimeOptions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetUserDefinedEndpointsModuleRequest(string module, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/userDefinedEndpoints/modules", false); - uri.AppendQuery("module", module, false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetUserDefinedRoleRequest(string roleName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/roles", false); - uri.AppendQuery("roleName", roleName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateUserDefinedRoleRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/roles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateUpdateUserDefinedRoleRequest(RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/roles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteUserDefinedRoleRequest(string roleName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/app/roles", false); - uri.AppendQuery("roleName", roleName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - internal HttpMessage CreateGetConsortiumMembersNextPageRequest(string nextLink, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -2208,24 +1164,9 @@ internal HttpMessage CreateGetUsersNextPageRequest(string nextLink, RequestConte return message; } - internal HttpMessage CreateGetLedgerUsersNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - private static ResponseClassifier _responseClassifier200; private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); private static ResponseClassifier _responseClassifier204; private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); - private static ResponseClassifier _responseClassifier201; - private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); } } diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/Docs/ConfidentialLedgerClient.xml b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/Docs/ConfidentialLedgerClient.xml index bf07be687f33..07f5a604ee69 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/Docs/ConfidentialLedgerClient.xml +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Generated/Docs/ConfidentialLedgerClient.xml @@ -603,882 +603,6 @@ Response response = client.CreateOrUpdateUser("", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("assignedRole").ToString()); Console.WriteLine(result.GetProperty("userId").ToString()); -]]> - - - -This sample shows how to call DeleteLedgerUserAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.DeleteLedgerUserAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteLedgerUserAsync with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.DeleteLedgerUserAsync(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteLedgerUser. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.DeleteLedgerUser(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteLedgerUser with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.DeleteLedgerUser(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetLedgerUserAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetLedgerUserAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -]]> -This sample shows how to call GetLedgerUserAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetLedgerUserAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -Console.WriteLine(result.GetProperty("userId").ToString()); -]]> - - - -This sample shows how to call GetLedgerUser and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetLedgerUser(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -]]> -This sample shows how to call GetLedgerUser with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetLedgerUser(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -Console.WriteLine(result.GetProperty("userId").ToString()); -]]> - - - -This sample shows how to call CreateOrUpdateLedgerUserAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - assignedRoles = new object[] - { - "Administrator" - }, -}); -Response response = await client.CreateOrUpdateLedgerUserAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -]]> -This sample shows how to call CreateOrUpdateLedgerUserAsync with all parameters and request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - assignedRoles = new object[] - { - "Administrator" - }, -}); -Response response = await client.CreateOrUpdateLedgerUserAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -Console.WriteLine(result.GetProperty("userId").ToString()); -]]> - - - -This sample shows how to call CreateOrUpdateLedgerUser and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - assignedRoles = new object[] - { - "Administrator" - }, -}); -Response response = client.CreateOrUpdateLedgerUser("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -]]> -This sample shows how to call CreateOrUpdateLedgerUser with all parameters and request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - assignedRoles = new object[] - { - "Administrator" - }, -}); -Response response = client.CreateOrUpdateLedgerUser("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -Console.WriteLine(result.GetProperty("userId").ToString()); -]]> - - - -This sample shows how to call GetUserDefinedEndpointAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedEndpointAsync(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modules").ToString()); -]]> -This sample shows how to call GetUserDefinedEndpointAsync with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedEndpointAsync(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("modules").ToString()); -]]> - - - -This sample shows how to call GetUserDefinedEndpoint and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedEndpoint(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("modules").ToString()); -]]> -This sample shows how to call GetUserDefinedEndpoint with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedEndpoint(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("authn_policies")[0].ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("forwarding_required").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("interpreter_reuse").GetProperty("key").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_function").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_module").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("mode").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi_hidden").ToString()); -Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("redirection_strategy").ToString()); -Console.WriteLine(result.GetProperty("modules").ToString()); -]]> - - - -This sample shows how to call CreateUserDefinedEndpointAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - metadata = new - { - endpoints = new - { - key = new object(), - }, - }, - modules = new object(), -}); -Response response = await client.CreateUserDefinedEndpointAsync(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call CreateUserDefinedEndpointAsync with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - metadata = new - { - endpoints = new - { - key = new - { - get = new - { - authn_policies = new object[] - { - new object() - }, - forwarding_required = "sometimes", - interpreter_reuse = new - { - key = "", - }, - js_function = "", - js_module = "", - mode = "readwrite", - openapi = new object(), - openapi_hidden = true, - redirection_strategy = "none", - }, - }, - }, - }, - modules = new object(), -}); -Response response = await client.CreateUserDefinedEndpointAsync(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call CreateUserDefinedEndpoint. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - metadata = new - { - endpoints = new - { - key = new object(), - }, - }, - modules = new object(), -}); -Response response = client.CreateUserDefinedEndpoint(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call CreateUserDefinedEndpoint with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - metadata = new - { - endpoints = new - { - key = new - { - get = new - { - authn_policies = new object[] - { - new object() - }, - forwarding_required = "sometimes", - interpreter_reuse = new - { - key = "", - }, - js_function = "", - js_module = "", - mode = "readwrite", - openapi = new object(), - openapi_hidden = true, - redirection_strategy = "none", - }, - }, - }, - }, - modules = new object(), -}); -Response response = client.CreateUserDefinedEndpoint(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetRuntimeOptionsAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetRuntimeOptionsAsync(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call GetRuntimeOptionsAsync with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetRuntimeOptionsAsync(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("log_exception_details").ToString()); -Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); -Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); -Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); -Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); -Console.WriteLine(result.GetProperty("return_exception_details").ToString()); -]]> - - - -This sample shows how to call GetRuntimeOptions and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetRuntimeOptions(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call GetRuntimeOptions with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetRuntimeOptions(); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("log_exception_details").ToString()); -Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); -Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); -Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); -Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); -Console.WriteLine(result.GetProperty("return_exception_details").ToString()); -]]> - - - -This sample shows how to call UpdateRuntimeOptionsAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = await client.UpdateRuntimeOptionsAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call UpdateRuntimeOptionsAsync with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - log_exception_details = true, - max_cached_interpreters = 1234L, - max_execution_time_ms = 1234L, - max_heap_bytes = 1234L, - max_stack_bytes = 1234L, - return_exception_details = true, -}); -Response response = await client.UpdateRuntimeOptionsAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("log_exception_details").ToString()); -Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); -Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); -Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); -Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); -Console.WriteLine(result.GetProperty("return_exception_details").ToString()); -]]> - - - -This sample shows how to call UpdateRuntimeOptions and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = client.UpdateRuntimeOptions(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call UpdateRuntimeOptions with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new -{ - log_exception_details = true, - max_cached_interpreters = 1234L, - max_execution_time_ms = 1234L, - max_heap_bytes = 1234L, - max_stack_bytes = 1234L, - return_exception_details = true, -}); -Response response = client.UpdateRuntimeOptions(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("log_exception_details").ToString()); -Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); -Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); -Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); -Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); -Console.WriteLine(result.GetProperty("return_exception_details").ToString()); -]]> - - - -This sample shows how to call GetUserDefinedEndpointsModuleAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedEndpointsModuleAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("module").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call GetUserDefinedEndpointsModuleAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedEndpointsModuleAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("module").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -]]> - - - -This sample shows how to call GetUserDefinedEndpointsModule and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedEndpointsModule(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("module").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call GetUserDefinedEndpointsModule with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedEndpointsModule(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("module").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -]]> - - - -This sample shows how to call GetUserDefinedRoleAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedRoleAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result[0].ToString()); -]]> -This sample shows how to call GetUserDefinedRoleAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.GetUserDefinedRoleAsync(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result[0].GetProperty("roleName").ToString()); -Console.WriteLine(result[0].GetProperty("roleActions")[0].ToString()); -]]> - - - -This sample shows how to call GetUserDefinedRole and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedRole(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result[0].ToString()); -]]> -This sample shows how to call GetUserDefinedRole with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.GetUserDefinedRole(""); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result[0].GetProperty("roleName").ToString()); -Console.WriteLine(result[0].GetProperty("roleActions")[0].ToString()); -]]> - - - -This sample shows how to call CreateUserDefinedRoleAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new object() -}); -Response response = await client.CreateUserDefinedRoleAsync(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call CreateUserDefinedRoleAsync with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new - { - roleName = "", - roleActions = new object[] - { - "" - }, - } -}); -Response response = await client.CreateUserDefinedRoleAsync(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call CreateUserDefinedRole. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new object() -}); -Response response = client.CreateUserDefinedRole(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call CreateUserDefinedRole with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new - { - roleName = "", - roleActions = new object[] - { - "" - }, - } -}); -Response response = client.CreateUserDefinedRole(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call UpdateUserDefinedRoleAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new object() -}); -Response response = await client.UpdateUserDefinedRoleAsync(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call UpdateUserDefinedRoleAsync with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new - { - roleName = "", - roleActions = new object[] - { - "" - }, - } -}); -Response response = await client.UpdateUserDefinedRoleAsync(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call UpdateUserDefinedRole. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new object() -}); -Response response = client.UpdateUserDefinedRole(content); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call UpdateUserDefinedRole with all request content. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object[] -{ - new - { - roleName = "", - roleActions = new object[] - { - "" - }, - } -}); -Response response = client.UpdateUserDefinedRole(content); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteUserDefinedRoleAsync. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.DeleteUserDefinedRoleAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteUserDefinedRoleAsync with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = await client.DeleteUserDefinedRoleAsync(""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteUserDefinedRole. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.DeleteUserDefinedRole(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteUserDefinedRole with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -Response response = client.DeleteUserDefinedRole(""); - -Console.WriteLine(response.Status); ]]> @@ -1705,62 +829,6 @@ foreach (BinaryData item in client.GetUsers()) Console.WriteLine(result.GetProperty("assignedRole").ToString()); Console.WriteLine(result.GetProperty("userId").ToString()); } -]]> - - - -This sample shows how to call GetLedgerUsersAsync and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -await foreach (BinaryData item in client.GetLedgerUsersAsync()) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -} -]]> -This sample shows how to call GetLedgerUsersAsync with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -await foreach (BinaryData item in client.GetLedgerUsersAsync()) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); -} -]]> - - - -This sample shows how to call GetLedgerUsers and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -foreach (BinaryData item in client.GetLedgerUsers()) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); -} -]]> -This sample shows how to call GetLedgerUsers with all request content and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - -foreach (BinaryData item in client.GetLedgerUsers()) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); -} ]]> diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/autorest.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/autorest.md index a83661997653..b3199185f519 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/autorest.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/autorest.md @@ -10,17 +10,17 @@ security: AADToken security-scopes: "https://confidential-ledger.azure.com/.default" keep-non-overloadable-protocol-signature: true input-file: -- https://github.com/Azure/azure-rest-api-specs/blob/4ae5cdc221660762336d5a899495b2b4941ea486/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-08-22-preview/common.json -- https://github.com/Azure/azure-rest-api-specs/blob/4ae5cdc221660762336d5a899495b2b4941ea486/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-08-22-preview/confidentialledger.json -- https://github.com/Azure/azure-rest-api-specs/blob/4ae5cdc221660762336d5a899495b2b4941ea486/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-08-22-preview/identityservice.json +- https://github.com/Azure/azure-rest-api-specs/blob/adb20036091c8d853084e62f89e1aecb866254d2/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-01-26-preview/common.json +- https://github.com/Azure/azure-rest-api-specs/blob/adb20036091c8d853084e62f89e1aecb866254d2/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-01-26-preview/confidentialledger.json +- https://github.com/Azure/azure-rest-api-specs/blob/adb20036091c8d853084e62f89e1aecb866254d2/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-01-26-preview/identityservice.json ``` ``` yaml directive: - - from: https://github.com/Azure/azure-rest-api-specs/blob/4ae5cdc221660762336d5a899495b2b4941ea486/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-08-22-preview/confidentialledger.json + - from: https://github.com/Azure/azure-rest-api-specs/blob/adb20036091c8d853084e62f89e1aecb866254d2/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-01-26-preview/confidentialledger.json where: '$..paths.*.*' transform: '$.operationId = "ConfidentialLedger_"+$.operationId' - - from: https://github.com/Azure/azure-rest-api-specs/blob/4ae5cdc221660762336d5a899495b2b4941ea486/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-08-22-preview/identityservice.json + - from: https://github.com/Azure/azure-rest-api-specs/blob/adb20036091c8d853084e62f89e1aecb866254d2/specification/confidentialledger/data-plane/Microsoft.ConfidentialLedger/preview/2024-01-26-preview/identityservice.json where: '$..paths.*.*' transform: '$.operationId = "ConfidentialLedgerCertificate_"+$.operationId' ``` @@ -39,11 +39,6 @@ directive: - - - - - diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/tests/Generated/Samples/Samples_ConfidentialLedgerClient.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/tests/Generated/Samples/Samples_ConfidentialLedgerClient.cs index f8828f5ca69d..c7370424c140 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/tests/Generated/Samples/Samples_ConfidentialLedgerClient.cs +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/tests/Generated/Samples/Samples_ConfidentialLedgerClient.cs @@ -680,954 +680,6 @@ public async Task Example_CreateOrUpdateUser_AllParameters_Async() Console.WriteLine(result.GetProperty("userId").ToString()); } - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteLedgerUser_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.DeleteLedgerUser(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteLedgerUser_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.DeleteLedgerUserAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteLedgerUser_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.DeleteLedgerUser(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteLedgerUser_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.DeleteLedgerUserAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetLedgerUser_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetLedgerUser(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetLedgerUser_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetLedgerUserAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetLedgerUser_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetLedgerUser(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetLedgerUser_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetLedgerUserAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateOrUpdateLedgerUser_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - assignedRoles = new object[] - { -"Administrator" - }, - }); - Response response = client.CreateOrUpdateLedgerUser("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateOrUpdateLedgerUser_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - assignedRoles = new object[] - { -"Administrator" - }, - }); - Response response = await client.CreateOrUpdateLedgerUserAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateOrUpdateLedgerUser_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - assignedRoles = new object[] - { -"Administrator" - }, - }); - Response response = client.CreateOrUpdateLedgerUser("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateOrUpdateLedgerUser_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - assignedRoles = new object[] - { -"Administrator" - }, - }); - Response response = await client.CreateOrUpdateLedgerUserAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedEndpoint_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedEndpoint(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modules").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedEndpoint_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedEndpointAsync(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("modules").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedEndpoint_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedEndpoint(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("modules").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedEndpoint_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedEndpointAsync(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("get").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("put").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("patch").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("authn_policies")[0].ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("forwarding_required").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("interpreter_reuse").GetProperty("key").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_function").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("js_module").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("mode").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("openapi_hidden").ToString()); - Console.WriteLine(result.GetProperty("metadata").GetProperty("endpoints").GetProperty("").GetProperty("delete").GetProperty("redirection_strategy").ToString()); - Console.WriteLine(result.GetProperty("modules").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateUserDefinedEndpoint_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - metadata = new - { - endpoints = new - { - key = new object(), - }, - }, - modules = new object(), - }); - Response response = client.CreateUserDefinedEndpoint(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateUserDefinedEndpoint_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - metadata = new - { - endpoints = new - { - key = new object(), - }, - }, - modules = new object(), - }); - Response response = await client.CreateUserDefinedEndpointAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateUserDefinedEndpoint_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - metadata = new - { - endpoints = new - { - key = new - { - get = new - { - authn_policies = new object[] - { -new object() - }, - forwarding_required = "sometimes", - interpreter_reuse = new - { - key = "", - }, - js_function = "", - js_module = "", - mode = "readwrite", - openapi = new object(), - openapi_hidden = true, - redirection_strategy = "none", - }, - }, - }, - }, - modules = new object(), - }); - Response response = client.CreateUserDefinedEndpoint(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateUserDefinedEndpoint_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - metadata = new - { - endpoints = new - { - key = new - { - get = new - { - authn_policies = new object[] - { -new object() - }, - forwarding_required = "sometimes", - interpreter_reuse = new - { - key = "", - }, - js_function = "", - js_module = "", - mode = "readwrite", - openapi = new object(), - openapi_hidden = true, - redirection_strategy = "none", - }, - }, - }, - }, - modules = new object(), - }); - Response response = await client.CreateUserDefinedEndpointAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetRuntimeOptions_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetRuntimeOptions(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetRuntimeOptions_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetRuntimeOptionsAsync(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetRuntimeOptions_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetRuntimeOptions(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("log_exception_details").ToString()); - Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); - Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); - Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); - Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); - Console.WriteLine(result.GetProperty("return_exception_details").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetRuntimeOptions_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetRuntimeOptionsAsync(); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("log_exception_details").ToString()); - Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); - Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); - Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); - Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); - Console.WriteLine(result.GetProperty("return_exception_details").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_UpdateRuntimeOptions_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = client.UpdateRuntimeOptions(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_UpdateRuntimeOptions_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = await client.UpdateRuntimeOptionsAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_UpdateRuntimeOptions_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - log_exception_details = true, - max_cached_interpreters = 1234L, - max_execution_time_ms = 1234L, - max_heap_bytes = 1234L, - max_stack_bytes = 1234L, - return_exception_details = true, - }); - Response response = client.UpdateRuntimeOptions(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("log_exception_details").ToString()); - Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); - Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); - Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); - Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); - Console.WriteLine(result.GetProperty("return_exception_details").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_UpdateRuntimeOptions_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new - { - log_exception_details = true, - max_cached_interpreters = 1234L, - max_execution_time_ms = 1234L, - max_heap_bytes = 1234L, - max_stack_bytes = 1234L, - return_exception_details = true, - }); - Response response = await client.UpdateRuntimeOptionsAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("log_exception_details").ToString()); - Console.WriteLine(result.GetProperty("max_cached_interpreters").ToString()); - Console.WriteLine(result.GetProperty("max_execution_time_ms").ToString()); - Console.WriteLine(result.GetProperty("max_heap_bytes").ToString()); - Console.WriteLine(result.GetProperty("max_stack_bytes").ToString()); - Console.WriteLine(result.GetProperty("return_exception_details").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedEndpointsModule_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedEndpointsModule(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("module").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedEndpointsModule_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedEndpointsModuleAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("module").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedEndpointsModule_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedEndpointsModule(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("module").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedEndpointsModule_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedEndpointsModuleAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("module").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedRole_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedRole(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedRole_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedRoleAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetUserDefinedRole_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.GetUserDefinedRole(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result[0].GetProperty("roleName").ToString()); - Console.WriteLine(result[0].GetProperty("roleActions")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetUserDefinedRole_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.GetUserDefinedRoleAsync(""); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result[0].GetProperty("roleName").ToString()); - Console.WriteLine(result[0].GetProperty("roleActions")[0].ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateUserDefinedRole_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new object() - }); - Response response = client.CreateUserDefinedRole(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateUserDefinedRole_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new object() - }); - Response response = await client.CreateUserDefinedRoleAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_CreateUserDefinedRole_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new -{ -roleName = "", -roleActions = new object[] -{ -"" -}, -} - }); - Response response = client.CreateUserDefinedRole(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_CreateUserDefinedRole_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new -{ -roleName = "", -roleActions = new object[] -{ -"" -}, -} - }); - Response response = await client.CreateUserDefinedRoleAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_UpdateUserDefinedRole_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new object() - }); - Response response = client.UpdateUserDefinedRole(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_UpdateUserDefinedRole_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new object() - }); - Response response = await client.UpdateUserDefinedRoleAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_UpdateUserDefinedRole_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new -{ -roleName = "", -roleActions = new object[] -{ -"" -}, -} - }); - Response response = client.UpdateUserDefinedRole(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_UpdateUserDefinedRole_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object[] - { -new -{ -roleName = "", -roleActions = new object[] -{ -"" -}, -} - }); - Response response = await client.UpdateUserDefinedRoleAsync(content); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteUserDefinedRole_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.DeleteUserDefinedRole(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteUserDefinedRole_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.DeleteUserDefinedRoleAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DeleteUserDefinedRole_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = client.DeleteUserDefinedRole(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DeleteUserDefinedRole_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - Response response = await client.DeleteUserDefinedRoleAsync(""); - - Console.WriteLine(response.Status); - } - [Test] [Ignore("Only validating compilation of examples")] public void Example_GetConsortiumMembers_ShortVersion() @@ -1877,67 +929,5 @@ public async Task Example_GetUsers_AllParameters_Async() Console.WriteLine(result.GetProperty("userId").ToString()); } } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetLedgerUsers_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - foreach (BinaryData item in client.GetLedgerUsers()) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetLedgerUsers_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - await foreach (BinaryData item in client.GetLedgerUsersAsync()) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_GetLedgerUsers_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - foreach (BinaryData item in client.GetLedgerUsers()) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_GetLedgerUsers_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential); - - await foreach (BinaryData item in client.GetLedgerUsersAsync()) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("assignedRoles")[0].ToString()); - Console.WriteLine(result.GetProperty("userId").ToString()); - } - } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md index 802f13271944..7f18b39a63f5 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0-beta.2 (Unreleased) +## 1.3.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.2.0 (2025-02-11) + +### Other Changes + +- Updated dependencies to ensure they are up-to-date with the latest targets and trimming from built-in dependencies. + ## 1.1.1 (2023-12-13) ### Bugs Fixed diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md index 81cf71037f54..17e4fabccd1b 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md @@ -465,8 +465,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcontainerregistry%2FAzure.Containers.ContainerRegistry%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/containerregistry/Azure.Containers.ContainerRegistry/src [package]: https://www.nuget.org/packages/Azure.Containers.ContainerRegistry/ diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/perf/Azure.Containers.ContainerRegistry.Perf/README.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/perf/Azure.Containers.ContainerRegistry.Perf/README.md index d1a6390eaec6..ee2f7f138d40 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/perf/Azure.Containers.ContainerRegistry.Perf/README.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/perf/Azure.Containers.ContainerRegistry.Perf/README.md @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcontainerregistry%2FAzure.Containers.ContainerRegistry.Perf%2FREADME.png) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj index c17ba57d6ece..74a91ef39c79 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj @@ -2,9 +2,9 @@ This client library enables working with the Microsoft Azure Container Registry service to store and manage container images and deployment artifacts. Microsoft Azure.Containers.ContainerRegistry client library - 1.2.0-beta.2 + 1.3.0-beta.1 - 1.1.1 + 1.2.0 Azure Container Registry;$(PackageCommonTags) $(RequiredTargetFrameworks) true diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md index b2f2bdc4a8e6..374a1559cde9 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.3.0-beta.2 (Unreleased) +## 1.3.0-beta.3 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.3.0-beta.2 (2025-01-24) + +### Features Added + +- Upgraded api-version tag from 'package-2023-01-preview' to 'package-2024-11-preview'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/0a27976a58c16279e827bda36004d1b74b3d922a/specification/containerregistry/resource-manager/readme.md. + ## 1.3.0-beta.1 (2024-10-15) ### Features Added @@ -133,4 +139,3 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). > NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). - diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs index 15ae6fe1be1c..a1d2d450a68a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.net8.0.cs @@ -1,5 +1,66 @@ namespace Azure.ResourceManager.ContainerRegistry { + public partial class ConnectedRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedRegistryCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectedRegistryName, Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectedRegistryName, Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectedRegistryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? ActivationStatus { get { throw null; } } + public System.Collections.Generic.IList ClientTokenIds { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? ConnectionState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties GarbageCollection { get { throw null; } set { } } + public System.DateTimeOffset? LastActivityOn { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging Logging { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer LoginServer { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationsList { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent Parent { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StatusDetails { get { throw null; } } + public string Version { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedRegistryResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Deactivate(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeactivateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryAgentPoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryAgentPoolCollection() { } @@ -59,6 +120,159 @@ protected ContainerRegistryAgentPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ContainerRegistryArchiveCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties PackageSource { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string PublishedVersion { get { throw null; } set { } } + public string RepositoryEndpoint { get { throw null; } } + public string RepositoryEndpointPrefix { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetContainerRegistryArchiveVersion(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryArchiveVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveVersionData() { } + public string ArchiveVersionErrorMessage { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveVersionResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryCacheRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryCacheRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheRuleName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheRuleName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryCacheRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCacheRuleData() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier CredentialSetResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SourceRepository { get { throw null; } set { } } + public string TargetRepository { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryCacheRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryCacheRuleResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryCollection() { } @@ -76,16 +290,70 @@ protected ContainerRegistryCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } + public partial class ContainerRegistryCredentialSetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryCredentialSetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string credentialSetName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string credentialSetName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryCredentialSetData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCredentialSetData() { } + public System.Collections.Generic.IList AuthCredentials { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public string LoginServer { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryCredentialSetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryCredentialSetResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataEndpointHostNames { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public bool? IsAdminUserEnabled { get { throw null; } set { } } + public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } public string LoginServer { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } @@ -102,16 +370,75 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryExportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryExportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryExportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryExportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryExportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryExportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ContainerRegistryExtensions { public static Azure.Response CheckContainerRegistryNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CheckContainerRegistryNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCollection GetContainerRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetContainerRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetContainerRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static System.Threading.Tasks.Task> GetContainerRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -123,6 +450,108 @@ public static partial class ContainerRegistryExtensions public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapResource GetScopeMapResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } + public partial class ContainerRegistryImportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryImportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryImportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryImportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? SourceTriggerStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryImportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryImportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryPipelineRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryPipelineRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryPipelineRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunData() { } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent Request { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult Response { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryPipelineRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryPipelineRunResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryPrivateEndpointConnectionCollection() { } @@ -288,9 +717,30 @@ protected ContainerRegistryResource() { } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetBuildSourceUploadUrl(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetBuildSourceUploadUrlAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryCollection GetConnectedRegistries() { throw null; } + public virtual Azure.Response GetConnectedRegistry(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedRegistryAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetContainerRegistryAgentPool(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryAgentPoolAsync(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPools() { throw null; } + public virtual Azure.Response GetContainerRegistryArchive(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) { throw null; } + public virtual Azure.Response GetContainerRegistryCacheRule(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryCacheRuleAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() { throw null; } + public virtual Azure.Response GetContainerRegistryCredentialSet(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryCredentialSetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetCollection GetContainerRegistryCredentialSets() { throw null; } + public virtual Azure.Response GetContainerRegistryExportPipeline(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryImportPipeline(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryPipelineRun(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() { throw null; } public virtual Azure.Response GetContainerRegistryPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() { throw null; } @@ -699,7 +1149,15 @@ namespace Azure.ResourceManager.ContainerRegistry.Mocking public partial class MockableContainerRegistryArmClient : Azure.ResourceManager.ArmResource { protected MockableContainerRegistryArmClient() { } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -729,6 +1187,24 @@ protected MockableContainerRegistrySubscriptionResource() { } } namespace Azure.ResourceManager.ContainerRegistry.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AadAuthenticationAsArmPolicyStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AadAuthenticationAsArmPolicyStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus left, Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus left, Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ActionsRequiredForPrivateLinkServiceConsumer : System.IEquatable { @@ -747,25 +1223,73 @@ namespace Azure.ResourceManager.ContainerRegistry.Models public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer left, Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer right) { throw null; } public override string ToString() { throw null; } } + public partial class ArchivePackageSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArchivePackageSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType? SourceType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArchivePackageSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArchivePackageSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType Remote { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmContainerRegistryModelFactory { + public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData ConnectedRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode?), string version = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? connectionState = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState?), System.DateTimeOffset? lastActivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? activationStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent parent = null, System.Collections.Generic.IEnumerable clientTokenIds = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer loginServer = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging logging = null, System.Collections.Generic.IEnumerable statusDetails = null, System.Collections.Generic.IEnumerable notificationsList = null, Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties garbageCollection = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer ConnectedRegistryLoginServer(string host = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties tls = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail ConnectedRegistryStatusDetail(string statusDetailType = null, string code = null, string description = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Guid? correlationId = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId = null, string schedule = null, System.TimeSpan? syncWindow = default(System.TimeSpan?), System.TimeSpan messageTtl = default(System.TimeSpan), System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?), string gatewayEndpoint = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolData ContainerRegistryAgentPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), int? count = default(int?), string tier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS? os = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS?), Azure.Core.ResourceIdentifier virtualNetworkSubnetResourceId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolQueueStatus ContainerRegistryAgentPoolQueueStatus(int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData ContainerRegistryArchiveData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), string archiveVersionErrorMessage = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential ContainerRegistryAuthCredential(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName?), string usernameSecretIdentifier = null, string passwordSecretIdentifier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth credentialHealth = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependency ContainerRegistryBaseImageDependency(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType? dependencyType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType?), string registry = null, string repository = null, string tag = null, string digest = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerUpdateContent ContainerRegistryBaseImageTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType? baseImageTriggerType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType?), string updateTriggerEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType? updateTriggerPayloadType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData ContainerRegistryCacheRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier credentialSetResourceId = null, string sourceRepository = null, string targetRepository = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth ContainerRegistryCredentialHealth(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus?), string errorCode = null, string errorMessage = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData ContainerRegistryCredentialSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.Collections.Generic.IEnumerable authCredentials = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? metadataSearch = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch?), Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryDockerBuildStep ContainerRegistryDockerBuildStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, System.Collections.Generic.IEnumerable imageNames = null, bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string dockerFilePath = null, string target = null, System.Collections.Generic.IEnumerable arguments = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string encodedTaskContent = null, string encodedValuesContent = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryFileTaskStep ContainerRegistryFileTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string taskFilePath = null, string valuesFilePath = null, System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryGenerateCredentialsResult ContainerRegistryGenerateCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportImageContent ContainerRegistryImportImageContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource source = null, System.Collections.Generic.IEnumerable targetTags = null, System.Collections.Generic.IEnumerable untaggedTargetRepositories = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? sourceTriggerStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource ContainerRegistryImportSource(Azure.Core.ResourceIdentifier resourceId = null, string registryAddress = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials credentials = null, string sourceImage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials ContainerRegistryImportSourceCredentials(string username = null, string password = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryKeyVaultProperties ContainerRegistryKeyVaultProperties(string keyIdentifier = null, string versionedKeyIdentifier = null, string identity = null, bool? isKeyRotationEnabled = default(bool?), System.DateTimeOffset? lastKeyRotationTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryListCredentialsResult ContainerRegistryListCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType)) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType), string resourceGroupName = null, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPassword ContainerRegistryPassword(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName?), string value = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent request = null, Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult response = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResourceData ContainerRegistryPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationData ContainerRegistryReplicationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isRegionEndpointEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } @@ -774,11 +1298,14 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData ContainerRegistryRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string runId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType? runType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType?), string agentPoolName = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable outputImages = null, string task = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageUpdateTrigger imageUpdateTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerDescriptor sourceTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerDescriptor timerTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string sourceRegistryAuth = null, System.Collections.Generic.IEnumerable customRegistries = null, string runErrorMessage = null, string updateTriggerToken = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageDescriptor logArtifact = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), bool? isArchiveEnabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunGetLogResult ContainerRegistryRunGetLogResult(string logLink = null, string logArtifactLink = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku ContainerRegistrySku(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier? tier = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = default(int?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerUpdateContent ContainerRegistrySourceTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoUpdateContent sourceRepository = null, System.Collections.Generic.IEnumerable sourceTriggerEvents = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData ContainerRegistryTaskData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string agentPoolName = null, int? timeoutInSeconds = default(int?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties step = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerProperties trigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials credentials = null, string logTemplate = null, bool? isSystemTask = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskRunData ContainerRegistryTaskRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent runRequest = null, Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData runResult = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties ContainerRegistryTaskStepProperties(string containerRegistryTaskStepType = null, System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerUpdateContent ContainerRegistryTimerTriggerUpdateContent(string schedule = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties ContainerRegistryTlsCertificateProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType? certificateType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType?), string certificateLocation = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties ContainerRegistryTlsProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties certificate = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTokenData ContainerRegistryTokenData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.Core.ResourceIdentifier scopeMapId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenCredentials credentials = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPassword ContainerRegistryTokenPassword(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPasswordName?), string value = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsage ContainerRegistryUsage(string name = null, long? limit = default(long?), long? currentValue = default(long?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsageUnit? unit = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsageUnit?)) { throw null; } @@ -793,9 +1320,238 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventResponseMessage ContainerRegistryWebhookEventResponseMessage(string content = null, System.Collections.Generic.IReadOnlyDictionary headers = null, string reasonPhrase = null, string statusCode = null, string version = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventSource ContainerRegistryWebhookEventSource(string addr = null, string instanceId = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventTarget ContainerRegistryWebhookEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, System.Uri uri = null, string tag = null, string name = null, string version = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult PipelineRunResult(string status = null, System.Collections.Generic.IEnumerable importedArtifacts = null, string progressPercentage = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, string catalogDigest = null, System.DateTimeOffset? sourceTriggerTimestamp = default(System.DateTimeOffset?), string pipelineRunErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapData ScopeMapData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string scopeMapType = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.SourceUploadDefinition SourceUploadDefinition(System.Uri uploadUri = null, string relativePath = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope Unsecure { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryActivationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryActivationStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus Active { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus Inactive { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryAuditLogStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryAuditLogStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryConnectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryConnectionState(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Offline { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Online { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Syncing { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Unhealthy { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedRegistryLogging : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryLogging() { } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus? AuditLogStatus { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel? LogLevel { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryLoginServer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryLoginServer() { } + public string Host { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties Tls { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryLogLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryLogLevel(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Debug { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Error { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Information { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel None { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode Mirror { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode ReadOnly { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode ReadWrite { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode Registry { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedRegistryParent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryParent(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties syncProperties) { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties SyncProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPatch() { } + public System.Collections.Generic.IList ClientTokenIds { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties GarbageCollection { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging Logging { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationsList { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties SyncProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryPipelineRunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPipelineRunContent() { } + public System.Collections.Generic.IList Artifacts { get { throw null; } } + public string CatalogDigest { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PipelineResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties Target { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryStatusDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConnectedRegistryStatusDetail() { } + public string Code { get { throw null; } } + public System.Guid? CorrelationId { get { throw null; } } + public string Description { get { throw null; } } + public string StatusDetailType { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistrySyncProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId, System.TimeSpan messageTtl) { } + public string GatewayEndpoint { get { throw null; } } + public System.DateTimeOffset? LastSyncOn { get { throw null; } } + public System.TimeSpan MessageTtl { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + public System.TimeSpan? SyncWindow { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TokenId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistrySyncUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistrySyncUpdateProperties() { } + public System.TimeSpan? MessageTtl { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + public System.TimeSpan? SyncWindow { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryAgentPoolPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryAgentPoolPatch() { } @@ -819,6 +1575,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryArchivePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchivePatch() { } + public string PublishedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryAuthCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryAuthCredential() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth CredentialHealth { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? Name { get { throw null; } set { } } + public string PasswordSecretIdentifier { get { throw null; } set { } } + public string UsernameSecretIdentifier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryBaseImageDependency : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryBaseImageDependency() { } @@ -900,6 +1681,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryCacheRulePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCacheRulePatch() { } + public Azure.Core.ResourceIdentifier CredentialSetResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCertificateType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCertificateType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType LocalDirectory { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerRegistryCpuVariant : System.IEquatable { @@ -919,6 +1728,54 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCpuVariant left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCpuVariant right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistryCredentialHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryCredentialHealth() { } + public string ErrorCode { get { throw null; } } + public string ErrorMessage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCredentialHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCredentialHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus Healthy { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus Unhealthy { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCredentialName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCredentialName(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName Credential1 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryCredentialRegenerateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryCredentialRegenerateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName name) { } @@ -942,6 +1799,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryCredentialSetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCredentialSetPatch() { } + public System.Collections.Generic.IList AuthCredentials { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryDockerBuildContent : Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryDockerBuildContent(string dockerFilePath, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform) { } @@ -1300,10 +2169,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryMetadataSearch : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryMetadataSearch(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryNameAvailabilityContent(string name) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public string Name { get { throw null; } } + public string ResourceGroupName { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1315,6 +2204,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryNameAvailableResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryNameAvailableResult() { } + public string AvailableLoginServerName { get { throw null; } } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public string Reason { get { throw null; } } @@ -1451,7 +2341,9 @@ public ContainerRegistryPatch() { } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public bool? IsAdminUserEnabled { get { throw null; } set { } } + public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } @@ -1465,6 +2357,101 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineOption(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption ContinueOnErrors { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteBlobs { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteTags { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunSourceProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType? SourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunTargetProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunTargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryPlatformProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPlatformProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS os) { } @@ -1494,9 +2481,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryPolicies : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPolicies() { } + public Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus? AzureADAuthenticationAsArmStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryExportPolicyStatus? ExportStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? QuarantineStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRetentionPolicy RetentionPolicy { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTrustPolicy TrustPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1826,6 +2815,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistrySoftDeletePolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistrySoftDeletePolicy() { } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } + public int? RetentionDays { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistrySourceTrigger : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistrySourceTrigger(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoProperties sourceRepository, System.Collections.Generic.IEnumerable sourceTriggerEvents, string name) { } @@ -2031,6 +3033,48 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryTlsCertificateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryTlsCertificateProperties() { } + public string CertificateLocation { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType? CertificateType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryTlsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryTlsProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties Certificate { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryTlsStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryTlsStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryTokenCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryTokenCertificate() { } @@ -2492,6 +3536,64 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ExportPipelineTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportPipelineTargetProperties(System.Uri keyVaultUri) { } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public string PipelineTargetType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GarbageCollectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GarbageCollectionProperties() { } + public bool? Enabled { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportPipelineSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImportPipelineSourceProperties(System.Uri keyVaultUri) { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineRunResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PipelineRunResult() { } + public string CatalogDigest { get { throw null; } } + public System.DateTimeOffset? FinishOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ImportedArtifacts { get { throw null; } } + public string PipelineRunErrorMessage { get { throw null; } } + public string ProgressPercentage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } } + public System.DateTimeOffset? SourceTriggerTimestamp { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ScopeMapPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScopeMapPatch() { } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs index 15ae6fe1be1c..a1d2d450a68a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/api/Azure.ResourceManager.ContainerRegistry.netstandard2.0.cs @@ -1,5 +1,66 @@ namespace Azure.ResourceManager.ContainerRegistry { + public partial class ConnectedRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedRegistryCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectedRegistryName, Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectedRegistryName, Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectedRegistryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? ActivationStatus { get { throw null; } } + public System.Collections.Generic.IList ClientTokenIds { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? ConnectionState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties GarbageCollection { get { throw null; } set { } } + public System.DateTimeOffset? LastActivityOn { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging Logging { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer LoginServer { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationsList { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent Parent { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StatusDetails { get { throw null; } } + public string Version { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedRegistryResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Deactivate(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeactivateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryAgentPoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryAgentPoolCollection() { } @@ -59,6 +120,159 @@ protected ContainerRegistryAgentPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ContainerRegistryArchiveCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveData() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties PackageSource { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string PublishedVersion { get { throw null; } set { } } + public string RepositoryEndpoint { get { throw null; } } + public string RepositoryEndpointPrefix { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetContainerRegistryArchiveVersion(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryArchiveVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryArchiveVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string archiveVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryArchiveVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchiveVersionData() { } + public string ArchiveVersionErrorMessage { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryArchiveVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryArchiveVersionResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryCacheRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryCacheRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheRuleName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheRuleName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryCacheRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCacheRuleData() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier CredentialSetResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SourceRepository { get { throw null; } set { } } + public string TargetRepository { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryCacheRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryCacheRuleResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryCollection() { } @@ -76,16 +290,70 @@ protected ContainerRegistryCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } + public partial class ContainerRegistryCredentialSetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryCredentialSetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string credentialSetName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string credentialSetName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryCredentialSetData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCredentialSetData() { } + public System.Collections.Generic.IList AuthCredentials { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public string LoginServer { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryCredentialSetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryCredentialSetResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryData(Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataEndpointHostNames { get { throw null; } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public bool? IsAdminUserEnabled { get { throw null; } set { } } + public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } public string LoginServer { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } @@ -102,16 +370,75 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryExportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryExportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string exportPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryExportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryExportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryExportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryExportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class ContainerRegistryExtensions { public static Azure.Response CheckContainerRegistryNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CheckContainerRegistryNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCollection GetContainerRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetContainerRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetContainerRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static System.Threading.Tasks.Task> GetContainerRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string registryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -123,6 +450,108 @@ public static partial class ContainerRegistryExtensions public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapResource GetScopeMapResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } + public partial class ContainerRegistryImportPipelineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryImportPipelineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importPipelineName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryImportPipelineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryImportPipelineData() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public System.Collections.Generic.IList Options { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? SourceTriggerStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryImportPipelineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryImportPipelineResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerRegistryPipelineRunCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerRegistryPipelineRunCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineRunName, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerRegistryPipelineRunData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunData() { } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent Request { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult Response { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryPipelineRunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerRegistryPipelineRunResource() { } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerRegistryPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerRegistryPrivateEndpointConnectionCollection() { } @@ -288,9 +717,30 @@ protected ContainerRegistryResource() { } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetBuildSourceUploadUrl(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetBuildSourceUploadUrlAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryCollection GetConnectedRegistries() { throw null; } + public virtual Azure.Response GetConnectedRegistry(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedRegistryAsync(string connectedRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetContainerRegistryAgentPool(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryAgentPoolAsync(string agentPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPools() { throw null; } + public virtual Azure.Response GetContainerRegistryArchive(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) { throw null; } + public virtual Azure.Response GetContainerRegistryCacheRule(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryCacheRuleAsync(string cacheRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() { throw null; } + public virtual Azure.Response GetContainerRegistryCredentialSet(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryCredentialSetAsync(string credentialSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetCollection GetContainerRegistryCredentialSets() { throw null; } + public virtual Azure.Response GetContainerRegistryExportPipeline(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryImportPipeline(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() { throw null; } + public virtual Azure.Response GetContainerRegistryPipelineRun(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() { throw null; } public virtual Azure.Response GetContainerRegistryPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerRegistryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() { throw null; } @@ -699,7 +1149,15 @@ namespace Azure.ResourceManager.ContainerRegistry.Mocking public partial class MockableContainerRegistryArmClient : Azure.ResourceManager.ArmResource { protected MockableContainerRegistryArmClient() { } + public virtual Azure.ResourceManager.ContainerRegistry.ConnectedRegistryResource GetConnectedRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -729,6 +1187,24 @@ protected MockableContainerRegistrySubscriptionResource() { } } namespace Azure.ResourceManager.ContainerRegistry.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AadAuthenticationAsArmPolicyStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AadAuthenticationAsArmPolicyStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus left, Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus left, Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ActionsRequiredForPrivateLinkServiceConsumer : System.IEquatable { @@ -747,25 +1223,73 @@ namespace Azure.ResourceManager.ContainerRegistry.Models public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer left, Azure.ResourceManager.ContainerRegistry.Models.ActionsRequiredForPrivateLinkServiceConsumer right) { throw null; } public override string ToString() { throw null; } } + public partial class ArchivePackageSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArchivePackageSourceProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType? SourceType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArchivePackageSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArchivePackageSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType Remote { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmContainerRegistryModelFactory { + public static Azure.ResourceManager.ContainerRegistry.ConnectedRegistryData ConnectedRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode?), string version = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState? connectionState = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState?), System.DateTimeOffset? lastActivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus? activationStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent parent = null, System.Collections.Generic.IEnumerable clientTokenIds = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer loginServer = null, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging logging = null, System.Collections.Generic.IEnumerable statusDetails = null, System.Collections.Generic.IEnumerable notificationsList = null, Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties garbageCollection = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer ConnectedRegistryLoginServer(string host = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties tls = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail ConnectedRegistryStatusDetail(string statusDetailType = null, string code = null, string description = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.Guid? correlationId = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId = null, string schedule = null, System.TimeSpan? syncWindow = default(System.TimeSpan?), System.TimeSpan messageTtl = default(System.TimeSpan), System.DateTimeOffset? lastSyncOn = default(System.DateTimeOffset?), string gatewayEndpoint = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryAgentPoolData ContainerRegistryAgentPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), int? count = default(int?), string tier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS? os = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS?), Azure.Core.ResourceIdentifier virtualNetworkSubnetResourceId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAgentPoolQueueStatus ContainerRegistryAgentPoolQueueStatus(int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveData ContainerRegistryArchiveData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), string archiveVersionErrorMessage = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential ContainerRegistryAuthCredential(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName?), string usernameSecretIdentifier = null, string passwordSecretIdentifier = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth credentialHealth = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependency ContainerRegistryBaseImageDependency(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType? dependencyType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageDependencyType?), string registry = null, string repository = null, string tag = null, string digest = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerUpdateContent ContainerRegistryBaseImageTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType? baseImageTriggerType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryBaseImageTriggerType?), string updateTriggerEndpoint = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType? updateTriggerPayloadType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUpdateTriggerPayloadType?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCacheRuleData ContainerRegistryCacheRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier credentialSetResourceId = null, string sourceRepository = null, string targetRepository = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth ContainerRegistryCredentialHealth(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus?), string errorCode = null, string errorMessage = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryCredentialSetData ContainerRegistryCredentialSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.Collections.Generic.IEnumerable authCredentials = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string loginServer, System.DateTimeOffset? createdOn, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, System.Collections.Generic.IEnumerable dataEndpointHostNames, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryData ContainerRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string loginServer = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies policies = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = default(bool?), System.Collections.Generic.IEnumerable dataEndpointHostNames = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPublicNetworkAccess?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?), bool? isAnonymousPullEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? metadataSearch = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch?), Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryDockerBuildStep ContainerRegistryDockerBuildStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, System.Collections.Generic.IEnumerable imageNames = null, bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string dockerFilePath = null, string target = null, System.Collections.Generic.IEnumerable arguments = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string encodedTaskContent = null, string encodedValuesContent = null, System.Collections.Generic.IEnumerable values = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryFileTaskStep ContainerRegistryFileTaskStep(System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null, string taskFilePath = null, string valuesFilePath = null, System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryGenerateCredentialsResult ContainerRegistryGenerateCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportImageContent ContainerRegistryImportImageContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource source = null, System.Collections.Generic.IEnumerable targetTags = null, System.Collections.Generic.IEnumerable untaggedTargetRepositories = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode? mode = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportMode?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? sourceTriggerStatus = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), System.Collections.Generic.IEnumerable options = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSource ContainerRegistryImportSource(Azure.Core.ResourceIdentifier resourceId = null, string registryAddress = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials credentials = null, string sourceImage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImportSourceCredentials ContainerRegistryImportSourceCredentials(string username = null, string password = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryKeyVaultProperties ContainerRegistryKeyVaultProperties(string keyIdentifier = null, string versionedKeyIdentifier = null, string identity = null, bool? isKeyRotationEnabled = default(bool?), System.DateTimeOffset? lastKeyRotationTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryListCredentialsResult ContainerRegistryListCredentialsResult(string username = null, System.Collections.Generic.IEnumerable passwords = null) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType)) { throw null; } - public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType resourceType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType), string resourceGroupName = null, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPassword ContainerRegistryPassword(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName?), string value = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent request = null, Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult response = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryPrivateLinkResourceData ContainerRegistryPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryReplicationData ContainerRegistryReplicationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceStatus status = null, bool? isRegionEndpointEnabled = default(bool?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryZoneRedundancy?)) { throw null; } @@ -774,11 +1298,14 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData ContainerRegistryRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string runId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunStatus?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType? runType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunType?), string agentPoolName = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable outputImages = null, string task = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageUpdateTrigger imageUpdateTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerDescriptor sourceTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerDescriptor timerTrigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string sourceRegistryAuth = null, System.Collections.Generic.IEnumerable customRegistries = null, string runErrorMessage = null, string updateTriggerToken = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryImageDescriptor logArtifact = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), bool? isArchiveEnabled = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunGetLogResult ContainerRegistryRunGetLogResult(string logLink = null, string logArtifactLink = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySku ContainerRegistrySku(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuName), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier? tier = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier?)) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = default(int?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySourceTriggerUpdateContent ContainerRegistrySourceTriggerUpdateContent(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoUpdateContent sourceRepository = null, System.Collections.Generic.IEnumerable sourceTriggerEvents = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskData ContainerRegistryTaskData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform = null, int? agentCpu = default(int?), string agentPoolName = null, int? timeoutInSeconds = default(int?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties step = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerProperties trigger = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentials credentials = null, string logTemplate = null, bool? isSystemTask = default(bool?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTaskRunData ContainerRegistryTaskRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent runRequest = null, Azure.ResourceManager.ContainerRegistry.ContainerRegistryRunData runResult = null, string forceUpdateTag = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTaskStepProperties ContainerRegistryTaskStepProperties(string containerRegistryTaskStepType = null, System.Collections.Generic.IEnumerable baseImageDependencies = null, string contextPath = null, string contextAccessToken = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTimerTriggerUpdateContent ContainerRegistryTimerTriggerUpdateContent(string schedule = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTriggerStatus?), string name = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties ContainerRegistryTlsCertificateProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType? certificateType = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType?), string certificateLocation = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties ContainerRegistryTlsProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties certificate = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ContainerRegistryTokenData ContainerRegistryTokenData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), Azure.Core.ResourceIdentifier scopeMapId = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenCredentials credentials = null, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenStatus? status = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenStatus?)) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPassword ContainerRegistryTokenPassword(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPasswordName? name = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTokenPasswordName?), string value = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsage ContainerRegistryUsage(string name = null, long? limit = default(long?), long? currentValue = default(long?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsageUnit? unit = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryUsageUnit?)) { throw null; } @@ -793,9 +1320,238 @@ public static partial class ArmContainerRegistryModelFactory public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventResponseMessage ContainerRegistryWebhookEventResponseMessage(string content = null, System.Collections.Generic.IReadOnlyDictionary headers = null, string reasonPhrase = null, string statusCode = null, string version = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventSource ContainerRegistryWebhookEventSource(string addr = null, string instanceId = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryWebhookEventTarget ContainerRegistryWebhookEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, System.Uri uri = null, string tag = null, string name = null, string version = null) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult PipelineRunResult(string status = null, System.Collections.Generic.IEnumerable importedArtifacts = null, string progressPercentage = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? finishOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties source = null, Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties target = null, string catalogDigest = null, System.DateTimeOffset? sourceTriggerTimestamp = default(System.DateTimeOffset?), string pipelineRunErrorMessage = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.ScopeMapData ScopeMapData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string scopeMapType = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryProvisioningState?), System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.ContainerRegistry.Models.SourceUploadDefinition SourceUploadDefinition(System.Uri uploadUri = null, string relativePath = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope Unsecure { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryActivationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryActivationStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus Active { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus Inactive { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryActivationStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryAuditLogStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryAuditLogStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryConnectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryConnectionState(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Offline { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Online { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Syncing { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState Unhealthy { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryConnectionState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedRegistryLogging : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryLogging() { } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryAuditLogStatus? AuditLogStatus { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel? LogLevel { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryLoginServer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryLoginServer() { } + public string Host { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties Tls { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLoginServer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryLogLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryLogLevel(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Debug { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Error { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Information { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel None { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogLevel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedRegistryMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedRegistryMode(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode Mirror { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode ReadOnly { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode ReadWrite { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode Registry { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode left, Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedRegistryParent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryParent(Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties syncProperties) { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties SyncProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryParent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPatch() { } + public System.Collections.Generic.IList ClientTokenIds { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties GarbageCollection { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryLogging Logging { get { throw null; } set { } } + public System.Collections.Generic.IList NotificationsList { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties SyncProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryPipelineRunContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistryPipelineRunContent() { } + public System.Collections.Generic.IList Artifacts { get { throw null; } } + public string CatalogDigest { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PipelineResourceId { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties Source { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties Target { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryPipelineRunContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistryStatusDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConnectedRegistryStatusDetail() { } + public string Code { get { throw null; } } + public System.Guid? CorrelationId { get { throw null; } } + public string Description { get { throw null; } } + public string StatusDetailType { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistryStatusDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistrySyncProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistrySyncProperties(Azure.Core.ResourceIdentifier tokenId, System.TimeSpan messageTtl) { } + public string GatewayEndpoint { get { throw null; } } + public System.DateTimeOffset? LastSyncOn { get { throw null; } } + public System.TimeSpan MessageTtl { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + public System.TimeSpan? SyncWindow { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TokenId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedRegistrySyncUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedRegistrySyncUpdateProperties() { } + public System.TimeSpan? MessageTtl { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + public System.TimeSpan? SyncWindow { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ConnectedRegistrySyncUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryAgentPoolPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryAgentPoolPatch() { } @@ -819,6 +1575,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryArchivePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryArchivePatch() { } + public string PublishedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryArchivePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryAuthCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryAuthCredential() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth CredentialHealth { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName? Name { get { throw null; } set { } } + public string PasswordSecretIdentifier { get { throw null; } set { } } + public string UsernameSecretIdentifier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryAuthCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryBaseImageDependency : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryBaseImageDependency() { } @@ -900,6 +1681,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryCacheRulePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCacheRulePatch() { } + public Azure.Core.ResourceIdentifier CredentialSetResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCacheRulePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCertificateType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCertificateType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType LocalDirectory { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerRegistryCpuVariant : System.IEquatable { @@ -919,6 +1728,54 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCpuVariant left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCpuVariant right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistryCredentialHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryCredentialHealth() { } + public string ErrorCode { get { throw null; } } + public string ErrorMessage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCredentialHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCredentialHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus Healthy { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus Unhealthy { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryCredentialName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryCredentialName(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName Credential1 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialName right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryCredentialRegenerateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryCredentialRegenerateContent(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPasswordName name) { } @@ -942,6 +1799,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryCredentialSetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryCredentialSetPatch() { } + public System.Collections.Generic.IList AuthCredentials { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCredentialSetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistryDockerBuildContent : Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRunContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryDockerBuildContent(string dockerFilePath, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPlatformProperties platform) { } @@ -1300,10 +2169,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryMetadataSearch : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryMetadataSearch(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryNameAvailabilityContent(string name) { } + public Azure.ResourceManager.ContainerRegistry.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public string Name { get { throw null; } } + public string ResourceGroupName { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1315,6 +2204,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryNameAvailableResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryNameAvailableResult() { } + public string AvailableLoginServerName { get { throw null; } } public bool? IsNameAvailable { get { throw null; } } public string Message { get { throw null; } } public string Reason { get { throw null; } } @@ -1451,7 +2341,9 @@ public ContainerRegistryPatch() { } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryEncryption Encryption { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public bool? IsAdminUserEnabled { get { throw null; } set { } } + public bool? IsAnonymousPullEnabled { get { throw null; } set { } } public bool? IsDataEndpointEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryMetadataSearch? MetadataSearch { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryNetworkRuleSet NetworkRuleSet { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies Policies { get { throw null; } set { } } @@ -1465,6 +2357,101 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineOption(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption ContinueOnErrors { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteBlobs { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption OverwriteTags { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunSourceProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType? SourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunSourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerRegistryPipelineRunTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryPipelineRunTargetProperties() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineRunTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineRunTargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType AzureStorageBlob { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineRunTargetType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryPipelineSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryPipelineSourceType(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryPlatformProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPlatformProperties(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryOS os) { } @@ -1494,9 +2481,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryPolicies : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryPolicies() { } + public Azure.ResourceManager.ContainerRegistry.Models.AadAuthenticationAsArmPolicyStatus? AzureADAuthenticationAsArmStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryExportPolicyStatus? ExportStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? QuarantineStatus { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryRetentionPolicy RetentionPolicy { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get { throw null; } set { } } public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTrustPolicy TrustPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1826,6 +2815,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySkuTier right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerRegistrySoftDeletePolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistrySoftDeletePolicy() { } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } + public int? RetentionDays { get { throw null; } set { } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPolicyStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistrySoftDeletePolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerRegistrySourceTrigger : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistrySourceTrigger(Azure.ResourceManager.ContainerRegistry.Models.SourceCodeRepoProperties sourceRepository, System.Collections.Generic.IEnumerable sourceTriggerEvents, string name) { } @@ -2031,6 +3033,48 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerRegistryTlsCertificateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryTlsCertificateProperties() { } + public string CertificateLocation { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryCertificateType? CertificateType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryTlsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerRegistryTlsProperties() { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsCertificateProperties Certificate { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerRegistryTlsStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerRegistryTlsStatus(string value) { throw null; } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus left, Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryTlsStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryTokenCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryTokenCertificate() { } @@ -2492,6 +3536,64 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ExportPipelineTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportPipelineTargetProperties(System.Uri keyVaultUri) { } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public string PipelineTargetType { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GarbageCollectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GarbageCollectionProperties() { } + public bool? Enabled { get { throw null; } set { } } + public string Schedule { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.GarbageCollectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportPipelineSourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ImportPipelineSourceProperties(System.Uri keyVaultUri) { } + public Azure.ResourceManager.ContainerRegistry.Models.ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineRunResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PipelineRunResult() { } + public string CatalogDigest { get { throw null; } } + public System.DateTimeOffset? FinishOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ImportedArtifacts { get { throw null; } } + public string PipelineRunErrorMessage { get { throw null; } } + public string ProgressPercentage { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ImportPipelineSourceProperties Source { get { throw null; } } + public System.DateTimeOffset? SourceTriggerTimestamp { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string Status { get { throw null; } } + public Azure.ResourceManager.ContainerRegistry.Models.ExportPipelineTargetProperties Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerRegistry.Models.PipelineRunResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ScopeMapPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ScopeMapPatch() { } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs new file mode 100644 index 000000000000..16111341aa24 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryCollection.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using System.Xml; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ConnectedRegistryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ConnectedRegistryCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryCreate.json + // this example is just showing the usage of "ConnectedRegistries_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ConnectedRegistryResource + ConnectedRegistryCollection collection = containerRegistry.GetConnectedRegistries(); + + // invoke the operation + string connectedRegistryName = "myConnectedRegistry"; + ConnectedRegistryData data = new ConnectedRegistryData + { + Mode = ConnectedRegistryMode.ReadWrite, + Parent = new ConnectedRegistryParent(new ConnectedRegistrySyncProperties(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), XmlConvert.ToTimeSpan("P2D")) + { + Schedule = "0 9 * * *", + SyncWindow = XmlConvert.ToTimeSpan("PT3H"), + }), + ClientTokenIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token") }, + NotificationsList = { "hello-world:*:*", "sample/repo/*:1.0:*" }, + GarbageCollection = new GarbageCollectionProperties + { + Enabled = true, + Schedule = "0 5 * * *", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectedRegistryName, data); + ConnectedRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConnectedRegistryGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryGet.json + // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ConnectedRegistryResource + ConnectedRegistryCollection collection = containerRegistry.GetConnectedRegistries(); + + // invoke the operation + string connectedRegistryName = "myConnectedRegistry"; + ConnectedRegistryResource result = await collection.GetAsync(connectedRegistryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ConnectedRegistryList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryList.json + // this example is just showing the usage of "ConnectedRegistries_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ConnectedRegistryResource + ConnectedRegistryCollection collection = containerRegistry.GetConnectedRegistries(); + + // invoke the operation and iterate over the result + await foreach (ConnectedRegistryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ConnectedRegistryGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryGet.json + // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ConnectedRegistryResource + ConnectedRegistryCollection collection = containerRegistry.GetConnectedRegistries(); + + // invoke the operation + string connectedRegistryName = "myConnectedRegistry"; + bool result = await collection.ExistsAsync(connectedRegistryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ConnectedRegistryGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryGet.json + // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ConnectedRegistryResource + ConnectedRegistryCollection collection = containerRegistry.GetConnectedRegistries(); + + // invoke the operation + string connectedRegistryName = "myConnectedRegistry"; + NullableResponse response = await collection.GetIfExistsAsync(connectedRegistryName); + ConnectedRegistryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs new file mode 100644 index 000000000000..c33058e87c6d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ConnectedRegistryResource.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using System.Xml; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ConnectedRegistryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConnectedRegistryGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryGet.json + // this example is just showing the usage of "ConnectedRegistries_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedRegistryResource created on azure + // for more information of creating ConnectedRegistryResource, please refer to the document of ConnectedRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string connectedRegistryName = "myConnectedRegistry"; + ResourceIdentifier connectedRegistryResourceId = ConnectedRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + ConnectedRegistryResource connectedRegistry = client.GetConnectedRegistryResource(connectedRegistryResourceId); + + // invoke the operation + ConnectedRegistryResource result = await connectedRegistry.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ConnectedRegistryDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryDelete.json + // this example is just showing the usage of "ConnectedRegistries_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedRegistryResource created on azure + // for more information of creating ConnectedRegistryResource, please refer to the document of ConnectedRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string connectedRegistryName = "myConnectedRegistry"; + ResourceIdentifier connectedRegistryResourceId = ConnectedRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + ConnectedRegistryResource connectedRegistry = client.GetConnectedRegistryResource(connectedRegistryResourceId); + + // invoke the operation + await connectedRegistry.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ConnectedRegistryUpdate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryUpdate.json + // this example is just showing the usage of "ConnectedRegistries_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedRegistryResource created on azure + // for more information of creating ConnectedRegistryResource, please refer to the document of ConnectedRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string connectedRegistryName = "myScopeMap"; + ResourceIdentifier connectedRegistryResourceId = ConnectedRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + ConnectedRegistryResource connectedRegistry = client.GetConnectedRegistryResource(connectedRegistryResourceId); + + // invoke the operation + ConnectedRegistryPatch patch = new ConnectedRegistryPatch + { + SyncProperties = new ConnectedRegistrySyncUpdateProperties + { + Schedule = "0 0 */10 * *", + SyncWindow = XmlConvert.ToTimeSpan("P2D"), + MessageTtl = XmlConvert.ToTimeSpan("P30D"), + }, + Logging = new ConnectedRegistryLogging + { + LogLevel = ConnectedRegistryLogLevel.Debug, + AuditLogStatus = ConnectedRegistryAuditLogStatus.Enabled, + }, + ClientTokenIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token") }, + NotificationsList = { "hello-world:*:*", "sample/repo/*:1.0:*" }, + GarbageCollection = new GarbageCollectionProperties + { + Enabled = true, + Schedule = "0 5 * * *", + }, + }; + ArmOperation lro = await connectedRegistry.UpdateAsync(WaitUntil.Completed, patch); + ConnectedRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Deactivate_ConnectedRegistryDeactivate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ConnectedRegistryDeactivate.json + // this example is just showing the usage of "ConnectedRegistries_Deactivate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedRegistryResource created on azure + // for more information of creating ConnectedRegistryResource, please refer to the document of ConnectedRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string connectedRegistryName = "myConnectedRegistry"; + ResourceIdentifier connectedRegistryResourceId = ConnectedRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + ConnectedRegistryResource connectedRegistry = client.GetConnectedRegistryResource(connectedRegistryResourceId); + + // invoke the operation + await connectedRegistry.DeactivateAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs new file mode 100644 index 000000000000..8401885676c1 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveCollection.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ArchiveCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveCreate.json + // this example is just showing the usage of "Archives_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "rpm"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + ContainerRegistryArchiveData data = new ContainerRegistryArchiveData + { + PackageSource = new ArchivePackageSourceProperties + { + SourceType = ArchivePackageSourceType.Remote, + Uri = new Uri("string"), + }, + PublishedVersion = "string", + RepositoryEndpointPrefix = "string", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, archiveName, data); + ContainerRegistryArchiveResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + ContainerRegistryArchiveResource result = await collection.GetAsync(archiveName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ArchiveList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveList.json + // this example is just showing the usage of "Archives_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryArchiveResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + bool result = await collection.ExistsAsync(archiveName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryArchiveResource + string packageType = "myPackageType"; + ContainerRegistryArchiveCollection collection = containerRegistry.GetContainerRegistryArchives(packageType); + + // invoke the operation + string archiveName = "myArchiveName"; + NullableResponse response = await collection.GetIfExistsAsync(archiveName); + ContainerRegistryArchiveResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs new file mode 100644 index 000000000000..b3bde52c57a2 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveResource.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveGet.json + // this example is just showing the usage of "Archives_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + ContainerRegistryArchiveResource result = await containerRegistryArchive.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ArchiveDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveDelete.json + // this example is just showing the usage of "Archives_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + await containerRegistryArchive.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ArchiveUpdate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveUpdate.json + // this example is just showing the usage of "Archives_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // invoke the operation + ContainerRegistryArchivePatch patch = new ContainerRegistryArchivePatch + { + PublishedVersion = "string", + }; + ContainerRegistryArchiveResource result = await containerRegistryArchive.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs new file mode 100644 index 000000000000..56aa48bae08a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ArchiveVersionCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionCreate.json + // this example is just showing the usage of "ArchiveVersions_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, archiveVersionName); + ContainerRegistryArchiveVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + ContainerRegistryArchiveVersionResource result = await collection.GetAsync(archiveVersionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ArchiveVersionList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionList.json + // this example is just showing the usage of "ArchiveVersions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryArchiveVersionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + bool result = await collection.ExistsAsync(archiveVersionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveResource created on azure + // for more information of creating ContainerRegistryArchiveResource, please refer to the document of ContainerRegistryArchiveResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + ResourceIdentifier containerRegistryArchiveResourceId = ContainerRegistryArchiveResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + ContainerRegistryArchiveResource containerRegistryArchive = client.GetContainerRegistryArchiveResource(containerRegistryArchiveResourceId); + + // get the collection of this ContainerRegistryArchiveVersionResource + ContainerRegistryArchiveVersionCollection collection = containerRegistryArchive.GetContainerRegistryArchiveVersions(); + + // invoke the operation + string archiveVersionName = "myArchiveVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(archiveVersionName); + ContainerRegistryArchiveVersionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs new file mode 100644 index 000000000000..59231e811f65 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryArchiveVersionResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryArchiveVersionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ArchiveVersionGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionGet.json + // this example is just showing the usage of "ArchiveVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + ContainerRegistryArchiveVersionResource result = await containerRegistryArchiveVersion.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ArchiveVersionDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionDelete.json + // this example is just showing the usage of "ArchiveVersions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "myPackageType"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + await containerRegistryArchiveVersion.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ArchiveVersionCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ArchiveVersionCreate.json + // this example is just showing the usage of "ArchiveVersions_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryArchiveVersionResource created on azure + // for more information of creating ContainerRegistryArchiveVersionResource, please refer to the document of ContainerRegistryArchiveVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string packageType = "rpm"; + string archiveName = "myArchiveName"; + string archiveVersionName = "myArchiveVersionName"; + ResourceIdentifier containerRegistryArchiveVersionResourceId = ContainerRegistryArchiveVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + ContainerRegistryArchiveVersionResource containerRegistryArchiveVersion = client.GetContainerRegistryArchiveVersionResource(containerRegistryArchiveVersionResourceId); + + // invoke the operation + ArmOperation lro = await containerRegistryArchiveVersion.UpdateAsync(WaitUntil.Completed); + ContainerRegistryArchiveVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryArchiveVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs new file mode 100644 index 000000000000..4de11f8d6538 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryCacheRuleCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CacheRuleCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleCreate.json + // this example is just showing the usage of "CacheRules_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCacheRuleResource + ContainerRegistryCacheRuleCollection collection = containerRegistry.GetContainerRegistryCacheRules(); + + // invoke the operation + string cacheRuleName = "myCacheRule"; + ContainerRegistryCacheRuleData data = new ContainerRegistryCacheRuleData + { + CredentialSetResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + SourceRepository = "docker.io/library/hello-world", + TargetRepository = "cached-docker-hub/hello-world", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cacheRuleName, data); + ContainerRegistryCacheRuleResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CacheRuleGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleGet.json + // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCacheRuleResource + ContainerRegistryCacheRuleCollection collection = containerRegistry.GetContainerRegistryCacheRules(); + + // invoke the operation + string cacheRuleName = "myCacheRule"; + ContainerRegistryCacheRuleResource result = await collection.GetAsync(cacheRuleName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CacheRuleList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleList.json + // this example is just showing the usage of "CacheRules_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCacheRuleResource + ContainerRegistryCacheRuleCollection collection = containerRegistry.GetContainerRegistryCacheRules(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryCacheRuleResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CacheRuleGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleGet.json + // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCacheRuleResource + ContainerRegistryCacheRuleCollection collection = containerRegistry.GetContainerRegistryCacheRules(); + + // invoke the operation + string cacheRuleName = "myCacheRule"; + bool result = await collection.ExistsAsync(cacheRuleName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CacheRuleGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleGet.json + // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCacheRuleResource + ContainerRegistryCacheRuleCollection collection = containerRegistry.GetContainerRegistryCacheRules(); + + // invoke the operation + string cacheRuleName = "myCacheRule"; + NullableResponse response = await collection.GetIfExistsAsync(cacheRuleName); + ContainerRegistryCacheRuleResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs new file mode 100644 index 000000000000..94d4ae6bbe96 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCacheRuleResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryCacheRuleResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CacheRuleGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleGet.json + // this example is just showing the usage of "CacheRules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCacheRuleResource created on azure + // for more information of creating ContainerRegistryCacheRuleResource, please refer to the document of ContainerRegistryCacheRuleResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string cacheRuleName = "myCacheRule"; + ResourceIdentifier containerRegistryCacheRuleResourceId = ContainerRegistryCacheRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, cacheRuleName); + ContainerRegistryCacheRuleResource containerRegistryCacheRule = client.GetContainerRegistryCacheRuleResource(containerRegistryCacheRuleResourceId); + + // invoke the operation + ContainerRegistryCacheRuleResource result = await containerRegistryCacheRule.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CacheRuleDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleDelete.json + // this example is just showing the usage of "CacheRules_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCacheRuleResource created on azure + // for more information of creating ContainerRegistryCacheRuleResource, please refer to the document of ContainerRegistryCacheRuleResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string cacheRuleName = "myCacheRule"; + ResourceIdentifier containerRegistryCacheRuleResourceId = ContainerRegistryCacheRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, cacheRuleName); + ContainerRegistryCacheRuleResource containerRegistryCacheRule = client.GetContainerRegistryCacheRuleResource(containerRegistryCacheRuleResourceId); + + // invoke the operation + await containerRegistryCacheRule.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CacheRuleUpdate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CacheRuleUpdate.json + // this example is just showing the usage of "CacheRules_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCacheRuleResource created on azure + // for more information of creating ContainerRegistryCacheRuleResource, please refer to the document of ContainerRegistryCacheRuleResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string cacheRuleName = "myCacheRule"; + ResourceIdentifier containerRegistryCacheRuleResourceId = ContainerRegistryCacheRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, cacheRuleName); + ContainerRegistryCacheRuleResource containerRegistryCacheRule = client.GetContainerRegistryCacheRuleResource(containerRegistryCacheRuleResourceId); + + // invoke the operation + ContainerRegistryCacheRulePatch patch = new ContainerRegistryCacheRulePatch + { + CredentialSetResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"), + }; + ArmOperation lro = await containerRegistryCacheRule.UpdateAsync(WaitUntil.Completed, patch); + ContainerRegistryCacheRuleResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCacheRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs index 1b88aeb8431f..6658984f186c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerRegistryCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RegistryCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryCreate.json // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,11 +59,53 @@ public async Task CreateOrUpdate_RegistryCreate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RegistryCreateDomainNameLabelScope() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryCreateDomainNameLabelScope.json + // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerRegistryResource + ContainerRegistryCollection collection = resourceGroupResource.GetContainerRegistries(); + + // invoke the operation + string registryName = "myRegistry"; + ContainerRegistryData data = new ContainerRegistryData(new AzureLocation("westus"), new ContainerRegistrySku(ContainerRegistrySkuName.Standard)) + { + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse, + Tags = +{ +["key"] = "value" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, registryName, data); + ContainerRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RegistryCreateZoneRedundant() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryCreateZoneRedundant.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryCreateZoneRedundant.json // this example is just showing the usage of "Registries_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +147,7 @@ public async Task CreateOrUpdate_RegistryCreateZoneRedundant() [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +180,7 @@ public async Task Get_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RegistryListByResourceGroup() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryListByResourceGroup.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryListByResourceGroup.json // this example is just showing the usage of "Registries_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +215,7 @@ public async Task GetAll_RegistryListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +244,7 @@ public async Task Exists_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs new file mode 100644 index 000000000000..a4ee5c87d697 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetCollection.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryCredentialSetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CredentialSetCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetCreate.json + // this example is just showing the usage of "CredentialSets_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCredentialSetResource + ContainerRegistryCredentialSetCollection collection = containerRegistry.GetContainerRegistryCredentialSets(); + + // invoke the operation + string credentialSetName = "myCredentialSet"; + ContainerRegistryCredentialSetData data = new ContainerRegistryCredentialSetData + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + LoginServer = "docker.io", + AuthCredentials = {new ContainerRegistryAuthCredential +{ +Name = ContainerRegistryCredentialName.Credential1, +UsernameSecretIdentifier = "https://myvault.vault.azure.net/secrets/username", +PasswordSecretIdentifier = "https://myvault.vault.azure.net/secrets/password", +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, credentialSetName, data); + ContainerRegistryCredentialSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CredentialSetGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetGet.json + // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCredentialSetResource + ContainerRegistryCredentialSetCollection collection = containerRegistry.GetContainerRegistryCredentialSets(); + + // invoke the operation + string credentialSetName = "myCredentialSet"; + ContainerRegistryCredentialSetResource result = await collection.GetAsync(credentialSetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CredentialSetList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetList.json + // this example is just showing the usage of "CredentialSets_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCredentialSetResource + ContainerRegistryCredentialSetCollection collection = containerRegistry.GetContainerRegistryCredentialSets(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryCredentialSetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CredentialSetGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetGet.json + // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCredentialSetResource + ContainerRegistryCredentialSetCollection collection = containerRegistry.GetContainerRegistryCredentialSets(); + + // invoke the operation + string credentialSetName = "myCredentialSet"; + bool result = await collection.ExistsAsync(credentialSetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CredentialSetGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetGet.json + // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryCredentialSetResource + ContainerRegistryCredentialSetCollection collection = containerRegistry.GetContainerRegistryCredentialSets(); + + // invoke the operation + string credentialSetName = "myCredentialSet"; + NullableResponse response = await collection.GetIfExistsAsync(credentialSetName); + ContainerRegistryCredentialSetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs new file mode 100644 index 000000000000..676d661397ab --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryCredentialSetResource.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryCredentialSetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CredentialSetGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetGet.json + // this example is just showing the usage of "CredentialSets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCredentialSetResource created on azure + // for more information of creating ContainerRegistryCredentialSetResource, please refer to the document of ContainerRegistryCredentialSetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string credentialSetName = "myCredentialSet"; + ResourceIdentifier containerRegistryCredentialSetResourceId = ContainerRegistryCredentialSetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, credentialSetName); + ContainerRegistryCredentialSetResource containerRegistryCredentialSet = client.GetContainerRegistryCredentialSetResource(containerRegistryCredentialSetResourceId); + + // invoke the operation + ContainerRegistryCredentialSetResource result = await containerRegistryCredentialSet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CredentialSetDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetDelete.json + // this example is just showing the usage of "CredentialSets_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCredentialSetResource created on azure + // for more information of creating ContainerRegistryCredentialSetResource, please refer to the document of ContainerRegistryCredentialSetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string credentialSetName = "myCredentialSet"; + ResourceIdentifier containerRegistryCredentialSetResourceId = ContainerRegistryCredentialSetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, credentialSetName); + ContainerRegistryCredentialSetResource containerRegistryCredentialSet = client.GetContainerRegistryCredentialSetResource(containerRegistryCredentialSetResourceId); + + // invoke the operation + await containerRegistryCredentialSet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CredentialSetUpdate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/CredentialSetUpdate.json + // this example is just showing the usage of "CredentialSets_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryCredentialSetResource created on azure + // for more information of creating ContainerRegistryCredentialSetResource, please refer to the document of ContainerRegistryCredentialSetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string credentialSetName = "myCredentialSet"; + ResourceIdentifier containerRegistryCredentialSetResourceId = ContainerRegistryCredentialSetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, credentialSetName); + ContainerRegistryCredentialSetResource containerRegistryCredentialSet = client.GetContainerRegistryCredentialSetResource(containerRegistryCredentialSetResourceId); + + // invoke the operation + ContainerRegistryCredentialSetPatch patch = new ContainerRegistryCredentialSetPatch + { + AuthCredentials = {new ContainerRegistryAuthCredential +{ +Name = ContainerRegistryCredentialName.Credential1, +UsernameSecretIdentifier = "https://myvault.vault.azure.net/secrets/username2", +PasswordSecretIdentifier = "https://myvault.vault.azure.net/secrets/password2", +}}, + }; + ArmOperation lro = await containerRegistryCredentialSet.UpdateAsync(WaitUntil.Completed, patch); + ContainerRegistryCredentialSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryCredentialSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs new file mode 100644 index 000000000000..284afa7f64dd --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineCollection.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryExportPipelineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ExportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineCreate.json + // this example is just showing the usage of "ExportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + ContainerRegistryExportPipelineData data = new ContainerRegistryExportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("SystemAssigned"), + Target = new ExportPipelineTargetProperties(new Uri("https://myvault.vault.azure.net/secrets/acrexportsas")) + { + PipelineTargetType = "AzureStorageBlobContainer", + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + }, + Options = { ContainerRegistryPipelineOption.OverwriteBlobs }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, exportPipelineName, data); + ContainerRegistryExportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + ContainerRegistryExportPipelineResource result = await collection.GetAsync(exportPipelineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ExportPipelineList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineList.json + // this example is just showing the usage of "ExportPipelines_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryExportPipelineResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + bool result = await collection.ExistsAsync(exportPipelineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryExportPipelineResource + ContainerRegistryExportPipelineCollection collection = containerRegistry.GetContainerRegistryExportPipelines(); + + // invoke the operation + string exportPipelineName = "myExportPipeline"; + NullableResponse response = await collection.GetIfExistsAsync(exportPipelineName); + ContainerRegistryExportPipelineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs new file mode 100644 index 000000000000..f8cff4721cea --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryExportPipelineResource.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryExportPipelineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineGet.json + // this example is just showing the usage of "ExportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + ContainerRegistryExportPipelineResource result = await containerRegistryExportPipeline.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ExportPipelineDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineDelete.json + // this example is just showing the usage of "ExportPipelines_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + await containerRegistryExportPipeline.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ExportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ExportPipelineCreate.json + // this example is just showing the usage of "ExportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryExportPipelineResource created on azure + // for more information of creating ContainerRegistryExportPipelineResource, please refer to the document of ContainerRegistryExportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string exportPipelineName = "myExportPipeline"; + ResourceIdentifier containerRegistryExportPipelineResourceId = ContainerRegistryExportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, exportPipelineName); + ContainerRegistryExportPipelineResource containerRegistryExportPipeline = client.GetContainerRegistryExportPipelineResource(containerRegistryExportPipelineResourceId); + + // invoke the operation + ContainerRegistryExportPipelineData data = new ContainerRegistryExportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("SystemAssigned"), + Target = new ExportPipelineTargetProperties(new Uri("https://myvault.vault.azure.net/secrets/acrexportsas")) + { + PipelineTargetType = "AzureStorageBlobContainer", + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + }, + Options = { ContainerRegistryPipelineOption.OverwriteBlobs }, + }; + ArmOperation lro = await containerRegistryExportPipeline.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryExportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryExportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs new file mode 100644 index 000000000000..81d2e907197b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryImportPipelineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ImportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineCreate.json + // this example is just showing the usage of "ImportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + ContainerRegistryImportPipelineData data = new ContainerRegistryImportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2")] = new UserAssignedIdentity() +}, + }, + Source = new ImportPipelineSourceProperties(new Uri("https://myvault.vault.azure.net/secrets/acrimportsas")) + { + ContainerRegistryPipelineSourceType = ContainerRegistryPipelineSourceType.AzureStorageBlobContainer, + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + }, + Options = { ContainerRegistryPipelineOption.OverwriteTags, ContainerRegistryPipelineOption.DeleteSourceBlobOnSuccess, ContainerRegistryPipelineOption.ContinueOnErrors }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, importPipelineName, data); + ContainerRegistryImportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + ContainerRegistryImportPipelineResource result = await collection.GetAsync(importPipelineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ImportPipelineList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineList.json + // this example is just showing the usage of "ImportPipelines_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryImportPipelineResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + bool result = await collection.ExistsAsync(importPipelineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryImportPipelineResource + ContainerRegistryImportPipelineCollection collection = containerRegistry.GetContainerRegistryImportPipelines(); + + // invoke the operation + string importPipelineName = "myImportPipeline"; + NullableResponse response = await collection.GetIfExistsAsync(importPipelineName); + ContainerRegistryImportPipelineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs new file mode 100644 index 000000000000..5c189468e248 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryImportPipelineResource.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryImportPipelineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportPipelineGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineGet.json + // this example is just showing the usage of "ImportPipelines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + ContainerRegistryImportPipelineResource result = await containerRegistryImportPipeline.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ImportPipelineDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineDelete.json + // this example is just showing the usage of "ImportPipelines_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + await containerRegistryImportPipeline.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ImportPipelineCreate() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportPipelineCreate.json + // this example is just showing the usage of "ImportPipelines_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryImportPipelineResource created on azure + // for more information of creating ContainerRegistryImportPipelineResource, please refer to the document of ContainerRegistryImportPipelineResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string importPipelineName = "myImportPipeline"; + ResourceIdentifier containerRegistryImportPipelineResourceId = ContainerRegistryImportPipelineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, importPipelineName); + ContainerRegistryImportPipelineResource containerRegistryImportPipeline = client.GetContainerRegistryImportPipelineResource(containerRegistryImportPipelineResourceId); + + // invoke the operation + ContainerRegistryImportPipelineData data = new ContainerRegistryImportPipelineData + { + Location = new AzureLocation("westus"), + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2")] = new UserAssignedIdentity() +}, + }, + Source = new ImportPipelineSourceProperties(new Uri("https://myvault.vault.azure.net/secrets/acrimportsas")) + { + ContainerRegistryPipelineSourceType = ContainerRegistryPipelineSourceType.AzureStorageBlobContainer, + Uri = new Uri("https://accountname.blob.core.windows.net/containername"), + }, + Options = { ContainerRegistryPipelineOption.OverwriteTags, ContainerRegistryPipelineOption.DeleteSourceBlobOnSuccess, ContainerRegistryPipelineOption.ContinueOnErrors }, + }; + ArmOperation lro = await containerRegistryImportPipeline.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryImportPipelineResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryImportPipelineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs new file mode 100644 index 000000000000..b0229c7e19b0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunCollection.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryPipelineRunCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PipelineRunCreateExport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunCreate_Export.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + Artifacts = { "sourceRepository/hello-world", "sourceRepository2@sha256:00000000000000000000000000000000000" }, + Target = new ContainerRegistryPipelineRunTargetProperties + { + TargetType = ContainerRegistryPipelineRunTargetType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineRunName, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PipelineRunCreateImport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunCreate_Import.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + Source = new ContainerRegistryPipelineRunSourceProperties + { + SourceType = ContainerRegistryPipelineRunSourceType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + CatalogDigest = "sha256@", + }, + ForceUpdateTag = "2020-03-04T17:23:21.9261521+00:00", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineRunName, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + ContainerRegistryPipelineRunResource result = await collection.GetAsync(pipelineRunName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PipelineRunList() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunList.json + // this example is just showing the usage of "PipelineRuns_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation and iterate over the result + await foreach (ContainerRegistryPipelineRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + bool result = await collection.ExistsAsync(pipelineRunName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryResource created on azure + // for more information of creating ContainerRegistryResource, please refer to the document of ContainerRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + ResourceIdentifier containerRegistryResourceId = ContainerRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + ContainerRegistryResource containerRegistry = client.GetContainerRegistryResource(containerRegistryResourceId); + + // get the collection of this ContainerRegistryPipelineRunResource + ContainerRegistryPipelineRunCollection collection = containerRegistry.GetContainerRegistryPipelineRuns(); + + // invoke the operation + string pipelineRunName = "myPipelineRun"; + NullableResponse response = await collection.GetIfExistsAsync(pipelineRunName); + ContainerRegistryPipelineRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs new file mode 100644 index 000000000000..611f2d022a33 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPipelineRunResource.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerRegistry.Samples +{ + public partial class Sample_ContainerRegistryPipelineRunResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PipelineRunGet() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunGet.json + // this example is just showing the usage of "PipelineRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunResource result = await containerRegistryPipelineRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PipelineRunDelete() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunDelete.json + // this example is just showing the usage of "PipelineRuns_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + await containerRegistryPipelineRun.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PipelineRunCreateExport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunCreate_Export.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + Artifacts = { "sourceRepository/hello-world", "sourceRepository2@sha256:00000000000000000000000000000000000" }, + Target = new ContainerRegistryPipelineRunTargetProperties + { + TargetType = ContainerRegistryPipelineRunTargetType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + }, + }; + ArmOperation lro = await containerRegistryPipelineRun.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PipelineRunCreateImport() + { + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PipelineRunCreate_Import.json + // this example is just showing the usage of "PipelineRuns_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerRegistryPipelineRunResource created on azure + // for more information of creating ContainerRegistryPipelineRunResource, please refer to the document of ContainerRegistryPipelineRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string registryName = "myRegistry"; + string pipelineRunName = "myPipelineRun"; + ResourceIdentifier containerRegistryPipelineRunResourceId = ContainerRegistryPipelineRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName, pipelineRunName); + ContainerRegistryPipelineRunResource containerRegistryPipelineRun = client.GetContainerRegistryPipelineRunResource(containerRegistryPipelineRunResourceId); + + // invoke the operation + ContainerRegistryPipelineRunData data = new ContainerRegistryPipelineRunData + { + Request = new ConnectedRegistryPipelineRunContent + { + PipelineResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + Source = new ContainerRegistryPipelineRunSourceProperties + { + SourceType = ContainerRegistryPipelineRunSourceType.AzureStorageBlob, + Name = "myblob.tar.gz", + }, + CatalogDigest = "sha256@", + }, + ForceUpdateTag = "2020-03-04T17:23:21.9261521+00:00", + }; + ArmOperation lro = await containerRegistryPipelineRun.UpdateAsync(WaitUntil.Completed, data); + ContainerRegistryPipelineRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerRegistryPipelineRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs index a50d8578dcc6..3deeaa7850ef 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionCreateOrUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionList.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_PrivateEndpointConnectionList() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs index 483dbf7ce61f..e5eb4d7d5b77 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_PrivateEndpointConnectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionCreateOrUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/PrivateEndpointConnectionCreateOrUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs index 8e0fca18a5fa..c6075f3611ea 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs index d5e4f07a6899..0feb081fff51 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerRegistryPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_RegistryGetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_RegistryListPrivateLinkResources() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryListPrivateLinkResources.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryListPrivateLinkResources.json // this example is just showing the usage of "Registries_ListPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_RegistryListPrivateLinkResources() [Ignore("Only validating compilation of examples")] public async Task Exists_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_RegistryGetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RegistryGetPrivateLinkResource() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGetPrivateLinkResource.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGetPrivateLinkResource.json // this example is just showing the usage of "Registries_GetPrivateLinkResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs index a51d6410d08f..3d9a494bd164 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryReplicationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ReplicationCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationCreate.json // this example is just showing the usage of "Replications_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_ReplicationCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ReplicationCreateZoneRedundant() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationCreateZoneRedundant.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationCreateZoneRedundant.json // this example is just showing the usage of "Replications_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_ReplicationCreateZoneRedundant() [Ignore("Only validating compilation of examples")] public async Task Get_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task Get_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ReplicationList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationList.json // this example is just showing the usage of "Replications_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +176,7 @@ public async Task GetAll_ReplicationList() [Ignore("Only validating compilation of examples")] public async Task Exists_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task Exists_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs index c924e5188f4d..493b305d780a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryReplicationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryReplicationResource [Ignore("Only validating compilation of examples")] public async Task Get_ReplicationGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationGet.json // this example is just showing the usage of "Replications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ReplicationGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ReplicationDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationDelete.json // this example is just showing the usage of "Replications_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ReplicationDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ReplicationUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ReplicationUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ReplicationUpdate.json // this example is just showing the usage of "Replications_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs index 7b11dcb271bf..df6c42afd4e4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryResource [Ignore("Only validating compilation of examples")] public async Task Get_RegistryGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGet.json // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RegistryGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RegistryDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryDelete.json // this example is just showing the usage of "Registries_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_RegistryDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RegistryUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryUpdate.json // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Update_RegistryUpdate() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageByManifestDigest() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ImportImageByManifestDigest.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportImageByManifestDigest.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task ImportImage_ImportImageByManifestDigest() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageByTag() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ImportImageByTag.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportImageByTag.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +186,7 @@ public async Task ImportImage_ImportImageByTag() [Ignore("Only validating compilation of examples")] public async Task ImportImage_ImportImageFromPublicRegistry() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ImportImageFromPublicRegistry.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ImportImageFromPublicRegistry.json // this example is just showing the usage of "Registries_ImportImage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -221,7 +221,7 @@ public async Task ImportImage_ImportImageFromPublicRegistry() [Ignore("Only validating compilation of examples")] public async Task GetUsages_RegistryListUsages() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryListUsages.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryListUsages.json // this example is just showing the usage of "Registries_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +250,7 @@ public async Task GetUsages_RegistryListUsages() [Ignore("Only validating compilation of examples")] public async Task GetCredentials_RegistryListCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryListCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryListCredentials.json // this example is just showing the usage of "Registries_ListCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +276,7 @@ public async Task GetCredentials_RegistryListCredentials() [Ignore("Only validating compilation of examples")] public async Task RegenerateCredential_RegistryRegenerateCredential() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryRegenerateCredential.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryRegenerateCredential.json // this example is just showing the usage of "Registries_RegenerateCredential" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +303,7 @@ public async Task RegenerateCredential_RegistryRegenerateCredential() [Ignore("Only validating compilation of examples")] public async Task GenerateCredentials_RegistryGenerateCredentials() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryGenerateCredentials.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryGenerateCredentials.json // this example is just showing the usage of "Registries_GenerateCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs index 4a96d228a5b0..124c762c8453 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTokenCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TokenCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenCreate.json // this example is just showing the usage of "Tokens_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_TokenCreate() [Ignore("Only validating compilation of examples")] public async Task Get_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_TokenGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_TokenList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenList.json // this example is just showing the usage of "Tokens_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_TokenList() [Ignore("Only validating compilation of examples")] public async Task Exists_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_TokenGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs index 2ec6c5597c76..7d06e8e9515e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryTokenResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryTokenResource [Ignore("Only validating compilation of examples")] public async Task Get_TokenGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenGet.json // this example is just showing the usage of "Tokens_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_TokenGet() [Ignore("Only validating compilation of examples")] public async Task Delete_TokenDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenDelete.json // this example is just showing the usage of "Tokens_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_TokenDelete() [Ignore("Only validating compilation of examples")] public async Task Update_TokenUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/TokenUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/TokenUpdate.json // this example is just showing the usage of "Tokens_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs index 90807d33bed7..4950df5cf2d2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryWebhookCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_WebhookCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookCreate.json // this example is just showing the usage of "Webhooks_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -70,7 +70,7 @@ public async Task CreateOrUpdate_WebhookCreate() [Ignore("Only validating compilation of examples")] public async Task Get_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_WebhookList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookList.json // this example is just showing the usage of "Webhooks_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAll_WebhookList() [Ignore("Only validating compilation of examples")] public async Task Exists_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs index 0ab756244a3c..cd0132d54054 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ContainerRegistryWebhookResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerRegistryWebhookResource [Ignore("Only validating compilation of examples")] public async Task Get_WebhookGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookGet.json // this example is just showing the usage of "Webhooks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_WebhookGet() [Ignore("Only validating compilation of examples")] public async Task Delete_WebhookDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookDelete.json // this example is just showing the usage of "Webhooks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_WebhookDelete() [Ignore("Only validating compilation of examples")] public async Task Update_WebhookUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookUpdate.json // this example is just showing the usage of "Webhooks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Update_WebhookUpdate() [Ignore("Only validating compilation of examples")] public async Task Ping_WebhookPing() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookPing.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookPing.json // this example is just showing the usage of "Webhooks_Ping" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Ping_WebhookPing() [Ignore("Only validating compilation of examples")] public async Task GetEvents_WebhookListEvents() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookListEvents.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookListEvents.json // this example is just showing the usage of "Webhooks_ListEvents" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task GetEvents_WebhookListEvents() [Ignore("Only validating compilation of examples")] public async Task GetCallbackConfig_WebhookGetCallbackConfig() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/WebhookGetCallbackConfig.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/WebhookGetCallbackConfig.json // this example is just showing the usage of "Webhooks_GetCallbackConfig" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs index 06b189f3786e..0823c45e6355 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ScopeMapCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ScopeMapCreate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapCreate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapCreate.json // this example is just showing the usage of "ScopeMaps_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_ScopeMapCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ScopeMapList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapList.json // this example is just showing the usage of "ScopeMaps_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_ScopeMapList() [Ignore("Only validating compilation of examples")] public async Task Exists_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Exists_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs index 152b4a9cc030..ea3f8f2f68f4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_ScopeMapResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ScopeMapResource [Ignore("Only validating compilation of examples")] public async Task Get_ScopeMapGet() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapGet.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapGet.json // this example is just showing the usage of "ScopeMaps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ScopeMapGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ScopeMapDelete() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapDelete.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapDelete.json // this example is just showing the usage of "ScopeMaps_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ScopeMapDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ScopeMapUpdate() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/ScopeMapUpdate.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/ScopeMapUpdate.json // this example is just showing the usage of "ScopeMaps_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index cc39c0ff03e9..3a226f68e1ed 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvailable() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryCheckNameAvailable.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryCheckNameAvailable.json // this example is just showing the usage of "Registries_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -36,7 +36,11 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvaila SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry"); + ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry") + { + ResourceGroupName = "myResourceGroup", + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.ResourceGroupReuse, + }; ContainerRegistryNameAvailableResult result = await subscriptionResource.CheckContainerRegistryNameAvailabilityAsync(content); Console.WriteLine($"Succeeded: {result}"); @@ -46,7 +50,7 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameAvaila [Ignore("Only validating compilation of examples")] public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAvailable() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryCheckNameNotAvailable.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryCheckNameNotAvailable.json // this example is just showing the usage of "Registries_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +65,11 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAva SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry"); + ContainerRegistryNameAvailabilityContent content = new ContainerRegistryNameAvailabilityContent("myRegistry") + { + ResourceGroupName = "myResourceGroup", + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.ResourceGroupReuse, + }; ContainerRegistryNameAvailableResult result = await subscriptionResource.CheckContainerRegistryNameAvailabilityAsync(content); Console.WriteLine($"Succeeded: {result}"); @@ -71,7 +79,7 @@ public async Task CheckContainerRegistryNameAvailability_RegistryCheckNameNotAva [Ignore("Only validating compilation of examples")] public async Task GetContainerRegistries_RegistryList() { - // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2022-12-01/examples/RegistryList.json + // Generated from example definition: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2024-11-01-preview/examples/RegistryList.json // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Azure.ResourceManager.ContainerRegistry.csproj b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Azure.ResourceManager.ContainerRegistry.csproj index 1848071ff865..234dce329a78 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Azure.ResourceManager.ContainerRegistry.csproj +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Azure.ResourceManager.ContainerRegistry.csproj @@ -1,6 +1,6 @@ - 1.3.0-beta.2 + 1.3.0-beta.3 1.2.1 Azure.ResourceManager.ContainerRegistry diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs index ab34330a1072..f7c2f85f012e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ArmContainerRegistryModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -16,6 +17,272 @@ namespace Azure.ResourceManager.ContainerRegistry.Models /// Model factory for models. public static partial class ArmContainerRegistryModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The package source of the archive. + /// The published version of the archive. + /// + /// + /// The provisioning state of the archive at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryArchiveData ContainerRegistryArchiveData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ArchivePackageSourceProperties packageSource = null, string publishedVersion = null, string repositoryEndpointPrefix = null, string repositoryEndpoint = null, ContainerRegistryProvisioningState? provisioningState = null) + { + return new ContainerRegistryArchiveData( + id, + name, + resourceType, + systemData, + packageSource, + publishedVersion, + repositoryEndpointPrefix, + repositoryEndpoint, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the archive at the time the operation was called. + /// The detailed error message for the archive version in the case of failure. + /// A new instance for mocking. + public static ContainerRegistryArchiveVersionData ContainerRegistryArchiveVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerRegistryProvisioningState? provisioningState = null, string archiveVersionErrorMessage = null) + { + return new ContainerRegistryArchiveVersionData( + id, + name, + resourceType, + systemData, + provisioningState, + archiveVersionErrorMessage, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The ARM resource ID of the credential store which is associated with the cache rule. + /// Source repository pulled from upstream. + /// + /// Target repository specified in docker pull command. + /// Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + /// + /// The creation date of the cache rule. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static ContainerRegistryCacheRuleData ContainerRegistryCacheRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier credentialSetResourceId = null, string sourceRepository = null, string targetRepository = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null) + { + return new ContainerRegistryCacheRuleData( + id, + name, + resourceType, + systemData, + credentialSetResourceId, + sourceRepository, + targetRepository, + createdOn, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning state of the resource. + /// The mode of the connected registry resource that indicates the permissions of the registry. + /// The current version of ACR runtime on the connected registry. + /// The current connection state of the connected registry. + /// The last activity time of the connected registry. + /// The activation properties of the connected registry. + /// The parent of the connected registry. + /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. + /// The login server properties of the connected registry. + /// The logging properties of the connected registry. + /// The list of current statuses of the connected registry. + /// The list of notifications subscription information for the connected registry. + /// The garbage collection properties of the connected registry. + /// A new instance for mocking. + public static ConnectedRegistryData ConnectedRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerRegistryProvisioningState? provisioningState = null, ConnectedRegistryMode? mode = null, string version = null, ConnectedRegistryConnectionState? connectionState = null, DateTimeOffset? lastActivityOn = null, ConnectedRegistryActivationStatus? activationStatus = null, ConnectedRegistryParent parent = null, IEnumerable clientTokenIds = null, ConnectedRegistryLoginServer loginServer = null, ConnectedRegistryLogging logging = null, IEnumerable statusDetails = null, IEnumerable notificationsList = null, GarbageCollectionProperties garbageCollection = null) + { + clientTokenIds ??= new List(); + statusDetails ??= new List(); + notificationsList ??= new List(); + + return new ConnectedRegistryData( + id, + name, + resourceType, + systemData, + provisioningState, + mode, + version, + connectionState, + lastActivityOn, + activationStatus != null ? new ConnectedRegistryActivation(activationStatus, serializedAdditionalRawData: null) : null, + parent, + clientTokenIds?.ToList(), + loginServer, + logging, + statusDetails?.ToList(), + notificationsList?.ToList(), + garbageCollection, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. + /// The cron expression indicating the schedule that the connected registry will sync with its parent. + /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// The last time a sync occurred between the connected registry and its parent. + /// The gateway endpoint used by the connected registry to communicate with its parent. + /// A new instance for mocking. + public static ConnectedRegistrySyncProperties ConnectedRegistrySyncProperties(ResourceIdentifier tokenId = null, string schedule = null, TimeSpan? syncWindow = null, TimeSpan messageTtl = default, DateTimeOffset? lastSyncOn = null, string gatewayEndpoint = null) + { + return new ConnectedRegistrySyncProperties( + tokenId, + schedule, + syncWindow, + messageTtl, + lastSyncOn, + gatewayEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The host of the connected registry. Can be FQDN or IP. + /// The TLS properties of the connected registry login server. + /// A new instance for mocking. + public static ConnectedRegistryLoginServer ConnectedRegistryLoginServer(string host = null, ContainerRegistryTlsProperties tls = null) + { + return new ConnectedRegistryLoginServer(host, tls, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Indicates whether HTTPS is enabled for the login server. + /// The certificate used to configure HTTPS for the login server. + /// A new instance for mocking. + public static ContainerRegistryTlsProperties ContainerRegistryTlsProperties(ContainerRegistryTlsStatus? status = null, ContainerRegistryTlsCertificateProperties certificate = null) + { + return new ContainerRegistryTlsProperties(status, certificate, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of certificate location. + /// Indicates the location of the certificates. + /// A new instance for mocking. + public static ContainerRegistryTlsCertificateProperties ContainerRegistryTlsCertificateProperties(ContainerRegistryCertificateType? certificateType = null, string certificateLocation = null) + { + return new ContainerRegistryTlsCertificateProperties(certificateType, certificateLocation, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The component of the connected registry corresponding to the status. + /// The code of the status. + /// The description of the status. + /// The timestamp of the status. + /// The correlation ID of the status. + /// A new instance for mocking. + public static ConnectedRegistryStatusDetail ConnectedRegistryStatusDetail(string statusDetailType = null, string code = null, string description = null, DateTimeOffset? timestamp = null, Guid? correlationId = null) + { + return new ConnectedRegistryStatusDetail( + statusDetailType, + code, + description, + timestamp, + correlationId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Identities associated with the resource. This is used to access the KeyVault secrets. + /// The credentials are stored for this upstream or login server. + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + /// The creation date of credential store resource. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static ContainerRegistryCredentialSetData ContainerRegistryCredentialSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedServiceIdentity identity = null, string loginServer = null, IEnumerable authCredentials = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null) + { + authCredentials ??= new List(); + + return new ContainerRegistryCredentialSetData( + id, + name, + resourceType, + systemData, + identity, + loginServer, + authCredentials?.ToList(), + createdOn, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the credential. + /// KeyVault Secret URI for accessing the username. + /// KeyVault Secret URI for accessing the password. + /// This provides data pertaining to the health of the auth credential. + /// A new instance for mocking. + public static ContainerRegistryAuthCredential ContainerRegistryAuthCredential(ContainerRegistryCredentialName? name = null, string usernameSecretIdentifier = null, string passwordSecretIdentifier = null, ContainerRegistryCredentialHealth credentialHealth = null) + { + return new ContainerRegistryAuthCredential(name, usernameSecretIdentifier, passwordSecretIdentifier, credentialHealth, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The health status of credential. + /// Error code representing the health check error. + /// Descriptive message representing the health check error. + /// A new instance for mocking. + public static ContainerRegistryCredentialHealth ContainerRegistryCredentialHealth(ContainerRegistryCredentialHealthStatus? status = null, string errorCode = null, string errorMessage = null) + { + return new ContainerRegistryCredentialHealth(status, errorCode, errorMessage, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the export pipeline. + /// The identity of the export pipeline. + /// The target properties of the export pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryExportPipelineData ContainerRegistryExportPipelineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ExportPipelineTargetProperties target = null, IEnumerable options = null, ContainerRegistryProvisioningState? provisioningState = null) + { + options ??= new List(); + + return new ContainerRegistryExportPipelineData( + id, + name, + resourceType, + systemData, + location, + identity, + target, + options?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The source of the image. /// List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). @@ -55,23 +322,110 @@ public static ContainerRegistryImportSourceCredentials ContainerRegistryImportSo return new ContainerRegistryImportSourceCredentials(username, password, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the import pipeline. + /// The identity of the import pipeline. + /// The source properties of the import pipeline. + /// The properties that describe the trigger of the import pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// A new instance for mocking. + public static ContainerRegistryImportPipelineData ContainerRegistryImportPipelineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ImportPipelineSourceProperties source = null, ContainerRegistryTriggerStatus? sourceTriggerStatus = null, IEnumerable options = null, ContainerRegistryProvisioningState? provisioningState = null) + { + options ??= new List(); + + return new ContainerRegistryImportPipelineData( + id, + name, + resourceType, + systemData, + location, + identity, + source, + sourceTriggerStatus.HasValue ? new PipelineTriggerProperties(new PipelineSourceTriggerProperties(sourceTriggerStatus.Value, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + options?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The name of the container registry. /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// The resource group name of the container registry. + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". /// A new instance for mocking. - public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, ContainerRegistryResourceType resourceType = default) + public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name = null, ContainerRegistryResourceType resourceType = default, string resourceGroupName = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) { - return new ContainerRegistryNameAvailabilityContent(name, resourceType, serializedAdditionalRawData: null); + return new ContainerRegistryNameAvailabilityContent(name, resourceType, resourceGroupName, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); } /// Initializes a new instance of . + /// The complete login server name with domain name label (DNL) hash, if available. /// The value that indicates whether the name is available. /// If any, the reason that the name is not available. /// If any, the error message that provides more detail for the reason that the name is not available. /// A new instance for mocking. - public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable = null, string reason = null, string message = null) + public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(string availableLoginServerName = null, bool? isNameAvailable = null, string reason = null, string message = null) + { + return new ContainerRegistryNameAvailableResult(availableLoginServerName, isNameAvailable, reason, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of a pipeline run. + /// The request parameters for a pipeline run. + /// The response of a pipeline run. + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + /// A new instance for mocking. + public static ContainerRegistryPipelineRunData ContainerRegistryPipelineRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerRegistryProvisioningState? provisioningState = null, ConnectedRegistryPipelineRunContent request = null, PipelineRunResult response = null, string forceUpdateTag = null) + { + return new ContainerRegistryPipelineRunData( + id, + name, + resourceType, + systemData, + provisioningState, + request, + response, + forceUpdateTag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The current status of the pipeline run. + /// The artifacts imported in the pipeline run. + /// The current progress of the copy operation. + /// The time the pipeline run started. + /// The time the pipeline run finished. + /// The source of the pipeline run. + /// The target of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// The trigger that caused the pipeline run. + /// The detailed error message for the pipeline run in the case of failure. + /// A new instance for mocking. + public static PipelineRunResult PipelineRunResult(string status = null, IEnumerable importedArtifacts = null, string progressPercentage = null, DateTimeOffset? startOn = null, DateTimeOffset? finishOn = null, ImportPipelineSourceProperties source = null, ExportPipelineTargetProperties target = null, string catalogDigest = null, DateTimeOffset? sourceTriggerTimestamp = null, string pipelineRunErrorMessage = null) { - return new ContainerRegistryNameAvailableResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); + importedArtifacts ??= new List(); + + return new PipelineRunResult( + status, + importedArtifacts?.ToList(), + progressPercentage != null ? new PipelineProgress(progressPercentage, serializedAdditionalRawData: null) : null, + startOn, + finishOn, + source, + target, + catalogDigest, + sourceTriggerTimestamp != null ? new PipelineTriggerDescriptor(new PipelineSourceTriggerDescriptor(sourceTriggerTimestamp, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + pipelineRunErrorMessage, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -119,8 +473,11 @@ public static ContainerRegistryPrivateEndpointConnectionData ContainerRegistryPr /// Whether or not public network access is allowed for the container registry. /// Whether to allow trusted Azure services to access a network restricted registry. /// Whether or not zone redundancy is enabled for this container registry. + /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. + /// Determines the domain name label reuse scope. /// A new instance for mocking. - public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerRegistrySku sku = null, ManagedServiceIdentity identity = null, string loginServer = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null, ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = null, ContainerRegistryNetworkRuleSet networkRuleSet = null, ContainerRegistryPolicies policies = null, ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = null, IEnumerable dataEndpointHostNames = null, IEnumerable privateEndpointConnections = null, ContainerRegistryPublicNetworkAccess? publicNetworkAccess = null, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = null, ContainerRegistryZoneRedundancy? zoneRedundancy = null) + public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerRegistrySku sku = null, ManagedServiceIdentity identity = null, string loginServer = null, DateTimeOffset? createdOn = null, ContainerRegistryProvisioningState? provisioningState = null, ContainerRegistryResourceStatus status = null, bool? isAdminUserEnabled = null, ContainerRegistryNetworkRuleSet networkRuleSet = null, ContainerRegistryPolicies policies = null, ContainerRegistryEncryption encryption = null, bool? isDataEndpointEnabled = null, IEnumerable dataEndpointHostNames = null, IEnumerable privateEndpointConnections = null, ContainerRegistryPublicNetworkAccess? publicNetworkAccess = null, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = null, ContainerRegistryZoneRedundancy? zoneRedundancy = null, bool? isAnonymousPullEnabled = null, ContainerRegistryMetadataSearch? metadataSearch = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) { tags ??= new Dictionary(); dataEndpointHostNames ??= new List(); @@ -149,6 +506,9 @@ public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id publicNetworkAccess, networkRuleBypassOptions, zoneRedundancy, + isAnonymousPullEnabled, + metadataSearch, + autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); } @@ -181,6 +541,16 @@ public static ContainerRegistryRetentionPolicy ContainerRegistryRetentionPolicy( return new ContainerRegistryRetentionPolicy(days, lastUpdatedOn, status, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The number of days after which a soft-deleted item is permanently deleted. + /// The timestamp when the policy was last updated. + /// The value that indicates whether the policy is enabled or not. + /// A new instance for mocking. + public static ContainerRegistrySoftDeletePolicy ContainerRegistrySoftDeletePolicy(int? retentionDays = null, DateTimeOffset? lastUpdatedOn = null, ContainerRegistryPolicyStatus? status = null) + { + return new ContainerRegistrySoftDeletePolicy(retentionDays, lastUpdatedOn, status, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Key vault uri to access the encryption key. /// The fully qualified key identifier that includes the version of the key that is actually used for encryption. @@ -921,5 +1291,56 @@ public static ContainerRegistryEncodedTaskStep ContainerRegistryEncodedTaskStep( encodedValuesContent, values?.ToList()); } + + /// Initializes a new instance of . + /// The name of the container registry. + /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryNameAvailabilityContent ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType) + { + return ContainerRegistryNameAvailabilityContent(name: name, resourceType: resourceType, resourceGroupName: default, autoGeneratedDomainNameLabelScope: default); + } + + /// Initializes a new instance of . + /// The value that indicates whether the name is available. + /// If any, the reason that the name is not available. + /// If any, the error message that provides more detail for the reason that the name is not available. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryNameAvailableResult ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message) + { + return ContainerRegistryNameAvailableResult(availableLoginServerName: default, isNameAvailable: isNameAvailable, reason: reason, message: message); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The SKU of the container registry. + /// The identity of the container registry. + /// The URL that can be used to log into the container registry. + /// The creation date of the container registry in ISO8601 format. + /// The provisioning state of the container registry at the time the operation was called. + /// The status of the container registry at the time the operation was called. + /// The value that indicates whether the admin user is enabled. + /// The network rule set for a container registry. + /// The policies for a container registry. + /// The encryption settings of container registry. + /// Enable a single data endpoint per region for serving data. + /// List of host names that will serve data when dataEndpointEnabled is true. + /// List of private endpoint connections for a container registry. + /// Whether or not public network access is allowed for the container registry. + /// Whether to allow trusted Azure services to access a network restricted registry. + /// Whether or not zone redundancy is enabled for this container registry. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerRegistryData ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IEnumerable dataEndpointHostNames, IEnumerable privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy) + { + return ContainerRegistryData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, identity: identity, loginServer: loginServer, createdOn: createdOn, provisioningState: provisioningState, status: status, isAdminUserEnabled: isAdminUserEnabled, networkRuleSet: networkRuleSet, policies: policies, encryption: encryption, isDataEndpointEnabled: isDataEndpointEnabled, dataEndpointHostNames: dataEndpointHostNames, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, networkRuleBypassOptions: networkRuleBypassOptions, zoneRedundancy: zoneRedundancy, isAnonymousPullEnabled: default, metadataSearch: default, autoGeneratedDomainNameLabelScope: default); + } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs new file mode 100644 index 000000000000..91679b077d35 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedRegistries method from an instance of . + /// + public partial class ConnectedRegistryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _connectedRegistryClientDiagnostics; + private readonly ConnectedRegistriesRestOperations _connectedRegistryRestClient; + + /// Initializes a new instance of the class for mocking. + protected ConnectedRegistryCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ConnectedRegistryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectedRegistryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ConnectedRegistryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedRegistryResource.ResourceType, out string connectedRegistryApiVersion); + _connectedRegistryRestClient = new ConnectedRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedRegistryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a connected registry for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the connected registry. + /// The parameters for creating a connectedRegistry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a connected registry for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the connected registry. + /// The parameters for creating a connectedRegistry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Get"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Get"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all connected registries for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries + /// + /// + /// Operation Id + /// ConnectedRegistries_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedRegistryResource(Client, ConnectedRegistryData.DeserializeConnectedRegistryData(e)), _connectedRegistryClientDiagnostics, Pipeline, "ConnectedRegistryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all connected registries for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries + /// + /// + /// Operation Id + /// ConnectedRegistries_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedRegistryResource(Client, ConnectedRegistryData.DeserializeConnectedRegistryData(e)), _connectedRegistryClientDiagnostics, Pipeline, "ConnectedRegistryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Exists"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Exists"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs new file mode 100644 index 000000000000..f1e97ddc5b4e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.Serialization.cs @@ -0,0 +1,726 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ConnectedRegistryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("connectionState"u8); + writer.WriteStringValue(ConnectionState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastActivityOn)) + { + writer.WritePropertyName("lastActivityTime"u8); + writer.WriteStringValue(LastActivityOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Activation)) + { + writer.WritePropertyName("activation"u8); + writer.WriteObjectValue(Activation, options); + } + if (Optional.IsDefined(Parent)) + { + writer.WritePropertyName("parent"u8); + writer.WriteObjectValue(Parent, options); + } + if (Optional.IsCollectionDefined(ClientTokenIds)) + { + writer.WritePropertyName("clientTokenIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientTokenIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LoginServer)) + { + writer.WritePropertyName("loginServer"u8); + writer.WriteObjectValue(LoginServer, options); + } + if (Optional.IsDefined(Logging)) + { + writer.WritePropertyName("logging"u8); + writer.WriteObjectValue(Logging, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StatusDetails)) + { + writer.WritePropertyName("statusDetails"u8); + writer.WriteStartArray(); + foreach (var item in StatusDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NotificationsList)) + { + writer.WritePropertyName("notificationsList"u8); + writer.WriteStartArray(); + foreach (var item in NotificationsList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(GarbageCollection)) + { + writer.WritePropertyName("garbageCollection"u8); + writer.WriteObjectValue(GarbageCollection, options); + } + writer.WriteEndObject(); + } + + ConnectedRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryData(document.RootElement, options); + } + + internal static ConnectedRegistryData DeserializeConnectedRegistryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerRegistryProvisioningState? provisioningState = default; + ConnectedRegistryMode? mode = default; + string version = default; + ConnectedRegistryConnectionState? connectionState = default; + DateTimeOffset? lastActivityTime = default; + ConnectedRegistryActivation activation = default; + ConnectedRegistryParent parent = default; + IList clientTokenIds = default; + ConnectedRegistryLoginServer loginServer = default; + ConnectedRegistryLogging logging = default; + IReadOnlyList statusDetails = default; + IList notificationsList = default; + GarbageCollectionProperties garbageCollection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("mode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new ConnectedRegistryMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("version"u8)) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("connectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionState = new ConnectedRegistryConnectionState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("lastActivityTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastActivityTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("activation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activation = ConnectedRegistryActivation.DeserializeConnectedRegistryActivation(property0.Value, options); + continue; + } + if (property0.NameEquals("parent"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parent = ConnectedRegistryParent.DeserializeConnectedRegistryParent(property0.Value, options); + continue; + } + if (property0.NameEquals("clientTokenIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + clientTokenIds = array; + continue; + } + if (property0.NameEquals("loginServer"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loginServer = ConnectedRegistryLoginServer.DeserializeConnectedRegistryLoginServer(property0.Value, options); + continue; + } + if (property0.NameEquals("logging"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logging = ConnectedRegistryLogging.DeserializeConnectedRegistryLogging(property0.Value, options); + continue; + } + if (property0.NameEquals("statusDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ConnectedRegistryStatusDetail.DeserializeConnectedRegistryStatusDetail(item, options)); + } + statusDetails = array; + continue; + } + if (property0.NameEquals("notificationsList"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + notificationsList = array; + continue; + } + if (property0.NameEquals("garbageCollection"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + garbageCollection = GarbageCollectionProperties.DeserializeGarbageCollectionProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryData( + id, + name, + type, + systemData, + provisioningState, + mode, + version, + connectionState, + lastActivityTime, + activation, + parent, + clientTokenIds ?? new ChangeTrackingList(), + loginServer, + logging, + statusDetails ?? new ChangeTrackingList(), + notificationsList ?? new ChangeTrackingList(), + garbageCollection, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Mode)) + { + builder.Append(" mode: "); + builder.AppendLine($"'{Mode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Version), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" version: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Version)) + { + builder.Append(" version: "); + if (Version.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Version}'''"); + } + else + { + builder.AppendLine($"'{Version}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionState)) + { + builder.Append(" connectionState: "); + builder.AppendLine($"'{ConnectionState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastActivityOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastActivityTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastActivityOn)) + { + builder.Append(" lastActivityTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastActivityOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ActivationStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" activation: "); + builder.AppendLine("{"); + builder.AppendLine(" activation: {"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Activation)) + { + builder.Append(" activation: "); + BicepSerializationHelpers.AppendChildObject(builder, Activation, options, 4, false, " activation: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Parent), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parent: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Parent)) + { + builder.Append(" parent: "); + BicepSerializationHelpers.AppendChildObject(builder, Parent, options, 4, false, " parent: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientTokenIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientTokenIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ClientTokenIds)) + { + if (ClientTokenIds.Any()) + { + builder.Append(" clientTokenIds: "); + builder.AppendLine("["); + foreach (var item in ClientTokenIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LoginServer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" loginServer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LoginServer)) + { + builder.Append(" loginServer: "); + BicepSerializationHelpers.AppendChildObject(builder, LoginServer, options, 4, false, " loginServer: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Logging), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logging: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Logging)) + { + builder.Append(" logging: "); + BicepSerializationHelpers.AppendChildObject(builder, Logging, options, 4, false, " logging: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StatusDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" statusDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(StatusDetails)) + { + if (StatusDetails.Any()) + { + builder.Append(" statusDetails: "); + builder.AppendLine("["); + foreach (var item in StatusDetails) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " statusDetails: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NotificationsList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" notificationsList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(NotificationsList)) + { + if (NotificationsList.Any()) + { + builder.Append(" notificationsList: "); + builder.AppendLine("["); + foreach (var item in NotificationsList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GarbageCollection), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" garbageCollection: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GarbageCollection)) + { + builder.Append(" garbageCollection: "); + BicepSerializationHelpers.AppendChildObject(builder, GarbageCollection, options, 4, false, " garbageCollection: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryData)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs new file mode 100644 index 000000000000..d45939008e2b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ConnectedRegistry data model. + /// An object that represents a connected registry for a container registry. + /// + public partial class ConnectedRegistryData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryData() + { + ClientTokenIds = new ChangeTrackingList(); + StatusDetails = new ChangeTrackingList(); + NotificationsList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning state of the resource. + /// The mode of the connected registry resource that indicates the permissions of the registry. + /// The current version of ACR runtime on the connected registry. + /// The current connection state of the connected registry. + /// The last activity time of the connected registry. + /// The activation properties of the connected registry. + /// The parent of the connected registry. + /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. + /// The login server properties of the connected registry. + /// The logging properties of the connected registry. + /// The list of current statuses of the connected registry. + /// The list of notifications subscription information for the connected registry. + /// The garbage collection properties of the connected registry. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryMode? mode, string version, ConnectedRegistryConnectionState? connectionState, DateTimeOffset? lastActivityOn, ConnectedRegistryActivation activation, ConnectedRegistryParent parent, IList clientTokenIds, ConnectedRegistryLoginServer loginServer, ConnectedRegistryLogging logging, IReadOnlyList statusDetails, IList notificationsList, GarbageCollectionProperties garbageCollection, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + Mode = mode; + Version = version; + ConnectionState = connectionState; + LastActivityOn = lastActivityOn; + Activation = activation; + Parent = parent; + ClientTokenIds = clientTokenIds; + LoginServer = loginServer; + Logging = logging; + StatusDetails = statusDetails; + NotificationsList = notificationsList; + GarbageCollection = garbageCollection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + /// The mode of the connected registry resource that indicates the permissions of the registry. + [WirePath("properties.mode")] + public ConnectedRegistryMode? Mode { get; set; } + /// The current version of ACR runtime on the connected registry. + [WirePath("properties.version")] + public string Version { get; } + /// The current connection state of the connected registry. + [WirePath("properties.connectionState")] + public ConnectedRegistryConnectionState? ConnectionState { get; } + /// The last activity time of the connected registry. + [WirePath("properties.lastActivityTime")] + public DateTimeOffset? LastActivityOn { get; } + /// The activation properties of the connected registry. + internal ConnectedRegistryActivation Activation { get; } + /// The activation status of the connected registry. + [WirePath("properties.activation.status")] + public ConnectedRegistryActivationStatus? ActivationStatus + { + get => Activation?.Status; + } + + /// The parent of the connected registry. + [WirePath("properties.parent")] + public ConnectedRegistryParent Parent { get; set; } + /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. + [WirePath("properties.clientTokenIds")] + public IList ClientTokenIds { get; } + /// The login server properties of the connected registry. + [WirePath("properties.loginServer")] + public ConnectedRegistryLoginServer LoginServer { get; set; } + /// The logging properties of the connected registry. + [WirePath("properties.logging")] + public ConnectedRegistryLogging Logging { get; set; } + /// The list of current statuses of the connected registry. + [WirePath("properties.statusDetails")] + public IReadOnlyList StatusDetails { get; } + /// The list of notifications subscription information for the connected registry. + [WirePath("properties.notificationsList")] + public IList NotificationsList { get; } + /// The garbage collection properties of the connected registry. + [WirePath("properties.garbageCollection")] + public GarbageCollectionProperties GarbageCollection { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.Serialization.cs new file mode 100644 index 000000000000..99875bd0aef6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ConnectedRegistryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectedRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs new file mode 100644 index 000000000000..565209f84250 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ConnectedRegistry along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetConnectedRegistryResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedRegistry method. + /// + public partial class ConnectedRegistryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The connectedRegistryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _connectedRegistryClientDiagnostics; + private readonly ConnectedRegistriesRestOperations _connectedRegistryRestClient; + private readonly ConnectedRegistryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/connectedRegistries"; + + /// Initializes a new instance of the class for mocking. + protected ConnectedRegistryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ConnectedRegistryResource(ArmClient client, ConnectedRegistryData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ConnectedRegistryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectedRegistryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedRegistryApiVersion); + _connectedRegistryRestClient = new ConnectedRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedRegistryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ConnectedRegistryData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Get"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Get"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a connected registry from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Delete"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a connected registry from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Delete"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a connected registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a connectedRegistry. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Update"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a connected registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a connectedRegistry. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Update"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deactivates the connected registry instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate + /// + /// + /// Operation Id + /// ConnectedRegistries_Deactivate + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeactivateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Deactivate"); + scope.Start(); + try + { + var response = await _connectedRegistryRestClient.DeactivateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deactivates the connected registry instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate + /// + /// + /// Operation Id + /// ConnectedRegistries_Deactivate + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Deactivate(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Deactivate"); + scope.Start(); + try + { + var response = _connectedRegistryRestClient.Deactivate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs new file mode 100644 index 000000000000..721224b955b8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryArchives method from an instance of . + /// + public partial class ContainerRegistryArchiveCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryArchiveArchivesClientDiagnostics; + private readonly ArchivesRestOperations _containerRegistryArchiveArchivesRestClient; + private readonly string _packageType; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + /// The type of the package resource. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal ContainerRegistryArchiveCollection(ArmClient client, ResourceIdentifier id, string packageType) : base(client, id) + { + _packageType = packageType; + _containerRegistryArchiveArchivesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryArchiveResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryArchiveResource.ResourceType, out string containerRegistryArchiveArchivesApiVersion); + _containerRegistryArchiveArchivesRestClient = new ArchivesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveArchivesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveOperationSource(Client), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveOperationSource(Client), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all archives for the specified container registry and package type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives + /// + /// + /// Operation Id + /// Archives_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveArchivesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveArchivesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveResource(Client, ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(e)), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, "ContainerRegistryArchiveCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all archives for the specified container registry and package type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives + /// + /// + /// Operation Id + /// Archives_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveArchivesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveArchivesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveResource(Client, ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(e)), _containerRegistryArchiveArchivesClientDiagnostics, Pipeline, "ContainerRegistryArchiveCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, _packageType, archiveName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs new file mode 100644 index 000000000000..4fcf85ae49c5 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.Serialization.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PackageSource)) + { + writer.WritePropertyName("packageSource"u8); + writer.WriteObjectValue(PackageSource, options); + } + if (Optional.IsDefined(PublishedVersion)) + { + writer.WritePropertyName("publishedVersion"u8); + writer.WriteStringValue(PublishedVersion); + } + if (Optional.IsDefined(RepositoryEndpointPrefix)) + { + writer.WritePropertyName("repositoryEndpointPrefix"u8); + writer.WriteStringValue(RepositoryEndpointPrefix); + } + if (options.Format != "W" && Optional.IsDefined(RepositoryEndpoint)) + { + writer.WritePropertyName("repositoryEndpoint"u8); + writer.WriteStringValue(RepositoryEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryArchiveData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArchiveData(document.RootElement, options); + } + + internal static ContainerRegistryArchiveData DeserializeContainerRegistryArchiveData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ArchivePackageSourceProperties packageSource = default; + string publishedVersion = default; + string repositoryEndpointPrefix = default; + string repositoryEndpoint = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("packageSource"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + packageSource = ArchivePackageSourceProperties.DeserializeArchivePackageSourceProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("publishedVersion"u8)) + { + publishedVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryEndpointPrefix"u8)) + { + repositoryEndpointPrefix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryEndpoint"u8)) + { + repositoryEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryArchiveData( + id, + name, + type, + systemData, + packageSource, + publishedVersion, + repositoryEndpointPrefix, + repositoryEndpoint, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PackageSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" packageSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PackageSource)) + { + builder.Append(" packageSource: "); + BicepSerializationHelpers.AppendChildObject(builder, PackageSource, options, 4, false, " packageSource: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublishedVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publishedVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublishedVersion)) + { + builder.Append(" publishedVersion: "); + if (PublishedVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PublishedVersion}'''"); + } + else + { + builder.AppendLine($"'{PublishedVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RepositoryEndpointPrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" repositoryEndpointPrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RepositoryEndpointPrefix)) + { + builder.Append(" repositoryEndpointPrefix: "); + if (RepositoryEndpointPrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RepositoryEndpointPrefix}'''"); + } + else + { + builder.AppendLine($"'{RepositoryEndpointPrefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RepositoryEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" repositoryEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RepositoryEndpoint)) + { + builder.Append(" repositoryEndpoint: "); + if (RepositoryEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RepositoryEndpoint}'''"); + } + else + { + builder.AppendLine($"'{RepositoryEndpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryArchiveData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryArchiveData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs new file mode 100644 index 000000000000..d7c015df2738 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryArchive data model. + /// An object that represents a archive for a container registry. + /// + public partial class ContainerRegistryArchiveData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchiveData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The package source of the archive. + /// The published version of the archive. + /// + /// + /// The provisioning state of the archive at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchiveData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ArchivePackageSourceProperties packageSource, string publishedVersion, string repositoryEndpointPrefix, string repositoryEndpoint, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + PackageSource = packageSource; + PublishedVersion = publishedVersion; + RepositoryEndpointPrefix = repositoryEndpointPrefix; + RepositoryEndpoint = repositoryEndpoint; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The package source of the archive. + [WirePath("properties.packageSource")] + public ArchivePackageSourceProperties PackageSource { get; set; } + /// The published version of the archive. + [WirePath("properties.publishedVersion")] + public string PublishedVersion { get; set; } + /// Gets or sets the repository endpoint prefix. + [WirePath("properties.repositoryEndpointPrefix")] + public string RepositoryEndpointPrefix { get; set; } + /// Gets the repository endpoint. + [WirePath("properties.repositoryEndpoint")] + public string RepositoryEndpoint { get; } + /// The provisioning state of the archive at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs new file mode 100644 index 000000000000..1cd37cd40cc2 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryArchiveData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryArchiveData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs new file mode 100644 index 000000000000..f04fb124bd85 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveResource.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryArchive along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryArchiveResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryArchive method. + /// + public partial class ContainerRegistryArchiveResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The packageType. + /// The archiveName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryArchiveArchivesClientDiagnostics; + private readonly ArchivesRestOperations _containerRegistryArchiveArchivesRestClient; + private readonly ContainerRegistryArchiveData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/packages/archives"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryArchiveResource(ArmClient client, ContainerRegistryArchiveData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryArchiveResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveArchivesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryArchiveArchivesApiVersion); + _containerRegistryArchiveArchivesRestClient = new ArchivesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveArchivesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryArchiveData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of ContainerRegistryArchiveVersionResources in the ContainerRegistryArchive. + /// An object representing collection of ContainerRegistryArchiveVersionResources and their operations over a ContainerRegistryArchiveVersionResource. + public virtual ContainerRegistryArchiveVersionCollection GetContainerRegistryArchiveVersions() + { + return GetCachedClient(client => new ContainerRegistryArchiveVersionCollection(client, Id)); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryArchiveVersionAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryArchiveVersions().GetAsync(archiveVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryArchiveVersion(string archiveVersionName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryArchiveVersions().Get(archiveVersionName, cancellationToken); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveArchivesClientDiagnostics, Pipeline, _containerRegistryArchiveArchivesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for updating a archive. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveArchivesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for updating a archive. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryArchiveArchivesClientDiagnostics.CreateScope("ContainerRegistryArchiveResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryArchiveArchivesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new ContainerRegistryArchiveResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs new file mode 100644 index 000000000000..68d717a8c628 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionCollection.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryArchiveVersions method from an instance of . + /// + public partial class ContainerRegistryArchiveVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics; + private readonly ArchiveVersionsRestOperations _containerRegistryArchiveVersionArchiveVersionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveVersionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryArchiveVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryArchiveVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryArchiveVersionResource.ResourceType, out string containerRegistryArchiveVersionArchiveVersionsApiVersion); + _containerRegistryArchiveVersionArchiveVersionsRestClient = new ArchiveVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveVersionArchiveVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryArchiveResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryArchiveResource.ResourceType), nameof(id)); + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions + /// + /// + /// Operation Id + /// ArchiveVersions_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveVersionResource(Client, ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(e)), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, "ContainerRegistryArchiveVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions + /// + /// + /// Operation Id + /// ArchiveVersions_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryArchiveVersionResource(Client, ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(e)), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, "ContainerRegistryArchiveVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the archive version resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, archiveVersionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs new file mode 100644 index 000000000000..29881a06decf --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.Serialization.cs @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveVersionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ArchiveVersionErrorMessage)) + { + writer.WritePropertyName("archiveVersionErrorMessage"u8); + writer.WriteStringValue(ArchiveVersionErrorMessage); + } + writer.WriteEndObject(); + } + + ContainerRegistryArchiveVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArchiveVersionData(document.RootElement, options); + } + + internal static ContainerRegistryArchiveVersionData DeserializeContainerRegistryArchiveVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerRegistryProvisioningState? provisioningState = default; + string archiveVersionErrorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("archiveVersionErrorMessage"u8)) + { + archiveVersionErrorMessage = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryArchiveVersionData( + id, + name, + type, + systemData, + provisioningState, + archiveVersionErrorMessage, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ArchiveVersionErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" archiveVersionErrorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ArchiveVersionErrorMessage)) + { + builder.Append(" archiveVersionErrorMessage: "); + if (ArchiveVersionErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ArchiveVersionErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{ArchiveVersionErrorMessage}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryArchiveVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryArchiveVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryArchiveVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs new file mode 100644 index 000000000000..7d4cb16a8cf6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryArchiveVersion data model. + /// An object that represents an export pipeline for a container registry. + /// + public partial class ContainerRegistryArchiveVersionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchiveVersionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the archive at the time the operation was called. + /// The detailed error message for the archive version in the case of failure. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchiveVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, string archiveVersionErrorMessage, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + ArchiveVersionErrorMessage = archiveVersionErrorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the archive at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + /// The detailed error message for the archive version in the case of failure. + [WirePath("properties.archiveVersionErrorMessage")] + public string ArchiveVersionErrorMessage { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs new file mode 100644 index 000000000000..80b70a4039eb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryArchiveVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryArchiveVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryArchiveVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs new file mode 100644 index 000000000000..a61b90a1196d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryArchiveVersionResource.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryArchiveVersion along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryArchiveVersionResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryArchiveVersion method. + /// + public partial class ContainerRegistryArchiveVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The packageType. + /// The archiveName. + /// The archiveVersionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics; + private readonly ArchiveVersionsRestOperations _containerRegistryArchiveVersionArchiveVersionsRestClient; + private readonly ContainerRegistryArchiveVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/packages/archives/versions"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArchiveVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryArchiveVersionResource(ArmClient client, ContainerRegistryArchiveVersionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryArchiveVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryArchiveVersionArchiveVersionsApiVersion); + _containerRegistryArchiveVersionArchiveVersionsRestClient = new ArchiveVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryArchiveVersionArchiveVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryArchiveVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the archive version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryArchiveVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive version from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a archive version from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a archive for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName} + /// + /// + /// Operation Id + /// ArchiveVersions_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Update(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics.CreateScope("ContainerRegistryArchiveVersionResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryArchiveVersionArchiveVersionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryArchiveVersionOperationSource(Client), _containerRegistryArchiveVersionArchiveVersionsClientDiagnostics, Pipeline, _containerRegistryArchiveVersionArchiveVersionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs new file mode 100644 index 000000000000..231968ff3710 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryCacheRules method from an instance of . + /// + public partial class ContainerRegistryCacheRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryCacheRuleCacheRulesClientDiagnostics; + private readonly CacheRulesRestOperations _containerRegistryCacheRuleCacheRulesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryCacheRuleCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryCacheRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryCacheRuleCacheRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryCacheRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryCacheRuleResource.ResourceType, out string containerRegistryCacheRuleCacheRulesApiVersion); + _containerRegistryCacheRuleCacheRulesRestClient = new CacheRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryCacheRuleCacheRulesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a cache rule for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string cacheRuleName, ContainerRegistryCacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCacheRuleOperationSource(Client), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a cache rule for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string cacheRuleName, ContainerRegistryCacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCacheRuleOperationSource(Client), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all cache rule resources for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules + /// + /// + /// Operation Id + /// CacheRules_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryCacheRuleCacheRulesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryCacheRuleCacheRulesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryCacheRuleResource(Client, ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(e)), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, "ContainerRegistryCacheRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all cache rule resources for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules + /// + /// + /// Operation Id + /// CacheRules_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryCacheRuleCacheRulesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryCacheRuleCacheRulesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryCacheRuleResource(Client, ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(e)), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, "ContainerRegistryCacheRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheRuleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.Serialization.cs new file mode 100644 index 000000000000..402596892ad4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.Serialization.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryCacheRuleData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCacheRuleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(CredentialSetResourceId)) + { + writer.WritePropertyName("credentialSetResourceId"u8); + writer.WriteStringValue(CredentialSetResourceId); + } + if (Optional.IsDefined(SourceRepository)) + { + writer.WritePropertyName("sourceRepository"u8); + writer.WriteStringValue(SourceRepository); + } + if (Optional.IsDefined(TargetRepository)) + { + writer.WritePropertyName("targetRepository"u8); + writer.WriteStringValue(TargetRepository); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationDate"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryCacheRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCacheRuleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryCacheRuleData(document.RootElement, options); + } + + internal static ContainerRegistryCacheRuleData DeserializeContainerRegistryCacheRuleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ResourceIdentifier credentialSetResourceId = default; + string sourceRepository = default; + string targetRepository = default; + DateTimeOffset? creationDate = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("credentialSetResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentialSetResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sourceRepository"u8)) + { + sourceRepository = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("targetRepository"u8)) + { + targetRepository = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("creationDate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryCacheRuleData( + id, + name, + type, + systemData, + credentialSetResourceId, + sourceRepository, + targetRepository, + creationDate, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CredentialSetResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentialSetResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CredentialSetResourceId)) + { + builder.Append(" credentialSetResourceId: "); + builder.AppendLine($"'{CredentialSetResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceRepository), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceRepository: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SourceRepository)) + { + builder.Append(" sourceRepository: "); + if (SourceRepository.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SourceRepository}'''"); + } + else + { + builder.AppendLine($"'{SourceRepository}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetRepository), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetRepository: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetRepository)) + { + builder.Append(" targetRepository: "); + if (TargetRepository.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TargetRepository}'''"); + } + else + { + builder.AppendLine($"'{TargetRepository}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" creationDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" creationDate: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryCacheRuleData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryCacheRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryCacheRuleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryCacheRuleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.cs new file mode 100644 index 000000000000..9733a7815692 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleData.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryCacheRule data model. + /// An object that represents a cache rule for a container registry. + /// + public partial class ContainerRegistryCacheRuleData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryCacheRuleData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The ARM resource ID of the credential store which is associated with the cache rule. + /// Source repository pulled from upstream. + /// + /// Target repository specified in docker pull command. + /// Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + /// + /// The creation date of the cache rule. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryCacheRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier credentialSetResourceId, string sourceRepository, string targetRepository, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + CredentialSetResourceId = credentialSetResourceId; + SourceRepository = sourceRepository; + TargetRepository = targetRepository; + CreatedOn = createdOn; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ARM resource ID of the credential store which is associated with the cache rule. + [WirePath("properties.credentialSetResourceId")] + public ResourceIdentifier CredentialSetResourceId { get; set; } + /// Source repository pulled from upstream. + [WirePath("properties.sourceRepository")] + public string SourceRepository { get; set; } + /// + /// Target repository specified in docker pull command. + /// Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + /// + [WirePath("properties.targetRepository")] + public string TargetRepository { get; set; } + /// The creation date of the cache rule. + [WirePath("properties.creationDate")] + public DateTimeOffset? CreatedOn { get; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.Serialization.cs new file mode 100644 index 000000000000..352710a9a9dd --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryCacheRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryCacheRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryCacheRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs new file mode 100644 index 000000000000..845e20ed50fb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCacheRuleResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryCacheRule along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryCacheRuleResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryCacheRule method. + /// + public partial class ContainerRegistryCacheRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The cacheRuleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryCacheRuleCacheRulesClientDiagnostics; + private readonly CacheRulesRestOperations _containerRegistryCacheRuleCacheRulesRestClient; + private readonly ContainerRegistryCacheRuleData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/cacheRules"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryCacheRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryCacheRuleResource(ArmClient client, ContainerRegistryCacheRuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryCacheRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryCacheRuleCacheRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryCacheRuleCacheRulesApiVersion); + _containerRegistryCacheRuleCacheRulesRestClient = new CacheRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryCacheRuleCacheRulesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryCacheRuleData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a cache rule resource from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a cache rule resource from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a cache rule for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryCacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryCacheRuleCacheRulesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCacheRuleOperationSource(Client), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a cache rule for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryCacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryCacheRuleCacheRulesClientDiagnostics.CreateScope("ContainerRegistryCacheRuleResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryCacheRuleCacheRulesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCacheRuleOperationSource(Client), _containerRegistryCacheRuleCacheRulesClientDiagnostics, Pipeline, _containerRegistryCacheRuleCacheRulesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs index 78cd64d5079d..e5377b63418d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string registryName, Canc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string registryName, Cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string registryName, CancellationToken canc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs new file mode 100644 index 000000000000..a3a018624b43 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryCredentialSets method from an instance of . + /// + public partial class ContainerRegistryCredentialSetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryCredentialSetCredentialSetsClientDiagnostics; + private readonly CredentialSetsRestOperations _containerRegistryCredentialSetCredentialSetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryCredentialSetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryCredentialSetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryCredentialSetCredentialSetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryCredentialSetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryCredentialSetResource.ResourceType, out string containerRegistryCredentialSetCredentialSetsApiVersion); + _containerRegistryCredentialSetCredentialSetsRestClient = new CredentialSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryCredentialSetCredentialSetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a credential set for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string credentialSetName, ContainerRegistryCredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCredentialSetOperationSource(Client), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a credential set for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string credentialSetName, ContainerRegistryCredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCredentialSetOperationSource(Client), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all credential set resources for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets + /// + /// + /// Operation Id + /// CredentialSets_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryCredentialSetCredentialSetsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryCredentialSetCredentialSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryCredentialSetResource(Client, ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(e)), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, "ContainerRegistryCredentialSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all credential set resources for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets + /// + /// + /// Operation Id + /// CredentialSets_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryCredentialSetCredentialSetsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryCredentialSetCredentialSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryCredentialSetResource(Client, ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(e)), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, "ContainerRegistryCredentialSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, credentialSetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.Serialization.cs new file mode 100644 index 000000000000..26d9c48d0c32 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.Serialization.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryCredentialSetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(LoginServer)) + { + writer.WritePropertyName("loginServer"u8); + writer.WriteStringValue(LoginServer); + } + if (Optional.IsCollectionDefined(AuthCredentials)) + { + writer.WritePropertyName("authCredentials"u8); + writer.WriteStartArray(); + foreach (var item in AuthCredentials) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationDate"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryCredentialSetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryCredentialSetData(document.RootElement, options); + } + + internal static ContainerRegistryCredentialSetData DeserializeContainerRegistryCredentialSetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string loginServer = default; + IList authCredentials = default; + DateTimeOffset? creationDate = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("loginServer"u8)) + { + loginServer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authCredentials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ContainerRegistryAuthCredential.DeserializeContainerRegistryAuthCredential(item, options)); + } + authCredentials = array; + continue; + } + if (property0.NameEquals("creationDate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryCredentialSetData( + id, + name, + type, + systemData, + identity, + loginServer, + authCredentials ?? new ChangeTrackingList(), + creationDate, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LoginServer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" loginServer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LoginServer)) + { + builder.Append(" loginServer: "); + if (LoginServer.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LoginServer}'''"); + } + else + { + builder.AppendLine($"'{LoginServer}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthCredentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authCredentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AuthCredentials)) + { + if (AuthCredentials.Any()) + { + builder.Append(" authCredentials: "); + builder.AppendLine("["); + foreach (var item in AuthCredentials) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " authCredentials: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" creationDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" creationDate: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryCredentialSetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryCredentialSetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.cs new file mode 100644 index 000000000000..bb688c67442f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetData.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryCredentialSet data model. + /// An object that represents a credential set resource for a container registry. + /// + public partial class ContainerRegistryCredentialSetData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryCredentialSetData() + { + AuthCredentials = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Identities associated with the resource. This is used to access the KeyVault secrets. + /// The credentials are stored for this upstream or login server. + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + /// The creation date of credential store resource. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryCredentialSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedServiceIdentity identity, string loginServer, IList authCredentials, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Identity = identity; + LoginServer = loginServer; + AuthCredentials = authCredentials; + CreatedOn = createdOn; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identities associated with the resource. This is used to access the KeyVault secrets. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The credentials are stored for this upstream or login server. + [WirePath("properties.loginServer")] + public string LoginServer { get; set; } + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + [WirePath("properties.authCredentials")] + public IList AuthCredentials { get; } + /// The creation date of credential store resource. + [WirePath("properties.creationDate")] + public DateTimeOffset? CreatedOn { get; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.Serialization.cs new file mode 100644 index 000000000000..c9d8afd415be --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryCredentialSetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryCredentialSetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryCredentialSetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs new file mode 100644 index 000000000000..a7a047d66943 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCredentialSetResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryCredentialSet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryCredentialSetResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryCredentialSet method. + /// + public partial class ContainerRegistryCredentialSetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The credentialSetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryCredentialSetCredentialSetsClientDiagnostics; + private readonly CredentialSetsRestOperations _containerRegistryCredentialSetCredentialSetsRestClient; + private readonly ContainerRegistryCredentialSetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/credentialSets"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryCredentialSetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryCredentialSetResource(ArmClient client, ContainerRegistryCredentialSetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryCredentialSetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryCredentialSetCredentialSetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryCredentialSetCredentialSetsApiVersion); + _containerRegistryCredentialSetCredentialSetsRestClient = new CredentialSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryCredentialSetCredentialSetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryCredentialSetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryCredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a credential set from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a credential set from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a credential set for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryCredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryCredentialSetCredentialSetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCredentialSetOperationSource(Client), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a credential set for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Update + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryCredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _containerRegistryCredentialSetCredentialSetsClientDiagnostics.CreateScope("ContainerRegistryCredentialSetResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryCredentialSetCredentialSetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryCredentialSetOperationSource(Client), _containerRegistryCredentialSetCredentialSetsClientDiagnostics, Pipeline, _containerRegistryCredentialSetCredentialSetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs index 3261e8a8e542..84ed1cea177e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.Serialization.cs @@ -128,6 +128,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("zoneRedundancy"u8); writer.WriteStringValue(ZoneRedundancy.Value.ToString()); } + if (Optional.IsDefined(IsAnonymousPullEnabled)) + { + writer.WritePropertyName("anonymousPullEnabled"u8); + writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); + } + if (Optional.IsDefined(MetadataSearch)) + { + writer.WritePropertyName("metadataSearch"u8); + writer.WriteStringValue(MetadataSearch.Value.ToString()); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } writer.WriteEndObject(); } @@ -173,6 +188,9 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default; ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default; ContainerRegistryZoneRedundancy? zoneRedundancy = default; + bool? anonymousPullEnabled = default; + ContainerRegistryMetadataSearch? metadataSearch = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -375,6 +393,33 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme zoneRedundancy = new ContainerRegistryZoneRedundancy(property0.Value.GetString()); continue; } + if (property0.NameEquals("anonymousPullEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + anonymousPullEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("metadataSearch"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadataSearch = new ContainerRegistryMetadataSearch(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property0.Value.GetString()); + continue; + } } continue; } @@ -407,6 +452,9 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme publicNetworkAccess, networkRuleBypassOptions, zoneRedundancy, + anonymousPullEnabled, + metadataSearch, + autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); } @@ -805,6 +853,52 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsAnonymousPullEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" anonymousPullEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsAnonymousPullEnabled)) + { + builder.Append(" anonymousPullEnabled: "); + var boolValue = IsAnonymousPullEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MetadataSearch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadataSearch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MetadataSearch)) + { + builder.Append(" metadataSearch: "); + builder.AppendLine($"'{MetadataSearch.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoGeneratedDomainNameLabelScope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" autoGeneratedDomainNameLabelScope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + builder.Append(" autoGeneratedDomainNameLabelScope: "); + builder.AppendLine($"'{AutoGeneratedDomainNameLabelScope.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs index 59a4052182ab..c7cc91c16155 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs @@ -87,8 +87,11 @@ public ContainerRegistryData(AzureLocation location, ContainerRegistrySku sku) : /// Whether or not public network access is allowed for the container registry. /// Whether to allow trusted Azure services to access a network restricted registry. /// Whether or not zone redundancy is enabled for this container registry. + /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. + /// Determines the domain name label reuse scope. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled, ContainerRegistryMetadataSearch? metadataSearch, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; @@ -106,6 +109,9 @@ internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType PublicNetworkAccess = publicNetworkAccess; NetworkRuleBypassOptions = networkRuleBypassOptions; ZoneRedundancy = zoneRedundancy; + IsAnonymousPullEnabled = isAnonymousPullEnabled; + MetadataSearch = metadataSearch; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -162,5 +168,14 @@ internal ContainerRegistryData() /// Whether or not zone redundancy is enabled for this container registry. [WirePath("properties.zoneRedundancy")] public ContainerRegistryZoneRedundancy? ZoneRedundancy { get; set; } + /// Enables registry-wide pull from unauthenticated clients. + [WirePath("properties.anonymousPullEnabled")] + public bool? IsAnonymousPullEnabled { get; set; } + /// Determines whether registry artifacts are indexed for metadata search. + [WirePath("properties.metadataSearch")] + public ContainerRegistryMetadataSearch? MetadataSearch { get; set; } + /// Determines the domain name label reuse scope. + [WirePath("properties.autoGeneratedDomainNameLabelScope")] + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs new file mode 100644 index 000000000000..0d87bdbca337 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryExportPipelines method from an instance of . + /// + public partial class ContainerRegistryExportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryExportPipelineExportPipelinesClientDiagnostics; + private readonly ExportPipelinesRestOperations _containerRegistryExportPipelineExportPipelinesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryExportPipelineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryExportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryExportPipelineExportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryExportPipelineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryExportPipelineResource.ResourceType, out string containerRegistryExportPipelineExportPipelinesApiVersion); + _containerRegistryExportPipelineExportPipelinesRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryExportPipelineExportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all export pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines + /// + /// + /// Operation Id + /// ExportPipelines_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryExportPipelineResource(Client, ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(e)), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all export pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines + /// + /// + /// Operation Id + /// ExportPipelines_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryExportPipelineExportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryExportPipelineResource(Client, ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(e)), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs new file mode 100644 index 000000000000..a6636bc215c8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.Serialization.cs @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryExportPipelineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsCollectionDefined(Options)) + { + writer.WritePropertyName("options"u8); + writer.WriteStartArray(); + foreach (var item in Options) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryExportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryExportPipelineData(document.RootElement, options); + } + + internal static ContainerRegistryExportPipelineData DeserializeContainerRegistryExportPipelineData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureLocation? location = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ExportPipelineTargetProperties target = default; + IList options0 = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("target"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("options"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ContainerRegistryPipelineOption(item.GetString())); + } + options0 = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryExportPipelineData( + id, + name, + type, + systemData, + location, + identity, + target, + options0 ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 4, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" options: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Options)) + { + if (Options.Any()) + { + builder.Append(" options: "); + builder.AppendLine("["); + foreach (var item in Options) + { + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryExportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryExportPipelineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryExportPipelineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs new file mode 100644 index 000000000000..4c094a6d3552 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineData.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryExportPipeline data model. + /// An object that represents an export pipeline for a container registry. + /// + public partial class ContainerRegistryExportPipelineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryExportPipelineData() + { + Options = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the export pipeline. + /// The identity of the export pipeline. + /// The target properties of the export pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryExportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ExportPipelineTargetProperties target, IList options, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Location = location; + Identity = identity; + Target = target; + Options = options; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The location of the export pipeline. + [WirePath("location")] + public AzureLocation? Location { get; set; } + /// The identity of the export pipeline. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The target properties of the export pipeline. + [WirePath("properties.target")] + public ExportPipelineTargetProperties Target { get; set; } + /// The list of all options configured for the pipeline. + [WirePath("properties.options")] + public IList Options { get; } + /// The provisioning state of the pipeline at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs new file mode 100644 index 000000000000..64c460364168 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryExportPipelineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryExportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryExportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs new file mode 100644 index 000000000000..165be75d85e8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a CosmosDBTableRoleAssignment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCosmosDBTableRoleAssignmentResource method. + /// Otherwise you can get one from its parent resource using the GetCosmosDBTableRoleAssignment method. + /// + public partial class CosmosDBTableRoleAssignmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleAssignmentId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics; + private readonly TableResourcesRestOperations _cosmosDBTableRoleAssignmentTableResourcesRestClient; + private readonly CosmosDBTableRoleAssignmentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/tableRoleAssignments"; + + /// Initializes a new instance of the class for mocking. + protected CosmosDBTableRoleAssignmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CosmosDBTableRoleAssignmentResource(ArmClient client, CosmosDBTableRoleAssignmentData data) : this(client, data.Id) +======== +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryExportPipeline along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryExportPipelineResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryExportPipeline method. + /// + public partial class ContainerRegistryExportPipelineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The exportPipelineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryExportPipelineExportPipelinesClientDiagnostics; + private readonly ExportPipelinesRestOperations _containerRegistryExportPipelineExportPipelinesRestClient; + private readonly ContainerRegistryExportPipelineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/exportPipelines"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryExportPipelineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryExportPipelineResource(ArmClient client, ContainerRegistryExportPipelineData data) : this(client, data.Id) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + { + HasData = true; + _data = data; + } + +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CosmosDBTableRoleAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cosmosDBTableRoleAssignmentTableResourcesApiVersion); + _cosmosDBTableRoleAssignmentTableResourcesRestClient = new TableResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBTableRoleAssignmentTableResourcesApiVersion); +======== + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryExportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryExportPipelineExportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryExportPipelineExportPipelinesApiVersion); + _containerRegistryExportPipelineExportPipelinesRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryExportPipelineExportPipelinesApiVersion); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + public virtual CosmosDBTableRoleAssignmentData Data +======== + public virtual ContainerRegistryExportPipelineData Data +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_GetTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// The cancellation token to use. +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); +======== + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_GetTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// The cancellation token to use. +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); +======== + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryExportPipelineResource(Client, response.Value), response.GetRawResponse()); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_DeleteTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Deletes an export pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.DeleteTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateDeleteTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); +======== + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_DeleteTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Deletes an export pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.DeleteTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateDeleteTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); +======== + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_CreateUpdateTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); +======== + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryExportPipelineExportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// TableResources_CreateUpdateTableRoleAssignment + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// +======== + /// Creates an export pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. +<<<<<<<< HEAD:sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); +======== + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryExportPipelineExportPipelinesClientDiagnostics.CreateScope("ContainerRegistryExportPipelineResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryExportPipelineExportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryExportPipelineOperationSource(Client), _containerRegistryExportPipelineExportPipelinesClientDiagnostics, Pipeline, _containerRegistryExportPipelineExportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryExportPipelineResource.cs + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs new file mode 100644 index 000000000000..139f78b4fb37 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryImportPipelines method from an instance of . + /// + public partial class ContainerRegistryImportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryImportPipelineImportPipelinesClientDiagnostics; + private readonly ImportPipelinesRestOperations _containerRegistryImportPipelineImportPipelinesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryImportPipelineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryImportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryImportPipelineImportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryImportPipelineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryImportPipelineResource.ResourceType, out string containerRegistryImportPipelineImportPipelinesApiVersion); + _containerRegistryImportPipelineImportPipelinesRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryImportPipelineImportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all import pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines + /// + /// + /// Operation Id + /// ImportPipelines_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryImportPipelineResource(Client, ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(e)), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all import pipelines for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines + /// + /// + /// Operation Id + /// ImportPipelines_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryImportPipelineImportPipelinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryImportPipelineResource(Client, ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(e)), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, "ContainerRegistryImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs new file mode 100644 index 000000000000..357bc12bef1d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.Serialization.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryImportPipelineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Trigger)) + { + writer.WritePropertyName("trigger"u8); + writer.WriteObjectValue(Trigger, options); + } + if (Optional.IsCollectionDefined(Options)) + { + writer.WritePropertyName("options"u8); + writer.WriteStartArray(); + foreach (var item in Options) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ContainerRegistryImportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImportPipelineData(document.RootElement, options); + } + + internal static ContainerRegistryImportPipelineData DeserializeContainerRegistryImportPipelineData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureLocation? location = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ImportPipelineSourceProperties source = default; + PipelineTriggerProperties trigger = default; + IList options0 = default; + ContainerRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("source"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("trigger"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trigger = PipelineTriggerProperties.DeserializePipelineTriggerProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("options"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ContainerRegistryPipelineOption(item.GetString())); + } + options0 = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryImportPipelineData( + id, + name, + type, + systemData, + location, + identity, + source, + trigger, + options0 ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" trigger: "); + builder.AppendLine("{"); + builder.AppendLine(" trigger: {"); + builder.AppendLine(" sourceTrigger: {"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Trigger)) + { + builder.Append(" trigger: "); + BicepSerializationHelpers.AppendChildObject(builder, Trigger, options, 4, false, " trigger: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" options: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Options)) + { + if (Options.Any()) + { + builder.Append(" options: "); + builder.AppendLine("["); + foreach (var item in Options) + { + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryImportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryImportPipelineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryImportPipelineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs new file mode 100644 index 000000000000..db2239a31c7a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineData.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryImportPipeline data model. + /// An object that represents an import pipeline for a container registry. + /// + public partial class ContainerRegistryImportPipelineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryImportPipelineData() + { + Options = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The location of the import pipeline. + /// The identity of the import pipeline. + /// The source properties of the import pipeline. + /// The properties that describe the trigger of the import pipeline. + /// The list of all options configured for the pipeline. + /// The provisioning state of the pipeline at the time the operation was called. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryImportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ImportPipelineSourceProperties source, PipelineTriggerProperties trigger, IList options, ContainerRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Location = location; + Identity = identity; + Source = source; + Trigger = trigger; + Options = options; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The location of the import pipeline. + [WirePath("location")] + public AzureLocation? Location { get; set; } + /// The identity of the import pipeline. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The source properties of the import pipeline. + [WirePath("properties.source")] + public ImportPipelineSourceProperties Source { get; set; } + /// The properties that describe the trigger of the import pipeline. + internal PipelineTriggerProperties Trigger { get; set; } + /// The current status of the source trigger. + [WirePath("properties.trigger.sourceTrigger.status")] + public ContainerRegistryTriggerStatus? SourceTriggerStatus + { + get => Trigger is null ? default : Trigger.SourceTriggerStatus; + set + { + if (value.HasValue) + { + if (Trigger is null) + Trigger = new PipelineTriggerProperties(); + Trigger.SourceTriggerStatus = value.Value; + } + else + { + Trigger = null; + } + } + } + + /// The list of all options configured for the pipeline. + [WirePath("properties.options")] + public IList Options { get; } + /// The provisioning state of the pipeline at the time the operation was called. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs new file mode 100644 index 000000000000..b3585138d256 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryImportPipelineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryImportPipelineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryImportPipelineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs new file mode 100644 index 000000000000..d8753749ddfa --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryImportPipelineResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryImportPipeline along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryImportPipelineResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryImportPipeline method. + /// + public partial class ContainerRegistryImportPipelineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The importPipelineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryImportPipelineImportPipelinesClientDiagnostics; + private readonly ImportPipelinesRestOperations _containerRegistryImportPipelineImportPipelinesRestClient; + private readonly ContainerRegistryImportPipelineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/importPipelines"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryImportPipelineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryImportPipelineResource(ArmClient client, ContainerRegistryImportPipelineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryImportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryImportPipelineImportPipelinesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryImportPipelineImportPipelinesApiVersion); + _containerRegistryImportPipelineImportPipelinesRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryImportPipelineImportPipelinesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryImportPipelineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryImportPipelineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an import pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an import pipeline from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryImportPipelineImportPipelinesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an import pipeline for a container registry with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryImportPipelineImportPipelinesClientDiagnostics.CreateScope("ContainerRegistryImportPipelineResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryImportPipelineImportPipelinesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryImportPipelineOperationSource(Client), _containerRegistryImportPipelineImportPipelinesClientDiagnostics, Pipeline, _containerRegistryImportPipelineImportPipelinesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs new file mode 100644 index 000000000000..fc7125105c20 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistryPipelineRuns method from an instance of . + /// + public partial class ContainerRegistryPipelineRunCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; + private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryPipelineRunCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerRegistryPipelineRunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryPipelineRunResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerRegistryPipelineRunResource.ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); + _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the pipeline runs for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns + /// + /// + /// Operation Id + /// PipelineRuns_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the pipeline runs for the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns + /// + /// + /// Operation Id + /// PipelineRuns_List + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs new file mode 100644 index 000000000000..4a6007187d08 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.Serialization.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryPipelineRunData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Request)) + { + writer.WritePropertyName("request"u8); + writer.WriteObjectValue(Request, options); + } + if (options.Format != "W" && Optional.IsDefined(Response)) + { + writer.WritePropertyName("response"u8); + writer.WriteObjectValue(Response, options); + } + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + writer.WriteEndObject(); + } + + ContainerRegistryPipelineRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunData(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunData DeserializeContainerRegistryPipelineRunData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerRegistryProvisioningState? provisioningState = default; + ConnectedRegistryPipelineRunContent request = default; + PipelineRunResult response = default; + string forceUpdateTag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("request"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + request = ConnectedRegistryPipelineRunContent.DeserializeConnectedRegistryPipelineRunContent(property0.Value, options); + continue; + } + if (property0.NameEquals("response"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + response = PipelineRunResult.DeserializePipelineRunResult(property0.Value, options); + continue; + } + if (property0.NameEquals("forceUpdateTag"u8)) + { + forceUpdateTag = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunData( + id, + name, + type, + systemData, + provisioningState, + request, + response, + forceUpdateTag, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Request), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" request: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Request)) + { + builder.Append(" request: "); + BicepSerializationHelpers.AppendChildObject(builder, Request, options, 4, false, " request: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Response), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" response: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Response)) + { + builder.Append(" response: "); + BicepSerializationHelpers.AppendChildObject(builder, Response, options, 4, false, " response: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ForceUpdateTag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" forceUpdateTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ForceUpdateTag)) + { + builder.Append(" forceUpdateTag: "); + if (ForceUpdateTag.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ForceUpdateTag}'''"); + } + else + { + builder.AppendLine($"'{ForceUpdateTag}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryPipelineRunData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs new file mode 100644 index 000000000000..54c3f395a8d9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A class representing the ContainerRegistryPipelineRun data model. + /// An object that represents a pipeline run for a container registry. + /// + public partial class ContainerRegistryPipelineRunData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of a pipeline run. + /// The request parameters for a pipeline run. + /// The response of a pipeline run. + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryPipelineRunContent request, PipelineRunResult response, string forceUpdateTag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + Request = request; + Response = response; + ForceUpdateTag = forceUpdateTag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of a pipeline run. + [WirePath("properties.provisioningState")] + public ContainerRegistryProvisioningState? ProvisioningState { get; } + /// The request parameters for a pipeline run. + [WirePath("properties.request")] + public ConnectedRegistryPipelineRunContent Request { get; set; } + /// The response of a pipeline run. + [WirePath("properties.response")] + public PipelineRunResult Response { get; } + /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + [WirePath("properties.forceUpdateTag")] + public string ForceUpdateTag { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs new file mode 100644 index 000000000000..f7a7140d7ce4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class ContainerRegistryPipelineRunResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerRegistryPipelineRunData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ContainerRegistryPipelineRunData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs new file mode 100644 index 000000000000..e58b2899b0fe --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a ContainerRegistryPipelineRun along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerRegistryPipelineRunResource method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistryPipelineRun method. + /// + public partial class ContainerRegistryPipelineRunResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The registryName. + /// The pipelineRunName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; + private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; + private readonly ContainerRegistryPipelineRunData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/pipelineRuns"; + + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryPipelineRunResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerRegistryPipelineRunResource(ArmClient client, ContainerRegistryPipelineRunData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerRegistryPipelineRunResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); + _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerRegistryPipelineRunData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a pipeline run from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a pipeline run from a container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Delete + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); + scope.Start(); + try + { + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a pipeline run for a container registry with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Create + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); + scope.Start(); + try + { + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs index 29600ed0bd8c..d530f1bd5484 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetA /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs index fa58038d9c5f..c3440a48e471 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs index 79d01ebfbb8d..16c89d943727 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs index e7811f4d9b6f..633f5f0f8e03 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupNa /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs index 9436aa2804f2..14dd9c92a7ef 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string replica /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string replicationName, Ca /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string replicationName, CancellationToken c /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs index 6010bd16b3e9..c18d56577c20 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs index 98228b43aee5..1db8931cbd3b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs @@ -99,6 +99,356 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of ContainerRegistryArchiveResources in the ContainerRegistry. + /// The type of the package resource. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of ContainerRegistryArchiveResources and their operations over a ContainerRegistryArchiveResource. + public virtual ContainerRegistryArchiveCollection GetContainerRegistryArchives(string packageType) + { + return new ContainerRegistryArchiveCollection(Client, Id, packageType); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryArchiveAsync(string packageType, string archiveName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryArchives(packageType).GetAsync(archiveName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the archive. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName} + /// + /// + /// Operation Id + /// Archives_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryArchive(string packageType, string archiveName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryArchives(packageType).Get(archiveName, cancellationToken); + } + + /// Gets a collection of ContainerRegistryCacheRuleResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryCacheRuleResources and their operations over a ContainerRegistryCacheRuleResource. + public virtual ContainerRegistryCacheRuleCollection GetContainerRegistryCacheRules() + { + return GetCachedClient(client => new ContainerRegistryCacheRuleCollection(client, Id)); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryCacheRuleAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryCacheRules().GetAsync(cacheRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// + /// + /// Operation Id + /// CacheRules_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryCacheRule(string cacheRuleName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryCacheRules().Get(cacheRuleName, cancellationToken); + } + + /// Gets a collection of ConnectedRegistryResources in the ContainerRegistry. + /// An object representing collection of ConnectedRegistryResources and their operations over a ConnectedRegistryResource. + public virtual ConnectedRegistryCollection GetConnectedRegistries() + { + return GetCachedClient(client => new ConnectedRegistryCollection(client, Id)); + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConnectedRegistryAsync(string connectedRegistryName, CancellationToken cancellationToken = default) + { + return await GetConnectedRegistries().GetAsync(connectedRegistryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the connected registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} + /// + /// + /// Operation Id + /// ConnectedRegistries_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the connected registry. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConnectedRegistry(string connectedRegistryName, CancellationToken cancellationToken = default) + { + return GetConnectedRegistries().Get(connectedRegistryName, cancellationToken); + } + + /// Gets a collection of ContainerRegistryCredentialSetResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryCredentialSetResources and their operations over a ContainerRegistryCredentialSetResource. + public virtual ContainerRegistryCredentialSetCollection GetContainerRegistryCredentialSets() + { + return GetCachedClient(client => new ContainerRegistryCredentialSetCollection(client, Id)); + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryCredentialSetAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryCredentialSets().GetAsync(credentialSetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified credential set resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// + /// + /// Operation Id + /// CredentialSets_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryCredentialSet(string credentialSetName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryCredentialSets().Get(credentialSetName, cancellationToken); + } + + /// Gets a collection of ContainerRegistryExportPipelineResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryExportPipelineResources and their operations over a ContainerRegistryExportPipelineResource. + public virtual ContainerRegistryExportPipelineCollection GetContainerRegistryExportPipelines() + { + return GetCachedClient(client => new ContainerRegistryExportPipelineCollection(client, Id)); + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryExportPipelineAsync(string exportPipelineName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryExportPipelines().GetAsync(exportPipelineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the export pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} + /// + /// + /// Operation Id + /// ExportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the export pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryExportPipeline(string exportPipelineName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryExportPipelines().Get(exportPipelineName, cancellationToken); + } + /// Gets a collection of ContainerRegistryPrivateLinkResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateLinkResources and their operations over a ContainerRegistryPrivateLinkResource. public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegistryPrivateLinkResources() @@ -119,7 +469,7 @@ public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegist /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -150,7 +500,7 @@ public virtual async Task> GetCon /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -168,6 +518,144 @@ public virtual Response GetContainerRegist return GetContainerRegistryPrivateLinkResources().Get(groupName, cancellationToken); } + /// Gets a collection of ContainerRegistryImportPipelineResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryImportPipelineResources and their operations over a ContainerRegistryImportPipelineResource. + public virtual ContainerRegistryImportPipelineCollection GetContainerRegistryImportPipelines() + { + return GetCachedClient(client => new ContainerRegistryImportPipelineCollection(client, Id)); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryImportPipelineAsync(string importPipelineName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryImportPipelines().GetAsync(importPipelineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the import pipeline. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} + /// + /// + /// Operation Id + /// ImportPipelines_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the import pipeline. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryImportPipeline(string importPipelineName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryImportPipelines().Get(importPipelineName, cancellationToken); + } + + /// Gets a collection of ContainerRegistryPipelineRunResources in the ContainerRegistry. + /// An object representing collection of ContainerRegistryPipelineRunResources and their operations over a ContainerRegistryPipelineRunResource. + public virtual ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() + { + return GetCachedClient(client => new ContainerRegistryPipelineRunCollection(client, Id)); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistryPipelineRuns().GetAsync(pipelineRunName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the detailed information for a given pipeline run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} + /// + /// + /// Operation Id + /// PipelineRuns_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the pipeline run. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistryPipelineRun(string pipelineRunName, CancellationToken cancellationToken = default) + { + return GetContainerRegistryPipelineRuns().Get(pipelineRunName, cancellationToken); + } + /// Gets a collection of ContainerRegistryPrivateEndpointConnectionResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateEndpointConnectionResources and their operations over a ContainerRegistryPrivateEndpointConnectionResource. public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() @@ -188,7 +676,7 @@ public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainer /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -219,7 +707,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -257,7 +745,7 @@ public virtual ContainerRegistryReplicationCollection GetContainerRegistryReplic /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -288,7 +776,7 @@ public virtual async Task> GetCon /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -326,7 +814,7 @@ public virtual ScopeMapCollection GetScopeMaps() /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -357,7 +845,7 @@ public virtual async Task> GetScopeMapAsync(string sc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -395,7 +883,7 @@ public virtual ContainerRegistryTokenCollection GetContainerRegistryTokens() /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -426,7 +914,7 @@ public virtual async Task> GetContainer /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -464,7 +952,7 @@ public virtual ContainerRegistryWebhookCollection GetContainerRegistryWebhooks() /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -495,7 +983,7 @@ public virtual async Task> GetContain /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -802,7 +1290,7 @@ public virtual Response GetContainerRegistryTask( /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -842,7 +1330,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -882,7 +1370,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -924,7 +1412,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -966,7 +1454,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1012,7 +1500,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1058,7 +1546,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1104,7 +1592,7 @@ public virtual async Task ImportImageAsync(WaitUntil waitUntil, Co /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1150,7 +1638,7 @@ public virtual ArmOperation ImportImage(WaitUntil waitUntil, ContainerRegistryIm /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1179,7 +1667,7 @@ public virtual AsyncPageable GetUsagesAsync(Cancellation /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1208,7 +1696,7 @@ public virtual Pageable GetUsages(CancellationToken canc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1246,7 +1734,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1284,7 +1772,7 @@ public virtual Response GetCredentials(C /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1326,7 +1814,7 @@ public virtual async Task> Rege /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1368,7 +1856,7 @@ public virtual Response RegenerateCreden /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1414,7 +1902,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1612,7 +2100,7 @@ public virtual Response GetBuildSourceUploadUrl(Cancella /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1674,7 +2162,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1736,7 +2224,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1793,7 +2281,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1850,7 +2338,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -1910,7 +2398,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs index 9764ab58b23e..71b66633fd4a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string tokenName, Ca /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string tokenName, Cancella /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string tokenName, CancellationToken cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs index 60de333f0bab..df4a03f80242 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs index db7998b7e92f..bd3857407d25 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string webhookName /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string webhookName, Cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string webhookName, CancellationToken cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs index db7863c385c9..2cb22d0f334b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual async Task> PingAsync /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -436,7 +436,7 @@ public virtual Response Ping(CancellationToke /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual AsyncPageable GetEventsAsync(Cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -496,7 +496,7 @@ public virtual Pageable GetEvents(CancellationTok /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -534,7 +534,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -572,7 +572,7 @@ public virtual Response GetCallbackConfi /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -634,7 +634,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -753,7 +753,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -810,7 +810,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -870,7 +870,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs index a9cd5e808772..22047a4ccd9a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs @@ -33,6 +33,120 @@ private static MockableContainerRegistrySubscriptionResource GetMockableContaine return resource.GetCachedClient(client => new MockableContainerRegistrySubscriptionResource(client, resource.Id)); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryArchiveResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryArchiveVersionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryCacheRuleResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ConnectedRegistryResource GetConnectedRegistryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetConnectedRegistryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryCredentialSetResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryExportPipelineResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -71,6 +185,44 @@ public static ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLi return GetMockableContainerRegistryArmClient(client).GetContainerRegistryPrivateLinkResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryImportPipelineResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerRegistryArmClient(client).GetContainerRegistryPipelineRunResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -272,7 +424,7 @@ public static ContainerRegistryCollection GetContainerRegistries(this ResourceGr /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -310,7 +462,7 @@ public static async Task> GetContainerRegist /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -348,7 +500,7 @@ public static Response GetContainerRegistry(this Reso /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -384,7 +536,7 @@ public static async Task> CheckCo /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -420,7 +572,7 @@ public static Response CheckContainerRegis /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -456,7 +608,7 @@ public static AsyncPageable GetContainerRegistriesAsy /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs index 431410013618..fdad1f69cc73 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryArmClient.cs @@ -34,6 +34,78 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryArchiveResource GetContainerRegistryArchiveResource(ResourceIdentifier id) + { + ContainerRegistryArchiveResource.ValidateResourceId(id); + return new ContainerRegistryArchiveResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryArchiveVersionResource GetContainerRegistryArchiveVersionResource(ResourceIdentifier id) + { + ContainerRegistryArchiveVersionResource.ValidateResourceId(id); + return new ContainerRegistryArchiveVersionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryCacheRuleResource GetContainerRegistryCacheRuleResource(ResourceIdentifier id) + { + ContainerRegistryCacheRuleResource.ValidateResourceId(id); + return new ContainerRegistryCacheRuleResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ConnectedRegistryResource GetConnectedRegistryResource(ResourceIdentifier id) + { + ConnectedRegistryResource.ValidateResourceId(id); + return new ConnectedRegistryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryCredentialSetResource GetContainerRegistryCredentialSetResource(ResourceIdentifier id) + { + ContainerRegistryCredentialSetResource.ValidateResourceId(id); + return new ContainerRegistryCredentialSetResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryExportPipelineResource GetContainerRegistryExportPipelineResource(ResourceIdentifier id) + { + ContainerRegistryExportPipelineResource.ValidateResourceId(id); + return new ContainerRegistryExportPipelineResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,6 +130,30 @@ public virtual ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateL return new ContainerRegistryPrivateLinkResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryImportPipelineResource GetContainerRegistryImportPipelineResource(ResourceIdentifier id) + { + ContainerRegistryImportPipelineResource.ValidateResourceId(id); + return new ContainerRegistryImportPipelineResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(ResourceIdentifier id) + { + ContainerRegistryPipelineRunResource.ValidateResourceId(id); + return new ContainerRegistryPipelineRunResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs index 1ac2873d2226..4a754e9a78f0 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistryResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ContainerRegistryCollection GetContainerRegistries() /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetContainerRegis /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs index 6f131de22507..f81edfb393fd 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/MockableContainerRegistrySubscriptionResource.cs @@ -55,7 +55,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -97,7 +97,7 @@ public virtual async Task> CheckC /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -139,7 +139,7 @@ public virtual Response CheckContainerRegi /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -169,7 +169,7 @@ public virtual AsyncPageable GetContainerRegistriesAs /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs new file mode 100644 index 000000000000..b91d2973e1bb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ConnectedRegistryOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedRegistryOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedRegistryResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return new ConnectedRegistryResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return new ConnectedRegistryResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs new file mode 100644 index 000000000000..df3e6f9ac518 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryArchiveOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryArchiveOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryArchiveResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return new ContainerRegistryArchiveResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return new ContainerRegistryArchiveResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs new file mode 100644 index 000000000000..eb7b9fc3701e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryArchiveVersionOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryArchiveVersionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryArchiveVersionOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryArchiveVersionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return new ContainerRegistryArchiveVersionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return new ContainerRegistryArchiveVersionResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCacheRuleOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCacheRuleOperationSource.cs new file mode 100644 index 000000000000..b80a694a4e8b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCacheRuleOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryCacheRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryCacheRuleOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryCacheRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(document.RootElement); + return new ContainerRegistryCacheRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(document.RootElement); + return new ContainerRegistryCacheRuleResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCredentialSetOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCredentialSetOperationSource.cs new file mode 100644 index 000000000000..53cbba2b1574 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryCredentialSetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryCredentialSetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryCredentialSetOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryCredentialSetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(document.RootElement); + return new ContainerRegistryCredentialSetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(document.RootElement); + return new ContainerRegistryCredentialSetResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs new file mode 100644 index 000000000000..d38f287b9025 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryExportPipelineOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryExportPipelineOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryExportPipelineOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryExportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return new ContainerRegistryExportPipelineResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return new ContainerRegistryExportPipelineResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs new file mode 100644 index 000000000000..ce7ec139dff9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryImportPipelineOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryImportPipelineOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryImportPipelineOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryImportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return new ContainerRegistryImportPipelineResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return new ContainerRegistryImportPipelineResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs new file mode 100644 index 000000000000..7dbad7fa9d56 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class ContainerRegistryPipelineRunOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerRegistryPipelineRunOperationSource(ArmClient client) + { + _client = client; + } + + ContainerRegistryPipelineRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return new ContainerRegistryPipelineRunResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return new ContainerRegistryPipelineRunResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AadAuthenticationAsArmPolicyStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AadAuthenticationAsArmPolicyStatus.cs new file mode 100644 index 000000000000..7ecc2c4b1380 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AadAuthenticationAsArmPolicyStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The value that indicates whether the policy is enabled or not. + public readonly partial struct AadAuthenticationAsArmPolicyStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AadAuthenticationAsArmPolicyStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "enabled"; + private const string DisabledValue = "disabled"; + + /// enabled. + public static AadAuthenticationAsArmPolicyStatus Enabled { get; } = new AadAuthenticationAsArmPolicyStatus(EnabledValue); + /// disabled. + public static AadAuthenticationAsArmPolicyStatus Disabled { get; } = new AadAuthenticationAsArmPolicyStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(AadAuthenticationAsArmPolicyStatus left, AadAuthenticationAsArmPolicyStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AadAuthenticationAsArmPolicyStatus left, AadAuthenticationAsArmPolicyStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AadAuthenticationAsArmPolicyStatus(string value) => new AadAuthenticationAsArmPolicyStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AadAuthenticationAsArmPolicyStatus other && Equals(other); + /// + public bool Equals(AadAuthenticationAsArmPolicyStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs new file mode 100644 index 000000000000..5ee64355ee7c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class RaiBlockListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ArchiveListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlockListResult)} does not support writing '{format}' format."); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support writing '{format}' format."); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + } + + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs +======== + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + RaiBlockListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlockListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlockListResult(document.RootElement, options); + } + + internal static RaiBlockListResult DeserializeRaiBlockListResult(JsonElement element, ModelReaderWriterOptions options = null) +======== + ArchiveListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchiveListResult(document.RootElement, options); + } + + internal static ArchiveListResult DeserializeArchiveListResult(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs +======== + IReadOnlyList value = default; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistData.DeserializeRaiBlocklistData(item, options)); +======== + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(item, options)); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + return new RaiBlockListResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); +======== + return new ArchiveListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + throw new FormatException($"The model {nameof(RaiBlockListResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlockListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support writing '{options.Format}' format."); + } + } + + ArchiveListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlockListResult.Serialization.cs + return DeserializeRaiBlockListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlockListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeArchiveListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchiveListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.Serialization.cs + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs new file mode 100644 index 000000000000..d55ed7fa5618 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list archives for a container registry. + internal partial class ArchiveListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ArchiveListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next list of distributions. + /// The URI that can be used to request the next list of archives. + /// Keeps track of any properties unknown to the library. + internal ArchiveListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next list of distributions. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of archives. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs new file mode 100644 index 000000000000..07e42aecd28e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs +namespace Azure.ResourceManager.CognitiveServices.Models +{ + public partial class RaiBlocklistConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ArchivePackageSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BlocklistName)) + { + writer.WritePropertyName("blocklistName"u8); + writer.WriteStringValue(BlocklistName); + } + if (Optional.IsDefined(Blocking)) + { + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + RaiBlocklistConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistConfig(document.RootElement, options); + } + + internal static RaiBlocklistConfig DeserializeRaiBlocklistConfig(JsonElement element, ModelReaderWriterOptions options = null) +======== + ArchivePackageSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchivePackageSourceProperties(document.RootElement, options); + } + + internal static ArchivePackageSourceProperties DeserializeArchivePackageSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + string blocklistName = default; + bool? blocking = default; +======== + ArchivePackageSourceType? type = default; + Uri url = default; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + if (property.NameEquals("blocklistName"u8)) + { + blocklistName = property.Value.GetString(); + continue; + } + if (property.NameEquals("blocking"u8)) +======== + if (property.NameEquals("type"u8)) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + blocking = property.Value.GetBoolean(); +======== + type = new ArchivePackageSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + return new RaiBlocklistConfig(blocklistName, blocking, serializedAdditionalRawData); +======== + return new ArchivePackageSourceProperties(type, url, serializedAdditionalRawData); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BlocklistName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" blocklistName: "); +======== + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + builder.AppendLine(propertyOverride); + } + else + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + if (Optional.IsDefined(BlocklistName)) + { + builder.Append(" blocklistName: "); + if (BlocklistName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{BlocklistName}'''"); + } + else + { + builder.AppendLine($"'{BlocklistName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Blocking), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" blocking: "); +======== + if (Optional.IsDefined(SourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{SourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" url: "); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + builder.AppendLine(propertyOverride); + } + else + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + if (Optional.IsDefined(Blocking)) + { + builder.Append(" blocking: "); + var boolValue = Blocking.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); +======== + if (Optional.IsDefined(Uri)) + { + builder.Append(" url: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ArchivePackageSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiBlocklistConfig.Serialization.cs + return DeserializeRaiBlocklistConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeArchivePackageSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchivePackageSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.Serialization.cs + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs new file mode 100644 index 000000000000..6231b9e44a8f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the archive package source. + public partial class ArchivePackageSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ArchivePackageSourceProperties() + { + } + + /// Initializes a new instance of . + /// The type of package source for a archive. + /// The external repository url. + /// Keeps track of any properties unknown to the library. + internal ArchivePackageSourceProperties(ArchivePackageSourceType? sourceType, Uri uri, IDictionary serializedAdditionalRawData) + { + SourceType = sourceType; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of package source for a archive. + [WirePath("type")] + public ArchivePackageSourceType? SourceType { get; set; } + /// The external repository url. + [WirePath("url")] + public Uri Uri { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs new file mode 100644 index 000000000000..84c2208d063a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchivePackageSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of package source for a archive. + public readonly partial struct ArchivePackageSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArchivePackageSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RemoteValue = "remote"; + + /// remote. + public static ArchivePackageSourceType Remote { get; } = new ArchivePackageSourceType(RemoteValue); + /// Determines if two values are the same. + public static bool operator ==(ArchivePackageSourceType left, ArchivePackageSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArchivePackageSourceType left, ArchivePackageSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ArchivePackageSourceType(string value) => new ArchivePackageSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArchivePackageSourceType other && Equals(other); + /// + public bool Equals(ArchivePackageSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs new file mode 100644 index 000000000000..bf8b7f3cc481 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ArchiveVersionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ArchiveVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArchiveVersionListResult(document.RootElement, options); + } + + internal static ArchiveVersionListResult DeserializeArchiveVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArchiveVersionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + ArchiveVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeArchiveVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArchiveVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs new file mode 100644 index 000000000000..6c6387c5265e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ArchiveVersionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list export pipelines for a container registry. + internal partial class ArchiveVersionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ArchiveVersionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ArchiveVersionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs new file mode 100644 index 000000000000..4f6f0c364d12 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". + public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoGeneratedDomainNameLabelScope(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnsecureValue = "Unsecure"; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "NoReuse"; + + /// Unsecure. + public static AutoGeneratedDomainNameLabelScope Unsecure { get; } = new AutoGeneratedDomainNameLabelScope(UnsecureValue); + /// TenantReuse. + public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); + /// SubscriptionReuse. + public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); + /// ResourceGroupReuse. + public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); + /// NoReuse. + public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); + /// Determines if two values are the same. + public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); + /// + public bool Equals(AutoGeneratedDomainNameLabelScope other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs new file mode 100644 index 000000000000..0f235050598f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class AzureADAuthenticationAsArmPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureADAuthenticationAsArmPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureADAuthenticationAsArmPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureADAuthenticationAsArmPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureADAuthenticationAsArmPolicy(document.RootElement, options); + } + + internal static AzureADAuthenticationAsArmPolicy DeserializeAzureADAuthenticationAsArmPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AadAuthenticationAsArmPolicyStatus? status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AadAuthenticationAsArmPolicyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureADAuthenticationAsArmPolicy(status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AzureADAuthenticationAsArmPolicy)} does not support writing '{options.Format}' format."); + } + } + + AzureADAuthenticationAsArmPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureADAuthenticationAsArmPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureADAuthenticationAsArmPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs new file mode 100644 index 000000000000..98a1ff236195 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The policy for using ARM audience token for a container registry. + internal partial class AzureADAuthenticationAsArmPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AzureADAuthenticationAsArmPolicy() + { + } + + /// Initializes a new instance of . + /// The value that indicates whether the policy is enabled or not. + /// Keeps track of any properties unknown to the library. + internal AzureADAuthenticationAsArmPolicy(AadAuthenticationAsArmPolicyStatus? status, IDictionary serializedAdditionalRawData) + { + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The value that indicates whether the policy is enabled or not. + [WirePath("status")] + public AadAuthenticationAsArmPolicyStatus? Status { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs new file mode 100644 index 000000000000..fb4d882bdf4c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class CacheRulesListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CacheRulesListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CacheRulesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CacheRulesListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCacheRulesListResult(document.RootElement, options); + } + + internal static CacheRulesListResult DeserializeCacheRulesListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CacheRulesListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CacheRulesListResult)} does not support writing '{options.Format}' format."); + } + } + + CacheRulesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCacheRulesListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CacheRulesListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs new file mode 100644 index 000000000000..36db9684ddda --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list cache rules for a container registry. + internal partial class CacheRulesListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CacheRulesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of cache rules. + /// If provided, client must use NextLink URI to request next list of cache rules. + /// Keeps track of any properties unknown to the library. + internal CacheRulesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of cache rules. + public IReadOnlyList Value { get; } + /// If provided, client must use NextLink URI to request next list of cache rules. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs new file mode 100644 index 000000000000..650ae03f4baf --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ConnectedRegistryActivation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryActivation)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryActivation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryActivation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryActivation(document.RootElement, options); + } + + internal static ConnectedRegistryActivation DeserializeConnectedRegistryActivation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectedRegistryActivationStatus? status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ConnectedRegistryActivationStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryActivation(status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryActivation)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryActivation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryActivation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryActivation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs new file mode 100644 index 000000000000..10a0dcc15443 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The activation properties of the connected registry. + internal partial class ConnectedRegistryActivation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ConnectedRegistryActivation() + { + } + + /// Initializes a new instance of . + /// The activation status of the connected registry. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryActivation(ConnectedRegistryActivationStatus? status, IDictionary serializedAdditionalRawData) + { + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The activation status of the connected registry. + [WirePath("status")] + public ConnectedRegistryActivationStatus? Status { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs new file mode 100644 index 000000000000..197c0c5e2f5a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The activation status of the connected registry. + public readonly partial struct ConnectedRegistryActivationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedRegistryActivationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string InactiveValue = "Inactive"; + + /// Active. + public static ConnectedRegistryActivationStatus Active { get; } = new ConnectedRegistryActivationStatus(ActiveValue); + /// Inactive. + public static ConnectedRegistryActivationStatus Inactive { get; } = new ConnectedRegistryActivationStatus(InactiveValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedRegistryActivationStatus left, ConnectedRegistryActivationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedRegistryActivationStatus left, ConnectedRegistryActivationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedRegistryActivationStatus(string value) => new ConnectedRegistryActivationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedRegistryActivationStatus other && Equals(other); + /// + public bool Equals(ConnectedRegistryActivationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs new file mode 100644 index 000000000000..3ea1be3f1ff6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Indicates whether audit logs are enabled on the connected registry. + public readonly partial struct ConnectedRegistryAuditLogStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedRegistryAuditLogStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ConnectedRegistryAuditLogStatus Enabled { get; } = new ConnectedRegistryAuditLogStatus(EnabledValue); + /// Disabled. + public static ConnectedRegistryAuditLogStatus Disabled { get; } = new ConnectedRegistryAuditLogStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedRegistryAuditLogStatus left, ConnectedRegistryAuditLogStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedRegistryAuditLogStatus left, ConnectedRegistryAuditLogStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedRegistryAuditLogStatus(string value) => new ConnectedRegistryAuditLogStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedRegistryAuditLogStatus other && Equals(other); + /// + public bool Equals(ConnectedRegistryAuditLogStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs new file mode 100644 index 000000000000..1a547822ab9c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The current connection state of the connected registry. + public readonly partial struct ConnectedRegistryConnectionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedRegistryConnectionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OnlineValue = "Online"; + private const string OfflineValue = "Offline"; + private const string SyncingValue = "Syncing"; + private const string UnhealthyValue = "Unhealthy"; + + /// Online. + public static ConnectedRegistryConnectionState Online { get; } = new ConnectedRegistryConnectionState(OnlineValue); + /// Offline. + public static ConnectedRegistryConnectionState Offline { get; } = new ConnectedRegistryConnectionState(OfflineValue); + /// Syncing. + public static ConnectedRegistryConnectionState Syncing { get; } = new ConnectedRegistryConnectionState(SyncingValue); + /// Unhealthy. + public static ConnectedRegistryConnectionState Unhealthy { get; } = new ConnectedRegistryConnectionState(UnhealthyValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedRegistryConnectionState left, ConnectedRegistryConnectionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedRegistryConnectionState left, ConnectedRegistryConnectionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedRegistryConnectionState(string value) => new ConnectedRegistryConnectionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedRegistryConnectionState other && Equals(other); + /// + public bool Equals(ConnectedRegistryConnectionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs new file mode 100644 index 000000000000..8d94664c7529 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ConnectedRegistryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryListResult(document.RootElement, options); + } + + internal static ConnectedRegistryListResult DeserializeConnectedRegistryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectedRegistryData.DeserializeConnectedRegistryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryListResult)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs new file mode 100644 index 000000000000..eab6b89ce40f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list connected registries for a container registry. + internal partial class ConnectedRegistryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ConnectedRegistryListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next list of connected registries. + /// The URI that can be used to request the next list of connected registries. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next list of connected registries. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of connected registries. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs new file mode 100644 index 000000000000..804f40ec29ad --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The verbosity of logs persisted on the connected registry. + public readonly partial struct ConnectedRegistryLogLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedRegistryLogLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DebugValue = "Debug"; + private const string InformationValue = "Information"; + private const string WarningValue = "Warning"; + private const string ErrorValue = "Error"; + private const string NoneValue = "None"; + + /// Debug. + public static ConnectedRegistryLogLevel Debug { get; } = new ConnectedRegistryLogLevel(DebugValue); + /// Information. + public static ConnectedRegistryLogLevel Information { get; } = new ConnectedRegistryLogLevel(InformationValue); + /// Warning. + public static ConnectedRegistryLogLevel Warning { get; } = new ConnectedRegistryLogLevel(WarningValue); + /// Error. + public static ConnectedRegistryLogLevel Error { get; } = new ConnectedRegistryLogLevel(ErrorValue); + /// None. + public static ConnectedRegistryLogLevel None { get; } = new ConnectedRegistryLogLevel(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedRegistryLogLevel left, ConnectedRegistryLogLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedRegistryLogLevel left, ConnectedRegistryLogLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedRegistryLogLevel(string value) => new ConnectedRegistryLogLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedRegistryLogLevel other && Equals(other); + /// + public bool Equals(ConnectedRegistryLogLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs new file mode 100644 index 000000000000..dfd9f25872de --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryLogging : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryLogging)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LogLevel)) + { + writer.WritePropertyName("logLevel"u8); + writer.WriteStringValue(LogLevel.Value.ToString()); + } + if (Optional.IsDefined(AuditLogStatus)) + { + writer.WritePropertyName("auditLogStatus"u8); + writer.WriteStringValue(AuditLogStatus.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryLogging IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryLogging)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryLogging(document.RootElement, options); + } + + internal static ConnectedRegistryLogging DeserializeConnectedRegistryLogging(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectedRegistryLogLevel? logLevel = default; + ConnectedRegistryAuditLogStatus? auditLogStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logLevel = new ConnectedRegistryLogLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("auditLogStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auditLogStatus = new ConnectedRegistryAuditLogStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryLogging(logLevel, auditLogStatus, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogLevel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logLevel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogLevel)) + { + builder.Append(" logLevel: "); + builder.AppendLine($"'{LogLevel.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuditLogStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" auditLogStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AuditLogStatus)) + { + builder.Append(" auditLogStatus: "); + builder.AppendLine($"'{AuditLogStatus.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryLogging)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryLogging IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryLogging(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryLogging)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs new file mode 100644 index 000000000000..63b0faec7200 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The logging properties of the connected registry. + public partial class ConnectedRegistryLogging + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryLogging() + { + } + + /// Initializes a new instance of . + /// The verbosity of logs persisted on the connected registry. + /// Indicates whether audit logs are enabled on the connected registry. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryLogging(ConnectedRegistryLogLevel? logLevel, ConnectedRegistryAuditLogStatus? auditLogStatus, IDictionary serializedAdditionalRawData) + { + LogLevel = logLevel; + AuditLogStatus = auditLogStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The verbosity of logs persisted on the connected registry. + [WirePath("logLevel")] + public ConnectedRegistryLogLevel? LogLevel { get; set; } + /// Indicates whether audit logs are enabled on the connected registry. + [WirePath("auditLogStatus")] + public ConnectedRegistryAuditLogStatus? AuditLogStatus { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs new file mode 100644 index 000000000000..5b0dbdd51356 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryLoginServer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryLoginServer)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (options.Format != "W" && Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryLoginServer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryLoginServer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryLoginServer(document.RootElement, options); + } + + internal static ConnectedRegistryLoginServer DeserializeConnectedRegistryLoginServer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string host = default; + ContainerRegistryTlsProperties tls = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = ContainerRegistryTlsProperties.DeserializeContainerRegistryTlsProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryLoginServer(host, tls, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" host: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Host)) + { + builder.Append(" host: "); + if (Host.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Host}'''"); + } + else + { + builder.AppendLine($"'{Host}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tls), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tls: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Tls)) + { + builder.Append(" tls: "); + BicepSerializationHelpers.AppendChildObject(builder, Tls, options, 2, false, " tls: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryLoginServer)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryLoginServer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryLoginServer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryLoginServer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs new file mode 100644 index 000000000000..4e7172783263 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The login server properties of the connected registry. + public partial class ConnectedRegistryLoginServer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryLoginServer() + { + } + + /// Initializes a new instance of . + /// The host of the connected registry. Can be FQDN or IP. + /// The TLS properties of the connected registry login server. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryLoginServer(string host, ContainerRegistryTlsProperties tls, IDictionary serializedAdditionalRawData) + { + Host = host; + Tls = tls; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The host of the connected registry. Can be FQDN or IP. + [WirePath("host")] + public string Host { get; } + /// The TLS properties of the connected registry login server. + [WirePath("tls")] + public ContainerRegistryTlsProperties Tls { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs new file mode 100644 index 000000000000..0f1b74bd145a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The mode of the connected registry resource that indicates the permissions of the registry. + public readonly partial struct ConnectedRegistryMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedRegistryMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadWriteValue = "ReadWrite"; + private const string ReadOnlyValue = "ReadOnly"; + private const string RegistryValue = "Registry"; + private const string MirrorValue = "Mirror"; + + /// ReadWrite. + public static ConnectedRegistryMode ReadWrite { get; } = new ConnectedRegistryMode(ReadWriteValue); + /// ReadOnly. + public static ConnectedRegistryMode ReadOnly { get; } = new ConnectedRegistryMode(ReadOnlyValue); + /// Registry. + public static ConnectedRegistryMode Registry { get; } = new ConnectedRegistryMode(RegistryValue); + /// Mirror. + public static ConnectedRegistryMode Mirror { get; } = new ConnectedRegistryMode(MirrorValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedRegistryMode left, ConnectedRegistryMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedRegistryMode left, ConnectedRegistryMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedRegistryMode(string value) => new ConnectedRegistryMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedRegistryMode other && Equals(other); + /// + public bool Equals(ConnectedRegistryMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs new file mode 100644 index 000000000000..f79acdd0cd8b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryParent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryParent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + writer.WritePropertyName("syncProperties"u8); + writer.WriteObjectValue(SyncProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryParent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryParent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryParent(document.RootElement, options); + } + + internal static ConnectedRegistryParent DeserializeConnectedRegistryParent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + ConnectedRegistrySyncProperties syncProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("syncProperties"u8)) + { + syncProperties = ConnectedRegistrySyncProperties.DeserializeConnectedRegistrySyncProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryParent(id, syncProperties, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SyncProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" syncProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SyncProperties)) + { + builder.Append(" syncProperties: "); + BicepSerializationHelpers.AppendChildObject(builder, SyncProperties, options, 2, false, " syncProperties: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryParent)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryParent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryParent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryParent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs new file mode 100644 index 000000000000..dc4e7d7e87fb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the connected registry parent. + public partial class ConnectedRegistryParent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The sync properties of the connected registry with its parent. + /// is null. + public ConnectedRegistryParent(ConnectedRegistrySyncProperties syncProperties) + { + Argument.AssertNotNull(syncProperties, nameof(syncProperties)); + + SyncProperties = syncProperties; + } + + /// Initializes a new instance of . + /// The resource ID of the parent to which the connected registry will be associated. + /// The sync properties of the connected registry with its parent. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryParent(ResourceIdentifier id, ConnectedRegistrySyncProperties syncProperties, IDictionary serializedAdditionalRawData) + { + Id = id; + SyncProperties = syncProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedRegistryParent() + { + } + + /// The resource ID of the parent to which the connected registry will be associated. + [WirePath("id")] + public ResourceIdentifier Id { get; set; } + /// The sync properties of the connected registry with its parent. + [WirePath("syncProperties")] + public ConnectedRegistrySyncProperties SyncProperties { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs new file mode 100644 index 000000000000..4e5fc738cd98 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SyncProperties)) + { + writer.WritePropertyName("syncProperties"u8); + writer.WriteObjectValue(SyncProperties, options); + } + if (Optional.IsDefined(Logging)) + { + writer.WritePropertyName("logging"u8); + writer.WriteObjectValue(Logging, options); + } + if (Optional.IsCollectionDefined(ClientTokenIds)) + { + writer.WritePropertyName("clientTokenIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientTokenIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NotificationsList)) + { + writer.WritePropertyName("notificationsList"u8); + writer.WriteStartArray(); + foreach (var item in NotificationsList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(GarbageCollection)) + { + writer.WritePropertyName("garbageCollection"u8); + writer.WriteObjectValue(GarbageCollection, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryPatch(document.RootElement, options); + } + + internal static ConnectedRegistryPatch DeserializeConnectedRegistryPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectedRegistrySyncUpdateProperties syncProperties = default; + ConnectedRegistryLogging logging = default; + IList clientTokenIds = default; + IList notificationsList = default; + GarbageCollectionProperties garbageCollection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("syncProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + syncProperties = ConnectedRegistrySyncUpdateProperties.DeserializeConnectedRegistrySyncUpdateProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("logging"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logging = ConnectedRegistryLogging.DeserializeConnectedRegistryLogging(property0.Value, options); + continue; + } + if (property0.NameEquals("clientTokenIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + clientTokenIds = array; + continue; + } + if (property0.NameEquals("notificationsList"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + notificationsList = array; + continue; + } + if (property0.NameEquals("garbageCollection"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + garbageCollection = GarbageCollectionProperties.DeserializeGarbageCollectionProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryPatch( + syncProperties, + logging, + clientTokenIds ?? new ChangeTrackingList(), + notificationsList ?? new ChangeTrackingList(), + garbageCollection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPatch)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs new file mode 100644 index 000000000000..d243f0fe0f42 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a connected registry. + public partial class ConnectedRegistryPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryPatch() + { + ClientTokenIds = new ChangeTrackingList(); + NotificationsList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The sync properties of the connected registry with its parent. + /// The logging properties of the connected registry. + /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. + /// The list of notifications subscription information for the connected registry. + /// The garbage collection properties of the connected registry. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryPatch(ConnectedRegistrySyncUpdateProperties syncProperties, ConnectedRegistryLogging logging, IList clientTokenIds, IList notificationsList, GarbageCollectionProperties garbageCollection, IDictionary serializedAdditionalRawData) + { + SyncProperties = syncProperties; + Logging = logging; + ClientTokenIds = clientTokenIds; + NotificationsList = notificationsList; + GarbageCollection = garbageCollection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sync properties of the connected registry with its parent. + [WirePath("properties.syncProperties")] + public ConnectedRegistrySyncUpdateProperties SyncProperties { get; set; } + /// The logging properties of the connected registry. + [WirePath("properties.logging")] + public ConnectedRegistryLogging Logging { get; set; } + /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. + [WirePath("properties.clientTokenIds")] + public IList ClientTokenIds { get; } + /// The list of notifications subscription information for the connected registry. + [WirePath("properties.notificationsList")] + public IList NotificationsList { get; } + /// The garbage collection properties of the connected registry. + [WirePath("properties.garbageCollection")] + public GarbageCollectionProperties GarbageCollection { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs new file mode 100644 index 000000000000..ba21ec9db4ae --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.Serialization.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryPipelineRunContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PipelineResourceId)) + { + writer.WritePropertyName("pipelineResourceId"u8); + writer.WriteStringValue(PipelineResourceId); + } + if (Optional.IsCollectionDefined(Artifacts)) + { + writer.WritePropertyName("artifacts"u8); + writer.WriteStartArray(); + foreach (var item in Artifacts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsDefined(CatalogDigest)) + { + writer.WritePropertyName("catalogDigest"u8); + writer.WriteStringValue(CatalogDigest); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryPipelineRunContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryPipelineRunContent(document.RootElement, options); + } + + internal static ConnectedRegistryPipelineRunContent DeserializeConnectedRegistryPipelineRunContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier pipelineResourceId = default; + IList artifacts = default; + ContainerRegistryPipelineRunSourceProperties source = default; + ContainerRegistryPipelineRunTargetProperties target = default; + string catalogDigest = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pipelineResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pipelineResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("artifacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + artifacts = array; + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ContainerRegistryPipelineRunSourceProperties.DeserializeContainerRegistryPipelineRunSourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ContainerRegistryPipelineRunTargetProperties.DeserializeContainerRegistryPipelineRunTargetProperties(property.Value, options); + continue; + } + if (property.NameEquals("catalogDigest"u8)) + { + catalogDigest = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryPipelineRunContent( + pipelineResourceId, + artifacts ?? new ChangeTrackingList(), + source, + target, + catalogDigest, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pipelineResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineResourceId)) + { + builder.Append(" pipelineResourceId: "); + builder.AppendLine($"'{PipelineResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Artifacts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" artifacts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Artifacts)) + { + if (Artifacts.Any()) + { + builder.Append(" artifacts: "); + builder.AppendLine("["); + foreach (var item in Artifacts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 2, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CatalogDigest), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" catalogDigest: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CatalogDigest)) + { + builder.Append(" catalogDigest: "); + if (CatalogDigest.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CatalogDigest}'''"); + } + else + { + builder.AppendLine($"'{CatalogDigest}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryPipelineRunContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryPipelineRunContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryPipelineRunContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs new file mode 100644 index 000000000000..4161ebbfeff4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPipelineRunContent.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The request properties provided for a pipeline run. + public partial class ConnectedRegistryPipelineRunContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistryPipelineRunContent() + { + Artifacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The resource ID of the pipeline to run. + /// + /// List of source artifacts to be transferred by the pipeline. + /// Specify an image by repository ('hello-world'). This will use the 'latest' tag. + /// Specify an image by tag ('hello-world:latest'). + /// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + /// + /// The source properties of the pipeline run. + /// The target properties of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryPipelineRunContent(ResourceIdentifier pipelineResourceId, IList artifacts, ContainerRegistryPipelineRunSourceProperties source, ContainerRegistryPipelineRunTargetProperties target, string catalogDigest, IDictionary serializedAdditionalRawData) + { + PipelineResourceId = pipelineResourceId; + Artifacts = artifacts; + Source = source; + Target = target; + CatalogDigest = catalogDigest; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of the pipeline to run. + [WirePath("pipelineResourceId")] + public ResourceIdentifier PipelineResourceId { get; set; } + /// + /// List of source artifacts to be transferred by the pipeline. + /// Specify an image by repository ('hello-world'). This will use the 'latest' tag. + /// Specify an image by tag ('hello-world:latest'). + /// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + /// + [WirePath("artifacts")] + public IList Artifacts { get; } + /// The source properties of the pipeline run. + [WirePath("source")] + public ContainerRegistryPipelineRunSourceProperties Source { get; set; } + /// The target properties of the pipeline run. + [WirePath("target")] + public ContainerRegistryPipelineRunTargetProperties Target { get; set; } + /// The digest of the tar used to transfer the artifacts. + [WirePath("catalogDigest")] + public string CatalogDigest { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs new file mode 100644 index 000000000000..66745a3d3c92 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistryStatusDetail : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryStatusDetail)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StatusDetailType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(StatusDetailType); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistryStatusDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistryStatusDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistryStatusDetail(document.RootElement, options); + } + + internal static ConnectedRegistryStatusDetail DeserializeConnectedRegistryStatusDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + string code = default; + string description = default; + DateTimeOffset? timestamp = default; + Guid? correlationId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + correlationId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistryStatusDetail( + type, + code, + description, + timestamp, + correlationId, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StatusDetailType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StatusDetailType)) + { + builder.Append(" type: "); + if (StatusDetailType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{StatusDetailType}'''"); + } + else + { + builder.AppendLine($"'{StatusDetailType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" code: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Code)) + { + builder.Append(" code: "); + if (Code.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Code}'''"); + } + else + { + builder.AppendLine($"'{Code}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Timestamp)) + { + builder.Append(" timestamp: "); + var formattedDateTimeString = TypeFormatters.ToString(Timestamp.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CorrelationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" correlationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CorrelationId)) + { + builder.Append(" correlationId: "); + builder.AppendLine($"'{CorrelationId.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistryStatusDetail)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistryStatusDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistryStatusDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistryStatusDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs new file mode 100644 index 000000000000..c067829c4355 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The status detail properties of the connected registry. + public partial class ConnectedRegistryStatusDetail + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ConnectedRegistryStatusDetail() + { + } + + /// Initializes a new instance of . + /// The component of the connected registry corresponding to the status. + /// The code of the status. + /// The description of the status. + /// The timestamp of the status. + /// The correlation ID of the status. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistryStatusDetail(string statusDetailType, string code, string description, DateTimeOffset? timestamp, Guid? correlationId, IDictionary serializedAdditionalRawData) + { + StatusDetailType = statusDetailType; + Code = code; + Description = description; + Timestamp = timestamp; + CorrelationId = correlationId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The component of the connected registry corresponding to the status. + [WirePath("type")] + public string StatusDetailType { get; } + /// The code of the status. + [WirePath("code")] + public string Code { get; } + /// The description of the status. + [WirePath("description")] + public string Description { get; } + /// The timestamp of the status. + [WirePath("timestamp")] + public DateTimeOffset? Timestamp { get; } + /// The correlation ID of the status. + [WirePath("correlationId")] + public Guid? CorrelationId { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs new file mode 100644 index 000000000000..e367a48d0383 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistrySyncProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistrySyncProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tokenId"u8); + writer.WriteStringValue(TokenId); + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteStringValue(Schedule); + } + if (Optional.IsDefined(SyncWindow)) + { + writer.WritePropertyName("syncWindow"u8); + writer.WriteStringValue(SyncWindow.Value, "P"); + } + writer.WritePropertyName("messageTtl"u8); + writer.WriteStringValue(MessageTtl, "P"); + if (options.Format != "W" && Optional.IsDefined(LastSyncOn)) + { + writer.WritePropertyName("lastSyncTime"u8); + writer.WriteStringValue(LastSyncOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(GatewayEndpoint)) + { + writer.WritePropertyName("gatewayEndpoint"u8); + writer.WriteStringValue(GatewayEndpoint); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistrySyncProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistrySyncProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistrySyncProperties(document.RootElement, options); + } + + internal static ConnectedRegistrySyncProperties DeserializeConnectedRegistrySyncProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier tokenId = default; + string schedule = default; + TimeSpan? syncWindow = default; + TimeSpan messageTtl = default; + DateTimeOffset? lastSyncTime = default; + string gatewayEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tokenId"u8)) + { + tokenId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("schedule"u8)) + { + schedule = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncWindow"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + syncWindow = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("messageTtl"u8)) + { + messageTtl = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("lastSyncTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSyncTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("gatewayEndpoint"u8)) + { + gatewayEndpoint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistrySyncProperties( + tokenId, + schedule, + syncWindow, + messageTtl, + lastSyncTime, + gatewayEndpoint, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TokenId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tokenId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TokenId)) + { + builder.Append(" tokenId: "); + builder.AppendLine($"'{TokenId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Schedule), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" schedule: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Schedule)) + { + builder.Append(" schedule: "); + if (Schedule.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Schedule}'''"); + } + else + { + builder.AppendLine($"'{Schedule}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SyncWindow), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" syncWindow: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SyncWindow)) + { + builder.Append(" syncWindow: "); + var formattedTimeSpan = TypeFormatters.ToString(SyncWindow.Value, "P"); + builder.AppendLine($"'{formattedTimeSpan}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MessageTtl), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" messageTtl: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" messageTtl: "); + var formattedTimeSpan = TypeFormatters.ToString(MessageTtl, "P"); + builder.AppendLine($"'{formattedTimeSpan}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastSyncOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastSyncTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastSyncOn)) + { + builder.Append(" lastSyncTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastSyncOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gatewayEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GatewayEndpoint)) + { + builder.Append(" gatewayEndpoint: "); + if (GatewayEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GatewayEndpoint}'''"); + } + else + { + builder.AppendLine($"'{GatewayEndpoint}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistrySyncProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistrySyncProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistrySyncProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistrySyncProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs new file mode 100644 index 000000000000..2e5234348da3 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The sync properties of the connected registry with its parent. + public partial class ConnectedRegistrySyncProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// is null. + public ConnectedRegistrySyncProperties(ResourceIdentifier tokenId, TimeSpan messageTtl) + { + Argument.AssertNotNull(tokenId, nameof(tokenId)); + + TokenId = tokenId; + MessageTtl = messageTtl; + } + + /// Initializes a new instance of . + /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. + /// The cron expression indicating the schedule that the connected registry will sync with its parent. + /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// The last time a sync occurred between the connected registry and its parent. + /// The gateway endpoint used by the connected registry to communicate with its parent. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistrySyncProperties(ResourceIdentifier tokenId, string schedule, TimeSpan? syncWindow, TimeSpan messageTtl, DateTimeOffset? lastSyncOn, string gatewayEndpoint, IDictionary serializedAdditionalRawData) + { + TokenId = tokenId; + Schedule = schedule; + SyncWindow = syncWindow; + MessageTtl = messageTtl; + LastSyncOn = lastSyncOn; + GatewayEndpoint = gatewayEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedRegistrySyncProperties() + { + } + + /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. + [WirePath("tokenId")] + public ResourceIdentifier TokenId { get; set; } + /// The cron expression indicating the schedule that the connected registry will sync with its parent. + [WirePath("schedule")] + public string Schedule { get; set; } + /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + [WirePath("syncWindow")] + public TimeSpan? SyncWindow { get; set; } + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + [WirePath("messageTtl")] + public TimeSpan MessageTtl { get; set; } + /// The last time a sync occurred between the connected registry and its parent. + [WirePath("lastSyncTime")] + public DateTimeOffset? LastSyncOn { get; } + /// The gateway endpoint used by the connected registry to communicate with its parent. + [WirePath("gatewayEndpoint")] + public string GatewayEndpoint { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..6b49c4df8a64 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ConnectedRegistrySyncUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistrySyncUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteStringValue(Schedule); + } + if (Optional.IsDefined(SyncWindow)) + { + writer.WritePropertyName("syncWindow"u8); + writer.WriteStringValue(SyncWindow.Value, "P"); + } + if (Optional.IsDefined(MessageTtl)) + { + writer.WritePropertyName("messageTtl"u8); + writer.WriteStringValue(MessageTtl.Value, "P"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedRegistrySyncUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedRegistrySyncUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedRegistrySyncUpdateProperties(document.RootElement, options); + } + + internal static ConnectedRegistrySyncUpdateProperties DeserializeConnectedRegistrySyncUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string schedule = default; + TimeSpan? syncWindow = default; + TimeSpan? messageTtl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("schedule"u8)) + { + schedule = property.Value.GetString(); + continue; + } + if (property.NameEquals("syncWindow"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + syncWindow = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("messageTtl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + messageTtl = property.Value.GetTimeSpan("P"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedRegistrySyncUpdateProperties(schedule, syncWindow, messageTtl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConnectedRegistrySyncUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedRegistrySyncUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConnectedRegistrySyncUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedRegistrySyncUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs new file mode 100644 index 000000000000..8804610624f2 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating the sync properties of the connected registry with its parent. + public partial class ConnectedRegistrySyncUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedRegistrySyncUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The cron expression indicating the schedule that the connected registry will sync with its parent. + /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + /// Keeps track of any properties unknown to the library. + internal ConnectedRegistrySyncUpdateProperties(string schedule, TimeSpan? syncWindow, TimeSpan? messageTtl, IDictionary serializedAdditionalRawData) + { + Schedule = schedule; + SyncWindow = syncWindow; + MessageTtl = messageTtl; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The cron expression indicating the schedule that the connected registry will sync with its parent. + [WirePath("schedule")] + public string Schedule { get; set; } + /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + [WirePath("syncWindow")] + public TimeSpan? SyncWindow { get; set; } + /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + [WirePath("messageTtl")] + public TimeSpan? MessageTtl { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs similarity index 59% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.Serialization.cs rename to sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs index ffc3e9bad440..898fbead827d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.ContainerRegistry.Models { - internal partial class TransportAuthenticationUpdate : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryArchivePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,22 +28,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TransportAuthenticationUpdate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(OwnCertificates)) + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PublishedVersion)) { - writer.WritePropertyName("ownCertificates"u8); - writer.WriteStartArray(); - foreach (var item in OwnCertificates) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("publishedVersion"u8); + writer.WriteStringValue(PublishedVersion); } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -61,19 +59,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TransportAuthenticationUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContainerRegistryArchivePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TransportAuthenticationUpdate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTransportAuthenticationUpdate(document.RootElement, options); + return DeserializeContainerRegistryArchivePatch(document.RootElement, options); } - internal static TransportAuthenticationUpdate DeserializeTransportAuthenticationUpdate(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContainerRegistryArchivePatch DeserializeContainerRegistryArchivePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,23 +79,26 @@ internal static TransportAuthenticationUpdate DeserializeTransportAuthentication { return null; } - IList ownCertificates = default; + string publishedVersion = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ownCertificates"u8)) + if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { + property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var property0 in property.Value.EnumerateObject()) { - array.Add(OwnCertificate.DeserializeOwnCertificate(item, options)); + if (property0.NameEquals("publishedVersion"u8)) + { + publishedVersion = property0.Value.GetString(); + continue; + } } - ownCertificates = array; continue; } if (options.Format != "W") @@ -106,38 +107,38 @@ internal static TransportAuthenticationUpdate DeserializeTransportAuthentication } } serializedAdditionalRawData = rawDataDictionary; - return new TransportAuthenticationUpdate(ownCertificates ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ContainerRegistryArchivePatch(publishedVersion, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TransportAuthenticationUpdate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support writing '{options.Format}' format."); } } - TransportAuthenticationUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContainerRegistryArchivePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTransportAuthenticationUpdate(document.RootElement, options); + return DeserializeContainerRegistryArchivePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TransportAuthenticationUpdate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContainerRegistryArchivePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs new file mode 100644 index 000000000000..df33a7aeb055 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryArchivePatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a archive. + public partial class ContainerRegistryArchivePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryArchivePatch() + { + } + + /// Initializes a new instance of . + /// The published version of the archive. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArchivePatch(string publishedVersion, IDictionary serializedAdditionalRawData) + { + PublishedVersion = publishedVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The published version of the archive. + [WirePath("properties.publishedVersion")] + public string PublishedVersion { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.Serialization.cs new file mode 100644 index 000000000000..926b8ee2c7e9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.Serialization.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryAuthCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryAuthCredential)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (Optional.IsDefined(UsernameSecretIdentifier)) + { + writer.WritePropertyName("usernameSecretIdentifier"u8); + writer.WriteStringValue(UsernameSecretIdentifier); + } + if (Optional.IsDefined(PasswordSecretIdentifier)) + { + writer.WritePropertyName("passwordSecretIdentifier"u8); + writer.WriteStringValue(PasswordSecretIdentifier); + } + if (options.Format != "W" && Optional.IsDefined(CredentialHealth)) + { + writer.WritePropertyName("credentialHealth"u8); + writer.WriteObjectValue(CredentialHealth, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryAuthCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryAuthCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryAuthCredential(document.RootElement, options); + } + + internal static ContainerRegistryAuthCredential DeserializeContainerRegistryAuthCredential(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryCredentialName? name = default; + string usernameSecretIdentifier = default; + string passwordSecretIdentifier = default; + ContainerRegistryCredentialHealth credentialHealth = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new ContainerRegistryCredentialName(property.Value.GetString()); + continue; + } + if (property.NameEquals("usernameSecretIdentifier"u8)) + { + usernameSecretIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("passwordSecretIdentifier"u8)) + { + passwordSecretIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("credentialHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentialHealth = ContainerRegistryCredentialHealth.DeserializeContainerRegistryCredentialHealth(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryAuthCredential(name, usernameSecretIdentifier, passwordSecretIdentifier, credentialHealth, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + builder.AppendLine($"'{Name.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UsernameSecretIdentifier), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" usernameSecretIdentifier: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UsernameSecretIdentifier)) + { + builder.Append(" usernameSecretIdentifier: "); + if (UsernameSecretIdentifier.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UsernameSecretIdentifier}'''"); + } + else + { + builder.AppendLine($"'{UsernameSecretIdentifier}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PasswordSecretIdentifier), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" passwordSecretIdentifier: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PasswordSecretIdentifier)) + { + builder.Append(" passwordSecretIdentifier: "); + if (PasswordSecretIdentifier.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PasswordSecretIdentifier}'''"); + } + else + { + builder.AppendLine($"'{PasswordSecretIdentifier}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CredentialHealth), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentialHealth: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CredentialHealth)) + { + builder.Append(" credentialHealth: "); + BicepSerializationHelpers.AppendChildObject(builder, CredentialHealth, options, 2, false, " credentialHealth: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryAuthCredential)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryAuthCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryAuthCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryAuthCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.cs new file mode 100644 index 000000000000..73995f35ff87 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryAuthCredential.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Authentication credential stored for an upstream. + public partial class ContainerRegistryAuthCredential + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryAuthCredential() + { + } + + /// Initializes a new instance of . + /// The name of the credential. + /// KeyVault Secret URI for accessing the username. + /// KeyVault Secret URI for accessing the password. + /// This provides data pertaining to the health of the auth credential. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryAuthCredential(ContainerRegistryCredentialName? name, string usernameSecretIdentifier, string passwordSecretIdentifier, ContainerRegistryCredentialHealth credentialHealth, IDictionary serializedAdditionalRawData) + { + Name = name; + UsernameSecretIdentifier = usernameSecretIdentifier; + PasswordSecretIdentifier = passwordSecretIdentifier; + CredentialHealth = credentialHealth; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the credential. + [WirePath("name")] + public ContainerRegistryCredentialName? Name { get; set; } + /// KeyVault Secret URI for accessing the username. + [WirePath("usernameSecretIdentifier")] + public string UsernameSecretIdentifier { get; set; } + /// KeyVault Secret URI for accessing the password. + [WirePath("passwordSecretIdentifier")] + public string PasswordSecretIdentifier { get; set; } + /// This provides data pertaining to the health of the auth credential. + [WirePath("credentialHealth")] + public ContainerRegistryCredentialHealth CredentialHealth { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.Serialization.cs new file mode 100644 index 000000000000..54cbf3f7c067 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryCacheRulePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCacheRulePatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(CredentialSetResourceId)) + { + writer.WritePropertyName("credentialSetResourceId"u8); + writer.WriteStringValue(CredentialSetResourceId); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryCacheRulePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCacheRulePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryCacheRulePatch(document.RootElement, options); + } + + internal static ContainerRegistryCacheRulePatch DeserializeContainerRegistryCacheRulePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier credentialSetResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("credentialSetResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentialSetResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryCacheRulePatch(credentialSetResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryCacheRulePatch)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryCacheRulePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryCacheRulePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryCacheRulePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.cs new file mode 100644 index 000000000000..94df81091a98 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCacheRulePatch.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a cache rule. + public partial class ContainerRegistryCacheRulePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryCacheRulePatch() + { + } + + /// Initializes a new instance of . + /// The ARM resource ID of the credential store which is associated with the Cache rule. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryCacheRulePatch(ResourceIdentifier credentialSetResourceId, IDictionary serializedAdditionalRawData) + { + CredentialSetResourceId = credentialSetResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ARM resource ID of the credential store which is associated with the Cache rule. + [WirePath("properties.credentialSetResourceId")] + public ResourceIdentifier CredentialSetResourceId { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCertificateType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCertificateType.cs new file mode 100644 index 000000000000..6a72819ca756 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCertificateType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of certificate location. + public readonly partial struct ContainerRegistryCertificateType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryCertificateType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocalDirectoryValue = "LocalDirectory"; + + /// LocalDirectory. + public static ContainerRegistryCertificateType LocalDirectory { get; } = new ContainerRegistryCertificateType(LocalDirectoryValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryCertificateType left, ContainerRegistryCertificateType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryCertificateType left, ContainerRegistryCertificateType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryCertificateType(string value) => new ContainerRegistryCertificateType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryCertificateType other && Equals(other); + /// + public bool Equals(ContainerRegistryCertificateType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.Serialization.cs new file mode 100644 index 000000000000..d545f3f0acec --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryCredentialHealth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialHealth)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(ErrorCode)) + { + writer.WritePropertyName("errorCode"u8); + writer.WriteStringValue(ErrorCode); + } + if (Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryCredentialHealth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialHealth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryCredentialHealth(document.RootElement, options); + } + + internal static ContainerRegistryCredentialHealth DeserializeContainerRegistryCredentialHealth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryCredentialHealthStatus? status = default; + string errorCode = default; + string errorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ContainerRegistryCredentialHealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorCode"u8)) + { + errorCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryCredentialHealth(status, errorCode, errorMessage, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorCode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorCode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorCode)) + { + builder.Append(" errorCode: "); + if (ErrorCode.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ErrorCode}'''"); + } + else + { + builder.AppendLine($"'{ErrorCode}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorMessage)) + { + builder.Append(" errorMessage: "); + if (ErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{ErrorMessage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialHealth)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryCredentialHealth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryCredentialHealth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialHealth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.cs new file mode 100644 index 000000000000..94bb79e4f21e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealth.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The health of the auth credential. + public partial class ContainerRegistryCredentialHealth + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerRegistryCredentialHealth() + { + } + + /// Initializes a new instance of . + /// The health status of credential. + /// Error code representing the health check error. + /// Descriptive message representing the health check error. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryCredentialHealth(ContainerRegistryCredentialHealthStatus? status, string errorCode, string errorMessage, IDictionary serializedAdditionalRawData) + { + Status = status; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The health status of credential. + [WirePath("status")] + public ContainerRegistryCredentialHealthStatus? Status { get; } + /// Error code representing the health check error. + [WirePath("errorCode")] + public string ErrorCode { get; } + /// Descriptive message representing the health check error. + [WirePath("errorMessage")] + public string ErrorMessage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealthStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealthStatus.cs new file mode 100644 index 000000000000..019d97246ec4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialHealthStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The health status of credential. + public readonly partial struct ContainerRegistryCredentialHealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryCredentialHealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HealthyValue = "Healthy"; + private const string UnhealthyValue = "Unhealthy"; + + /// Healthy. + public static ContainerRegistryCredentialHealthStatus Healthy { get; } = new ContainerRegistryCredentialHealthStatus(HealthyValue); + /// Unhealthy. + public static ContainerRegistryCredentialHealthStatus Unhealthy { get; } = new ContainerRegistryCredentialHealthStatus(UnhealthyValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryCredentialHealthStatus left, ContainerRegistryCredentialHealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryCredentialHealthStatus left, ContainerRegistryCredentialHealthStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryCredentialHealthStatus(string value) => new ContainerRegistryCredentialHealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryCredentialHealthStatus other && Equals(other); + /// + public bool Equals(ContainerRegistryCredentialHealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialName.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialName.cs new file mode 100644 index 000000000000..5ab7ba573d31 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The name of the credential. + public readonly partial struct ContainerRegistryCredentialName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryCredentialName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Credential1Value = "Credential1"; + + /// Credential1. + public static ContainerRegistryCredentialName Credential1 { get; } = new ContainerRegistryCredentialName(Credential1Value); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryCredentialName left, ContainerRegistryCredentialName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryCredentialName left, ContainerRegistryCredentialName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryCredentialName(string value) => new ContainerRegistryCredentialName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryCredentialName other && Equals(other); + /// + public bool Equals(ContainerRegistryCredentialName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.Serialization.cs new file mode 100644 index 000000000000..3a569ec8773d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryCredentialSetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AuthCredentials)) + { + writer.WritePropertyName("authCredentials"u8); + writer.WriteStartArray(); + foreach (var item in AuthCredentials) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryCredentialSetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryCredentialSetPatch(document.RootElement, options); + } + + internal static ContainerRegistryCredentialSetPatch DeserializeContainerRegistryCredentialSetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + IList authCredentials = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("authCredentials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ContainerRegistryAuthCredential.DeserializeContainerRegistryAuthCredential(item, options)); + } + authCredentials = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryCredentialSetPatch(identity, authCredentials ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetPatch)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryCredentialSetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryCredentialSetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryCredentialSetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.cs new file mode 100644 index 000000000000..a22530d4efe7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryCredentialSetPatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a credential set. + public partial class ContainerRegistryCredentialSetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryCredentialSetPatch() + { + AuthCredentials = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Identities associated with the resource. This is used to access the KeyVault secrets. + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryCredentialSetPatch(ManagedServiceIdentity identity, IList authCredentials, IDictionary serializedAdditionalRawData) + { + Identity = identity; + AuthCredentials = authCredentials; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identities associated with the resource. This is used to access the KeyVault secrets. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + [WirePath("properties.authCredentials")] + public IList AuthCredentials { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs new file mode 100644 index 000000000000..6ce891fd0388 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryMetadataSearch.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Determines whether registry artifacts are indexed for metadata search. + public readonly partial struct ContainerRegistryMetadataSearch : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryMetadataSearch(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ContainerRegistryMetadataSearch Enabled { get; } = new ContainerRegistryMetadataSearch(EnabledValue); + /// Disabled. + public static ContainerRegistryMetadataSearch Disabled { get; } = new ContainerRegistryMetadataSearch(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryMetadataSearch left, ContainerRegistryMetadataSearch right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryMetadataSearch left, ContainerRegistryMetadataSearch right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryMetadataSearch(string value) => new ContainerRegistryMetadataSearch(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryMetadataSearch other && Equals(other); + /// + public bool Equals(ContainerRegistryMetadataSearch other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs index 38b735dd8afb..c6b8ff604c7f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.Serialization.cs @@ -38,6 +38,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); writer.WriteStringValue(ResourceType.ToString()); + if (Optional.IsDefined(ResourceGroupName)) + { + writer.WritePropertyName("resourceGroupName"u8); + writer.WriteStringValue(ResourceGroupName); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +87,8 @@ internal static ContainerRegistryNameAvailabilityContent DeserializeContainerReg } string name = default; ContainerRegistryResourceType type = default; + string resourceGroupName = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,13 +103,27 @@ internal static ContainerRegistryNameAvailabilityContent DeserializeContainerReg type = new ContainerRegistryResourceType(property.Value.GetString()); continue; } + if (property.NameEquals("resourceGroupName"u8)) + { + resourceGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryNameAvailabilityContent(name, type, serializedAdditionalRawData); + return new ContainerRegistryNameAvailabilityContent(name, type, resourceGroupName, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs index 467ee56cc19c..bde516a1947a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailabilityContent.cs @@ -59,11 +59,15 @@ public ContainerRegistryNameAvailabilityContent(string name) /// Initializes a new instance of . /// The name of the container registry. /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + /// The resource group name of the container registry. + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". /// Keeps track of any properties unknown to the library. - internal ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType, IDictionary serializedAdditionalRawData) + internal ContainerRegistryNameAvailabilityContent(string name, ContainerRegistryResourceType resourceType, string resourceGroupName, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) { Name = name; ResourceType = resourceType; + ResourceGroupName = resourceGroupName; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,5 +82,11 @@ internal ContainerRegistryNameAvailabilityContent() /// The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. [WirePath("type")] public ContainerRegistryResourceType ResourceType { get; } + /// The resource group name of the container registry. + [WirePath("resourceGroupName")] + public string ResourceGroupName { get; set; } + /// The auto generated domain name label of the container registry. This value defaults to "Unsecure". + [WirePath("autoGeneratedDomainNameLabelScope")] + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs index 00839fe26803..2c542d9c71d3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.Serialization.cs @@ -35,6 +35,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryNameAvailableResult)} does not support writing '{format}' format."); } + if (Optional.IsDefined(AvailableLoginServerName)) + { + writer.WritePropertyName("availableLoginServerName"u8); + writer.WriteStringValue(AvailableLoginServerName); + } if (Optional.IsDefined(IsNameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -87,6 +92,7 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr { return null; } + string availableLoginServerName = default; bool? nameAvailable = default; string reason = default; string message = default; @@ -94,6 +100,11 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("availableLoginServerName"u8)) + { + availableLoginServerName = property.Value.GetString(); + continue; + } if (property.NameEquals("nameAvailable"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -119,7 +130,7 @@ internal static ContainerRegistryNameAvailableResult DeserializeContainerRegistr } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryNameAvailableResult(nameAvailable, reason, message, serializedAdditionalRawData); + return new ContainerRegistryNameAvailableResult(availableLoginServerName, nameAvailable, reason, message, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -133,6 +144,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailableLoginServerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availableLoginServerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AvailableLoginServerName)) + { + builder.Append(" availableLoginServerName: "); + if (AvailableLoginServerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AvailableLoginServerName}'''"); + } + else + { + builder.AppendLine($"'{AvailableLoginServerName}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsNameAvailable), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs index f283691e35d6..58cc7b79002e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryNameAvailableResult.cs @@ -51,18 +51,23 @@ internal ContainerRegistryNameAvailableResult() } /// Initializes a new instance of . + /// The complete login server name with domain name label (DNL) hash, if available. /// The value that indicates whether the name is available. /// If any, the reason that the name is not available. /// If any, the error message that provides more detail for the reason that the name is not available. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryNameAvailableResult(bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + internal ContainerRegistryNameAvailableResult(string availableLoginServerName, bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) { + AvailableLoginServerName = availableLoginServerName; IsNameAvailable = isNameAvailable; Reason = reason; Message = message; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The complete login server name with domain name label (DNL) hash, if available. + [WirePath("availableLoginServerName")] + public string AvailableLoginServerName { get; } /// The value that indicates whether the name is available. [WirePath("nameAvailable")] public bool? IsNameAvailable { get; } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs index d9d83329c050..87935bb9d9da 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs @@ -93,6 +93,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkRuleBypassOptions"u8); writer.WriteStringValue(NetworkRuleBypassOptions.Value.ToString()); } + if (Optional.IsDefined(IsAnonymousPullEnabled)) + { + writer.WritePropertyName("anonymousPullEnabled"u8); + writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); + } + if (Optional.IsDefined(MetadataSearch)) + { + writer.WritePropertyName("metadataSearch"u8); + writer.WriteStringValue(MetadataSearch.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -141,6 +151,8 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle bool? dataEndpointEnabled = default; ContainerRegistryPublicNetworkAccess? publicNetworkAccess = default; ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions = default; + bool? anonymousPullEnabled = default; + ContainerRegistryMetadataSearch? metadataSearch = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -249,6 +261,24 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle networkRuleBypassOptions = new ContainerRegistryNetworkRuleBypassOption(property0.Value.GetString()); continue; } + if (property0.NameEquals("anonymousPullEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + anonymousPullEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("metadataSearch"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadataSearch = new ContainerRegistryMetadataSearch(property0.Value.GetString()); + continue; + } } continue; } @@ -269,6 +299,8 @@ internal static ContainerRegistryPatch DeserializeContainerRegistryPatch(JsonEle dataEndpointEnabled, publicNetworkAccess, networkRuleBypassOptions, + anonymousPullEnabled, + metadataSearch, serializedAdditionalRawData); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs index b98911eea453..abf37b78a947 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs @@ -63,8 +63,10 @@ public ContainerRegistryPatch() /// Enable a single data endpoint per region for serving data. /// Whether or not public network access is allowed for the container registry. /// Whether to allow trusted Azure services to access a network restricted registry. + /// Enables registry-wide pull from unauthenticated clients. + /// Determines whether registry artifacts are indexed for metadata search. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, ContainerRegistrySku sku, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, IDictionary serializedAdditionalRawData) + internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, ContainerRegistrySku sku, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, bool? isAnonymousPullEnabled, ContainerRegistryMetadataSearch? metadataSearch, IDictionary serializedAdditionalRawData) { Identity = identity; Tags = tags; @@ -76,6 +78,8 @@ internal ContainerRegistryPatch(ManagedServiceIdentity identity, IDictionary Whether to allow trusted Azure services to access a network restricted registry. [WirePath("properties.networkRuleBypassOptions")] public ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get; set; } + /// Enables registry-wide pull from unauthenticated clients. + [WirePath("properties.anonymousPullEnabled")] + public bool? IsAnonymousPullEnabled { get; set; } + /// Determines whether registry artifacts are indexed for metadata search. + [WirePath("properties.metadataSearch")] + public ContainerRegistryMetadataSearch? MetadataSearch { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs new file mode 100644 index 000000000000..2e9963653f2d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineOption.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The ContainerRegistryPipelineOption. + public readonly partial struct ContainerRegistryPipelineOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OverwriteTagsValue = "OverwriteTags"; + private const string OverwriteBlobsValue = "OverwriteBlobs"; + private const string DeleteSourceBlobOnSuccessValue = "DeleteSourceBlobOnSuccess"; + private const string ContinueOnErrorsValue = "ContinueOnErrors"; + + /// OverwriteTags. + public static ContainerRegistryPipelineOption OverwriteTags { get; } = new ContainerRegistryPipelineOption(OverwriteTagsValue); + /// OverwriteBlobs. + public static ContainerRegistryPipelineOption OverwriteBlobs { get; } = new ContainerRegistryPipelineOption(OverwriteBlobsValue); + /// DeleteSourceBlobOnSuccess. + public static ContainerRegistryPipelineOption DeleteSourceBlobOnSuccess { get; } = new ContainerRegistryPipelineOption(DeleteSourceBlobOnSuccessValue); + /// ContinueOnErrors. + public static ContainerRegistryPipelineOption ContinueOnErrors { get; } = new ContainerRegistryPipelineOption(ContinueOnErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineOption left, ContainerRegistryPipelineOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineOption left, ContainerRegistryPipelineOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineOption(string value) => new ContainerRegistryPipelineOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineOption other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs new file mode 100644 index 000000000000..805ac31d66e6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryPipelineRunSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryPipelineRunSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunSourceProperties(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunSourceProperties DeserializeContainerRegistryPipelineRunSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineRunSourceType? type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineRunSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunSourceProperties(type, name, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{SourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryPipelineRunSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs new file mode 100644 index 000000000000..1e5037453e64 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The ContainerRegistryPipelineRunSourceProperties. + public partial class ContainerRegistryPipelineRunSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunSourceProperties() + { + } + + /// Initializes a new instance of . + /// The type of the source. + /// The name of the source. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunSourceProperties(ContainerRegistryPipelineRunSourceType? sourceType, string name, IDictionary serializedAdditionalRawData) + { + SourceType = sourceType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the source. + [WirePath("type")] + public ContainerRegistryPipelineRunSourceType? SourceType { get; set; } + /// The name of the source. + [WirePath("name")] + public string Name { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs new file mode 100644 index 000000000000..f3f9a8153f3d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of the source. + public readonly partial struct ContainerRegistryPipelineRunSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineRunSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobValue = "AzureStorageBlob"; + + /// AzureStorageBlob. + public static ContainerRegistryPipelineRunSourceType AzureStorageBlob { get; } = new ContainerRegistryPipelineRunSourceType(AzureStorageBlobValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineRunSourceType left, ContainerRegistryPipelineRunSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineRunSourceType left, ContainerRegistryPipelineRunSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineRunSourceType(string value) => new ContainerRegistryPipelineRunSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineRunSourceType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineRunSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs new file mode 100644 index 000000000000..afe780989796 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryPipelineRunTargetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryPipelineRunTargetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryPipelineRunTargetProperties(document.RootElement, options); + } + + internal static ContainerRegistryPipelineRunTargetProperties DeserializeContainerRegistryPipelineRunTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineRunTargetType? type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineRunTargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryPipelineRunTargetProperties(type, name, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{TargetType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryPipelineRunTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryPipelineRunTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryPipelineRunTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs new file mode 100644 index 000000000000..0119f371a627 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The ContainerRegistryPipelineRunTargetProperties. + public partial class ContainerRegistryPipelineRunTargetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistryPipelineRunTargetProperties() + { + } + + /// Initializes a new instance of . + /// The type of the target. + /// The name of the target. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryPipelineRunTargetProperties(ContainerRegistryPipelineRunTargetType? targetType, string name, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of the target. + [WirePath("type")] + public ContainerRegistryPipelineRunTargetType? TargetType { get; set; } + /// The name of the target. + [WirePath("name")] + public string Name { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs new file mode 100644 index 000000000000..3d6e3b5b8604 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunTargetType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of the target. + public readonly partial struct ContainerRegistryPipelineRunTargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineRunTargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobValue = "AzureStorageBlob"; + + /// AzureStorageBlob. + public static ContainerRegistryPipelineRunTargetType AzureStorageBlob { get; } = new ContainerRegistryPipelineRunTargetType(AzureStorageBlobValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineRunTargetType left, ContainerRegistryPipelineRunTargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineRunTargetType left, ContainerRegistryPipelineRunTargetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineRunTargetType(string value) => new ContainerRegistryPipelineRunTargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineRunTargetType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineRunTargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs new file mode 100644 index 000000000000..a60f2cdd8bfa --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineSourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The type of source for the import pipeline. + public readonly partial struct ContainerRegistryPipelineSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryPipelineSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureStorageBlobContainerValue = "AzureStorageBlobContainer"; + + /// AzureStorageBlobContainer. + public static ContainerRegistryPipelineSourceType AzureStorageBlobContainer { get; } = new ContainerRegistryPipelineSourceType(AzureStorageBlobContainerValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryPipelineSourceType left, ContainerRegistryPipelineSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryPipelineSourceType left, ContainerRegistryPipelineSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryPipelineSourceType(string value) => new ContainerRegistryPipelineSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryPipelineSourceType other && Equals(other); + /// + public bool Equals(ContainerRegistryPipelineSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs index 5f6553cfb577..7e30bd8c790f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs @@ -55,6 +55,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("exportPolicy"u8); writer.WriteObjectValue(ExportPolicy, options); } + if (Optional.IsDefined(AzureADAuthenticationAsArmPolicy)) + { + writer.WritePropertyName("azureADAuthenticationAsArmPolicy"u8); + writer.WriteObjectValue(AzureADAuthenticationAsArmPolicy, options); + } + if (Optional.IsDefined(SoftDeletePolicy)) + { + writer.WritePropertyName("softDeletePolicy"u8); + writer.WriteObjectValue(SoftDeletePolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -96,6 +106,8 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J ContainerRegistryTrustPolicy trustPolicy = default; ContainerRegistryRetentionPolicy retentionPolicy = default; ContainerRegistryExportPolicy exportPolicy = default; + AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy = default; + ContainerRegistrySoftDeletePolicy softDeletePolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -136,13 +148,38 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J exportPolicy = ContainerRegistryExportPolicy.DeserializeContainerRegistryExportPolicy(property.Value, options); continue; } + if (property.NameEquals("azureADAuthenticationAsArmPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureADAuthenticationAsArmPolicy = AzureADAuthenticationAsArmPolicy.DeserializeAzureADAuthenticationAsArmPolicy(property.Value, options); + continue; + } + if (property.NameEquals("softDeletePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletePolicy = ContainerRegistrySoftDeletePolicy.DeserializeContainerRegistrySoftDeletePolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryPolicies(quarantinePolicy, trustPolicy, retentionPolicy, exportPolicy, serializedAdditionalRawData); + return new ContainerRegistryPolicies( + quarantinePolicy, + trustPolicy, + retentionPolicy, + exportPolicy, + azureADAuthenticationAsArmPolicy, + softDeletePolicy, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -222,6 +259,39 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AzureADAuthenticationAsArmStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" azureADAuthenticationAsArmPolicy: "); + builder.AppendLine("{"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(AzureADAuthenticationAsArmPolicy)) + { + builder.Append(" azureADAuthenticationAsArmPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, AzureADAuthenticationAsArmPolicy, options, 2, false, " azureADAuthenticationAsArmPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SoftDeletePolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" softDeletePolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SoftDeletePolicy)) + { + builder.Append(" softDeletePolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, SoftDeletePolicy, options, 2, false, " softDeletePolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs index 910ce521d849..254dfd394aee 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs @@ -55,13 +55,17 @@ public ContainerRegistryPolicies() /// The content trust policy for a container registry. /// The retention policy for a container registry. /// The export policy for a container registry. + /// The policy for using ARM audience token for a container registry. + /// The soft delete policy for a container registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy, IDictionary serializedAdditionalRawData) + internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy, AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy, ContainerRegistrySoftDeletePolicy softDeletePolicy, IDictionary serializedAdditionalRawData) { QuarantinePolicy = quarantinePolicy; TrustPolicy = trustPolicy; RetentionPolicy = retentionPolicy; ExportPolicy = exportPolicy; + AzureADAuthenticationAsArmPolicy = azureADAuthenticationAsArmPolicy; + SoftDeletePolicy = softDeletePolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -100,5 +104,24 @@ public ContainerRegistryExportPolicyStatus? ExportStatus ExportPolicy.Status = value; } } + + /// The policy for using ARM audience token for a container registry. + internal AzureADAuthenticationAsArmPolicy AzureADAuthenticationAsArmPolicy { get; set; } + /// The value that indicates whether the policy is enabled or not. + [WirePath("azureADAuthenticationAsArmPolicy.status")] + public AadAuthenticationAsArmPolicyStatus? AzureADAuthenticationAsArmStatus + { + get => AzureADAuthenticationAsArmPolicy is null ? default : AzureADAuthenticationAsArmPolicy.Status; + set + { + if (AzureADAuthenticationAsArmPolicy is null) + AzureADAuthenticationAsArmPolicy = new AzureADAuthenticationAsArmPolicy(); + AzureADAuthenticationAsArmPolicy.Status = value; + } + } + + /// The soft delete policy for a container registry. + [WirePath("softDeletePolicy")] + public ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs new file mode 100644 index 000000000000..58b2a99640d8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistrySoftDeletePolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RetentionDays)) + { + writer.WritePropertyName("retentionDays"u8); + writer.WriteNumberValue(RetentionDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastUpdatedOn)) + { + writer.WritePropertyName("lastUpdatedTime"u8); + writer.WriteStringValue(LastUpdatedOn.Value, "O"); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistrySoftDeletePolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistrySoftDeletePolicy(document.RootElement, options); + } + + internal static ContainerRegistrySoftDeletePolicy DeserializeContainerRegistrySoftDeletePolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? retentionDays = default; + DateTimeOffset? lastUpdatedTime = default; + ContainerRegistryPolicyStatus? status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("retentionDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastUpdatedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastUpdatedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ContainerRegistryPolicyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistrySoftDeletePolicy(retentionDays, lastUpdatedTime, status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionDays), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" retentionDays: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RetentionDays)) + { + builder.Append(" retentionDays: "); + builder.AppendLine($"{RetentionDays.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastUpdatedTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastUpdatedOn)) + { + builder.Append(" lastUpdatedTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistrySoftDeletePolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistrySoftDeletePolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistrySoftDeletePolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs new file mode 100644 index 000000000000..36898949580d --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The soft delete policy for a container registry. + public partial class ContainerRegistrySoftDeletePolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerRegistrySoftDeletePolicy() + { + } + + /// Initializes a new instance of . + /// The number of days after which a soft-deleted item is permanently deleted. + /// The timestamp when the policy was last updated. + /// The value that indicates whether the policy is enabled or not. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistrySoftDeletePolicy(int? retentionDays, DateTimeOffset? lastUpdatedOn, ContainerRegistryPolicyStatus? status, IDictionary serializedAdditionalRawData) + { + RetentionDays = retentionDays; + LastUpdatedOn = lastUpdatedOn; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of days after which a soft-deleted item is permanently deleted. + [WirePath("retentionDays")] + public int? RetentionDays { get; set; } + /// The timestamp when the policy was last updated. + [WirePath("lastUpdatedTime")] + public DateTimeOffset? LastUpdatedOn { get; } + /// The value that indicates whether the policy is enabled or not. + [WirePath("status")] + public ContainerRegistryPolicyStatus? Status { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.Serialization.cs new file mode 100644 index 000000000000..ef7e9a46c320 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryTlsCertificateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryTlsCertificateProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CertificateType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(CertificateType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CertificateLocation)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(CertificateLocation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryTlsCertificateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryTlsCertificateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryTlsCertificateProperties(document.RootElement, options); + } + + internal static ContainerRegistryTlsCertificateProperties DeserializeContainerRegistryTlsCertificateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryCertificateType? type = default; + string location = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryCertificateType(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryTlsCertificateProperties(type, location, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CertificateType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CertificateType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{CertificateType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CertificateLocation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CertificateLocation)) + { + builder.Append(" location: "); + if (CertificateLocation.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CertificateLocation}'''"); + } + else + { + builder.AppendLine($"'{CertificateLocation}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryTlsCertificateProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryTlsCertificateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerRegistryTlsCertificateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryTlsCertificateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.cs new file mode 100644 index 000000000000..033bf8847f93 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsCertificateProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The TLS certificate properties of the connected registry login server. + public partial class ContainerRegistryTlsCertificateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerRegistryTlsCertificateProperties() + { + } + + /// Initializes a new instance of . + /// The type of certificate location. + /// Indicates the location of the certificates. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryTlsCertificateProperties(ContainerRegistryCertificateType? certificateType, string certificateLocation, IDictionary serializedAdditionalRawData) + { + CertificateType = certificateType; + CertificateLocation = certificateLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of certificate location. + [WirePath("type")] + public ContainerRegistryCertificateType? CertificateType { get; } + /// Indicates the location of the certificates. + [WirePath("location")] + public string CertificateLocation { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs new file mode 100644 index 000000000000..b0d4a2d22b36 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs +namespace Azure.ResourceManager.CognitiveServices.Models +{ + public partial class DeploymentCapacitySettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ContainerRegistryTlsProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentCapacitySettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DesignatedCapacity)) + { + writer.WritePropertyName("designatedCapacity"u8); + writer.WriteNumberValue(DesignatedCapacity.Value); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryTlsProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Certificate)) + { + writer.WritePropertyName("certificate"u8); + writer.WriteObjectValue(Certificate, options); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + DeploymentCapacitySettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentCapacitySettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentCapacitySettings(document.RootElement, options); + } + + internal static DeploymentCapacitySettings DeserializeDeploymentCapacitySettings(JsonElement element, ModelReaderWriterOptions options = null) +======== + ContainerRegistryTlsProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryTlsProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryTlsProperties(document.RootElement, options); + } + + internal static ContainerRegistryTlsProperties DeserializeContainerRegistryTlsProperties(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + int? designatedCapacity = default; + int? priority = default; +======== + ContainerRegistryTlsStatus? status = default; + ContainerRegistryTlsCertificateProperties certificate = default; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + if (property.NameEquals("designatedCapacity"u8)) +======== + if (property.NameEquals("status"u8)) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + designatedCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("priority"u8)) +======== + status = new ContainerRegistryTlsStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("certificate"u8)) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + priority = property.Value.GetInt32(); +======== + certificate = ContainerRegistryTlsCertificateProperties.DeserializeContainerRegistryTlsCertificateProperties(property.Value, options); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + return new DeploymentCapacitySettings(designatedCapacity, priority, serializedAdditionalRawData); +======== + return new ContainerRegistryTlsProperties(status, certificate, serializedAdditionalRawData); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DesignatedCapacity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" designatedCapacity: "); +======== + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + builder.AppendLine(propertyOverride); + } + else + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + if (Optional.IsDefined(DesignatedCapacity)) + { + builder.Append(" designatedCapacity: "); + builder.AppendLine($"{DesignatedCapacity.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Priority), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" priority: "); +======== + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Certificate), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" certificate: "); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + builder.AppendLine(propertyOverride); + } + else + { +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + if (Optional.IsDefined(Priority)) + { + builder.Append(" priority: "); + builder.AppendLine($"{Priority.Value}"); +======== + if (Optional.IsDefined(Certificate)) + { + builder.Append(" certificate: "); + BicepSerializationHelpers.AppendChildObject(builder, Certificate, options, 2, false, " certificate: "); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + throw new FormatException($"The model {nameof(DeploymentCapacitySettings)} does not support writing '{options.Format}' format."); + } + } + + DeploymentCapacitySettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ContainerRegistryTlsProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryTlsProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/DeploymentCapacitySettings.Serialization.cs + return DeserializeDeploymentCapacitySettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentCapacitySettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeContainerRegistryTlsProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryTlsProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.Serialization.cs + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.cs new file mode 100644 index 000000000000..91a0423d8ce6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The TLS properties of the connected registry login server. + public partial class ContainerRegistryTlsProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerRegistryTlsProperties() + { + } + + /// Initializes a new instance of . + /// Indicates whether HTTPS is enabled for the login server. + /// The certificate used to configure HTTPS for the login server. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryTlsProperties(ContainerRegistryTlsStatus? status, ContainerRegistryTlsCertificateProperties certificate, IDictionary serializedAdditionalRawData) + { + Status = status; + Certificate = certificate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether HTTPS is enabled for the login server. + [WirePath("status")] + public ContainerRegistryTlsStatus? Status { get; } + /// The certificate used to configure HTTPS for the login server. + [WirePath("certificate")] + public ContainerRegistryTlsCertificateProperties Certificate { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsStatus.cs new file mode 100644 index 000000000000..2da0bfa8d8cb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryTlsStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Indicates whether HTTPS is enabled for the login server. + public readonly partial struct ContainerRegistryTlsStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerRegistryTlsStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static ContainerRegistryTlsStatus Enabled { get; } = new ContainerRegistryTlsStatus(EnabledValue); + /// Disabled. + public static ContainerRegistryTlsStatus Disabled { get; } = new ContainerRegistryTlsStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerRegistryTlsStatus left, ContainerRegistryTlsStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerRegistryTlsStatus left, ContainerRegistryTlsStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerRegistryTlsStatus(string value) => new ContainerRegistryTlsStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerRegistryTlsStatus other && Equals(other); + /// + public bool Equals(ContainerRegistryTlsStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs new file mode 100644 index 000000000000..4a3217a7f169 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class CredentialSetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CredentialSetListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CredentialSetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CredentialSetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCredentialSetListResult(document.RootElement, options); + } + + internal static CredentialSetListResult DeserializeCredentialSetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CredentialSetListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CredentialSetListResult)} does not support writing '{options.Format}' format."); + } + } + + CredentialSetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCredentialSetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CredentialSetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs new file mode 100644 index 000000000000..03ed1e859125 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list credential sets for a container registry. + internal partial class CredentialSetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CredentialSetListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list of credential sets. + /// The URI that can be used to request the next list of credential sets. + /// Keeps track of any properties unknown to the library. + internal CredentialSetListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list of credential sets. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of credential sets. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs new file mode 100644 index 000000000000..d067fac51976 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ExportPipelineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportPipelineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportPipelineListResult(document.RootElement, options); + } + + internal static ExportPipelineListResult DeserializeExportPipelineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportPipelineListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support writing '{options.Format}' format."); + } + } + + ExportPipelineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportPipelineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportPipelineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs new file mode 100644 index 000000000000..52e7335391f7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list export pipelines for a container registry. + internal partial class ExportPipelineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ExportPipelineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ExportPipelineListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs new file mode 100644 index 000000000000..fbe60fa7fa82 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ExportPipelineTargetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PipelineTargetType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PipelineTargetType); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportPipelineTargetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportPipelineTargetProperties(document.RootElement, options); + } + + internal static ExportPipelineTargetProperties DeserializeExportPipelineTargetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + Uri uri = default; + Uri keyVaultUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + keyVaultUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportPipelineTargetProperties(type, uri, keyVaultUri, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineTargetType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineTargetType)) + { + builder.Append(" type: "); + if (PipelineTargetType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PipelineTargetType}'''"); + } + else + { + builder.AppendLine($"'{PipelineTargetType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultUri)) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine($"'{KeyVaultUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support writing '{options.Format}' format."); + } + } + + ExportPipelineTargetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportPipelineTargetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportPipelineTargetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs new file mode 100644 index 000000000000..bd680e56624a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the export pipeline target. + public partial class ExportPipelineTargetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// They key vault secret uri to obtain the target storage SAS token. + /// is null. + public ExportPipelineTargetProperties(Uri keyVaultUri) + { + Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); + + KeyVaultUri = keyVaultUri; + } + + /// Initializes a new instance of . + /// The type of target for the export pipeline. + /// + /// The target uri of the export pipeline. + /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + /// + /// They key vault secret uri to obtain the target storage SAS token. + /// Keeps track of any properties unknown to the library. + internal ExportPipelineTargetProperties(string pipelineTargetType, Uri uri, Uri keyVaultUri, IDictionary serializedAdditionalRawData) + { + PipelineTargetType = pipelineTargetType; + Uri = uri; + KeyVaultUri = keyVaultUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportPipelineTargetProperties() + { + } + + /// The type of target for the export pipeline. + [WirePath("type")] + public string PipelineTargetType { get; set; } + /// + /// The target uri of the export pipeline. + /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + /// + [WirePath("uri")] + public Uri Uri { get; set; } + /// They key vault secret uri to obtain the target storage SAS token. + [WirePath("keyVaultUri")] + public Uri KeyVaultUri { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.Serialization.cs new file mode 100644 index 000000000000..0a38b8b5d721 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class GarbageCollectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GarbageCollectionProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Schedule)) + { + writer.WritePropertyName("schedule"u8); + writer.WriteStringValue(Schedule); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GarbageCollectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GarbageCollectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGarbageCollectionProperties(document.RootElement, options); + } + + internal static GarbageCollectionProperties DeserializeGarbageCollectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + string schedule = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("schedule"u8)) + { + schedule = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GarbageCollectionProperties(enabled, schedule, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Schedule), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" schedule: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Schedule)) + { + builder.Append(" schedule: "); + if (Schedule.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Schedule}'''"); + } + else + { + builder.AppendLine($"'{Schedule}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GarbageCollectionProperties)} does not support writing '{options.Format}' format."); + } + } + + GarbageCollectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGarbageCollectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GarbageCollectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.cs new file mode 100644 index 000000000000..89d5fb6d7e9e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/GarbageCollectionProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The garbage collection properties of the connected registry. + public partial class GarbageCollectionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GarbageCollectionProperties() + { + } + + /// Initializes a new instance of . + /// Indicates whether garbage collection is enabled for the connected registry. + /// The cron expression indicating the schedule that the connected registry will run garbage collection. + /// Keeps track of any properties unknown to the library. + internal GarbageCollectionProperties(bool? enabled, string schedule, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + Schedule = schedule; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether garbage collection is enabled for the connected registry. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// The cron expression indicating the schedule that the connected registry will run garbage collection. + [WirePath("schedule")] + public string Schedule { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs new file mode 100644 index 000000000000..93d3befe47ce --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class ImportPipelineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportPipelineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportPipelineListResult(document.RootElement, options); + } + + internal static ImportPipelineListResult DeserializeImportPipelineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportPipelineListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support writing '{options.Format}' format."); + } + } + + ImportPipelineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImportPipelineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportPipelineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs new file mode 100644 index 000000000000..99757c2ac8e4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list import pipelines for a container registry. + internal partial class ImportPipelineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ImportPipelineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal ImportPipelineListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs new file mode 100644 index 000000000000..76532b350f24 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class ImportPipelineSourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ContainerRegistryPipelineSourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ContainerRegistryPipelineSourceType.Value.ToString()); + } + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + writer.WritePropertyName("keyVaultUri"u8); + writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportPipelineSourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportPipelineSourceProperties(document.RootElement, options); + } + + internal static ImportPipelineSourceProperties DeserializeImportPipelineSourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryPipelineSourceType? type = default; + Uri uri = default; + Uri keyVaultUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ContainerRegistryPipelineSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keyVaultUri"u8)) + { + keyVaultUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportPipelineSourceProperties(type, uri, keyVaultUri, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerRegistryPipelineSourceType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerRegistryPipelineSourceType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{ContainerRegistryPipelineSourceType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultUri)) + { + builder.Append(" keyVaultUri: "); + builder.AppendLine($"'{KeyVaultUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ImportPipelineSourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImportPipelineSourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportPipelineSourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs new file mode 100644 index 000000000000..367a2daac168 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The properties of the import pipeline source. + public partial class ImportPipelineSourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// They key vault secret uri to obtain the source storage SAS token. + /// is null. + public ImportPipelineSourceProperties(Uri keyVaultUri) + { + Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); + + KeyVaultUri = keyVaultUri; + } + + /// Initializes a new instance of . + /// The type of source for the import pipeline. + /// + /// The source uri of the import pipeline. + /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + /// + /// They key vault secret uri to obtain the source storage SAS token. + /// Keeps track of any properties unknown to the library. + internal ImportPipelineSourceProperties(ContainerRegistryPipelineSourceType? containerRegistryPipelineSourceType, Uri uri, Uri keyVaultUri, IDictionary serializedAdditionalRawData) + { + ContainerRegistryPipelineSourceType = containerRegistryPipelineSourceType; + Uri = uri; + KeyVaultUri = keyVaultUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImportPipelineSourceProperties() + { + } + + /// The type of source for the import pipeline. + [WirePath("type")] + public ContainerRegistryPipelineSourceType? ContainerRegistryPipelineSourceType { get; set; } + /// + /// The source uri of the import pipeline. + /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + /// + [WirePath("uri")] + public Uri Uri { get; set; } + /// They key vault secret uri to obtain the source storage SAS token. + [WirePath("keyVaultUri")] + public Uri KeyVaultUri { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs new file mode 100644 index 000000000000..1bce26439e06 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineProgress : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineProgress)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Percentage)) + { + writer.WritePropertyName("percentage"u8); + writer.WriteStringValue(Percentage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineProgress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineProgress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineProgress(document.RootElement, options); + } + + internal static PipelineProgress DeserializePipelineProgress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string percentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("percentage"u8)) + { + percentage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineProgress(percentage, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Percentage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" percentage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Percentage)) + { + builder.Append(" percentage: "); + if (Percentage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Percentage}'''"); + } + else + { + builder.AppendLine($"'{Percentage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineProgress)} does not support writing '{options.Format}' format."); + } + } + + PipelineProgress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineProgress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineProgress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs new file mode 100644 index 000000000000..07374fac021a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The PipelineProgress. + internal partial class PipelineProgress + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineProgress() + { + } + + /// Initializes a new instance of . + /// The percentage complete of the copy operation. + /// Keeps track of any properties unknown to the library. + internal PipelineProgress(string percentage, IDictionary serializedAdditionalRawData) + { + Percentage = percentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The percentage complete of the copy operation. + [WirePath("percentage")] + public string Percentage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs new file mode 100644 index 000000000000..2f501a4c5871 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineRunListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineRunListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineRunListResult(document.RootElement, options); + } + + internal static PipelineRunListResult DeserializePipelineRunListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineRunListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support writing '{options.Format}' format."); + } + } + + PipelineRunListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineRunListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineRunListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs new file mode 100644 index 000000000000..5e7444729a6b --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list pipeline runs for a container registry. + internal partial class PipelineRunListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineRunListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. + /// The URI that can be used to request the next list of pipeline runs. + /// Keeps track of any properties unknown to the library. + internal PipelineRunListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of pipeline runs. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs new file mode 100644 index 000000000000..95e73c098570 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class PipelineRunResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsCollectionDefined(ImportedArtifacts)) + { + writer.WritePropertyName("importedArtifacts"u8); + writer.WriteStartArray(); + foreach (var item in ImportedArtifacts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Progress)) + { + writer.WritePropertyName("progress"u8); + writer.WriteObjectValue(Progress, options); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(FinishOn)) + { + writer.WritePropertyName("finishTime"u8); + writer.WriteStringValue(FinishOn.Value, "O"); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } + if (Optional.IsDefined(CatalogDigest)) + { + writer.WritePropertyName("catalogDigest"u8); + writer.WriteStringValue(CatalogDigest); + } + if (Optional.IsDefined(Trigger)) + { + writer.WritePropertyName("trigger"u8); + writer.WriteObjectValue(Trigger, options); + } + if (Optional.IsDefined(PipelineRunErrorMessage)) + { + writer.WritePropertyName("pipelineRunErrorMessage"u8); + writer.WriteStringValue(PipelineRunErrorMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineRunResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineRunResult(document.RootElement, options); + } + + internal static PipelineRunResult DeserializePipelineRunResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + IReadOnlyList importedArtifacts = default; + PipelineProgress progress = default; + DateTimeOffset? startTime = default; + DateTimeOffset? finishTime = default; + ImportPipelineSourceProperties source = default; + ExportPipelineTargetProperties target = default; + string catalogDigest = default; + PipelineTriggerDescriptor trigger = default; + string pipelineRunErrorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("importedArtifacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + importedArtifacts = array; + continue; + } + if (property.NameEquals("progress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + progress = PipelineProgress.DeserializePipelineProgress(property.Value, options); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("finishTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + finishTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property.Value, options); + continue; + } + if (property.NameEquals("catalogDigest"u8)) + { + catalogDigest = property.Value.GetString(); + continue; + } + if (property.NameEquals("trigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trigger = PipelineTriggerDescriptor.DeserializePipelineTriggerDescriptor(property.Value, options); + continue; + } + if (property.NameEquals("pipelineRunErrorMessage"u8)) + { + pipelineRunErrorMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineRunResult( + status, + importedArtifacts ?? new ChangeTrackingList(), + progress, + startTime, + finishTime, + source, + target, + catalogDigest, + trigger, + pipelineRunErrorMessage, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImportedArtifacts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" importedArtifacts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ImportedArtifacts)) + { + if (ImportedArtifacts.Any()) + { + builder.Append(" importedArtifacts: "); + builder.AppendLine("["); + foreach (var item in ImportedArtifacts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ProgressPercentage", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" progress: "); + builder.AppendLine("{"); + builder.Append(" percentage: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Progress)) + { + builder.Append(" progress: "); + BicepSerializationHelpers.AppendChildObject(builder, Progress, options, 2, false, " progress: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FinishOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" finishTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FinishOn)) + { + builder.Append(" finishTime: "); + var formattedDateTimeString = TypeFormatters.ToString(FinishOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + BicepSerializationHelpers.AppendChildObject(builder, Target, options, 2, false, " target: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CatalogDigest), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" catalogDigest: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CatalogDigest)) + { + builder.Append(" catalogDigest: "); + if (CatalogDigest.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CatalogDigest}'''"); + } + else + { + builder.AppendLine($"'{CatalogDigest}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerTimestamp", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" trigger: "); + builder.AppendLine("{"); + builder.AppendLine(" sourceTrigger: {"); + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Trigger)) + { + builder.Append(" trigger: "); + BicepSerializationHelpers.AppendChildObject(builder, Trigger, options, 2, false, " trigger: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PipelineRunErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pipelineRunErrorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PipelineRunErrorMessage)) + { + builder.Append(" pipelineRunErrorMessage: "); + if (PipelineRunErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PipelineRunErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{PipelineRunErrorMessage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support writing '{options.Format}' format."); + } + } + + PipelineRunResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineRunResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineRunResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs new file mode 100644 index 000000000000..ce39d76d06c9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The response properties returned for a pipeline run. + public partial class PipelineRunResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineRunResult() + { + ImportedArtifacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The current status of the pipeline run. + /// The artifacts imported in the pipeline run. + /// The current progress of the copy operation. + /// The time the pipeline run started. + /// The time the pipeline run finished. + /// The source of the pipeline run. + /// The target of the pipeline run. + /// The digest of the tar used to transfer the artifacts. + /// The trigger that caused the pipeline run. + /// The detailed error message for the pipeline run in the case of failure. + /// Keeps track of any properties unknown to the library. + internal PipelineRunResult(string status, IReadOnlyList importedArtifacts, PipelineProgress progress, DateTimeOffset? startOn, DateTimeOffset? finishOn, ImportPipelineSourceProperties source, ExportPipelineTargetProperties target, string catalogDigest, PipelineTriggerDescriptor trigger, string pipelineRunErrorMessage, IDictionary serializedAdditionalRawData) + { + Status = status; + ImportedArtifacts = importedArtifacts; + Progress = progress; + StartOn = startOn; + FinishOn = finishOn; + Source = source; + Target = target; + CatalogDigest = catalogDigest; + Trigger = trigger; + PipelineRunErrorMessage = pipelineRunErrorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The current status of the pipeline run. + [WirePath("status")] + public string Status { get; } + /// The artifacts imported in the pipeline run. + [WirePath("importedArtifacts")] + public IReadOnlyList ImportedArtifacts { get; } + /// The current progress of the copy operation. + internal PipelineProgress Progress { get; } + /// The percentage complete of the copy operation. + [WirePath("progress.percentage")] + public string ProgressPercentage + { + get => Progress?.Percentage; + } + + /// The time the pipeline run started. + [WirePath("startTime")] + public DateTimeOffset? StartOn { get; } + /// The time the pipeline run finished. + [WirePath("finishTime")] + public DateTimeOffset? FinishOn { get; } + /// The source of the pipeline run. + [WirePath("source")] + public ImportPipelineSourceProperties Source { get; } + /// The target of the pipeline run. + [WirePath("target")] + public ExportPipelineTargetProperties Target { get; } + /// The digest of the tar used to transfer the artifacts. + [WirePath("catalogDigest")] + public string CatalogDigest { get; } + /// The trigger that caused the pipeline run. + internal PipelineTriggerDescriptor Trigger { get; } + /// The timestamp when the source update happened. + [WirePath("trigger.sourceTrigger.timestamp")] + public DateTimeOffset? SourceTriggerTimestamp + { + get => Trigger?.SourceTriggerTimestamp; + } + + /// The detailed error message for the pipeline run in the case of failure. + [WirePath("pipelineRunErrorMessage")] + public string PipelineRunErrorMessage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs new file mode 100644 index 000000000000..4c2b7a4184e1 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineSourceTriggerDescriptor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineSourceTriggerDescriptor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineSourceTriggerDescriptor(document.RootElement, options); + } + + internal static PipelineSourceTriggerDescriptor DeserializePipelineSourceTriggerDescriptor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? timestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineSourceTriggerDescriptor(timestamp, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Timestamp)) + { + builder.Append(" timestamp: "); + var formattedDateTimeString = TypeFormatters.ToString(Timestamp.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support writing '{options.Format}' format."); + } + } + + PipelineSourceTriggerDescriptor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineSourceTriggerDescriptor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerDescriptor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs new file mode 100644 index 000000000000..a427b05b4b11 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The PipelineSourceTriggerDescriptor. + internal partial class PipelineSourceTriggerDescriptor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineSourceTriggerDescriptor() + { + } + + /// Initializes a new instance of . + /// The timestamp when the source update happened. + /// Keeps track of any properties unknown to the library. + internal PipelineSourceTriggerDescriptor(DateTimeOffset? timestamp, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The timestamp when the source update happened. + [WirePath("timestamp")] + public DateTimeOffset? Timestamp { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs new file mode 100644 index 000000000000..a4809286f599 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineSourceTriggerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineSourceTriggerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineSourceTriggerProperties(document.RootElement, options); + } + + internal static PipelineSourceTriggerProperties DeserializePipelineSourceTriggerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerRegistryTriggerStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = new ContainerRegistryTriggerStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineSourceTriggerProperties(status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support writing '{options.Format}' format."); + } + } + + PipelineSourceTriggerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineSourceTriggerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineSourceTriggerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs new file mode 100644 index 000000000000..4dd88b85bdeb --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The PipelineSourceTriggerProperties. + internal partial class PipelineSourceTriggerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The current status of the source trigger. + public PipelineSourceTriggerProperties(ContainerRegistryTriggerStatus status) + { + Status = status; + } + + /// Initializes a new instance of . + /// The current status of the source trigger. + /// Keeps track of any properties unknown to the library. + internal PipelineSourceTriggerProperties(ContainerRegistryTriggerStatus status, IDictionary serializedAdditionalRawData) + { + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineSourceTriggerProperties() + { + } + + /// The current status of the source trigger. + [WirePath("status")] + public ContainerRegistryTriggerStatus Status { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs new file mode 100644 index 000000000000..14e88d36c7b7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineTriggerDescriptor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceTrigger)) + { + writer.WritePropertyName("sourceTrigger"u8); + writer.WriteObjectValue(SourceTrigger, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineTriggerDescriptor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineTriggerDescriptor(document.RootElement, options); + } + + internal static PipelineTriggerDescriptor DeserializePipelineTriggerDescriptor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineSourceTriggerDescriptor sourceTrigger = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceTrigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceTrigger = PipelineSourceTriggerDescriptor.DeserializePipelineSourceTriggerDescriptor(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineTriggerDescriptor(sourceTrigger, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerTimestamp", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceTrigger: "); + builder.AppendLine("{"); + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceTrigger)) + { + builder.Append(" sourceTrigger: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceTrigger, options, 2, false, " sourceTrigger: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support writing '{options.Format}' format."); + } + } + + PipelineTriggerDescriptor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineTriggerDescriptor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineTriggerDescriptor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs new file mode 100644 index 000000000000..84361730efdd --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The PipelineTriggerDescriptor. + internal partial class PipelineTriggerDescriptor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PipelineTriggerDescriptor() + { + } + + /// Initializes a new instance of . + /// The source trigger that caused the pipeline run. + /// Keeps track of any properties unknown to the library. + internal PipelineTriggerDescriptor(PipelineSourceTriggerDescriptor sourceTrigger, IDictionary serializedAdditionalRawData) + { + SourceTrigger = sourceTrigger; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source trigger that caused the pipeline run. + internal PipelineSourceTriggerDescriptor SourceTrigger { get; } + /// The timestamp when the source update happened. + [WirePath("sourceTrigger.timestamp")] + public DateTimeOffset? SourceTriggerTimestamp + { + get => SourceTrigger?.Timestamp; + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs new file mode 100644 index 000000000000..8a52080cf7c0 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class PipelineTriggerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SourceTrigger)) + { + writer.WritePropertyName("sourceTrigger"u8); + writer.WriteObjectValue(SourceTrigger, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineTriggerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineTriggerProperties(document.RootElement, options); + } + + internal static PipelineTriggerProperties DeserializePipelineTriggerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineSourceTriggerProperties sourceTrigger = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceTrigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceTrigger = PipelineSourceTriggerProperties.DeserializePipelineSourceTriggerProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineTriggerProperties(sourceTrigger, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceTriggerStatus", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceTrigger: "); + builder.AppendLine("{"); + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceTrigger)) + { + builder.Append(" sourceTrigger: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceTrigger, options, 2, false, " sourceTrigger: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support writing '{options.Format}' format."); + } + } + + PipelineTriggerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineTriggerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineTriggerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs new file mode 100644 index 000000000000..7082f7ca60ea --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The PipelineTriggerProperties. + internal partial class PipelineTriggerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PipelineTriggerProperties() + { + } + + /// Initializes a new instance of . + /// The source trigger properties of the pipeline. + /// Keeps track of any properties unknown to the library. + internal PipelineTriggerProperties(PipelineSourceTriggerProperties sourceTrigger, IDictionary serializedAdditionalRawData) + { + SourceTrigger = sourceTrigger; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source trigger properties of the pipeline. + internal PipelineSourceTriggerProperties SourceTrigger { get; set; } + /// The current status of the source trigger. + [WirePath("sourceTrigger.status")] + public ContainerRegistryTriggerStatus? SourceTriggerStatus + { + get => SourceTrigger is null ? default(ContainerRegistryTriggerStatus?) : SourceTrigger.Status; + set + { + SourceTrigger = value.HasValue ? new PipelineSourceTriggerProperties(value.Value) : null; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs new file mode 100644 index 000000000000..080f2848ed61 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchiveVersionsRestOperations.cs @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ArchiveVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ArchiveVersionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ArchiveVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the archive version. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the archive version. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryArchiveVersionData.DeserializeContainerRegistryArchiveVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(archiveVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a archive version from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a archive version from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The name of the archive version resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, string archiveVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNullOrEmpty(archiveVersionName, nameof(archiveVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, archiveVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archive versions for the specified container registry, repository type and archive name. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArchiveVersionListResult.DeserializeArchiveVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs new file mode 100644 index 000000000000..de7125392ecf --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ArchivesRestOperations.cs @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ArchivesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ArchivesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ArchivesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archives for the specified container registry and package type. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archives for the specified container registry and package type. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, packageType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the archive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the archive. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryArchiveData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for creating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchiveData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a archive from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a archive from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/packages/", false); + uri.AppendPath(packageType, true); + uri.AppendPath("/archives/", false); + uri.AppendPath(archiveName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for updating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a archive for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The name of the archive resource. + /// The parameters for updating a archive. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string packageType, string archiveName, ContainerRegistryArchivePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + Argument.AssertNotNullOrEmpty(archiveName, nameof(archiveName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, packageType, archiveName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryArchiveData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryArchiveData.DeserializeContainerRegistryArchiveData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all archives for the specified container registry and package type. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all archives for the specified container registry and package type. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The type of the package resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string packageType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(packageType, nameof(packageType)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, packageType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArchiveListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArchiveListResult.DeserializeArchiveListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs new file mode 100644 index 000000000000..36e4cac8bac7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class CacheRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CacheRulesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public CacheRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all cache rule resources for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all cache rule resources for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified cache rule resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryCacheRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryCacheRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified cache rule resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryCacheRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryCacheRuleData.DeserializeContainerRegistryCacheRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryCacheRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRuleData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a cache rule for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a cache rule for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a cache rule resource from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a cache rule resource from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRulePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRulePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a cache rule for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a cache rule for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the cache rule. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, ContainerRegistryCacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all cache rule resources for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all cache rule resources for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs new file mode 100644 index 000000000000..09c34f18cd30 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs @@ -0,0 +1,721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ConnectedRegistriesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectedRegistriesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectedRegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all connected registries for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all connected registries for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the connected registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedRegistryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the connected registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedRegistryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a connected registry for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The parameters for creating a connectedRegistry. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a connected registry for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The parameters for creating a connectedRegistry. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a connected registry from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a connected registry from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a connected registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The parameters for updating a connectedRegistry. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a connected registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The parameters for updating a connectedRegistry. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeactivateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendPath("/deactivate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeactivateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/connectedRegistries/", false); + uri.AppendPath(connectedRegistryName, true); + uri.AppendPath("/deactivate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deactivates the connected registry instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeactivateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateDeactivateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deactivates the connected registry instance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the connected registry. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Deactivate(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); + + using var message = CreateDeactivateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all connected registries for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all connected registries for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs new file mode 100644 index 000000000000..8d160ef42e3e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs +using Azure.ResourceManager.PostgreSql.FlexibleServers.Models; + +namespace Azure.ResourceManager.PostgreSql.FlexibleServers +{ + internal partial class VirtualEndpointsRestOperations +======== +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class CredentialSetsRestOperations +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Initializes a new instance of VirtualEndpointsRestOperations. +======== + /// Initializes a new instance of CredentialSetsRestOperations. +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + public VirtualEndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourceData data) +======== + public CredentialSetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets", false); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourceData data) +======== + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all credential set resources for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all credential set resources for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified credential set resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryCredentialSetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryCredentialSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified credential set resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryCredentialSetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryCredentialSetData.DeserializeContainerRegistryCredentialSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryCredentialSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetData data) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Creates a new virtual endpoint for PostgreSQL flexible server. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The required parameters for creating or updating virtual endpoints. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName, data); +======== + /// Creates a credential set for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, data); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Creates a new virtual endpoint for PostgreSQL flexible server. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The required parameters for creating or updating virtual endpoints. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName, data); +======== + /// Creates a credential set for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, data); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourcePatch patch) +======== + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The required parameters for updating a server. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the normal virtual endpoint definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The required parameters for updating a server. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, VirtualEndpointResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName) +======== + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Deletes a virtual endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName); +======== + /// Deletes a credential set from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Deletes a virtual endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName); +======== + /// Deletes a credential set from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName) +======== + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetPatch patch) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; +======== + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints/", false); + uri.AppendPath(virtualEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); +======== + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + _userAgent.Apply(message); + return message; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Gets information about a virtual endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName); +======== + /// Updates a credential set for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, patch); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + { + VirtualEndpointResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualEndpointResourceData.DeserializeVirtualEndpointResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VirtualEndpointResourceData)null, message.Response); +======== + case 201: + return message.Response; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// Gets information about a virtual endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The name of the virtual endpoint. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string serverName, string virtualEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(virtualEndpointName, nameof(virtualEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, virtualEndpointName); +======== + /// Updates a credential set for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the credential set. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string registryName, string credentialSetName, ContainerRegistryCredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, patch); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + { + VirtualEndpointResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualEndpointResourceData.DeserializeVirtualEndpointResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VirtualEndpointResourceData)null, message.Response); +======== + case 201: + return message.Response; +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal RequestUriBuilder CreateListByServerRequestUri(string subscriptionId, string resourceGroupName, string serverName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByServerRequest(string subscriptionId, string resourceGroupName, string serverName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DBforPostgreSQL/flexibleServers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/virtualendpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the servers in a given resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByServerAsync(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualEndpointsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualEndpointsListResult.DeserializeVirtualEndpointsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the servers in a given resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByServer(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualEndpointsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualEndpointsListResult.DeserializeVirtualEndpointsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByServerNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string serverName) +======== + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + internal HttpMessage CreateListByServerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string serverName) +======== + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// List all the servers in a given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByServerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) +======== + /// Lists all credential set resources for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerNextPageRequest(nextLink, subscriptionId, resourceGroupName, serverName); +======== + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + VirtualEndpointsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualEndpointsListResult.DeserializeVirtualEndpointsListResult(document.RootElement); +======== + CredentialSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + /// List all the servers in a given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the server. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByServerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) +======== + /// Lists all credential set resources for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerNextPageRequest(nextLink, subscriptionId, resourceGroupName, serverName); +======== + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { +<<<<<<<< HEAD:sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/VirtualEndpointsRestOperations.cs + VirtualEndpointsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualEndpointsListResult.DeserializeVirtualEndpointsListResult(document.RootElement); +======== + CredentialSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); +>>>>>>>> main:sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs new file mode 100644 index 000000000000..968564334cc7 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ExportPipelinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExportPipelinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExportPipelinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all export pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all export pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the export pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryExportPipelineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryExportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the export pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryExportPipelineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryExportPipelineData.DeserializeContainerRegistryExportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryExportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an export pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an export pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The parameters for creating an export pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ContainerRegistryExportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/exportPipelines/", false); + uri.AppendPath(exportPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an export pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an export pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the export pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all export pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all export pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs new file mode 100644 index 000000000000..ad27d6768db9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class ImportPipelinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ImportPipelinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ImportPipelinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all import pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all import pipelines for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the import pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryImportPipelineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryImportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the import pipeline. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryImportPipelineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryImportPipelineData.DeserializeContainerRegistryImportPipelineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryImportPipelineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an import pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an import pipeline for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The parameters for creating an import pipeline. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ContainerRegistryImportPipelineData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/importPipelines/", false); + uri.AppendPath(importPipelineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an import pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an import pipeline from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the import pipeline. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all import pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all import pipelines for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportPipelineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs new file mode 100644 index 000000000000..6d6e645405ba --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class PipelineRunsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PipelineRunsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PipelineRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the pipeline runs for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the pipeline runs for the specified container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the detailed information for a given pipeline run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryPipelineRunData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the detailed information for a given pipeline run. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerRegistryPipelineRunData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a pipeline run for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a pipeline run for a container registry with the specified parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The parameters for creating a pipeline run. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/pipelineRuns/", false); + uri.AppendPath(pipelineRunName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a pipeline run from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a pipeline run from a container registry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The name of the pipeline run. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the pipeline runs for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the pipeline runs for the specified container registry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the container registry. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineRunListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index ff2db15b47af..ebe5fe1f490b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs index e3fd870a9257..0f5c1e0c4618 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -32,7 +32,7 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs index 224ab32759ad..348174cff45b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs index a69fd674783d..df47e492d542 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs @@ -32,7 +32,7 @@ public ScopeMapsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs index 461c42ab5a41..4fb09081c7fe 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs @@ -32,7 +32,7 @@ public TokensRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs index b0396eaee375..c1d90d1591bb 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs @@ -32,7 +32,7 @@ public WebhooksRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-12-01"; + _apiVersion = apiVersion ?? "2024-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs index 04cdb3f5be35..7311cc19bda0 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string scopeMapNa /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string scopeMapName, CancellationT /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string scopeMapName, Cance /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string scopeMapName, CancellationToken canc /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs index c942f4c1cd42..75fd7f73c09d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2022-12-01 + /// 2024-11-01-preview /// /// /// Resource diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md index 79c3700d7b67..00c48b64242b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md @@ -7,9 +7,8 @@ azure-arm: true csharp: true library-name: ContainerRegistry namespace: Azure.ResourceManager.ContainerRegistry -# default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/8a28143c7271d4496296ed47f70c3cb5a9981e57/specification/containerregistry/resource-manager/readme.md -tag: package-2022-12 +require: https://github.com/Azure/azure-rest-api-specs/blob/0a27976a58c16279e827bda36004d1b74b3d922a/specification/containerregistry/resource-manager/readme.md +#tag: package-2024-11-preview output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -18,11 +17,12 @@ sample-gen: skip-csproj: true modelerfour: flatten-payloads: false + lenient-model-deduplication: true use-model-reader-writer: true enable-bicep-serialization: true -# mgmt-debug: -# show-serialized-names: true +#mgmt-debug: +# show-serialized-names: true format-by-name-rules: 'tenantId': 'uuid' @@ -66,74 +66,83 @@ keep-plural-enums: - ContainerRegistryOS prepend-rp-prefix: - - KeyVaultProperties - - PlatformProperties - - TaskStepProperties - - Run - - RunPatch - - RunStatus - - RunType - - RunListResult - - Task - - TaskRun - - TaskPatch - - TaskStatus - - TaskListResult - - TaskRunListResult - - ProvisioningState - - Policies - - PolicyStatus - - Replication - - ReplicationPatch - - ReplicationListResult - - Webhook - - IPRule - AgentPool - - AgentPoolPatch + - AgentPoolListResult - AgentPoolQueueStatus - - NetworkRuleSet + - AgentProperties + - Archive + - ArchiveVersion + - AuthCredential + - BaseImageDependency + - BaseImageDependencyType + - BaseImageTrigger + - BaseImageTriggerType + - CacheRule + - CertificateType + - CredentialName + - CredentialHealth + - CredentialHealthStatus + - Credentials + - CredentialSet - DockerBuildStep - - TriggerProperties + - EncodedTaskStep - EncryptionStatus + - ExportPipeline - ExportPolicy - ExportPolicyStatus - FileTaskStep + - GenerateCredentialsResult - ImageDescriptor - ImageUpdateTrigger - ImportImageParameters - ImportMode + - ImportPipeline - ImportSource - ImportSourceCredentials + - IPRule + - KeyVaultProperties + - MetadataSearch + - NetworkRuleSet + - OverrideTaskStepProperties + - PasswordName + - PipelineOptions + - PipelineRun + - PipelineRunSourceProperties + - PipelineRunSourceType + - PipelineRunTargetProperties + - PipelineRunTargetType + - PipelineSourceType + - PlatformProperties + - Policies + - PolicyStatus + - ProvisioningState - PublicNetworkAccess + - QuarantinePolicy + - Replication + - ReplicationListResult - RetentionPolicy + - Run - RunGetLogResult + - RunListResult + - RunStatus + - RunType - SecretObject - SecretObjectType + - SoftDeletePolicy - SourceTrigger - SourceTriggerDescriptor - SourceTriggerEvent + - Task + - TaskListResult + - TaskRun + - TaskRunListResult + - TaskStatus + - TaskStepProperties - TimerTrigger - TimerTriggerDescriptor - - TriggerStatus - - TrustPolicy - - TrustPolicyType - - WebhookAction - - WebhookPatch - - WebhookStatus - - ZoneRedundancy - - PasswordName - - AgentPoolListResult - - AgentProperties - - EncodedTaskStep - - OverrideTaskStepProperties - - QuarantinePolicy - - UpdateTriggerPayloadType - - WebhookListResult - - BaseImageDependency - - BaseImageDependencyType - - BaseImageTrigger - - BaseImageTriggerType - - Credentials + - TlsCertificateProperties + - TlsProperties + - TlsStatus - Token - TokenCertificate - TokenCertificateName @@ -141,9 +150,16 @@ prepend-rp-prefix: - TokenPassword - TokenPasswordName - TokenStatus - - PipelineRun - - GenerateCredentialsResult - - SoftDeletePolicy + - TriggerProperties + - TriggerStatus + - TrustPolicy + - TrustPolicyType + - UpdateTriggerPayloadType + - Webhook + - WebhookAction + - WebhookListResult + - WebhookStatus + - ZoneRedundancy rename-mapping: OS: ContainerRegistryOS @@ -221,7 +237,6 @@ rename-mapping: ImageUpdateTrigger.id: -|uuid SourceTriggerDescriptor.id: -|uuid EventContent.id: -|uuid - Event.id: -|uuid EventInfo.id: -|uuid Request.id: -|uuid ActivationProperties: ConnectedRegistryActivation @@ -233,11 +248,11 @@ rename-mapping: LoggingProperties: ConnectedRegistryLogging StatusDetailProperties: ConnectedRegistryStatusDetail StatusDetailProperties.type: StatusDetailType + StatusDetailProperties.correlationId: -|uuid AuditLogStatus: ConnectedRegistryAuditLogStatus - CertificateType: TlsCertificateLocationType GenerateCredentialsParameters: ContainerRegistryGenerateCredentialsContent LogLevel: ConnectedRegistryLogLevel - PipelineRunRequest: PipelineRunContent + PipelineRunRequest: ConnectedRegistryPipelineRunContent PipelineRunResponse: PipelineRunResult ProgressProperties: PipelineProgress SyncProperties: ConnectedRegistrySyncProperties @@ -248,6 +263,8 @@ rename-mapping: TlsCertificateProperties.location: CertificateLocation TokenCredentialsProperties: ContainerRegistryTokenCredentials ImportSource.registryUri: RegistryAddress + AzureADAuthenticationAsArmPolicyStatus: AadAuthenticationAsArmPolicyStatus + PackageSourceType: ArchivePackageSourceType override-operation-name: Schedules_ScheduleRun: ScheduleRun diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/README.md b/sdk/contentsafety/Azure.AI.ContentSafety/README.md index 3d7f0a82bd56..7c3a04723a55 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/README.md +++ b/sdk/contentsafety/Azure.AI.ContentSafety/README.md @@ -424,5 +424,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [authenticate_with_microsoft_entra_id]: https://learn.microsoft.com/azure/ai-services/authentication?tabs=powershell#authenticate-with-microsoft-entra-id [text_severity_levels]: https://learn.microsoft.com/azure/ai-services/content-safety/concepts/harm-categories?tabs=definitions#text-content [image_severity_levels]: https://learn.microsoft.com/azure/ai-services/content-safety/concepts/harm-categories?tabs=definitions#image-content - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk//Azure.AI/README.png) diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/README.md b/sdk/core/Azure.Core.Expressions.DataFactory/README.md index 2618d178a185..fed667e8a6e9 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/README.md +++ b/sdk/core/Azure.Core.Expressions.DataFactory/README.md @@ -1,12 +1,12 @@ # Azure Core Expressions DataFactory shared client library for .NET -Azure.Core.Expressions.DataFactory provides classes that represent [Expressions](https://learn.microsoft.com/azure/data-factory/control-flow-expression-language-functions#expressions). +Azure.Core.Expressions.DataFactory provides classes that represent [Expressions](https://learn.microsoft.com/azure/data-factory/control-flow-expression-language-functions#expressions). ## Getting started -Typically, you will not need to install Azure.Core.Expressions.DataFactory; -it will be installed for you when you install one of the client libraries using it. -In case you want to install it explicitly (to implement your own client library, for example), +Typically, you will not need to install Azure.Core.Expressions.DataFactory; +it will be installed for you when you install one of the client libraries using it. +In case you want to install it explicitly (to implement your own client library, for example), you can find the NuGet package. ## Key concepts @@ -59,7 +59,7 @@ When a secure string is used, the value is return masked with '*' characters whe } ``` -A Key Vault Reference can be used to specify a Key Vault where the value of the property is stored. +A Key Vault Reference can be used to specify a Key Vault where the value of the property is stored. ### DataFactoryElement @@ -113,8 +113,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FAzure.Core%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src [package]: https://www.nuget.org/packages/Azure.Core/ [docs]: https://learn.microsoft.com/dotnet/api/azure.core diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index 1736c1c2ff76..d3f5456963f9 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.45.0-beta.1 (Unreleased) +## 1.46.0-beta.1 (Unreleased) ### Features Added @@ -14,6 +14,24 @@ ### Other Changes +## 1.45.0 (2025-02-11) + +### Acknowledgments + +Thank you to our developer community members who helped to make the Azure.Core library better with their contributions to this release: + +- Jero Bado _([GitHub](https://github.com/jerobado))_ + +### Features Added + +- Added `MexicoCentral` and `SpainCentral` locations to `AzureLocation` struct. This was a community contribution, courtesy of [jerobado](https://github.com/jerobado). ([#47862](https://github.com/Azure/azure-sdk-for-net/pull/47862)) + +### Bugs Fixed + +- Fixed an issue where `BearerTokenAuthenticationPolicy` throws `ArgumentOutOfRangeException` if the `ExpiresOn` property of the token is the default value. ([#47040](https://github.com/Azure/azure-sdk-for-net/pull/47040)) + +### Other Changes + - Use `BinaryData.Empty` for `PipelineResponse.Content` when HTTP message has no content. ## 1.44.1 (2024-10-09) diff --git a/sdk/core/Azure.Core/README.md b/sdk/core/Azure.Core/README.md index 9e5a17696dcb..3a4f58bec5d3 100644 --- a/sdk/core/Azure.Core/README.md +++ b/sdk/core/Azure.Core/README.md @@ -258,8 +258,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FAzure.Core%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src [package]: https://www.nuget.org/packages/Azure.Core/ [docs]: https://learn.microsoft.com/dotnet/api/azure.core diff --git a/sdk/core/Azure.Core/src/Azure.Core.csproj b/sdk/core/Azure.Core/src/Azure.Core.csproj index 98a0969eadd8..7e4e76a0c5b9 100644 --- a/sdk/core/Azure.Core/src/Azure.Core.csproj +++ b/sdk/core/Azure.Core/src/Azure.Core.csproj @@ -2,9 +2,9 @@ This is the implementation of the Azure Client Pipeline Microsoft Azure Client Pipeline - 1.45.0-beta.1 + 1.46.0-beta.1 - 1.44.1 + 1.45.0 Microsoft Azure Client Pipeline enable $(DefineConstants);AZURE_NULLABLE;HAS_INTERNALS_VISIBLE_CORE diff --git a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs index bfec3b23b5da..6fe5f5b55375 100644 --- a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs +++ b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs @@ -41,6 +41,8 @@ internal DiagnosticsOptions(DiagnosticsOptions? diagnosticsOptions) } else { + // These values are similar to the default values in System.ClientModel.Primitives.ClientLoggingOptions and both + // should be kept in sync. When updating, update the default values in both classes. LoggedHeaderNames = new List() { "x-ms-request-id", diff --git a/sdk/core/Microsoft.Azure.Core.NewtonsoftJson/README.md b/sdk/core/Microsoft.Azure.Core.NewtonsoftJson/README.md index 6f778d00c64a..85990126ee0a 100644 --- a/sdk/core/Microsoft.Azure.Core.NewtonsoftJson/README.md +++ b/sdk/core/Microsoft.Azure.Core.NewtonsoftJson/README.md @@ -117,8 +117,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FMicrosoft.Azure.Core.NewtonsoftJson%2FREADME.png) - [azure_core_package]: https://www.nuget.org/packages/Azure.Core/ [azure_digital_twins_core_package]: https://www.nuget.org/packages/Azure.DigitalTwins.Core [azure_search_documents_package]: https://www.nuget.org/packages/Azure.Search.Documents/ diff --git a/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md b/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md index ed34b1a623c3..652d6048243b 100644 --- a/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md +++ b/sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md @@ -89,8 +89,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FMicrosoft.Azure.Core.NewtonsoftJson%2FREADME.png) - [azure_search_documents_package]: https://www.nuget.org/packages/Azure.Search.Documents/ [azure_search_documents_readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/README.md [code_of_conduct]: https://opensource.microsoft.com/codeofconduct diff --git a/sdk/core/Microsoft.Azure.Core.Spatial/README.md b/sdk/core/Microsoft.Azure.Core.Spatial/README.md index 213b352363af..dc2124536422 100644 --- a/sdk/core/Microsoft.Azure.Core.Spatial/README.md +++ b/sdk/core/Microsoft.Azure.Core.Spatial/README.md @@ -89,8 +89,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FMicrosoft.Azure.Core.NewtonsoftJson%2FREADME.png) - [azure_search_documents_package]: https://www.nuget.org/packages/Azure.Search.Documents/ [azure_search_documents_readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/README.md [code_of_conduct]: https://opensource.microsoft.com/codeofconduct diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index c18beee0b217..d2c11a9c5fc2 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.4.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 1.3.0 (2025-02-11) + +### Other Changes + - Use `BinaryData.Empty` for `PipelineResponse.Content` when HTTP message has no content ([#46669](https://github.com/Azure/azure-sdk-for-net/pull/46669)). ## 1.2.1 (2024-10-09) diff --git a/sdk/core/System.ClientModel/README.md b/sdk/core/System.ClientModel/README.md index 09b64e2d18dc..8413efca842a 100644 --- a/sdk/core/System.ClientModel/README.md +++ b/sdk/core/System.ClientModel/README.md @@ -376,8 +376,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fcore%2FSytem.ClientModel%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/System.ClientModel/src [package]: https://www.nuget.org/packages/System.ClientModel [code_of_conduct]: https://opensource.microsoft.com/codeofconduct diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs index 675d7c513786..2cce8ba3d9f0 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs @@ -83,6 +83,19 @@ public enum ClientErrorBehaviors Default = 0, NoThrow = 1, } + public partial class ClientLoggingOptions + { + public ClientLoggingOptions() { } + public System.Collections.Generic.IList AllowedHeaderNames { get { throw null; } } + public System.Collections.Generic.IList AllowedQueryParameters { get { throw null; } } + public bool? EnableLogging { get { throw null; } set { } } + public bool? EnableMessageContentLogging { get { throw null; } set { } } + public bool? EnableMessageLogging { get { throw null; } set { } } + public Microsoft.Extensions.Logging.ILoggerFactory? LoggerFactory { get { throw null; } set { } } + public int? MessageContentSizeLimit { get { throw null; } set { } } + protected void AssertNotFrozen() { } + public virtual void Freeze() { } + } public sealed partial class ClientPipeline { internal ClientPipeline() { } @@ -95,6 +108,8 @@ public void Send(System.ClientModel.Primitives.PipelineMessage message) { } public partial class ClientPipelineOptions { public ClientPipelineOptions() { } + public System.ClientModel.Primitives.ClientLoggingOptions? ClientLoggingOptions { get { throw null; } set { } } + public System.ClientModel.Primitives.PipelinePolicy? MessageLoggingPolicy { get { throw null; } set { } } public System.TimeSpan? NetworkTimeout { get { throw null; } set { } } public System.ClientModel.Primitives.PipelinePolicy? RetryPolicy { get { throw null; } set { } } public System.ClientModel.Primitives.PipelineTransport? Transport { get { throw null; } set { } } @@ -105,6 +120,7 @@ public virtual void Freeze() { } public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy { public ClientRetryPolicy(int maxRetries = 3) { } + public ClientRetryPolicy(int maxRetries, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } } protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; } protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { } @@ -129,6 +145,7 @@ public partial class HttpClientPipelineTransport : System.ClientModel.Primitives { public HttpClientPipelineTransport() { } public HttpClientPipelineTransport(System.Net.Http.HttpClient client) { } + public HttpClientPipelineTransport(System.Net.Http.HttpClient? client, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.HttpClientPipelineTransport Shared { get { throw null; } } protected override System.ClientModel.Primitives.PipelineMessage CreateMessageCore() { throw null; } public void Dispose() { } @@ -158,6 +175,13 @@ public JsonModelConverter(System.ClientModel.Primitives.ModelReaderWriterOptions public override System.ClientModel.Primitives.IJsonModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } public override void Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.IJsonModel value, System.Text.Json.JsonSerializerOptions options) { } } + public partial class MessageLoggingPolicy : System.ClientModel.Primitives.PipelinePolicy + { + public MessageLoggingPolicy(System.ClientModel.Primitives.ClientLoggingOptions? options = null) { } + public static System.ClientModel.Primitives.MessageLoggingPolicy Default { get { throw null; } } + public sealed override void Process(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { } + public sealed override System.Threading.Tasks.ValueTask ProcessAsync(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { throw null; } + } public static partial class ModelReaderWriter { public static object? Read(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, System.ClientModel.Primitives.ModelReaderWriterOptions? options = null) { throw null; } @@ -279,6 +303,7 @@ protected PipelineResponseHeaders() { } public abstract partial class PipelineTransport : System.ClientModel.Primitives.PipelinePolicy { protected PipelineTransport() { } + protected PipelineTransport(bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public System.ClientModel.Primitives.PipelineMessage CreateMessage() { throw null; } protected abstract System.ClientModel.Primitives.PipelineMessage CreateMessageCore(); public void Process(System.ClientModel.Primitives.PipelineMessage message) { } diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.net8.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.net8.0.cs index 675d7c513786..2cce8ba3d9f0 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.net8.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.net8.0.cs @@ -83,6 +83,19 @@ public enum ClientErrorBehaviors Default = 0, NoThrow = 1, } + public partial class ClientLoggingOptions + { + public ClientLoggingOptions() { } + public System.Collections.Generic.IList AllowedHeaderNames { get { throw null; } } + public System.Collections.Generic.IList AllowedQueryParameters { get { throw null; } } + public bool? EnableLogging { get { throw null; } set { } } + public bool? EnableMessageContentLogging { get { throw null; } set { } } + public bool? EnableMessageLogging { get { throw null; } set { } } + public Microsoft.Extensions.Logging.ILoggerFactory? LoggerFactory { get { throw null; } set { } } + public int? MessageContentSizeLimit { get { throw null; } set { } } + protected void AssertNotFrozen() { } + public virtual void Freeze() { } + } public sealed partial class ClientPipeline { internal ClientPipeline() { } @@ -95,6 +108,8 @@ public void Send(System.ClientModel.Primitives.PipelineMessage message) { } public partial class ClientPipelineOptions { public ClientPipelineOptions() { } + public System.ClientModel.Primitives.ClientLoggingOptions? ClientLoggingOptions { get { throw null; } set { } } + public System.ClientModel.Primitives.PipelinePolicy? MessageLoggingPolicy { get { throw null; } set { } } public System.TimeSpan? NetworkTimeout { get { throw null; } set { } } public System.ClientModel.Primitives.PipelinePolicy? RetryPolicy { get { throw null; } set { } } public System.ClientModel.Primitives.PipelineTransport? Transport { get { throw null; } set { } } @@ -105,6 +120,7 @@ public virtual void Freeze() { } public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy { public ClientRetryPolicy(int maxRetries = 3) { } + public ClientRetryPolicy(int maxRetries, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } } protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; } protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { } @@ -129,6 +145,7 @@ public partial class HttpClientPipelineTransport : System.ClientModel.Primitives { public HttpClientPipelineTransport() { } public HttpClientPipelineTransport(System.Net.Http.HttpClient client) { } + public HttpClientPipelineTransport(System.Net.Http.HttpClient? client, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.HttpClientPipelineTransport Shared { get { throw null; } } protected override System.ClientModel.Primitives.PipelineMessage CreateMessageCore() { throw null; } public void Dispose() { } @@ -158,6 +175,13 @@ public JsonModelConverter(System.ClientModel.Primitives.ModelReaderWriterOptions public override System.ClientModel.Primitives.IJsonModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } public override void Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.IJsonModel value, System.Text.Json.JsonSerializerOptions options) { } } + public partial class MessageLoggingPolicy : System.ClientModel.Primitives.PipelinePolicy + { + public MessageLoggingPolicy(System.ClientModel.Primitives.ClientLoggingOptions? options = null) { } + public static System.ClientModel.Primitives.MessageLoggingPolicy Default { get { throw null; } } + public sealed override void Process(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { } + public sealed override System.Threading.Tasks.ValueTask ProcessAsync(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { throw null; } + } public static partial class ModelReaderWriter { public static object? Read(System.BinaryData data, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type returnType, System.ClientModel.Primitives.ModelReaderWriterOptions? options = null) { throw null; } @@ -279,6 +303,7 @@ protected PipelineResponseHeaders() { } public abstract partial class PipelineTransport : System.ClientModel.Primitives.PipelinePolicy { protected PipelineTransport() { } + protected PipelineTransport(bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public System.ClientModel.Primitives.PipelineMessage CreateMessage() { throw null; } protected abstract System.ClientModel.Primitives.PipelineMessage CreateMessageCore(); public void Process(System.ClientModel.Primitives.PipelineMessage message) { } diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs index ce85c5d8b83d..c26dae86758c 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs @@ -83,6 +83,19 @@ public enum ClientErrorBehaviors Default = 0, NoThrow = 1, } + public partial class ClientLoggingOptions + { + public ClientLoggingOptions() { } + public System.Collections.Generic.IList AllowedHeaderNames { get { throw null; } } + public System.Collections.Generic.IList AllowedQueryParameters { get { throw null; } } + public bool? EnableLogging { get { throw null; } set { } } + public bool? EnableMessageContentLogging { get { throw null; } set { } } + public bool? EnableMessageLogging { get { throw null; } set { } } + public Microsoft.Extensions.Logging.ILoggerFactory? LoggerFactory { get { throw null; } set { } } + public int? MessageContentSizeLimit { get { throw null; } set { } } + protected void AssertNotFrozen() { } + public virtual void Freeze() { } + } public sealed partial class ClientPipeline { internal ClientPipeline() { } @@ -95,6 +108,8 @@ public void Send(System.ClientModel.Primitives.PipelineMessage message) { } public partial class ClientPipelineOptions { public ClientPipelineOptions() { } + public System.ClientModel.Primitives.ClientLoggingOptions? ClientLoggingOptions { get { throw null; } set { } } + public System.ClientModel.Primitives.PipelinePolicy? MessageLoggingPolicy { get { throw null; } set { } } public System.TimeSpan? NetworkTimeout { get { throw null; } set { } } public System.ClientModel.Primitives.PipelinePolicy? RetryPolicy { get { throw null; } set { } } public System.ClientModel.Primitives.PipelineTransport? Transport { get { throw null; } set { } } @@ -105,6 +120,7 @@ public virtual void Freeze() { } public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy { public ClientRetryPolicy(int maxRetries = 3) { } + public ClientRetryPolicy(int maxRetries, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } } protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; } protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { } @@ -129,6 +145,7 @@ public partial class HttpClientPipelineTransport : System.ClientModel.Primitives { public HttpClientPipelineTransport() { } public HttpClientPipelineTransport(System.Net.Http.HttpClient client) { } + public HttpClientPipelineTransport(System.Net.Http.HttpClient? client, bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public static System.ClientModel.Primitives.HttpClientPipelineTransport Shared { get { throw null; } } protected override System.ClientModel.Primitives.PipelineMessage CreateMessageCore() { throw null; } public void Dispose() { } @@ -157,6 +174,13 @@ public JsonModelConverter(System.ClientModel.Primitives.ModelReaderWriterOptions public override System.ClientModel.Primitives.IJsonModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { throw null; } public override void Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.IJsonModel value, System.Text.Json.JsonSerializerOptions options) { } } + public partial class MessageLoggingPolicy : System.ClientModel.Primitives.PipelinePolicy + { + public MessageLoggingPolicy(System.ClientModel.Primitives.ClientLoggingOptions? options = null) { } + public static System.ClientModel.Primitives.MessageLoggingPolicy Default { get { throw null; } } + public sealed override void Process(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { } + public sealed override System.Threading.Tasks.ValueTask ProcessAsync(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { throw null; } + } public static partial class ModelReaderWriter { public static object? Read(System.BinaryData data, System.Type returnType, System.ClientModel.Primitives.ModelReaderWriterOptions? options = null) { throw null; } @@ -277,6 +301,7 @@ protected PipelineResponseHeaders() { } public abstract partial class PipelineTransport : System.ClientModel.Primitives.PipelinePolicy { protected PipelineTransport() { } + protected PipelineTransport(bool enableLogging, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory) { } public System.ClientModel.Primitives.PipelineMessage CreateMessage() { throw null; } protected abstract System.ClientModel.Primitives.PipelineMessage CreateMessageCore(); public void Process(System.ClientModel.Primitives.PipelineMessage message) { } diff --git a/sdk/core/System.ClientModel/samples/Logging.md b/sdk/core/System.ClientModel/samples/Logging.md new file mode 100644 index 000000000000..c36f2360b3cb --- /dev/null +++ b/sdk/core/System.ClientModel/samples/Logging.md @@ -0,0 +1,158 @@ +# System.ClientModel-based client logging samples + +## Introduction + +Clients built on `System.ClientModel` emit log messages by default. These log messages include information about HTTP message requests and responses, retries, exceptions thrown in the transport, and delays in receiving responses. + +Clients can be configured to completely disable logging, or enable additional log messages. + +By default, logs are written to Event Source. Clients can be configured to write logs to ILogger instead by providing an ILoggerFactory to the client in `ClientLoggingOptions`. + +## Using ILoggerFactory to capture logs + +Here is an example of how a client can be configured to use `ILogger`. Information about acquiring or defining an `ILoggerFactory` can be found in the documentation for [`Microsoft.Extensions.Logging`](https://learn.microsoft.com/dotnet/core/extensions/logging?tabs=command-line). + +This method of creating an `ILoggerFactory` is a trivial example and is only suitable for simple console apps. + +```C# Snippet:UseILoggerFactoryToCaptureLogs +using ILoggerFactory factory = LoggerFactory.Create(builder => +{ + builder.AddConsole().SetMinimumLevel(LogLevel.Information); +}); + +ClientLoggingOptions loggingOptions = new() +{ + LoggerFactory = factory +}; + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; + +// Create and use client as usual +``` + +Some sensitive headers and query parameters are not logged by default and are displayed as "REDACTED". To include them in logs add them to `ClientLoggingOptions.AllowedHeaderNames` or `ClientLoggingOptions.AllowedQueryParameters`. + +```C# Snippet:LoggingRedactedHeaderILogger +using ILoggerFactory factory = LoggerFactory.Create(builder => +{ + builder.AddConsole(); +}); + +ClientLoggingOptions loggingOptions = new() +{ + LoggerFactory = factory +}; +loggingOptions.AllowedHeaderNames.Add("Request-Id"); +loggingOptions.AllowedQueryParameters.Add("api-version"); + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` + +You can also disable redaction completely by adding a `"*"` to `ClientLoggingOptions.AllowedHeaderNames` or `ClientLoggingOptions.AllowedQueryParameters`. + +```C# Snippet:LoggingAllRedactedHeadersILogger +using ILoggerFactory factory = LoggerFactory.Create(builder => +{ + builder.AddConsole(); +}); + +ClientLoggingOptions loggingOptions = new() +{ + LoggerFactory = factory +}; +loggingOptions.AllowedHeaderNames.Add("*"); +loggingOptions.AllowedQueryParameters.Add("*"); + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` + +By default, only URI and header names are logged. To enable content logging, set the logging level to `LogLevel.Debug` and set the `ClientLoggingOptions.EnableMessageContentLogging` client option: + + +```C# Snippet:EnableContentLoggingILogger +using ILoggerFactory factory = LoggerFactory.Create(builder => +{ + builder.AddConsole().SetMinimumLevel(LogLevel.Debug); +}); + +ClientLoggingOptions loggingOptions = new() +{ + LoggerFactory = factory, + EnableMessageContentLogging = true +}; + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` + +## Using Event Source to capture logs + +If an `ILoggerFactory` is not provided to the client, and logging is enabled, logs will be written to Event Source. The name of the Event Source is "System.ClientModel". Event Source logs can be collected in a few ways, as described in the [Event Source documentation for collecting traces](https://learn.microsoft.com/dotnet/core/diagnostics/eventsource-collect-and-view-traces). + +This sample uses an Event Listener to collect logs. It uses the `ConsoleWriterEventListener` as defined in the [EventListener section](https://learn.microsoft.com/dotnet/core/diagnostics/eventsource-collect-and-view-traces#eventlistener) of the Event Source documentation above. + +```C# Snippet:UseEventSourceToCaptureLogs +// In order for an event listener to collect logs, it must be in scope and active +// while the client library is in use. If the listener is disposed or otherwise +// out of scope, logs cannot be collected. +using ConsoleWriterEventListener listener = new(); + +// Create and use client as usual +``` + +Some sensitive headers and query parameters are not logged by default and are displayed as "REDACTED". To include them in logs add them to `ClientLoggingOptions.AllowedHeaderNames` or `ClientLoggingOptions.AllowedQueryParameters`. + +```C# Snippet:LoggingRedactedHeaderEventSource +using ConsoleWriterEventListener listener = new(); + +ClientLoggingOptions loggingOptions = new(); +loggingOptions.AllowedHeaderNames.Add("Request-Id"); +loggingOptions.AllowedQueryParameters.Add("api-version"); + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` + +You can also disable redaction completely by adding a `"*"` to `ClientLoggingOptions.AllowedHeaderNames` or `ClientLoggingOptions.AllowedQueryParameters`. + +```C# Snippet:LoggingAllRedactedHeadersEventSource +using ConsoleWriterEventListener listener = new(); + +ClientLoggingOptions loggingOptions = new(); +loggingOptions.AllowedHeaderNames.Add("*"); +loggingOptions.AllowedQueryParameters.Add("*"); + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` + +By default only URI and headers are logged. To enable content logging, set the logging level to `EventLevel.Verbose` and set the `ClientLoggingOptions.EnableMessageContentLogging` client option: + +```C# Snippet:EnableContentLoggingEventSource +using ConsoleWriterEventListener listener = new(); + +ClientLoggingOptions loggingOptions = new() +{ + EnableMessageContentLogging = true +}; + +MapsClientOptions options = new() +{ + ClientLoggingOptions = loggingOptions +}; +``` diff --git a/sdk/core/System.ClientModel/src/Internal/ChangeTrackingStringList.cs b/sdk/core/System.ClientModel/src/Internal/ChangeTrackingStringList.cs new file mode 100644 index 000000000000..7bfbc246e7f9 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/ChangeTrackingStringList.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace System.ClientModel.Internal; + +internal class ChangeTrackingStringList : IList +{ + private IList _list; + private bool _frozen = false; + private bool _tracking = true; + + public ChangeTrackingStringList() + { + _list = []; + } + + public ChangeTrackingStringList(IEnumerable collection) + { + _list = new List(collection); + } + + public bool HasChanged { get; private set; } + + public void Freeze() + { + _frozen = true; + } + + public void AssertNotFrozen() + { + if (_frozen) + { + throw new InvalidOperationException("Cannot change any client pipeline options after the client pipeline has been created."); + } + } + + #region IList implementation + + public string this[int index] + { + get => _list[index]; + set + { + AssertNotFrozen(); + _list[index] = value; + + HasChanged |= _tracking; + } + } + + public int Count => _list.Count; + + public bool IsReadOnly => _list.IsReadOnly; + + public void Add(string item) + { + AssertNotFrozen(); + _list.Add(item); + + HasChanged |= _tracking; + } + + public void Clear() + { + AssertNotFrozen(); + int count = _list.Count; + + _list.Clear(); + + HasChanged |= _tracking && (count != 0); + } + + public bool Contains(string item) => _list.Contains(item); + + public void CopyTo(string[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); + + public IEnumerator GetEnumerator() => _list.GetEnumerator(); + + public int IndexOf(string item) => _list.IndexOf(item); + + public void Insert(int index, string item) + { + AssertNotFrozen(); + _list.Insert(index, item); + + HasChanged |= _tracking; + } + + public bool Remove(string item) + { + AssertNotFrozen(); + bool removed = _list.Remove(item); + + HasChanged |= _tracking && removed; + + return removed; + } + + public void RemoveAt(int index) + { + AssertNotFrozen(); + _list.RemoveAt(index); + + HasChanged |= _tracking; + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + #endregion +} diff --git a/sdk/core/System.ClientModel/src/Internal/ContentTypeUtilities.cs b/sdk/core/System.ClientModel/src/Internal/ContentTypeUtilities.cs new file mode 100644 index 000000000000..d2c3eef84a58 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/ContentTypeUtilities.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text; + +namespace System.ClientModel.Internal; + +internal class ContentTypeUtilities +{ + public static bool TryGetTextEncoding(string contentType, out Encoding? encoding) + { + const string charsetMarker = "; charset="; + const string utf8Charset = "utf-8"; + const string textContentTypePrefix = "text/"; + const string jsonSuffix = "json"; + const string appJsonPrefix = "application/json"; + const string xmlSuffix = "xml"; + const string urlEncodedSuffix = "-urlencoded"; + + // Default is technically US-ASCII, but will default to UTF-8 which is a superset. + const string appFormUrlEncoded = "application/x-www-form-urlencoded"; + + if (contentType == null) + { + encoding = null; + return false; + } + + var charsetIndex = contentType.IndexOf(charsetMarker, StringComparison.OrdinalIgnoreCase); + if (charsetIndex != -1) + { + ReadOnlySpan charset = contentType.AsSpan().Slice(charsetIndex + charsetMarker.Length); + if (charset.StartsWith(utf8Charset.AsSpan(), StringComparison.OrdinalIgnoreCase)) + { + encoding = Encoding.UTF8; + return true; + } + } + + if (contentType.StartsWith(textContentTypePrefix, StringComparison.OrdinalIgnoreCase) || + contentType.EndsWith(jsonSuffix, StringComparison.OrdinalIgnoreCase) || + contentType.EndsWith(xmlSuffix, StringComparison.OrdinalIgnoreCase) || + contentType.EndsWith(urlEncodedSuffix, StringComparison.OrdinalIgnoreCase) || + contentType.StartsWith(appJsonPrefix, StringComparison.OrdinalIgnoreCase) || + contentType.StartsWith(appFormUrlEncoded, StringComparison.OrdinalIgnoreCase)) + { + encoding = Encoding.UTF8; + return true; + } + + encoding = null; + return false; + } +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/ClientModelEventSource.cs b/sdk/core/System.ClientModel/src/Internal/Logging/ClientModelEventSource.cs new file mode 100644 index 000000000000..f84d5714f72b --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/ClientModelEventSource.cs @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Tracing; +using System.Text; + +namespace System.ClientModel.Internal; + +// The methods in this class should only ever be called from PipelineMessageLogger, PipelineRetryLogger, or PipelineTransportLogger +[EventSource(Name = "System.ClientModel")] +internal sealed class ClientModelEventSource : EventSource +{ + private ClientModelEventSource(string eventSourceName, string[]? traits = default) : base(eventSourceName, EventSourceSettings.Default, traits) { } + + public static ClientModelEventSource Log = new("System.ClientModel"); + + #region Request + + [NonEvent] + public void Request(string requestId, PipelineRequest request, string? clientAssembly, PipelineMessageSanitizer sanitizer) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + Request(requestId, request.Method, sanitizer.SanitizeUrl(request.Uri!.AbsoluteUri), FormatHeaders(request.Headers, sanitizer), clientAssembly); + } + } + + [Event(LoggingEventIds.RequestEvent, Level = EventLevel.Informational, Message = "Request [{0}] {1} {2}\r\n{3}client assembly: {4}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + private void Request(string? requestId, string method, string uri, string headers, string? clientAssembly) + { + WriteEvent(LoggingEventIds.RequestEvent, requestId, method, uri, headers, clientAssembly); + } + + [NonEvent] + public void RequestContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) + { + if (textEncoding != null) + { + RequestContentText(requestId, textEncoding.GetString(content)); + } + else + { + RequestContent(requestId, content); + } + } + } + + [Event(LoggingEventIds.RequestContentEvent, Level = EventLevel.Verbose, Message = "Request [{0}] content: {1}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with an array with primitive type elements.")] + private void RequestContent(string? requestId, byte[] content) + { + WriteEvent(LoggingEventIds.RequestContentEvent, requestId, content); + } + + [Event(LoggingEventIds.RequestContentTextEvent, Level = EventLevel.Verbose, Message = "Request [{0}] content: {1}")] + private void RequestContentText(string? requestId, string content) + { + WriteEvent(LoggingEventIds.RequestContentTextEvent, requestId, content); + } + + #endregion + + #region Response + + [NonEvent] + public void Response(string requestId, PipelineResponse response, double seconds, PipelineMessageSanitizer sanitizer) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + Response(requestId, response.Status, response.ReasonPhrase, FormatHeaders(response.Headers, sanitizer), seconds); + } + } + + [Event(LoggingEventIds.ResponseEvent, Level = EventLevel.Informational, Message = "Response [{0}] {1} {2} ({4:00.0}s)\r\n{3}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + private void Response(string? requestId, int status, string reasonPhrase, string headers, double seconds) + { + WriteEvent(LoggingEventIds.ResponseEvent, requestId, status, reasonPhrase, headers, seconds); + } + + [NonEvent] + public void ResponseContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) + { + if (textEncoding is not null) + { + ResponseContentText(requestId, textEncoding.GetString(content)); + } + else + { + ResponseContent(requestId, content); + } + } + } + + [Event(LoggingEventIds.ResponseContentEvent, Level = EventLevel.Verbose, Message = "Response [{0}] content: {1}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with an array with primitive type elements.")] + private void ResponseContent(string? requestId, byte[] content) + { + WriteEvent(LoggingEventIds.ResponseContentEvent, requestId, content); + } + + [Event(LoggingEventIds.ResponseContentTextEvent, Level = EventLevel.Verbose, Message = "Response [{0}] content: {1}")] + private void ResponseContentText(string? requestId, string content) + { + WriteEvent(LoggingEventIds.ResponseContentTextEvent, requestId, content); + } + + [NonEvent] + public void ResponseContentBlock(string requestId, int blockNumber, byte[] content, Encoding? textEncoding) + { + if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) + { + if (textEncoding is not null) + { + ResponseContentTextBlock(requestId, blockNumber, textEncoding.GetString(content)); + } + else + { + ResponseContentBlock(requestId, blockNumber, content); + } + } + } + + [Event(LoggingEventIds.ResponseContentBlockEvent, Level = EventLevel.Verbose, Message = "Response [{0}] content block {1}: {2}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with an array with primitive type elements.")] + private void ResponseContentBlock(string? requestId, int blockNumber, byte[] content) + { + WriteEvent(LoggingEventIds.ResponseContentBlockEvent, requestId, blockNumber, content); + } + + [Event(LoggingEventIds.ResponseContentTextBlockEvent, Level = EventLevel.Verbose, Message = "Response [{0}] content block {1}: {2}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + private void ResponseContentTextBlock(string? requestId, int blockNumber, string content) + { + WriteEvent(LoggingEventIds.ResponseContentTextBlockEvent, requestId, blockNumber, content); + } + + #endregion + + #region Error Response + + [NonEvent] + public void ErrorResponse(string requestId, PipelineResponse response, double elapsed, PipelineMessageSanitizer sanitizer) + { + if (IsEnabled(EventLevel.Warning, EventKeywords.None)) + { + ErrorResponse(requestId, response.Status, response.ReasonPhrase, FormatHeaders(response.Headers, sanitizer), elapsed); + } + } + + [Event(LoggingEventIds.ErrorResponseEvent, Level = EventLevel.Warning, Message = "Error response [{0}] {1} {2} ({4:00.0}s)\r\n{3}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + private void ErrorResponse(string? requestId, int status, string reasonPhrase, string headers, double seconds) + { + WriteEvent(LoggingEventIds.ErrorResponseEvent, requestId, status, reasonPhrase, headers, seconds); + } + + [NonEvent] + public void ErrorResponseContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + if (textEncoding is not null) + { + ErrorResponseContentText(requestId, textEncoding.GetString(content)); + } + else + { + ErrorResponseContent(requestId, content); + } + } + } + + [Event(LoggingEventIds.ErrorResponseContentEvent, Level = EventLevel.Informational, Message = "Error response [{0}] content: {1}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with an array with primitive type elements.")] + private void ErrorResponseContent(string? requestId, byte[] content) + { + WriteEvent(LoggingEventIds.ErrorResponseContentEvent, requestId, content); + } + + [Event(LoggingEventIds.ErrorResponseContentTextEvent, Level = EventLevel.Informational, Message = "Error response [{0}] content: {1}")] + private void ErrorResponseContentText(string? requestId, string content) + { + WriteEvent(LoggingEventIds.ErrorResponseContentTextEvent, requestId, content); + } + + [NonEvent] + public void ErrorResponseContentBlock(string requestId, int blockNumber, byte[] content, Encoding? textEncoding) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + if (textEncoding is not null) + { + ErrorResponseContentTextBlock(requestId, blockNumber, textEncoding.GetString(content)); + } + else + { + ErrorResponseContentBlock(requestId, blockNumber, content); + } + } + } + + [Event(LoggingEventIds.ErrorResponseContentBlockEvent, Level = EventLevel.Informational, Message = "Error response [{0}] content block {1}: {2}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with an array with primitive type elements.")] + private void ErrorResponseContentBlock(string? requestId, int blockNumber, byte[] content) + { + WriteEvent(LoggingEventIds.ErrorResponseContentBlockEvent, requestId, blockNumber, content); + } + + [Event(LoggingEventIds.ErrorResponseContentTextBlockEvent, Level = EventLevel.Informational, Message = "Error response [{0}] content block {1}: {2}")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + private void ErrorResponseContentTextBlock(string? requestId, int blockNumber, string content) + { + WriteEvent(LoggingEventIds.ErrorResponseContentTextBlockEvent, requestId, blockNumber, content); + } + + #endregion + + #region Retry + + [Event(LoggingEventIds.RequestRetryingEvent, Level = EventLevel.Informational, Message = "Request [{0}] attempt number {1} took {2:00.0}s")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + public void RequestRetrying(string? requestId, int retryNumber, double seconds) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + WriteEvent(LoggingEventIds.RequestRetryingEvent, requestId, retryNumber, seconds); + } + } + + #endregion + + #region Response Delay + + [Event(LoggingEventIds.ResponseDelayEvent, Level = EventLevel.Warning, Message = "Response [{0}] took {1:00.0}s")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "WriteEvent is used with primitive types.")] + public void ResponseDelay(string? requestId, double seconds) + { + if (IsEnabled(EventLevel.Warning, EventKeywords.None)) + { + WriteEvent(LoggingEventIds.ResponseDelayEvent, requestId, seconds); + } + } + + #endregion + + #region Exception Response + + [Event(LoggingEventIds.ExceptionResponseEvent, Level = EventLevel.Informational, Message = "Request [{0}] exception {1}")] + public void ExceptionResponse(string? requestId, string exception) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + WriteEvent(LoggingEventIds.ExceptionResponseEvent, requestId, exception); + } + } + + #endregion + + #region Helpers + + [NonEvent] + private string FormatHeaders(IEnumerable> headers, PipelineMessageSanitizer sanitizer) + { + var stringBuilder = new StringBuilder(); + foreach (var header in headers) + { + stringBuilder.Append(header.Key); + stringBuilder.Append(':'); + stringBuilder.Append(sanitizer.SanitizeHeader(header.Key, header.Value)); + stringBuilder.Append(Environment.NewLine); + } + return stringBuilder.ToString(); + } + + #endregion +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/LoggingEventIds.cs b/sdk/core/System.ClientModel/src/Internal/Logging/LoggingEventIds.cs new file mode 100644 index 000000000000..f121ba4af494 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/LoggingEventIds.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace System.ClientModel.Internal; + +internal class LoggingEventIds +{ + public const int RequestEvent = 1; + public const int RequestContentEvent = 2; + public const int ResponseEvent = 5; + public const int ResponseContentEvent = 6; + public const int ResponseDelayEvent = 7; + public const int ErrorResponseEvent = 8; + public const int ErrorResponseContentEvent = 9; + public const int RequestRetryingEvent = 10; + public const int ResponseContentBlockEvent = 11; + public const int ErrorResponseContentBlockEvent = 12; + public const int ResponseContentTextEvent = 13; + public const int ErrorResponseContentTextEvent = 14; + public const int ResponseContentTextBlockEvent = 15; + public const int ErrorResponseContentTextBlockEvent = 16; + public const int RequestContentTextEvent = 17; + public const int ExceptionResponseEvent = 18; +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageHeadersLogValue.cs b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageHeadersLogValue.cs new file mode 100644 index 000000000000..8f7df0ece01c --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageHeadersLogValue.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.Text; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; + +namespace System.ClientModel.Internal; + +internal class PipelineMessageHeadersLogValue : IReadOnlyList> +{ + private readonly PipelineRequestHeaders? _requestHeaders; + private readonly PipelineResponseHeaders? _responseHeaders; + private readonly PipelineMessageSanitizer _sanitizer; + + private List>? _values; + private string? _formatted; + + public PipelineMessageHeadersLogValue(PipelineRequestHeaders headers, PipelineMessageSanitizer sanitizer) + { + _sanitizer = sanitizer; + _requestHeaders = headers; + } + + public PipelineMessageHeadersLogValue(PipelineResponseHeaders headers, PipelineMessageSanitizer sanitizer) + { + _sanitizer = sanitizer; + _responseHeaders = headers; + } + + private List> Values + { + get + { + if (_values == null) + { + var values = new List>(); + + if (_requestHeaders != null) + { + foreach (KeyValuePair kvp in _requestHeaders) + { + values.Add(new KeyValuePair(kvp.Key, _sanitizer.SanitizeHeader(kvp.Key, kvp.Value))); + } + } + else if (_responseHeaders != null) + { + foreach (KeyValuePair kvp in _responseHeaders) + { + values.Add(new KeyValuePair(kvp.Key, _sanitizer.SanitizeHeader(kvp.Key, kvp.Value))); + } + } + + _values = values; + } + + return _values; + } + } + + public KeyValuePair this[int index] + { + get + { + if (index < 0 || index >= Count) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + return Values[index]; + } + } + + public int Count => Values.Count; + + public IEnumerator> GetEnumerator() + { + return Values.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return Values.GetEnumerator(); + } + + public override string ToString() + { + if (_formatted == null) + { + var builder = new StringBuilder(); + + foreach (KeyValuePair header in Values) + { + builder.Append(header.Key); + builder.Append(':'); + builder.Append(_sanitizer.SanitizeHeader(header.Key, header.Value)); + builder.Append(Environment.NewLine); + } + + _formatted = builder.ToString(); + } + + return _formatted; + } +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageLogger.cs b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageLogger.cs new file mode 100644 index 000000000000..da86c233b907 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageLogger.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.Text; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; + +namespace System.ClientModel.Internal; + +internal partial class PipelineMessageLogger +{ + private readonly ILogger? _logger; + private readonly PipelineMessageSanitizer _sanitizer; + + public PipelineMessageLogger(PipelineMessageSanitizer sanitizer, ILoggerFactory? loggerFactory) + { + _sanitizer = sanitizer; + _logger = loggerFactory?.CreateLogger() ?? null; + } + + /// + /// Whether the given log level or event level is enabled, depending + /// on whether this handler logs to ILogger or Event Source. Should be + /// used to guard expensive operations. + /// + /// The LogLevel to log to for ILogger. If an ILogger WAS NOT provided to the constructor, this value will be ignored. + /// The EventLevel to log to for EventSource. If an ILogger WAS provided to the constructor, this value will be ignored. + public bool IsEnabled(LogLevel logLevel, EventLevel eventLevel) + { + return _logger is not null ? _logger.IsEnabled(logLevel) : ClientModelEventSource.Log.IsEnabled(eventLevel, EventKeywords.None); + } + + #region Request + + public void LogRequest(string requestId, PipelineRequest request, string? clientAssembly) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Information)) + { + Request(_logger, requestId, request.Method, _sanitizer.SanitizeUrl(request.Uri!.AbsoluteUri), new PipelineMessageHeadersLogValue(request.Headers, _sanitizer), clientAssembly); + } + } + else + { + ClientModelEventSource.Log.Request(requestId, request, clientAssembly, _sanitizer); + } + } + + [LoggerMessage(LoggingEventIds.RequestEvent, LogLevel.Information, "Request [{requestId}] {method} {uri}\r\n{headers}client assembly: {clientAssembly}", SkipEnabledCheck = true, EventName = "Request")] + private static partial void Request(ILogger logger, string requestId, string method, string uri, PipelineMessageHeadersLogValue headers, string? clientAssembly); + + public void LogRequestContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Debug)) + { + if (textEncoding != null) + { + RequestContentText(_logger, requestId, textEncoding.GetString(content)); + } + else + { + RequestContent(_logger, requestId, content); + } + } + } + else + { + ClientModelEventSource.Log.RequestContent(requestId, content, textEncoding); + } + } + + [LoggerMessage(LoggingEventIds.RequestContentEvent, LogLevel.Debug, "Request [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "RequestContent")] + private static partial void RequestContent(ILogger logger, string requestId, byte[] content); + + [LoggerMessage(LoggingEventIds.RequestContentTextEvent, LogLevel.Debug, "Request [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "RequestContentText")] + private static partial void RequestContentText(ILogger logger, string requestId, string content); + + #endregion + + #region Response + + public void LogResponse(string requestId, PipelineResponse response, double seconds) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Information)) + { + Response(_logger, requestId, response.Status, response.ReasonPhrase, new PipelineMessageHeadersLogValue(response.Headers, _sanitizer), seconds); + } + } + else + { + ClientModelEventSource.Log.Response(requestId, response, seconds, _sanitizer); + } + } + + [LoggerMessage(LoggingEventIds.ResponseEvent, LogLevel.Information, "Response [{requestId}] {status} {reasonPhrase} ({seconds:00.0}s)\r\n{headers}", SkipEnabledCheck = true, EventName = "Response")] + private static partial void Response(ILogger logger, string requestId, int status, string reasonPhrase, PipelineMessageHeadersLogValue headers, double seconds); + + public void LogResponseContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Debug)) + { + if (textEncoding != null) + { + ResponseContentText(_logger, requestId, textEncoding.GetString(content)); + } + else + { + ResponseContent(_logger, requestId, content); + } + } + } + else + { + ClientModelEventSource.Log.ResponseContent(requestId, content, textEncoding); + } + } + + [LoggerMessage(LoggingEventIds.ResponseContentEvent, LogLevel.Debug, "Response [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "ResponseContent")] + private static partial void ResponseContent(ILogger logger, string requestId, byte[] content); + + [LoggerMessage(LoggingEventIds.ResponseContentTextEvent, LogLevel.Debug, "Response [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "ResponseContentText")] + private static partial void ResponseContentText(ILogger logger, string requestId, string content); + + public void LogResponseContentBlock(string requestId, int blockNumber, byte[] content, Encoding? textEncoding) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Debug)) + { + if (textEncoding != null) + { + ResponseContentTextBlock(_logger, requestId, blockNumber, textEncoding.GetString(content)); + } + else + { + ResponseContentBlock(_logger, requestId, blockNumber, content); + } + } + } + else + { + ClientModelEventSource.Log.ResponseContentBlock(requestId, blockNumber, content, textEncoding); + } + } + + [LoggerMessage(LoggingEventIds.ResponseContentBlockEvent, LogLevel.Debug, "Response [{requestId}] content block {blockNumber}: {content}", SkipEnabledCheck = true, EventName = "ResponseContentBlock")] + private static partial void ResponseContentBlock(ILogger logger, string requestId, int blockNumber, byte[] content); + + [LoggerMessage(LoggingEventIds.ResponseContentTextBlockEvent, LogLevel.Debug, "Response [{requestId}] content block {blockNumber}: {content}", SkipEnabledCheck = true, EventName = "ResponseContentTextBlock")] + private static partial void ResponseContentTextBlock(ILogger logger, string requestId, int blockNumber, string content); + + #endregion + + #region Error Response + + public void LogErrorResponse(string requestId, PipelineResponse response, double seconds) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Warning)) + { + ErrorResponse(_logger, requestId, response.Status, response.ReasonPhrase, new PipelineMessageHeadersLogValue(response.Headers, _sanitizer), seconds); + } + } + else + { + ClientModelEventSource.Log.ErrorResponse(requestId, response, seconds, _sanitizer); + } + } + + [LoggerMessage(LoggingEventIds.ErrorResponseEvent, LogLevel.Warning, "Error response [{requestId}] {status} {reasonPhrase} ({seconds:00.0}s)\r\n{headers}", SkipEnabledCheck = true, EventName = "ErrorResponse")] + private static partial void ErrorResponse(ILogger logger, string requestId, int status, string reasonPhrase, PipelineMessageHeadersLogValue headers, double seconds); + + public void LogErrorResponseContent(string requestId, byte[] content, Encoding? textEncoding) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Information)) + { + if (textEncoding != null) + { + ErrorResponseContentText(_logger, requestId, textEncoding.GetString(content)); + } + else + { + ErrorResponseContent(_logger, requestId, content); + } + } + } + else + { + ClientModelEventSource.Log.ErrorResponseContent(requestId, content, textEncoding); + } + } + + [LoggerMessage(LoggingEventIds.ErrorResponseContentEvent, LogLevel.Information, "Error response [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "ErrorResponseContent")] + private static partial void ErrorResponseContent(ILogger logger, string requestId, byte[] content); + + [LoggerMessage(LoggingEventIds.ErrorResponseContentTextEvent, LogLevel.Information, "Error response [{requestId}] content: {content}", SkipEnabledCheck = true, EventName = "ErrorResponseContentText")] + private static partial void ErrorResponseContentText(ILogger logger, string requestId, string content); + + public void LogErrorResponseContentBlock(string requestId, int blockNumber, byte[] content, Encoding? textEncoding) + { + if (_logger is not null) + { + if (_logger.IsEnabled(LogLevel.Information)) + { + if (textEncoding != null) + { + ErrorResponseContentTextBlock(_logger, requestId, blockNumber, textEncoding.GetString(content)); + } + else + { + ErrorResponseContentBlock(_logger, requestId, blockNumber, content); + } + } + } + else + { + ClientModelEventSource.Log.ErrorResponseContentBlock(requestId, blockNumber, content, textEncoding); + } + } + + [LoggerMessage(LoggingEventIds.ErrorResponseContentBlockEvent, LogLevel.Information, "Error response [{requestId}] content block {blockNumber}: {content}", SkipEnabledCheck = true, EventName = "ErrorResponseContentBlock")] + private static partial void ErrorResponseContentBlock(ILogger logger, string requestId, int blockNumber, byte[] content); + + [LoggerMessage(LoggingEventIds.ErrorResponseContentTextBlockEvent, LogLevel.Information, "Error response [{requestId}] content block {blockNumber}: {content}", SkipEnabledCheck = true, EventName = "ErrorResponseContentTextBlock")] + private static partial void ErrorResponseContentTextBlock(ILogger logger, string requestId, int blockNumber, string content); + + #endregion +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageSanitizer.cs b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageSanitizer.cs new file mode 100644 index 000000000000..606c7e670de9 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineMessageSanitizer.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.ClientModel.Internal; + +internal class PipelineMessageSanitizer +{ + private const string LogAllValue = "*"; + private readonly bool _logAllHeaders; + private readonly bool _logFullQueries; + private readonly string _redactedPlaceholder; + + [ThreadStatic] + private static StringBuilder? s_cachedStringBuilder; + private const int MaxCachedStringBuilderCapacity = 1024; + + internal readonly HashSet _allowedQueryParameters; //internal for testing + internal readonly HashSet _allowedHeaders; + + public PipelineMessageSanitizer(HashSet allowedQueryParameters, HashSet allowedHeaders, string redactedPlaceholder = "REDACTED") + { + _logAllHeaders = allowedHeaders.Contains(LogAllValue); + _logFullQueries = allowedQueryParameters.Contains(LogAllValue); + + _allowedQueryParameters = allowedQueryParameters; + _redactedPlaceholder = redactedPlaceholder; + _allowedHeaders = allowedHeaders; + } + + public string SanitizeHeader(string name, string value) + { + if (_logAllHeaders || _allowedHeaders.Contains(name)) + { + return value; + } + + return _redactedPlaceholder; + } + + public bool ShouldSanitizeHeaderValue(string name) + { + if (_logAllHeaders || _allowedHeaders.Contains(name)) + { + return false; + } + + return true; + } + + public string SanitizeUrl(string url) + { + if (_logFullQueries) + { + return url; + } + +#if NET6_0_OR_GREATER + int indexOfQuerySeparator = url.IndexOf('?', StringComparison.Ordinal); +#else + int indexOfQuerySeparator = url.IndexOf('?'); +#endif + + if (indexOfQuerySeparator == -1) + { + return url; + } + + // PERF: Avoid allocations in this heavily-used method: + // 1. Use ReadOnlySpan to avoid creating substrings. + // 2. Defer creating a StringBuilder until absolutely necessary. + // 3. Use a rented StringBuilder to avoid allocating a new one + // each time. + + // Create the StringBuilder only when necessary (when we encounter + // a query parameter that needs to be redacted) + StringBuilder? stringBuilder = null; + + // Keeps track of the number of characters we've processed so far + // so that, if we need to create a StringBuilder, we know how many + // characters to copy over from the original URL. + int lengthSoFar = indexOfQuerySeparator + 1; + + ReadOnlySpan query = url.AsSpan(indexOfQuerySeparator + 1); // +1 to skip the '?' + + while (query.Length > 0) + { + int endOfParameterValue = query.IndexOf('&'); + int endOfParameterName = query.IndexOf('='); + bool noValue = false; + + // Check if we have parameter without value + if ((endOfParameterValue == -1 && endOfParameterName == -1) || + (endOfParameterValue != -1 && (endOfParameterName == -1 || endOfParameterName > endOfParameterValue))) + { + endOfParameterName = endOfParameterValue; + noValue = true; + } + + if (endOfParameterName == -1) + { + endOfParameterName = query.Length; + } + + if (endOfParameterValue == -1) + { + endOfParameterValue = query.Length; + } + else + { + // include the separator + endOfParameterValue++; + } + + ReadOnlySpan parameterName = query.Slice(0, endOfParameterName); + + bool isAllowed = false; + foreach (string name in _allowedQueryParameters) + { + if (parameterName.Equals(name.AsSpan(), StringComparison.OrdinalIgnoreCase)) + { + isAllowed = true; + break; + } + } + + int valueLength = endOfParameterValue; + int nameLength = endOfParameterName; + + if (isAllowed || noValue) + { + if (stringBuilder is null) + { + lengthSoFar += valueLength; + } + else + { + AppendReadOnlySpan(stringBuilder, query.Slice(0, valueLength)); + } + } + else + { + // Encountered a query value that needs to be redacted. + // Create the StringBuilder if we haven't already. + stringBuilder ??= RentStringBuilder(url.Length).Append(url, 0, lengthSoFar); + + AppendReadOnlySpan(stringBuilder, query.Slice(0, nameLength)) + .Append('=') + .Append(_redactedPlaceholder); + + if (query[endOfParameterValue - 1] == '&') + { + stringBuilder.Append('&'); + } + } + + query = query.Slice(valueLength); + } + + return stringBuilder is null ? url : ToStringAndReturnStringBuilder(stringBuilder); + + static StringBuilder AppendReadOnlySpan(StringBuilder builder, ReadOnlySpan span) + { +#if NET6_0_OR_GREATER + return builder.Append(span); +#else + foreach (char c in span) + { + builder.Append(c); + } + + return builder; +#endif + } + } + + private static StringBuilder RentStringBuilder(int capacity) + { + if (capacity <= MaxCachedStringBuilderCapacity) + { + StringBuilder? builder = s_cachedStringBuilder; + if (builder is not null && builder.Capacity >= capacity) + { + s_cachedStringBuilder = null; + return builder; + } + } + + return new StringBuilder(capacity); + } + + private static string ToStringAndReturnStringBuilder(StringBuilder builder) + { + string result = builder.ToString(); + if (builder.Capacity <= MaxCachedStringBuilderCapacity) + { + s_cachedStringBuilder = builder.Clear(); + } + + return result; + } +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/PipelineRetryLogger.cs b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineRetryLogger.cs new file mode 100644 index 000000000000..86e1b6160e64 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineRetryLogger.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using Microsoft.Extensions.Logging; + +namespace System.ClientModel.Internal; + +internal partial class PipelineRetryLogger +{ + private readonly ILogger? _logger; + + public PipelineRetryLogger(ILoggerFactory? loggerFactory) + { + _logger = loggerFactory?.CreateLogger() ?? null; + } + + public void LogRequestRetrying(string? requestId, int retryNumber, double seconds) + { + if (_logger is not null) + { + RequestRetrying(_logger, requestId, retryNumber, seconds); + } + else + { + ClientModelEventSource.Log.RequestRetrying(requestId, retryNumber, seconds); + } + } + + [LoggerMessage(LoggingEventIds.RequestRetryingEvent, LogLevel.Information, "Request [{requestId}] attempt number {retryNumber} took {seconds:00.0}s", EventName = "RequestRetrying")] + private static partial void RequestRetrying(ILogger logger, string? requestId, int retryNumber, double seconds); +} diff --git a/sdk/core/System.ClientModel/src/Internal/Logging/PipelineTransportLogger.cs b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineTransportLogger.cs new file mode 100644 index 000000000000..dea86edb50be --- /dev/null +++ b/sdk/core/System.ClientModel/src/Internal/Logging/PipelineTransportLogger.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics.Tracing; +using Microsoft.Extensions.Logging; + +namespace System.ClientModel.Internal; + +internal partial class PipelineTransportLogger +{ + private readonly ILogger? _logger; + + public PipelineTransportLogger(ILoggerFactory? loggerFactory) + { + _logger = loggerFactory?.CreateLogger() ?? null; + } + + #region Delay Response + + public void LogResponseDelay(string requestId, double seconds) + { + if (_logger is not null) + { + ResponseDelay(_logger, requestId, seconds); + } + else + { + ClientModelEventSource.Log.ResponseDelay(requestId, seconds); + } + } + + [LoggerMessage(LoggingEventIds.ResponseDelayEvent, LogLevel.Warning, "Response [{requestId}] took {seconds:00.0}s", EventName = "ResponseDelay")] + private static partial void ResponseDelay(ILogger logger, string requestId, double seconds); + + #endregion + + #region Exception Response + + public void LogExceptionResponse(string requestId, Exception exception) + { + if (_logger is not null) + { + ExceptionResponse(_logger, requestId, exception); + } + else if (ClientModelEventSource.Log.IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + ClientModelEventSource.Log.ExceptionResponse(requestId, exception.ToString()); + } + } + + [LoggerMessage(LoggingEventIds.ExceptionResponseEvent, LogLevel.Information, "Request [{requestId}] exception occurred.", EventName = "ExceptionResponse")] + private static partial void ExceptionResponse(ILogger logger, string requestId, Exception exception); + + #endregion +} diff --git a/sdk/core/System.ClientModel/src/Message/PipelineRequest.cs b/sdk/core/System.ClientModel/src/Message/PipelineRequest.cs index eaf15c1bfc05..771c42ec855e 100644 --- a/sdk/core/System.ClientModel/src/Message/PipelineRequest.cs +++ b/sdk/core/System.ClientModel/src/Message/PipelineRequest.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Diagnostics; + namespace System.ClientModel.Primitives; /// @@ -68,6 +70,11 @@ public BinaryContent? Content /// protected abstract BinaryContent? ContentCore { get; set; } + /// + /// The client request id to include in log entries. + /// + internal string? ClientRequestId { get; set; } + /// public abstract void Dispose(); } diff --git a/sdk/core/System.ClientModel/src/Options/ClientLoggingOptions.cs b/sdk/core/System.ClientModel/src/Options/ClientLoggingOptions.cs new file mode 100644 index 000000000000..171a57417eba --- /dev/null +++ b/sdk/core/System.ClientModel/src/Options/ClientLoggingOptions.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; + +namespace System.ClientModel.Primitives; + +/// +/// Exposes client options for logging within a . +/// +public class ClientLoggingOptions +{ + private bool _frozen; + + private bool? _enableLogging; + private bool? _enableMessageLogging; + private bool? _enableMessageContentLogging; + private int? _messageContentSizeLimit; + private ILoggerFactory? _loggerFactory; + private PipelineMessageSanitizer? _sanitizer; + private ChangeTrackingStringList? _allowedHeaderNames; + private ChangeTrackingStringList? _allowedQueryParameters; + + // These values are similar to the default values in Azure.Core.DiagnosticsOptions and both + // should be kept in sync. When updating, update the default values in both classes. + private static readonly HashSet s_defaultAllowedHeaderNames = ["traceparent", + "Accept", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent", + "WWW-Authenticate" ]; + private static readonly HashSet s_defaultAllowedQueryParameters = ["api-version"]; + private static readonly PipelineMessageSanitizer s_defaultSanitizer = new(s_defaultAllowedQueryParameters, s_defaultAllowedHeaderNames); + + internal const bool DefaultEnableLogging = true; + internal const bool DefaultEnableMessageContentLogging = false; + internal const int DefaultMessageContentSizeLimitBytes = 4 * 1024; + internal const double RequestTooLongSeconds = 3.0; // sec + + /// + /// Gets or sets the implementation of to use to + /// create instances for logging. + /// + /// If an ILoggerFactory is not provided, logs will be written to Event Source + /// instead. If an ILoggerFactory is provided, logs will be written to ILogger only and not + /// Event Source. + /// Defaults to . + public ILoggerFactory? LoggerFactory + { + get => _loggerFactory; + set + { + AssertNotFrozen(); + + _loggerFactory = value; + } + } + + /// + /// Gets or sets value indicating if logging should be enabled in this client pipeline. + /// + /// Defaults to null. If null, this value will be treated as true. + public bool? EnableLogging + { + get => _enableLogging; + set + { + AssertNotFrozen(); + + _enableLogging = value; + } + } + + /// + /// Gets or sets value indicating if request and response uri and header information should be logged. + /// + /// Defaults to null. If null, the value + /// of will be used instead. + public bool? EnableMessageLogging + { + get => _enableMessageLogging; + set + { + AssertNotFrozen(); + + _enableMessageLogging = value; + } + } + + /// + /// Gets or sets value indicating if request and response content should be logged. + /// + /// Defaults to null. If null, this value will be treated as false. + public bool? EnableMessageContentLogging + { + get => _enableMessageContentLogging; + set + { + AssertNotFrozen(); + + _enableMessageContentLogging = value; + } + } + + /// + /// Gets or sets value indicating maximum size of content to log in bytes. + /// + /// Defaults to null. If null, this value will be treated as + public int? MessageContentSizeLimit + { + get => _messageContentSizeLimit; + set + { + AssertNotFrozen(); + + _messageContentSizeLimit = value; + } + } + + /// + /// Gets or sets a list of header names that are not redacted during logging. + /// + /// Defaults to a list of common header names that do not + /// typically hold sensitive information. + public IList AllowedHeaderNames + { + get + { + if (!_frozen) + { + if (_allowedHeaderNames is null) + { + var changeList = new ChangeTrackingStringList(s_defaultAllowedHeaderNames); + _allowedHeaderNames = changeList; + } + return _allowedHeaderNames; + } + else + { + if (_allowedHeaderNames is null) + { + // If this instance is frozen still allow read-only access to the defaults by + // creating a copy of the default allowed headers and freezing it. This + // avoids copying the default array and allocating the change tracking list unless necessary. + _allowedHeaderNames = new ChangeTrackingStringList(s_defaultAllowedHeaderNames); + _allowedHeaderNames.Freeze(); + } + return _allowedHeaderNames; + } + } + } + + /// + /// Gets or sets a list of query parameter names that are not redacted during logging. + /// + /// Defaults to a list of common query parameters that do not + /// typically hold sensitive information. + public IList AllowedQueryParameters + { + get + { + if (!_frozen) + { + if (_allowedQueryParameters is null) + { + var changeList = new ChangeTrackingStringList(s_defaultAllowedQueryParameters); + _allowedQueryParameters = changeList; + } + return _allowedQueryParameters; + } + else + { + if (_allowedQueryParameters is null) + { + // If this instance is frozen still allow read-only access to the defaults by + // creating a copy of the default allowed query parameters and freezing it. This + // avoids copying the default array and allocating the change tracking list unless necessary. + _allowedQueryParameters = new ChangeTrackingStringList(s_defaultAllowedQueryParameters); + _allowedQueryParameters.Freeze(); + } + return _allowedQueryParameters; + } + } + } + + /// + /// Freeze this instance of . After this method + /// has been called, any attempt to set properties on the instance or call + /// methods that would change its state will throw . + /// + public virtual void Freeze() + { + _frozen = true; + if (_allowedHeaderNames is not null) + { + _allowedHeaderNames.Freeze(); + } + if (_allowedQueryParameters is not null) + { + _allowedQueryParameters.Freeze(); + } + } + + /// + /// Assert that has not been called on this + /// instance. + /// + /// Thrown when an attempt is + /// made to change the state of this instance + /// after has been called. + protected void AssertNotFrozen() + { + if (_frozen) + { + throw new InvalidOperationException("Cannot change a ClientLoggingOptions instance after the ClientPipeline is created."); + } + } + + internal void ValidateOptions() + { + if (EnableLogging == false + && (EnableMessageLogging == true || EnableMessageContentLogging == true)) + { + throw new InvalidOperationException("HTTP Message logging cannot be enabled when client-wide logging is disabled."); + } + if (EnableMessageLogging == false + && EnableMessageContentLogging == true) + { + throw new InvalidOperationException("HTTP Message content logging cannot be enabled when HTTP message logging is disabled."); + } + } + + internal PipelineMessageSanitizer GetPipelineMessageSanitizer() + { + Console.WriteLine($"Allowed header names:{_allowedHeaderNames}"); + if (HeaderListIsDefault && QueryParameterListIsDefault) + { + return s_defaultSanitizer; + } + HashSet headers = _allowedHeaderNames == null ? s_defaultAllowedHeaderNames : new HashSet(_allowedHeaderNames, StringComparer.InvariantCultureIgnoreCase); + HashSet queryParams = _allowedQueryParameters == null ? s_defaultAllowedQueryParameters : new HashSet(_allowedQueryParameters, StringComparer.InvariantCultureIgnoreCase); + + _sanitizer ??= new PipelineMessageSanitizer(queryParams, headers); + + return _sanitizer; + } + + internal bool AddMessageLoggingPolicy => EnableMessageLogging ?? EnableLogging ?? DefaultEnableLogging; + + internal bool UseDefaultClientWideLogging => LoggerFactory == null + && EnableLogging == null; + + internal bool AddDefaultMessageLoggingPolicy => EnableLogging == null + && MessageContentSizeLimit == null + && EnableMessageLogging == null + && EnableMessageContentLogging == null + && LoggerFactory == null + && HeaderListIsDefault + && QueryParameterListIsDefault; + + private bool HeaderListIsDefault => _allowedHeaderNames == null || !_allowedHeaderNames.HasChanged; + private bool QueryParameterListIsDefault => _allowedQueryParameters == null || !_allowedQueryParameters.HasChanged; +} diff --git a/sdk/core/System.ClientModel/src/Options/ClientPipelineOptions.cs b/sdk/core/System.ClientModel/src/Options/ClientPipelineOptions.cs index e8289a030228..6cb2f7ce475a 100644 --- a/sdk/core/System.ClientModel/src/Options/ClientPipelineOptions.cs +++ b/sdk/core/System.ClientModel/src/Options/ClientPipelineOptions.cs @@ -20,8 +20,10 @@ public class ClientPipelineOptions private bool _frozen; private PipelinePolicy? _retryPolicy; + private PipelinePolicy? _loggingPolicy; private PipelineTransport? _transport; private TimeSpan? _timeout; + private ClientLoggingOptions? _loggingOptions; #region Pipeline creation: Overrides of default pipeline policies @@ -44,6 +46,25 @@ public PipelinePolicy? RetryPolicy } } + /// + /// Gets or sets the to be used by the + /// for logging. + /// + /// + /// In most cases, this property will be set to an instance of + /// . + /// + public PipelinePolicy? MessageLoggingPolicy + { + get => _loggingPolicy; + set + { + AssertNotFrozen(); + + _loggingPolicy = value; + } + } + /// /// Gets or sets the to be used by the /// for sending and receiving HTTP messages. @@ -81,6 +102,21 @@ public TimeSpan? NetworkTimeout } } + /// + /// The options to be used to configure logging within the + /// . + /// + public ClientLoggingOptions? ClientLoggingOptions + { + get => _loggingOptions; + set + { + AssertNotFrozen(); + + _loggingOptions = value; + } + } + #endregion #region Pipeline creation: User-specified policies @@ -161,7 +197,11 @@ internal static PipelinePolicy[] AddPolicy(PipelinePolicy policy, PipelinePolicy /// instance or call methods that would change its state will throw /// . /// - public virtual void Freeze() => _frozen = true; + public virtual void Freeze() + { + _frozen = true; + _loggingOptions?.Freeze(); + } /// /// Assert that has not been called on this @@ -177,4 +217,39 @@ protected void AssertNotFrozen() throw new InvalidOperationException("Cannot change a ClientPipelineOptions instance after it has been used to create a ClientPipeline."); } } + + #region Helpers + + internal HttpClientPipelineTransport GetHttpClientPipelineTransport() + { + if (_loggingOptions == null || _loggingOptions.UseDefaultClientWideLogging) + { + return HttpClientPipelineTransport.Shared; + } + return new HttpClientPipelineTransport(null, _loggingOptions.EnableLogging ?? ClientLoggingOptions.DefaultEnableLogging, _loggingOptions.LoggerFactory); + } + + internal ClientRetryPolicy GetClientRetryPolicy() + { + if (_loggingOptions == null || _loggingOptions.UseDefaultClientWideLogging) + { + return ClientRetryPolicy.Default; + } + return new ClientRetryPolicy(ClientRetryPolicy.DefaultMaxRetries, + _loggingOptions.EnableLogging ?? ClientLoggingOptions.DefaultEnableLogging, + _loggingOptions.LoggerFactory); + } + + internal bool AddMessageLoggingPolicy => _loggingOptions?.AddMessageLoggingPolicy ?? true; + + internal MessageLoggingPolicy GetMessageLoggingPolicy() + { + if (_loggingOptions == null || _loggingOptions.AddDefaultMessageLoggingPolicy) + { + return System.ClientModel.Primitives.MessageLoggingPolicy.Default; + } + return new MessageLoggingPolicy(_loggingOptions); + } + + #endregion } diff --git a/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.RequestOptionsProcessor.cs b/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.RequestOptionsProcessor.cs index 4dbeb87f3bfc..7adc63a1df9b 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.RequestOptionsProcessor.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.RequestOptionsProcessor.cs @@ -185,7 +185,7 @@ private bool TryGetCustomPerTryPolicy(int index, out PipelinePolicy policy) private bool TryGetFixedPerTransportPolicy(int index, out PipelinePolicy policy) { - if (index < _perTryIndex + _customPerCallPolicies.Length + _customPerTryPolicies.Length) + if (index < _beforeTransportIndex + _customPerCallPolicies.Length + _customPerTryPolicies.Length) { policy = _fixedPolicies.Span[index - (_customPerCallPolicies.Length + _customPerTryPolicies.Length)]; return true; @@ -197,7 +197,7 @@ private bool TryGetFixedPerTransportPolicy(int index, out PipelinePolicy policy) private bool TryGetCustomBeforeTransportPolicy(int index, out PipelinePolicy policy) { - if (index < _perTryIndex + + if (index < _beforeTransportIndex + _customPerCallPolicies.Length + _customPerTryPolicies.Length + _customBeforeTransportPolicies.Length) diff --git a/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.cs b/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.cs index bae030b7ec33..4e3dc1a1840b 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/ClientPipeline.cs @@ -5,7 +5,10 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; namespace System.ClientModel.Primitives; @@ -26,10 +29,11 @@ public sealed partial class ClientPipeline private readonly ReadOnlyMemory _policies; private readonly PipelineTransport _transport; + private readonly bool _enableLogging; private readonly TimeSpan _networkTimeout; - private ClientPipeline(ReadOnlyMemory policies, TimeSpan networkTimeout, int perCallIndex, int perTryIndex, int beforeTransportIndex) + private ClientPipeline(ReadOnlyMemory policies, TimeSpan networkTimeout, int perCallIndex, int perTryIndex, int beforeTransportIndex, bool enableLogging) { if (policies.Span[policies.Length - 1] is not PipelineTransport) { @@ -47,6 +51,7 @@ private ClientPipeline(ReadOnlyMemory policies, TimeSpan network _beforeTransportIndex = beforeTransportIndex; _networkTimeout = networkTimeout; + _enableLogging = enableLogging; } #region Factory methods for creating a pipeline instance @@ -101,6 +106,7 @@ public static ClientPipeline Create( Argument.AssertNotNull(options, nameof(options)); options.Freeze(); + options.ClientLoggingOptions?.ValidateOptions(); // Add length of client-specific policies. int pipelineLength = perCallPolicies.Length + perTryPolicies.Length + beforeTransportPolicies.Length; @@ -111,6 +117,7 @@ public static ClientPipeline Create( pipelineLength += options.BeforeTransportPolicies?.Length ?? 0; pipelineLength++; // for retry policy + pipelineLength += options.AddMessageLoggingPolicy ? 1 : 0; // for message logging policy pipelineLength++; // for transport PipelinePolicy[] policies = new PipelinePolicy[pipelineLength]; @@ -130,7 +137,7 @@ public static ClientPipeline Create( int perCallIndex = index; // Add retry policy. - policies[index++] = options.RetryPolicy ?? ClientRetryPolicy.Default; + policies[index++] = options.RetryPolicy ?? options.GetClientRetryPolicy(); // Per try policies come after the retry policy. perTryPolicies.CopyTo(policies.AsSpan(index)); @@ -144,6 +151,13 @@ public static ClientPipeline Create( int perTryIndex = index; + // Add logging policy just before the transport. + + if (options.AddMessageLoggingPolicy) + { + policies[index++] = options.MessageLoggingPolicy ?? options.GetMessageLoggingPolicy(); + } + // Before transport policies come before the transport. beforeTransportPolicies.CopyTo(policies.AsSpan(index)); index += beforeTransportPolicies.Length; @@ -157,11 +171,13 @@ public static ClientPipeline Create( int beforeTransportIndex = index; // Add the transport. - policies[index++] = options.Transport ?? HttpClientPipelineTransport.Shared; + policies[index++] = options.Transport ?? options.GetHttpClientPipelineTransport(); + + bool enableLogging = options.ClientLoggingOptions?.EnableLogging ?? ClientLoggingOptions.DefaultEnableLogging; return new ClientPipeline(policies, options.NetworkTimeout ?? DefaultNetworkTimeout, - perCallIndex, perTryIndex, beforeTransportIndex); + perCallIndex, perTryIndex, beforeTransportIndex, enableLogging); } #endregion @@ -194,8 +210,10 @@ public PipelineMessage CreateMessage() public void Send(PipelineMessage message) { Argument.AssertNotNull(message, nameof(message)); + message.Request.ClientRequestId = Activity.Current?.Id ?? Guid.NewGuid().ToString(); IReadOnlyList policies = GetProcessor(message); + policies[0].Process(message, policies, 0); } @@ -215,8 +233,10 @@ public void Send(PipelineMessage message) public async ValueTask SendAsync(PipelineMessage message) { Argument.AssertNotNull(message, nameof(message)); + message.Request.ClientRequestId = Activity.Current?.Id ?? Guid.NewGuid().ToString(); IReadOnlyList policies = GetProcessor(message); + await policies[0].ProcessAsync(message, policies, 0).ConfigureAwait(false); } diff --git a/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs b/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs index 3e9be2399624..f8e61e9a46d4 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs @@ -7,6 +7,8 @@ using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; namespace System.ClientModel.Primitives; @@ -22,20 +24,34 @@ public class ClientRetryPolicy : PipelinePolicy /// public static ClientRetryPolicy Default { get; } = new ClientRetryPolicy(); - private const int DefaultMaxRetries = 3; private static readonly TimeSpan DefaultInitialDelay = TimeSpan.FromSeconds(0.8); private readonly int _maxRetries; private readonly TimeSpan _initialDelay; + private readonly PipelineRetryLogger? _retryLogger; + + internal const int DefaultMaxRetries = 3; + + /// + /// Creates a new instance of the class. + /// + /// The maximum number of retries to attempt. + public ClientRetryPolicy(int maxRetries = DefaultMaxRetries) : this(maxRetries, ClientLoggingOptions.DefaultEnableLogging, default) + { + } /// /// Creates a new instance of the class. /// /// The maximum number of retries to attempt. - public ClientRetryPolicy(int maxRetries = DefaultMaxRetries) + /// If client-wide logging is enabled for this pipeline. + /// The to use to create an instance for logging. + /// If one is not provided, logs are written to Event Source by default. + public ClientRetryPolicy(int maxRetries, bool enableLogging, ILoggerFactory? loggerFactory) { _maxRetries = maxRetries; _initialDelay = DefaultInitialDelay; + _retryLogger = enableLogging ? new PipelineRetryLogger(loggerFactory) : null; } /// @@ -53,6 +69,7 @@ private async ValueTask ProcessSyncOrAsync(PipelineMessage message, IReadOnlyLis while (true) { Exception? thisTryException = null; + var before = Stopwatch.GetTimestamp(); if (async) { @@ -91,6 +108,9 @@ private async ValueTask ProcessSyncOrAsync(PipelineMessage message, IReadOnlyLis OnRequestSent(message); } + var after = Stopwatch.GetTimestamp(); + double elapsed = (after-before) / (double)Stopwatch.Frequency; + bool shouldRetry = async ? await ShouldRetryInternalAsync(message, thisTryException).ConfigureAwait(false) : ShouldRetryInternal(message, thisTryException); @@ -116,6 +136,8 @@ await ShouldRetryInternalAsync(message, thisTryException).ConfigureAwait(false) message.RetryCount++; OnTryComplete(message); + _retryLogger?.LogRequestRetrying(message.Request.ClientRequestId ?? string.Empty, message.RetryCount, elapsed); + continue; } diff --git a/sdk/core/System.ClientModel/src/Pipeline/HttpClientPipelineTransport.cs b/sdk/core/System.ClientModel/src/Pipeline/HttpClientPipelineTransport.cs index 015847915920..bc7bb5378cbf 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/HttpClientPipelineTransport.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/HttpClientPipelineTransport.cs @@ -6,6 +6,7 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; namespace System.ClientModel.Primitives; @@ -40,11 +41,24 @@ public HttpClientPipelineTransport() : this(_sharedDefaultClient) /// The that this transport /// instance will use to send and receive HTTP requests and responses. /// - public HttpClientPipelineTransport(HttpClient client) + public HttpClientPipelineTransport(HttpClient client) : this(client, ClientLoggingOptions.DefaultEnableLogging, null) { Argument.AssertNotNull(client, nameof(client)); + } - _httpClient = client; + /// + /// Create a new instance of that + /// uses the provided . + /// + /// The that this transport + /// instance will use to send and receive HTTP requests and responses. If no + /// is passed, a default shared client will be used. + /// + /// If client-wide logging is enabled for this pipeline. + /// The to use to create an instance for logging. + public HttpClientPipelineTransport(HttpClient? client, bool enableLogging, ILoggerFactory? loggerFactory) : base(enableLogging, loggerFactory) + { + _httpClient = client ?? _sharedDefaultClient; } private static HttpClient CreateDefaultClient() diff --git a/sdk/core/System.ClientModel/src/Pipeline/MessageLoggingPolicy.cs b/sdk/core/System.ClientModel/src/Pipeline/MessageLoggingPolicy.cs new file mode 100644 index 000000000000..1f419a765ae5 --- /dev/null +++ b/sdk/core/System.ClientModel/src/Pipeline/MessageLoggingPolicy.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.Tracing; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; + +namespace System.ClientModel.Primitives; + +/// +/// A used by a to +/// log request and response information. +/// +public class MessageLoggingPolicy : PipelinePolicy +{ + /// + /// The instance used by a default + /// . + /// + public static MessageLoggingPolicy Default { get; } = new MessageLoggingPolicy(); + + private readonly ClientLoggingOptions _loggingOptions; + private PipelineMessageLogger? _messageLogger; + private readonly string _clientAssembly = typeof(MessageLoggingPolicy).Assembly.GetName().Name!; + + private bool _enableMessageContentLogging => _loggingOptions.EnableMessageContentLogging ?? ClientLoggingOptions.DefaultEnableMessageContentLogging; + private int _maxLength => _loggingOptions.MessageContentSizeLimit ?? ClientLoggingOptions.DefaultMessageContentSizeLimitBytes; + + /// + /// Creates a new instance of the class. + /// + /// The user-provided logging options object. + public MessageLoggingPolicy(ClientLoggingOptions? options = default) + { + _loggingOptions = options ?? new(); + } + + /// + public sealed override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) => + ProcessSyncOrAsync(message, pipeline, currentIndex, async: false).EnsureCompleted(); + + /// + public sealed override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) => + await ProcessSyncOrAsync(message, pipeline, currentIndex, async: true).ConfigureAwait(false); + + private async ValueTask ProcessSyncOrAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex, bool async) + { + _messageLogger ??= new PipelineMessageLogger(_loggingOptions.GetPipelineMessageSanitizer(), _loggingOptions.LoggerFactory); + + // EventLevel.Warning / LogLevel.Warning is the highest level logged by this policy. + // PipelineMessageLogger.IsEnabled checks to see: if an ILogger was provided - ensure it is enabled for at least LogLevel.Warning OR if + // an ILogger was not provided, see if an EventListener exists that is actively listening for at least EventLevel.Warning. + // If nothing is listening for logs then this policy immediately passes control to the next policy in the pipeline and returns when control + // is passed back. This avoids any performance hit from logging when no one is listening/collecting logs. + if (!_messageLogger.IsEnabled(LogLevel.Warning, EventLevel.Warning)) + { + if (async) + { + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + } + else + { + ProcessNext(message, pipeline, currentIndex); + } + return; + } + + PipelineRequest request = message.Request; + + string requestId = message.Request.ClientRequestId ?? string.Empty; + + _messageLogger.LogRequest(requestId, request, _clientAssembly); + + if (_enableMessageContentLogging && request.Content != null && _messageLogger.IsEnabled(LogLevel.Debug, EventLevel.Verbose)) + { + // Convert binary content to bytes + using var memoryStream = new MaxLengthStream(_maxLength); + if (async) + { + await request.Content.WriteToAsync(memoryStream, message.CancellationToken).ConfigureAwait(false); + } + else + { + request.Content.WriteTo(memoryStream, message.CancellationToken); + } + byte[] bytes = memoryStream.ToArray(); + + Encoding? requestTextEncoding = null; + // Try to extract a text encoding from the headers + if (request.Headers.TryGetValue("Content-Type", out var contentType) && contentType != null) + { + ContentTypeUtilities.TryGetTextEncoding(contentType, out requestTextEncoding); + } + + _messageLogger.LogRequestContent(requestId, bytes, requestTextEncoding); + } + + var before = Stopwatch.GetTimestamp(); + + // Any exceptions thrown are logged in the transport + if (async) + { + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + } + else + { + ProcessNext(message, pipeline, currentIndex); + } + + var after = Stopwatch.GetTimestamp(); + + PipelineResponse response = message.Response!; + + double elapsed = (after - before) / (double)Stopwatch.Frequency; + + if (response.IsError) + { + _messageLogger.LogErrorResponse(requestId, response, elapsed); + } + else + { + _messageLogger.LogResponse(requestId, response, elapsed); + } + + if (_enableMessageContentLogging && response.ContentStream != null && _messageLogger.IsEnabled(LogLevel.Information, EventLevel.Informational)) + { + Encoding? responseTextEncoding = null; + + if (response.Headers.TryGetValue("Content-Type", out var contentType) && contentType != null) + { + ContentTypeUtilities.TryGetTextEncoding(contentType, out responseTextEncoding); + } + + if (message.BufferResponse || response.ContentStream.CanSeek) + { + byte[]? responseBytes; + if (message.BufferResponse) + { + // Content is buffered, so log the first _maxLength bytes + ReadOnlyMemory contentAsMemory = response.Content.ToMemory(); + var length = Math.Min(contentAsMemory.Length, _maxLength); + responseBytes = contentAsMemory.Span.Slice(0, length).ToArray(); + } + else + { + responseBytes = new byte[_maxLength]; + response.ContentStream.Read(responseBytes, 0, _maxLength); + response.ContentStream.Seek(0, SeekOrigin.Begin); + } + + if (response.IsError) + { + _messageLogger.LogErrorResponseContent(requestId, responseBytes, responseTextEncoding); + } + else + { + _messageLogger.LogResponseContent(requestId, responseBytes, responseTextEncoding); + } + } + else + { + response.ContentStream = new LoggingStream(_messageLogger, requestId, _maxLength, response.ContentStream, response.IsError, responseTextEncoding); + } + } + } + + #region MaxLengthStream + private class MaxLengthStream : MemoryStream + { + private int _bytesLeft; + + public MaxLengthStream(int maxLength) : base() + { + _bytesLeft = maxLength; + } + + public override void Write(byte[] buffer, int offset, int count) + { + DecrementLength(ref count); + if (count > 0) + { + base.Write(buffer, offset, count); + } + } + + public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + return count > 0 ? base.WriteAsync(buffer, offset, count, cancellationToken) : Task.CompletedTask; + } + + private void DecrementLength(ref int count) + { + var left = Math.Min(count, _bytesLeft); + count = left; + + _bytesLeft -= count; + } + } + #endregion + + #region LoggingStream + private class LoggingStream : Stream + { + private readonly string _requestId; + private int _remainingBytesToLog; + private readonly Stream _originalStream; + private readonly bool _error; + private readonly Encoding? _textEncoding; + private int _blockNumber; + private readonly PipelineMessageLogger _messageLogger; + + public LoggingStream(PipelineMessageLogger messageLogger, string requestId, int maxLoggedBytes, Stream originalStream, bool error, Encoding? textEncoding) + { + // Should only wrap non-seekable streams + Debug.Assert(!originalStream.CanSeek); + _requestId = requestId; + _remainingBytesToLog = maxLoggedBytes; + _originalStream = originalStream; + _error = error; + _textEncoding = textEncoding; + _messageLogger = messageLogger; + } + + public override int Read(byte[] buffer, int offset, int count) + { + var numBytesRead = _originalStream.Read(buffer, offset, count); + + LogBuffer(buffer, offset, numBytesRead); + + return numBytesRead; + } + + public override async Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + var numBytesRead = await _originalStream.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); + + LogBuffer(buffer, offset, numBytesRead); + + return numBytesRead; + } + +#if !NETSTANDARD2_0 + + public override async ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + var numBytesRead = await _originalStream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + + LogMemory(buffer, numBytesRead); + + return numBytesRead; + } +#endif + + public override bool CanRead => _originalStream.CanRead; + public override bool CanSeek => _originalStream.CanSeek; + public override long Length => _originalStream.Length; + public override long Position + { + get => _originalStream.Position; + set => _originalStream.Position = value; + } + + // Make this stream readonly + public override bool CanWrite => false; + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("This stream does not support seek operations."); + } + + // Make this stream readonly + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("This stream is read-only."); + } + + // Make this stream readonly + public override void SetLength(long value) + { + throw new NotSupportedException("This stream is read-only."); + } + + public override void Flush() + { + _originalStream.Flush(); + } + + public override void Close() + { + _originalStream.Close(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + _originalStream.Dispose(); + } + + #region Helpers + + private void LogMemory(Memory memory, int numBytesReadIntoMemory) + { + // This is intentionally not thread-safe because synchronizing reads + // should be done by the caller. + var bytesToLog = Math.Min(numBytesReadIntoMemory, _remainingBytesToLog); + _remainingBytesToLog -= bytesToLog; + + if (bytesToLog == 0) + { + return; + } + + byte[] bytes = new byte[bytesToLog]; + memory.Slice(0, bytesToLog).Span.CopyTo(bytes); + + if (_error) + { + _messageLogger.LogErrorResponseContentBlock(_requestId, _blockNumber, bytes, _textEncoding); + } + else + { + _messageLogger.LogResponseContentBlock(_requestId, _blockNumber, bytes, _textEncoding); + } + + _blockNumber++; + } + + private void LogBuffer(byte[] buffer, int offset, int numBytesReadIntoBuffer) + { + // This is intentionally not thread-safe because synchronizing reads + // should be done by the caller. + var bytesToLog = Math.Min(numBytesReadIntoBuffer, _remainingBytesToLog); + _remainingBytesToLog -= bytesToLog; + + if (bytesToLog == 0 || buffer == null) + { + return; + } + + byte[] bytes; + if (bytesToLog == numBytesReadIntoBuffer && offset == 0) + { + bytes = buffer; + } + else + { + bytes = new byte[bytesToLog]; + Buffer.BlockCopy(buffer, offset, bytes, 0, bytesToLog); + } + + if (_error) + { + _messageLogger.LogErrorResponseContentBlock(_requestId, _blockNumber, bytes, _textEncoding); + } + else + { + _messageLogger.LogResponseContentBlock(_requestId, _blockNumber, bytes, _textEncoding); + } + + _blockNumber++; + } + #endregion + } + #endregion +} diff --git a/sdk/core/System.ClientModel/src/Pipeline/PipelineTransport.cs b/sdk/core/System.ClientModel/src/Pipeline/PipelineTransport.cs index 6465ea6c1245..c72a774a1445 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/PipelineTransport.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/PipelineTransport.cs @@ -7,6 +7,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; namespace System.ClientModel.Primitives; @@ -16,6 +17,29 @@ namespace System.ClientModel.Primitives; /// public abstract class PipelineTransport : PipelinePolicy { + private readonly PipelineTransportLogger? _pipelineTransportLogger; + + /// + /// Creates a new instance of the class. + /// + protected PipelineTransport() + { + } + + /// + /// Creates a new instance of the class. + /// + /// If client-wide logging is enabled for this pipeline. + /// The to use to create an instance for logging. + /// If one is not provided, logs are written to Event Source by default. + protected PipelineTransport(bool enableLogging, ILoggerFactory? loggerFactory) + { + if (enableLogging) + { + _pipelineTransportLogger = new(loggerFactory); + } + } + #region CreateMessage /// @@ -63,7 +87,17 @@ public PipelineMessage CreateMessage() /// The containing the /// request that was sent and response that was received by the transport. public void Process(PipelineMessage message) - => ProcessSyncOrAsync(message, async: false).EnsureCompleted(); + { + try + { + ProcessSyncOrAsync(message, async: false).EnsureCompleted(); + } + catch (Exception ex) + { + _pipelineTransportLogger?.LogExceptionResponse(message.Request.ClientRequestId ?? string.Empty, ex); + throw; + } + } /// /// Sends the HTTP request contained by @@ -72,7 +106,17 @@ public void Process(PipelineMessage message) /// The containing the /// request that was sent and response that was received by the transport. public async ValueTask ProcessAsync(PipelineMessage message) - => await ProcessSyncOrAsync(message, async: true).ConfigureAwait(false); + { + try + { + await ProcessSyncOrAsync(message, async: true).ConfigureAwait(false); + } + catch (Exception ex) + { + _pipelineTransportLogger?.LogExceptionResponse(message.Request.ClientRequestId ?? string.Empty, ex); + throw; + } + } private async ValueTask ProcessSyncOrAsync(PipelineMessage message, bool async) { @@ -84,6 +128,8 @@ private async ValueTask ProcessSyncOrAsync(PipelineMessage message, bool async) using CancellationTokenSource timeoutTokenSource = CancellationTokenSource.CreateLinkedTokenSource(messageToken); timeoutTokenSource.CancelAfter(networkTimeout); + var before = Stopwatch.GetTimestamp(); + try { message.CancellationToken = timeoutTokenSource.Token; @@ -108,9 +154,17 @@ private async ValueTask ProcessSyncOrAsync(PipelineMessage message, bool async) timeoutTokenSource.CancelAfter(Timeout.Infinite); } + var after = Stopwatch.GetTimestamp(); + double elapsed = (after - before) / (double)Stopwatch.Frequency; + message.AssertResponse(); message.Response!.IsErrorCore = ClassifyResponse(message); + if (elapsed > ClientLoggingOptions.RequestTooLongSeconds) + { + _pipelineTransportLogger?.LogResponseDelay(message.Request.ClientRequestId ?? string.Empty, elapsed); + } + // The remainder of the method handles response content according to // buffering logic specified by value of message.BufferResponse. diff --git a/sdk/core/System.ClientModel/src/System.ClientModel.csproj b/sdk/core/System.ClientModel/src/System.ClientModel.csproj index 291c0ef86906..ca6c88a3321d 100644 --- a/sdk/core/System.ClientModel/src/System.ClientModel.csproj +++ b/sdk/core/System.ClientModel/src/System.ClientModel.csproj @@ -2,9 +2,9 @@ Contains building blocks for clients that call cloud services. - 1.3.0-beta.1 + 1.4.0-beta.1 - 1.2.1 + 1.3.0 enable netstandard2.0;net6.0;net8.0 DotNetPackageIcon.png @@ -12,8 +12,10 @@ + + \ No newline at end of file diff --git a/sdk/core/System.ClientModel/tests/Options/ClientLoggingOptionsTests.cs b/sdk/core/System.ClientModel/tests/Options/ClientLoggingOptionsTests.cs new file mode 100644 index 000000000000..11fa8e5aa11f --- /dev/null +++ b/sdk/core/System.ClientModel/tests/Options/ClientLoggingOptionsTests.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using Microsoft.Extensions.Logging.Abstractions; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Options +{ + internal class ClientLoggingOptionsTests + { + [Test] + public void NonCollectionPropertiesDefaultToNull() + { + ClientLoggingOptions options = new(); + Assert.AreEqual(null, options.EnableLogging); + Assert.AreEqual(null, options.EnableMessageLogging); + Assert.AreEqual(null, options.EnableMessageContentLogging); + Assert.AreEqual(null, options.MessageContentSizeLimit); + Assert.AreEqual(null, options.LoggerFactory); + } + + [Test] + public void CollectionPropertiesDefaultsAreSet() + { + string[] expectedDefaultAllowedHeaderNames = [ + "traceparent", + "Accept", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent", + "WWW-Authenticate" ]; + string[] expectedDefaultAllowedQueryParameters = ["api-version"]; + + ClientLoggingOptions options = new(); + CollectionAssert.AreEquivalent(expectedDefaultAllowedHeaderNames, options.AllowedHeaderNames); + CollectionAssert.AreEquivalent(expectedDefaultAllowedQueryParameters, options.AllowedQueryParameters); + } + + [Test] + public void CanModifyOptions() + { + ClientLoggingOptions options = new(); + + options.MessageContentSizeLimit = 5; + options.LoggerFactory = NullLoggerFactory.Instance; + options.EnableLogging = false; + options.EnableMessageLogging = false; + options.EnableMessageContentLogging = false; + options.AllowedHeaderNames.Add("Hello"); + options.AllowedQueryParameters.Add("Hello"); + + Assert.AreEqual(5, options.MessageContentSizeLimit); + Assert.AreEqual(NullLoggerFactory.Instance, options.LoggerFactory); + Assert.AreEqual(false, options.EnableLogging); + Assert.AreEqual(false, options.EnableMessageLogging); + Assert.AreEqual(false, options.EnableMessageContentLogging); + CollectionAssert.Contains(options.AllowedHeaderNames, "Hello"); + CollectionAssert.Contains(options.AllowedQueryParameters, "Hello"); + } + + [Test] + public void DefaultOptionsFreeze() + { + ClientLoggingOptions options = new(); + + options.Freeze(); + + Assert.Throws(() => options.AllowedHeaderNames.Add("ShouldNotAdd")); + Assert.Throws(() => options.AllowedQueryParameters.Add("ShouldNotAdd")); + Assert.Throws(() => options.EnableLogging = true); + Assert.Throws(() => options.EnableMessageLogging = true); + Assert.Throws(() => options.EnableMessageContentLogging = true); + Assert.Throws(() => options.MessageContentSizeLimit = 5); + Assert.Throws(() => options.LoggerFactory = new NullLoggerFactory()); + } + + [Test] + public void CustomizedOptionsFreeze() + { + ClientLoggingOptions options = new(); + options.MessageContentSizeLimit = 5; + options.LoggerFactory = NullLoggerFactory.Instance; + options.EnableLogging = false; + options.EnableMessageLogging = false; + options.EnableMessageContentLogging = false; + options.AllowedHeaderNames.Add("Hello"); + options.AllowedQueryParameters.Add("Hello"); + + options.Freeze(); + + Assert.Throws(() => options.AllowedHeaderNames.Add("ShouldNotAdd")); + Assert.Throws(() => options.AllowedQueryParameters.Add("ShouldNotAdd")); + Assert.Throws(() => options.EnableLogging = true); + Assert.Throws(() => options.EnableMessageLogging = true); + Assert.Throws(() => options.EnableMessageContentLogging = true); + Assert.Throws(() => options.MessageContentSizeLimit = 10); + Assert.Throws(() => options.LoggerFactory = new NullLoggerFactory()); + } + } +} diff --git a/sdk/core/System.ClientModel/tests/Options/ClientPipelineOptionsTests.cs b/sdk/core/System.ClientModel/tests/Options/ClientPipelineOptionsTests.cs index 8b52090ff5f0..3248f29ca1e2 100644 --- a/sdk/core/System.ClientModel/tests/Options/ClientPipelineOptionsTests.cs +++ b/sdk/core/System.ClientModel/tests/Options/ClientPipelineOptionsTests.cs @@ -149,32 +149,46 @@ public async Task CanAddPoliciesAtAllPositions() public void CannotModifyOptionsAfterFrozen() { ClientPipelineOptions options = new(); + options.ClientLoggingOptions = new(); ClientPipeline pipeline = ClientPipeline.Create(options); Assert.Throws(() => options.RetryPolicy = new MockRetryPolicy()); + Assert.Throws(() + => options.MessageLoggingPolicy = new MockPipelinePolicy()); Assert.Throws(() => options.Transport = new MockPipelineTransport("Transport")); Assert.Throws(() => options.NetworkTimeout = TimeSpan.MinValue); Assert.Throws(() => options.AddPolicy(new ObservablePolicy("A"), PipelinePosition.PerCall)); + Assert.Throws(() + => options.ClientLoggingOptions = new()); + Assert.Throws(() + => options.ClientLoggingOptions.EnableLogging = true); } [Test] public void CannotModifyOptionsAfterExplicitlyFrozen() { ClientPipelineOptions options = new(); + options.ClientLoggingOptions = new(); options.Freeze(); Assert.Throws(() => options.RetryPolicy = new MockRetryPolicy()); + Assert.Throws(() + => options.MessageLoggingPolicy = new MockPipelinePolicy()); Assert.Throws(() => options.Transport = new MockPipelineTransport("Transport")); Assert.Throws(() => options.NetworkTimeout = TimeSpan.MinValue); Assert.Throws(() => options.AddPolicy(new ObservablePolicy("A"), PipelinePosition.PerCall)); + Assert.Throws(() + => options.ClientLoggingOptions = new()); + Assert.Throws(() + => options.ClientLoggingOptions.EnableLogging = true); } #region Helpers diff --git a/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineFunctionalTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineFunctionalTests.cs index 86e3bc1d831f..c226073da57c 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineFunctionalTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineFunctionalTests.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core.TestFramework; -using ClientModel.Tests.Mocks; -using Microsoft.AspNetCore.Http; -using Moq; -using NUnit.Framework; using System.ClientModel.Primitives; +using System.ClientModel.Tests.TestFramework; using System.Collections.Generic; +using System.Diagnostics.Tracing; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests; +using ClientModel.Tests.Mocks; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using Moq; +using NUnit.Framework; using SyncAsyncTestBase = ClientModel.Tests.SyncAsyncTestBase; namespace System.ClientModel.Tests.Pipeline; public class ClientPipelineFunctionalTests : SyncAsyncTestBase { + private const string LoggingPolicyCategoryName = "System.ClientModel.Primitives.MessageLoggingPolicy"; + private const string PipelineTransportCategoryName = "System.ClientModel.Primitives.PipelineTransport"; + private const string RetryPolicyCategoryName = "System.ClientModel.Primitives.ClientRetryPolicy"; + public ClientPipelineFunctionalTests(bool isAsync) : base(isAsync) { } @@ -348,7 +357,7 @@ public async Task RetriesTimeoutsServerTimeouts() } [Test] - public async Task DoesntRetryClientCancellation() + public async Task DoesNotRetryClientCancellation() { var testDoneTcs = new CancellationTokenSource(); int i = 0; @@ -431,6 +440,274 @@ public async Task RetriesBufferedBodyTimeout() #endregion + #region Test default logging policy behavior + + [Test] + public async Task LogsRequestAndResponseToEventSource() + { + using TestClientEventListener eventListener = new(); + + ClientPipeline pipeline = ClientPipeline.Create(); + + using TestServer testServer = new( + async context => + { + context.Response.StatusCode = 201; + await context.Response.WriteAsync("Hello World!"); + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + await pipeline.SendSyncOrAsync(message, IsAsync); + + // Request + EventWrittenEventArgs args = eventListener.SingleEventById(1, e => e.EventSource.Name == "System.ClientModel"); + Assert.AreEqual(EventLevel.Informational, args.Level); + Assert.AreEqual("Request", args.EventName); + + // Response + args = eventListener.SingleEventById(5, e => e.EventSource.Name == "System.ClientModel"); + Assert.AreEqual(EventLevel.Informational, args.Level); + Assert.AreEqual("Response", args.EventName); + Assert.AreEqual(201, args.GetProperty("status")); + + // No other events should have been logged + Assert.AreEqual(2, eventListener.EventData.Count()); + } + + [Test] + public void LogsRequestAndExceptionResponseToEventSource() + { + using TestClientEventListener eventListener = new(); + + ClientPipeline pipeline = ClientPipeline.Create(); + + using TestServer testServer = new( + async context => + { + await context.Response.WriteAsync("Hello World!"); + throw new Exception("Error"); + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + Assert.ThrowsAsync(async () => await pipeline.SendSyncOrAsync(message, IsAsync)); + + // Request Events + IEnumerable args = eventListener.EventsById(1); + Assert.AreEqual(4, args.Count()); + + // Exception Response Events + args = eventListener.EventsById(18); + Assert.AreEqual(4, args.Count()); + foreach (EventWrittenEventArgs responseEventArgs in args) + { + Assert.AreEqual(EventLevel.Informational, responseEventArgs.Level); + Assert.AreEqual("ExceptionResponse", responseEventArgs.EventName); + Assert.True((responseEventArgs.GetProperty("exception")).Contains("Exception")); + } + + // 4 request events, 3 request retrying, 4 exception response + Assert.AreEqual(11, eventListener.EventData.Count()); + } + + [Test] + public async Task LogsRequestAndRetryToEventSource() + { + using TestClientEventListener eventListener = new(); + + ClientPipeline pipeline = ClientPipeline.Create(); + + int responseNum = 0; + using TestServer testServer = new( + async context => + { + switch (responseNum) + { + case 0: + context.Response.StatusCode = 429; + await context.Response.WriteAsync("Try again"); + break; + default: + context.Response.StatusCode = 201; + await context.Response.WriteAsync("Success"); + break; + } + responseNum++; + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + await pipeline.SendSyncOrAsync(message, IsAsync); + + // Request Events + IEnumerable args = eventListener.EventsById(1); + Assert.AreEqual(2, args.Count()); + + // Retry event + EventWrittenEventArgs arg = eventListener.SingleEventById(10); + Assert.AreEqual("RequestRetrying", arg.EventName); + + // Error response event + arg = eventListener.SingleEventById(8); + Assert.AreEqual("ErrorResponse", arg.EventName); + + // Response event + arg = eventListener.SingleEventById(5); + Assert.AreEqual("Response", arg.EventName); + + // No other events should have been logged + Assert.AreEqual(5, eventListener.EventData.Count()); + } + + [Test] + public async Task LogsRequestAndResponseToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientPipelineOptions options = new() { ClientLoggingOptions = new() { LoggerFactory = factory } }; + ClientPipeline pipeline = ClientPipeline.Create(options); + + using TestServer testServer = new( + async context => + { + context.Response.StatusCode = 201; + await context.Response.WriteAsync("Hello World!"); + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + await pipeline.SendSyncOrAsync(message, IsAsync); + + // Message logger + TestLogger messageLogger = factory.GetLogger(LoggingPolicyCategoryName); + + // Request + LoggerEvent log = messageLogger.SingleEventById(1); + Assert.AreEqual(LogLevel.Information, log.LogLevel); + Assert.AreEqual("Request", log.EventId.Name); + + // Response + log = messageLogger.SingleEventById(5); + Assert.AreEqual(LogLevel.Information, log.LogLevel); + Assert.AreEqual("Response", log.EventId.Name); + Assert.AreEqual(201, log.GetValueFromArguments("status")); + + // No other events should have been logged + Assert.AreEqual(2, messageLogger.Logs.Count()); + } + + [Test] + public void LogsRequestAndExceptionResponseToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientPipelineOptions options = new() { ClientLoggingOptions = new() { LoggerFactory = factory } }; + ClientPipeline pipeline = ClientPipeline.Create(options); + + using TestServer testServer = new( + async context => + { + await context.Response.WriteAsync("Hello World!"); + context.Abort(); + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + Assert.ThrowsAsync(async () => await pipeline.SendSyncOrAsync(message, IsAsync)); + + // Message logger + TestLogger messageLogger = factory.GetLogger(LoggingPolicyCategoryName); + + // Transport Logger + TestLogger transportLogger = factory.GetLogger(PipelineTransportCategoryName); + + // Request Events + IEnumerable logs = messageLogger.EventsById(1); + Assert.AreEqual(4, logs.Count()); + + // Exception Response Events + logs = transportLogger.EventsById(18); + Assert.AreEqual(4, logs.Count()); + foreach (LoggerEvent responseEventLog in logs) + { + Assert.AreEqual(LogLevel.Information, responseEventLog.LogLevel); + Assert.AreEqual("ExceptionResponse", responseEventLog.EventId.Name); + } + + // No other events should have been logged + Assert.AreEqual(4, messageLogger.Logs.Count()); + Assert.AreEqual(4, transportLogger.Logs.Count()); + } + + [Test] + public async Task LogsRequestAndRetryToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientPipelineOptions options = new() { ClientLoggingOptions = new() { LoggerFactory = factory } }; + ClientPipeline pipeline = ClientPipeline.Create(options); + + int responseNum = 0; + using TestServer testServer = new( + async context => + { + switch (responseNum) + { + case 0: + context.Response.StatusCode = 429; + await context.Response.WriteAsync("Try again"); + break; + default: + context.Response.StatusCode = 201; + await context.Response.WriteAsync("Success"); + break; + } + responseNum++; + }); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Uri = testServer.Address; + message.BufferResponse = true; + + await pipeline.SendSyncOrAsync(message, IsAsync); + + // Message logger + TestLogger messageLogger = factory.GetLogger(LoggingPolicyCategoryName); + + // Retry Logger + TestLogger retryLogger = factory.GetLogger(RetryPolicyCategoryName); + + // Request Events + IEnumerable args = messageLogger.EventsById(1); + Assert.AreEqual(2, args.Count()); + + // Retry event + LoggerEvent arg = retryLogger.SingleEventById(10); + Assert.AreEqual("RequestRetrying", arg.EventId.Name); + + // Error response event + arg = messageLogger.SingleEventById(8); + Assert.AreEqual("ErrorResponse", arg.EventId.Name); + + // Response event + arg = messageLogger.SingleEventById(5); + Assert.AreEqual("Response", arg.EventId.Name); + + // No other events should have been logged + Assert.AreEqual(4, messageLogger.Logs.Count()); + Assert.AreEqual(1, retryLogger.Logs.Count()); + } + + #endregion + #region Test parallel connections [Test] diff --git a/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineTests.cs index a615fca52baa..a6fade00ebb3 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/ClientPipelineTests.cs @@ -205,6 +205,7 @@ public async Task CanCreateWithClientAuthorAndClientUserPolicies() ClientPipelineOptions options = new() { RetryPolicy = new ObservablePolicy("RetryPolicy"), + MessageLoggingPolicy = new ObservablePolicy("LoggingPolicy"), Transport = new ObservableTransport("Transport") }; @@ -246,7 +247,7 @@ public async Task CanCreateWithClientAuthorAndClientUserPolicies() List observations = ObservablePolicy.GetData(message); int index = 0; - Assert.AreEqual(27, observations.Count); + Assert.AreEqual(29, observations.Count); Assert.AreEqual("Request:ClientPerCallPolicyA", observations[index++]); Assert.AreEqual("Request:ClientPerCallPolicyB", observations[index++]); @@ -262,6 +263,8 @@ public async Task CanCreateWithClientAuthorAndClientUserPolicies() Assert.AreEqual("Request:UserPerTryPolicyA", observations[index++]); Assert.AreEqual("Request:UserPerTryPolicyB", observations[index++]); + Assert.AreEqual("Request:LoggingPolicy", observations[index++]); + Assert.AreEqual("Request:ClientBeforeTransportPolicyA", observations[index++]); Assert.AreEqual("Request:ClientBeforeTransportPolicyB", observations[index++]); @@ -276,6 +279,8 @@ public async Task CanCreateWithClientAuthorAndClientUserPolicies() Assert.AreEqual("Response:ClientBeforeTransportPolicyB", observations[index++]); Assert.AreEqual("Response:ClientBeforeTransportPolicyA", observations[index++]); + Assert.AreEqual("Response:LoggingPolicy", observations[index++]); + Assert.AreEqual("Response:UserPerTryPolicyB", observations[index++]); Assert.AreEqual("Response:UserPerTryPolicyA", observations[index++]); @@ -296,6 +301,7 @@ public async Task RequestOptionsCanCustomizePipeline() { ClientPipelineOptions pipelineOptions = new ClientPipelineOptions(); pipelineOptions.RetryPolicy = new ObservablePolicy("RetryPolicy"); + pipelineOptions.MessageLoggingPolicy = new ObservablePolicy("LoggingPolicy"); pipelineOptions.Transport = new ObservableTransport("Transport"); ClientPipeline pipeline = ClientPipeline.Create(pipelineOptions); @@ -312,13 +318,15 @@ public async Task RequestOptionsCanCustomizePipeline() List observations = ObservablePolicy.GetData(message); int index = 0; - Assert.AreEqual(9, observations.Count); + Assert.AreEqual(11, observations.Count); Assert.AreEqual("Request:A", observations[index++]); Assert.AreEqual("Request:RetryPolicy", observations[index++]); Assert.AreEqual("Request:B", observations[index++]); + Assert.AreEqual("Request:LoggingPolicy", observations[index++]); Assert.AreEqual("Request:C", observations[index++]); Assert.AreEqual("Transport:Transport", observations[index++]); Assert.AreEqual("Response:C", observations[index++]); + Assert.AreEqual("Response:LoggingPolicy", observations[index++]); Assert.AreEqual("Response:B", observations[index++]); Assert.AreEqual("Response:RetryPolicy", observations[index++]); Assert.AreEqual("Response:A", observations[index++]); diff --git a/sdk/core/System.ClientModel/tests/Pipeline/ClientRetryPolicyTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/ClientRetryPolicyTests.cs index a6c893724a01..16db2e408104 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/ClientRetryPolicyTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/ClientRetryPolicyTests.cs @@ -47,7 +47,7 @@ public async Task DoesNotExceedRetryCount() { ClientPipelineOptions options = new() { - Transport = new MockPipelineTransport("Transport", i => 500) + Transport = new MockPipelineTransport("Transport", _ => new MockPipelineResponse(500)) }; ClientPipeline pipeline = ClientPipeline.Create(options); @@ -76,7 +76,7 @@ public async Task CanConfigureMaxRetryCount() ClientPipelineOptions options = new() { RetryPolicy = new MockRetryPolicy(maxRetryCount, i => TimeSpan.FromMilliseconds(10)), - Transport = new MockPipelineTransport("Transport", i => 500) + Transport = new MockPipelineTransport("Transport", _ => new MockPipelineResponse(500)) }; ClientPipeline pipeline = ClientPipeline.Create(options); @@ -169,16 +169,17 @@ public void RespectsRetryAfterDateHeader() public async Task ShouldRetryIsCalledOnlyForErrors() { Exception retriableException = new IOException(); + int retryCount = 0; - MockRetryPolicy retryPolicy = new MockRetryPolicy(); - MockPipelineTransport transport = new MockPipelineTransport("Transport", responseFactory); + MockRetryPolicy retryPolicy = new(); + MockPipelineTransport transport = new("Transport", responseFactory); - int responseFactory(int i) - => i switch + MockPipelineResponse responseFactory(PipelineMessage m) + => retryCount++ switch { - 0 => 500, + 0 => new MockPipelineResponse(500), 1 => throw retriableException, - 2 => 200, + 2 => new MockPipelineResponse(200), _ => throw new InvalidOperationException(), }; @@ -190,9 +191,9 @@ int responseFactory(int i) ClientPipeline pipeline = ClientPipeline.Create(options); // Validate the state of the retry policy at the transport. - transport.OnSendingRequest = i => + transport.OnSendingRequest = _ => { - switch (i) + switch (retryCount) { case 0: Assert.IsFalse(retryPolicy.ShouldRetryCalled); @@ -237,16 +238,17 @@ int responseFactory(int i) public async Task CallbacksAreCalledForErrorResponseAndException() { Exception retriableException = new IOException(); + int retryCount = 0; - MockRetryPolicy retryPolicy = new MockRetryPolicy(); - MockPipelineTransport transport = new MockPipelineTransport("Transport", responseFactory); + MockRetryPolicy retryPolicy = new(); + MockPipelineTransport transport = new("Transport", responseFactory); - int responseFactory(int i) - => i switch + MockPipelineResponse responseFactory(PipelineMessage m) + => retryCount++ switch { - 0 => 500, + 0 => new MockPipelineResponse(500), 1 => throw retriableException, - 2 => 200, + 2 => new MockPipelineResponse(200), _ => throw new InvalidOperationException(), }; @@ -260,7 +262,7 @@ int responseFactory(int i) // Validate the state of the retry policy at the transport. transport.OnSendingRequest = i => { - switch (i) + switch (retryCount) { case 0: Assert.IsTrue(retryPolicy.OnSendingRequestCalled); @@ -338,17 +340,18 @@ public void RethrowsAggregateExceptionAfterMaxRetryCount() new IOException(), new IOException(), new IOException() }; + int retryCount = 0; MockRetryPolicy retryPolicy = new MockRetryPolicy(); MockPipelineTransport transport = new MockPipelineTransport("Transport", responseFactory); - int responseFactory(int i) - => i switch + MockPipelineResponse responseFactory(PipelineMessage i) + => retryCount++ switch { - 0 => throw exceptions[i], - 1 => throw exceptions[i], - 2 => throw exceptions[i], - 3 => throw exceptions[i], + 0 => throw exceptions[0], + 1 => throw exceptions[1], + 2 => throw exceptions[2], + 3 => throw exceptions[3], _ => throw new InvalidOperationException(), }; diff --git a/sdk/core/System.ClientModel/tests/Pipeline/MessageLoggingPolicyTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/MessageLoggingPolicyTests.cs new file mode 100644 index 000000000000..d9453b7ff401 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/Pipeline/MessageLoggingPolicyTests.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.ClientModel.Tests.TestFramework; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests; +using ClientModel.Tests.Mocks; +using Microsoft.Extensions.Logging; +using NUnit.Framework; +using SyncAsyncTestBase = ClientModel.Tests.SyncAsyncTestBase; + +namespace System.ClientModel.Tests.Pipeline; + +// Avoid running these tests in parallel with anything else that's sharing the event source +[NonParallelizable] +public class MessageLoggingPolicyTests(bool isAsync) : SyncAsyncTestBase(isAsync) +{ + private const int RequestEvent = 1; + private const int RequestContentEvent = 2; + private const int ResponseEvent = 5; + private const int ResponseContentEvent = 6; + private const int ErrorResponseEvent = 8; + private const int ErrorResponseContentEvent = 9; + private const int ResponseContentBlockEvent = 11; + private const int ErrorResponseContentBlockEvent = 12; + private const int ResponseContentTextEvent = 13; + private const int ErrorResponseContentTextEvent = 14; + private const int ResponseContentTextBlockEvent = 15; + private const int ErrorResponseContentTextBlockEvent = 16; + private const int RequestContentTextEvent = 17; + private const string LoggingPolicyCategoryName = "System.ClientModel.Primitives.MessageLoggingPolicy"; + private const string PipelineTransportCategoryName = "System.ClientModel.Primitives.PipelineTransport"; + private const string RetryPolicyCategoryName = "System.ClientModel.Primitives.ClientRetryPolicy"; + private const string SystemClientModelEventSourceName = "System.ClientModel"; + private readonly MockResponseHeaders _defaultHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + private readonly MockResponseHeaders _defaultTextHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Content-Type", "text/plain" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + + [Test] + public async Task OptionsCanBeUpdatedUntilFrozenByPipeline() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + + MessageLoggingPolicy loggingPolicy = new(loggingOptions); + + ClientPipelineOptions options = new() + { + MessageLoggingPolicy = loggingPolicy, + Transport = new MockPipelineTransport("Transport", [200]) + }; + + loggingOptions.EnableMessageContentLogging = true; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData([1,2,3])); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.GetAndValidateSingleEvent(RequestContentEvent, "RequestContent", LogLevel.Debug); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedByDefaultToEventSource(bool isError, bool asText) + { + using TestClientEventListener listener = new(); + ClientLoggingOptions loggingOptions = new(); + + await SendSimpleRequestResponseSyncOrAsync(isError, loggingOptions, asText, IsAsync); + + listener.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedByDefaultToILogger(bool isError, bool asText) + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + + await SendSimpleRequestResponseSyncOrAsync(isError, loggingOptions, asText, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedWhenDisabledToEventSource(bool isError, bool asText) + { + using TestClientEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = false + }; + + await SendSimpleRequestResponseSyncOrAsync(isError, loggingOptions, asText, IsAsync); + + listener.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedWhenDisabledToILogger(bool isError, bool asText) + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = false, + LoggerFactory = factory + }; + + await SendSimpleRequestResponseSyncOrAsync(isError, loggingOptions, asText, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedInBlocksWhenDisabledToEventSource(bool isError, bool asText) + { + using TestClientEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = false + }; + + MockPipelineResponse response = new(isError ? 500 : 200, mockHeaders: asText ? _defaultTextHeaders : _defaultHeaders) + { + ContentStream = new NonSeekableMemoryStream(Encoding.UTF8.GetBytes("Hello world")) + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(Encoding.UTF8.GetBytes("Hello world"))); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + listener.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedInBlocksWhenDisabledToILogger(bool isError, bool asText) + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = false, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(isError ? 500 : 200, mockHeaders: asText ? _defaultTextHeaders : _defaultHeaders) + { + ContentStream = new NonSeekableMemoryStream(Encoding.UTF8.GetBytes("Hello world")) + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(Encoding.UTF8.GetBytes("Hello world"))); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.AssertNoContentLogged(); + } + + [TestCase(true, true)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(false, false)] + [Test] + public async Task ContentIsNotLoggedWhenEventSourceIsDisabled(bool isError, bool asText) + { + using TestEventListenerWarning listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true + }; + + await SendSimpleRequestResponseSyncOrAsync(isError, loggingOptions, asText, IsAsync); + + listener.AssertNoContentLogged(); + } + + [TestCase(true)] + [TestCase(false)] + [Test] + public async Task ContentEventIsNotWrittenWhenThereIsNoContentToEventSource(bool isError) + { + using TestClientEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true + }; + + MockPipelineResponse response = new(isError ? 500 : 200); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + listener.AssertNoContentLogged(); + } + + [TestCase(true)] + [TestCase(false)] + [Test] + public async Task ContentEventIsNotWrittenWhenThereIsNoContentToILogger(bool isError) + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(isError ? 500 : 200); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.AssertNoContentLogged(); + } + + [Test] + public async Task RequestContentLogsAreLimitedInLengthToEventSource() + { + using TestClientEventListener listener = new(); + + var response = new MockPipelineResponse(500); + byte[] requestContent = [1, 2, 3, 4, 5, 6, 7, 8]; + byte[] requestContentLimited = [1, 2, 3, 4, 5]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = 5 + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + EventWrittenEventArgs logEvent = listener.GetAndValidateSingleEvent(RequestContentEvent, "RequestContent", EventLevel.Verbose, SystemClientModelEventSourceName); // RequestContentEvent + Assert.AreEqual(requestContentLimited, logEvent.GetProperty("content")); + CollectionAssert.IsEmpty(listener.EventsById(RequestContentTextEvent)); + } + + [Test] + public async Task RequestContentLogsAreLimitedInLengthToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + var response = new MockPipelineResponse(500); + byte[] requestContent = [1, 2, 3, 4, 5, 6, 7, 8]; + byte[] requestContentLimited = [1, 2, 3, 4, 5]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = 5, + LoggerFactory = factory + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + TestLogger logger = factory!.GetLogger(LoggingPolicyCategoryName); + LoggerEvent logEvent = logger.GetAndValidateSingleEvent(RequestContentEvent, "RequestContent", LogLevel.Debug); + Assert.AreEqual(requestContentLimited, logEvent.GetValueFromArguments("content")); + CollectionAssert.IsEmpty(logger.EventsById(RequestContentTextEvent)); + } + + [Test] + public async Task RequestContentTextLogsAreLimitedInLengthToEventSource() + { + using TestClientEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = 5 + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultTextHeaders); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData("Hello world")); + message.Request.Headers.Add("Content-Type", "text/plain"); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + EventWrittenEventArgs requestEvent = listener!.GetAndValidateSingleEvent(RequestContentTextEvent, "RequestContentText", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual("Hello", requestEvent.GetProperty("content")); + + CollectionAssert.IsEmpty(listener!.EventsById(RequestContentEvent)); + } + + [Test] + public async Task RequestContentTextLogsAreLimitedInLengthToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = 5, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(500, mockHeaders: _defaultTextHeaders); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData("Hello world")); + message.Request.Headers.Add("Content-Type", "text/plain"); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + LoggerEvent logEvent = logger.GetAndValidateSingleEvent(RequestContentTextEvent, "RequestContentText", LogLevel.Debug); + Assert.AreEqual("Hello", logEvent.GetValueFromArguments("content")); + CollectionAssert.IsEmpty(logger.EventsById(RequestContentEvent)); // RequestContentEvent + } + + [Test] + public async Task SeekableTextResponsesAreLimitedInLengthToEventSource() + { + using TestClientEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + MessageContentSizeLimit = 5, + EnableMessageContentLogging = true + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultTextHeaders); + await SendRequestWithStreamingResponseSyncOrAsync(response, true, loggingOptions); + + EventWrittenEventArgs contentEvent = listener.GetAndValidateSingleEvent(ResponseContentTextEvent, "ResponseContentText", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual("Hello", contentEvent.GetProperty("content")); + } + + [Test] + public async Task SeekableTextResponsesAreLimitedInLengthToILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() + { + MessageContentSizeLimit = 5, + EnableMessageContentLogging = true, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultTextHeaders); + await SendRequestWithStreamingResponseSyncOrAsync(response, true, loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + LoggerEvent contentEvent = logger.GetAndValidateSingleEvent(13, "ResponseContentText", LogLevel.Debug); + Assert.AreEqual("Hello", contentEvent.GetValueFromArguments("content")); + } + + [Test] + public async Task NonSeekableResponsesAreLimitedInLengthEventSource() + { + using TestClientEventListener listener = new(); + ClientLoggingOptions loggingOptions = new() + { + MessageContentSizeLimit = 5, + EnableMessageContentLogging = true + }; + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + + await SendRequestWithStreamingResponseSyncOrAsync(response, false, loggingOptions); + + EventWrittenEventArgs responseEvent = listener.GetAndValidateSingleEvent(11, "ResponseContentBlock", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual(Encoding.UTF8.GetBytes("Hello"), responseEvent.GetProperty("content")); + } + + [Test] + public async Task NonSeekableResponsesAreLimitedInLengthILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() + { + MessageContentSizeLimit = 5, + EnableMessageContentLogging = true, + LoggerFactory = factory + }; + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + + await SendRequestWithStreamingResponseSyncOrAsync(response, false, loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + LoggerEvent responseEvent = logger.GetAndValidateSingleEvent(11, "ResponseContentBlock", LogLevel.Debug); + Assert.AreEqual(Encoding.UTF8.GetBytes("Hello"), responseEvent.GetValueFromArguments("content")); + } + + #region Helpers + + private class TestEventListenerWarning : TestClientEventListener + { + protected override void OnEventSourceCreated(EventSource eventSource) + { + if (eventSource.Name == "System.ClientModel") + { + Console.WriteLine("Warning"); + EnableEvents(eventSource, EventLevel.Warning); + } + } + } + + private async Task SendRequestWithStreamingResponseSyncOrAsync(MockPipelineResponse response, + bool isSeekable, + ClientLoggingOptions loggingOptions) + { + byte[] responseContent = Encoding.UTF8.GetBytes("Hello world"); + if (isSeekable) + { + response.ContentStream = new MemoryStream(responseContent); + } + else + { + response.ContentStream = new NonSeekableMemoryStream(responseContent); + } + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + + // These tests are essentially testing whether the logging policy works + // correctly when responses are buffered (memory stream) and unbuffered + // (non-seekable). In order to validate the intent of the test, we set + // message.BufferResponse accordingly here. + message.BufferResponse = isSeekable; + + await pipeline.SendSyncOrAsync(message, IsAsync); + + var buffer = new byte[11]; + + if (IsAsync) + { +#if NET462 + Assert.AreEqual(6, await response.ContentStream.ReadAsync(buffer, 5, 6)); + Assert.AreEqual(5, await response.ContentStream.ReadAsync(buffer, 6, 5)); + Assert.AreEqual(0, await response.ContentStream.ReadAsync(buffer, 0, 5)); +#else + Assert.AreEqual(6, await response.ContentStream.ReadAsync(buffer.AsMemory(5, 6))); + Assert.AreEqual(5, await response.ContentStream.ReadAsync(buffer.AsMemory(6, 5))); + Assert.AreEqual(0, await response.ContentStream.ReadAsync(buffer.AsMemory(0, 5))); +#endif + } + else + { + Assert.AreEqual(6, response.ContentStream.Read(buffer, 5, 6)); + Assert.AreEqual(5, response.ContentStream.Read(buffer, 6, 5)); + Assert.AreEqual(0, response.ContentStream.Read(buffer, 0, 5)); + } + } + + private async Task SendSimpleRequestResponseSyncOrAsync(bool isError, ClientLoggingOptions loggingOptions, bool contentAsText, bool isAsync) + { + MockPipelineResponse response = new(isError ? 500 : 200); + response.SetContent([1, 2, 3]); + + loggingOptions.AllowedHeaderNames.Add("Custom-Header"); + loggingOptions.AllowedHeaderNames.Add("Custom-Response-Header"); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Headers.Add("Custom-Header", "custom-header-value"); + message.Request.Headers.Add("Date", "08/16/2024"); + + if (contentAsText) + { + response.SetContent("ResponseAsText"); + message.Request.Content = BinaryContent.Create(new BinaryData("RequestAsText")); + message.Request.Headers.Add("Content-Type", "text/plain"); + } + else + { + response.SetContent([1, 2, 3]); + message.Request.Content = BinaryContent.Create(new BinaryData(Encoding.UTF8.GetBytes("Hello world"))); + } + + await pipeline.SendSyncOrAsync(message, IsAsync); + } + + #endregion +} diff --git a/sdk/core/System.ClientModel/tests/Pipeline/PipelineTransportFunctionalTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/PipelineTransportFunctionalTests.cs index d62e71147f8f..dacce0a9e558 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/PipelineTransportFunctionalTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/PipelineTransportFunctionalTests.cs @@ -1,19 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core.TestFramework; -using ClientModel.Tests; -using ClientModel.Tests.Mocks; -using Microsoft.AspNetCore.Http.Features; -using NUnit.Framework; using System.ClientModel.Primitives; -using System.Collections.Generic; using System.IO; -using System.Net; -using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests.Mocks; +using Microsoft.AspNetCore.Http.Features; +using NUnit.Framework; using SyncAsyncTestBase = ClientModel.Tests.SyncAsyncTestBase; namespace System.ClientModel.Tests.Pipeline; diff --git a/sdk/core/System.ClientModel/tests/Samples/LoggingSamples.cs b/sdk/core/System.ClientModel/tests/Samples/LoggingSamples.cs new file mode 100644 index 000000000000..ae7672b3e0ef --- /dev/null +++ b/sdk/core/System.ClientModel/tests/Samples/LoggingSamples.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics.Tracing; +using Maps; +using Microsoft.Extensions.Logging; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Samples; + +public class LoggingSamples +{ + [Test] + public void UseILoggerFactoryToCaptureLogs() + { + #region Snippet:UseILoggerFactoryToCaptureLogs + using ILoggerFactory factory = LoggerFactory.Create(builder => + { + builder.AddConsole().SetMinimumLevel(LogLevel.Information); + }); + + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + + // Create and use client as usual + #endregion + } + + [Test] + public void UseEventSourceToCaptureLogs() + { + #region Snippet:UseEventSourceToCaptureLogs + // In order for an event listener to collect logs, it must be in scope and active + // while the client library is in use. If the listener is disposed or otherwise + // out of scope, logs cannot be collected. + using ConsoleWriterEventListener listener = new(); + + // Create and use client as usual + #endregion + } + + [Test] + public void LoggingRedactedHeaderILogger() + { + #region Snippet:LoggingRedactedHeaderILogger + using ILoggerFactory factory = LoggerFactory.Create(builder => + { + builder.AddConsole(); + }); + + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + loggingOptions.AllowedHeaderNames.Add("Request-Id"); + loggingOptions.AllowedQueryParameters.Add("api-version"); + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + [Test] + public void LoggingRedactedHeaderEventSource() + { + #region Snippet:LoggingRedactedHeaderEventSource + using ConsoleWriterEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new(); + loggingOptions.AllowedHeaderNames.Add("Request-Id"); + loggingOptions.AllowedQueryParameters.Add("api-version"); + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + [Test] + public void LoggingAllRedactedHeadersILogger() + { + #region Snippet:LoggingAllRedactedHeadersILogger + using ILoggerFactory factory = LoggerFactory.Create(builder => + { + builder.AddConsole(); + }); + + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + loggingOptions.AllowedHeaderNames.Add("*"); + loggingOptions.AllowedQueryParameters.Add("*"); + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + [Test] + public void LoggingAllRedactedHeadersEventSource() + { + #region Snippet:LoggingAllRedactedHeadersEventSource + using ConsoleWriterEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new(); + loggingOptions.AllowedHeaderNames.Add("*"); + loggingOptions.AllowedQueryParameters.Add("*"); + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + [Test] + public void EnableContentLoggingILogger() + { + #region Snippet:EnableContentLoggingILogger + using ILoggerFactory factory = LoggerFactory.Create(builder => + { + builder.AddConsole().SetMinimumLevel(LogLevel.Debug); + }); + + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory, + EnableMessageContentLogging = true + }; + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + [Test] + public void EnableContentLoggingEventSource() + { + #region Snippet:EnableContentLoggingEventSource + using ConsoleWriterEventListener listener = new(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true + }; + + MapsClientOptions options = new() + { + ClientLoggingOptions = loggingOptions + }; + #endregion + } + + internal class ConsoleWriterEventListener : EventListener + { + protected override void OnEventSourceCreated(EventSource eventSource) + { + if (eventSource.Name == "System-ClientModel") + { + EnableEvents(eventSource, EventLevel.Informational); + } + } + + protected override void OnEventWritten(EventWrittenEventArgs eventData) + { + Console.WriteLine(eventData.EventId + " " + eventData.EventName + " " + DateTime.Now); + } + } +} diff --git a/sdk/core/System.ClientModel/tests/System.ClientModel.Tests.csproj b/sdk/core/System.ClientModel/tests/System.ClientModel.Tests.csproj index 838309afa64f..799857a08a18 100644 --- a/sdk/core/System.ClientModel/tests/System.ClientModel.Tests.csproj +++ b/sdk/core/System.ClientModel/tests/System.ClientModel.Tests.csproj @@ -13,6 +13,8 @@ + + diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Logging/LoggerEvent.cs b/sdk/core/System.ClientModel/tests/TestFramework/Logging/LoggerEvent.cs new file mode 100644 index 000000000000..5c3758c20b06 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/TestFramework/Logging/LoggerEvent.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Logging; + +namespace System.ClientModel.Tests.TestFramework; + +public class LoggerEvent +{ + public LoggerEvent(LogLevel logLevel, + string message, + Exception? exception, + EventId eventId, + IReadOnlyList> arguments) + { + LogLevel = logLevel; + Message = message; + Exception = exception; + EventId = eventId; + Arguments = arguments; + } + + public LogLevel LogLevel { get; } + public string Message { get; } + public Exception? Exception { get; } + public EventId EventId { get; } + public IReadOnlyList> Arguments { get; } + + public T GetValueFromArguments(string key) + { + var value = Arguments.Single(kvp => kvp.Key == key).Value; + return (T)value!; + } +} diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestClientEventListener.cs b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestClientEventListener.cs new file mode 100644 index 000000000000..fa2726b7e36d --- /dev/null +++ b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestClientEventListener.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.Globalization; +using System.Linq; +using System.Text; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace ClientModel.Tests +{ + public class TestClientEventListener : EventListener + { + private volatile bool _disposed; + private readonly ConcurrentQueue _events = new(); + + public IEnumerable EventData => _events; + + /// + /// Creates an instance of . + /// + public TestClientEventListener() + { + } + + protected override void OnEventSourceCreated(EventSource eventSource) + { + // The event source names have to be hardcoded and cannot be configured at runtime by the constructor. This + // is because when an EventListener is instantiated, the OnEventWritten and OnEventSourceCreated callback methods can + // be called before the constructor has completed + // see: https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventlistener#remarks + if (eventSource.Name == "System.ClientModel") + { + EnableEvents(eventSource, EventLevel.Verbose); + } + } + + protected override void OnEventWritten(EventWrittenEventArgs eventData) + { + // Work around https://github.com/dotnet/corefx/issues/42600 + if (eventData.EventId == -1) + { + return; + } + + if (!_disposed) + { + // Make sure we can format the event + Format(eventData); + _events.Enqueue(eventData); + } + } + + public EventWrittenEventArgs GetAndValidateSingleEvent(int eventId, string expectedEventName, EventLevel expectedEventLevel, string expectedEventSourceName) + { + EventWrittenEventArgs args = SingleEventById(eventId); + Assert.AreEqual(expectedEventName, args.EventName); + Assert.AreEqual(expectedEventLevel, args.Level); + Assert.AreEqual(expectedEventSourceName, args.EventSource.Name); + string requestId = args.GetProperty("requestId"); + Assert.That(string.IsNullOrEmpty(requestId), Is.False); + return args; + } + + public EventWrittenEventArgs SingleEventById(int id, Func? filter = default) + { + return EventsById(id).Single(filter ?? (_ => true)); + } + + public void ValidateNumberOfEventsById(int eventId, int expectedNumEvents) + { + Assert.AreEqual(expectedNumEvents, EventsById(eventId).Count()); + } + + public IEnumerable EventsById(int id) + { + return _events.Where(e => e.EventId == id); + } + + public void AssertNoContentLogged() + { + CollectionAssert.IsEmpty(EventsById(2)); // RequestContentEvent + CollectionAssert.IsEmpty(EventsById(17)); // RequestContentTextEvent + + CollectionAssert.IsEmpty(EventsById(6)); // ResponseContentEvent + CollectionAssert.IsEmpty(EventsById(13)); // ResponseContentTextEvent + CollectionAssert.IsEmpty(EventsById(11)); // ResponseContentBlockEvent + CollectionAssert.IsEmpty(EventsById(15)); // ResponseContentTextBlockEvent + + CollectionAssert.IsEmpty(EventsById(9)); // ErrorResponseContentEvent + CollectionAssert.IsEmpty(EventsById(14)); // ErrorResponseContentTextEvent + CollectionAssert.IsEmpty(EventsById(12)); // ErrorResponseContentBlockEvent + CollectionAssert.IsEmpty(EventsById(16)); // ErrorResponseContentTextBlockEvent + } + + public override void Dispose() + { + _disposed = true; + base.Dispose(); + } + + #region Helpers + + private static string Format(EventWrittenEventArgs eventData) + { + var payloadArray = eventData.Payload?.ToArray() ?? Array.Empty(); + + ProcessPayloadArray(payloadArray); + + if (eventData.Message != null) + { + try + { + return string.Format(CultureInfo.InvariantCulture, eventData.Message, payloadArray); + } + catch (FormatException) + { + } + } + + var stringBuilder = new StringBuilder(); + stringBuilder.Append(eventData.EventName); + + if (!string.IsNullOrWhiteSpace(eventData.Message)) + { + stringBuilder.AppendLine(); + stringBuilder.Append(nameof(eventData.Message)).Append(" = ").Append(eventData.Message); + } + + if (eventData.PayloadNames != null) + { + for (int i = 0; i < eventData.PayloadNames.Count; i++) + { + stringBuilder.AppendLine(); + stringBuilder.Append(eventData.PayloadNames[i]).Append(" = ").Append(payloadArray[i]); + } + } + + return stringBuilder.ToString(); + } + + private static void ProcessPayloadArray(object?[] payloadArray) + { + for (int i = 0; i < payloadArray.Length; i++) + { + payloadArray[i] = FormatValue(payloadArray[i]); + } + } + + private static object? FormatValue(object? o) + { + if (o is byte[] bytes) + { + var stringBuilder = new StringBuilder(); + foreach (byte b in bytes) + { + stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0:X2}", b); + } + + return stringBuilder.ToString(); + } + + return o; + } + + #endregion + } +} diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLogger.cs b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLogger.cs new file mode 100644 index 000000000000..627d9a3d4f1e --- /dev/null +++ b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLogger.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel.Tests.TestFramework; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Logging; +using NUnit.Framework; + +namespace ClientModel.Tests; + +public class TestLogger : ILogger +{ + private LogLevel _logLevel; + private readonly ConcurrentQueue _logs = new(); + + public TestLogger(LogLevel logLevel, string name) + { + _logLevel = logLevel; + Name = name; + } + + public IEnumerable Logs => _logs; + + public string Name { get; set; } + + public IDisposable BeginScope(TState state) + { + throw new NotImplementedException(); + } + + public bool IsEnabled(LogLevel logLevel) + { + return logLevel >= _logLevel; + } + + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter) + { + if (IsEnabled(logLevel)) + { + IReadOnlyList> arguments = state as IReadOnlyList> ?? new List>(); + var loggerEvent = new LoggerEvent(logLevel, formatter(state, exception), exception, eventId, arguments); + _logs.Enqueue(loggerEvent); + } + } + + public LoggerEvent GetAndValidateSingleEvent(int eventId, string expectedEventName, LogLevel expectedEventLevel) + { + LoggerEvent log = SingleEventById(eventId); + Assert.AreEqual(expectedEventName, log.EventId.Name); + Assert.AreEqual(expectedEventLevel, log.LogLevel); + string requestId = log.GetValueFromArguments("requestId"); + Assert.That(string.IsNullOrEmpty(requestId), Is.False); + return log; + } + + public LoggerEvent SingleEventById(int eventId, Func? filter = default) + { + return EventsById(eventId).Single(filter ?? (_ => true)); + } + + public void ValidateNumberOfEventsById(int eventId, int expectedNumEvents) + { + Assert.AreEqual(expectedNumEvents, EventsById(eventId).Count()); + } + + public IEnumerable EventsById(int eventId) + { + return _logs.Where(e => e.EventId.Id == eventId); + } + + public void AssertNoContentLogged() + { + CollectionAssert.IsEmpty(EventsById(2)); // RequestContentEvent + CollectionAssert.IsEmpty(EventsById(17)); // RequestContentTextEvent + + CollectionAssert.IsEmpty(EventsById(6)); // ResponseContentEvent + CollectionAssert.IsEmpty(EventsById(13)); // ResponseContentTextEvent + CollectionAssert.IsEmpty(EventsById(11)); // ResponseContentBlockEvent + CollectionAssert.IsEmpty(EventsById(15)); // ResponseContentTextBlockEvent + + CollectionAssert.IsEmpty(EventsById(9)); // ErrorResponseContentEvent + CollectionAssert.IsEmpty(EventsById(14)); // ErrorResponseContentTextEvent + CollectionAssert.IsEmpty(EventsById(12)); // ErrorResponseContentBlockEvent + CollectionAssert.IsEmpty(EventsById(16)); // ErrorResponseContentTextBlockEvent + } +} diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLoggingFactory.cs b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLoggingFactory.cs new file mode 100644 index 000000000000..6b6b5f1c5cfb --- /dev/null +++ b/sdk/core/System.ClientModel/tests/TestFramework/Logging/TestLoggingFactory.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; + +namespace ClientModel.Tests; + +public class TestLoggingFactory : ILoggerFactory +{ + private readonly ConcurrentDictionary _loggers; + + public TestLoggingFactory(LogLevel level) + { + _loggers = new(); + LogLevel = level; + } + + public LogLevel LogLevel { get; } + + public void AddProvider(ILoggerProvider provider) + { + throw new NotImplementedException(); + } + + public ILogger CreateLogger(string categoryName) + { + return _loggers.GetOrAdd(categoryName, name => new TestLogger(LogLevel, name)); + } + + public TestLogger GetLogger(string categoryName) + { + return _loggers[categoryName]; + } + + public void Dispose() + { + _loggers.Clear(); + } +} diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineRequest.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineRequest.cs index bfafc9750091..7a2186539d94 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineRequest.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineRequest.cs @@ -20,6 +20,7 @@ public MockPipelineRequest() { _headers = new MockRequestHeaders(); _method = "GET"; + _uri = new Uri("https://www.example.com"); } protected override BinaryContent? ContentCore diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineResponse.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineResponse.cs index d04486feb670..0b7576d994a8 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineResponse.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineResponse.cs @@ -21,11 +21,11 @@ public class MockPipelineResponse : PipelineResponse private bool _disposed; - public MockPipelineResponse(int status = 0, string reasonPhrase = "") + public MockPipelineResponse(int status = 0, string reasonPhrase = "", MockResponseHeaders? mockHeaders = default) { _status = status; _reasonPhrase = reasonPhrase; - _headers = new MockResponseHeaders(); + _headers = mockHeaders ?? new MockResponseHeaders(); } public override int Status => _status; @@ -127,6 +127,7 @@ public override BinaryData BufferContent(CancellationToken cancellationToken = d // Less efficient FromStream method called here because it is a mock. // For intended production implementation, see HttpClientTransportResponse. _bufferedContent = BinaryData.FromStream(bufferStream); + _contentStream.Seek(0, SeekOrigin.Begin); return _bufferedContent; } @@ -158,6 +159,7 @@ public override async ValueTask BufferContentAsync(CancellationToken // Less efficient FromStream method called here because it is a mock. // For intended production implementation, see HttpClientTransportResponse. _bufferedContent = BinaryData.FromStream(bufferStream); + _contentStream.Seek(0, SeekOrigin.Begin); return _bufferedContent; } } diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineTransport.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineTransport.cs index 046edc105811..3a11a6cf2202 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineTransport.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockPipelineTransport.cs @@ -8,79 +8,69 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging; namespace ClientModel.Tests.Mocks; public class MockPipelineTransport : PipelineTransport { - private readonly Func _responseFactory; - private int _retryCount; + private readonly Func _responseFactory; + private readonly bool _addDelay; public string Id { get; } - public Action? OnSendingRequest { get; set; } - public Action? OnReceivedResponse { get; set; } + public Action? OnSendingRequest { get; set; } + public Action? OnReceivedResponse { get; set; } public MockPipelineTransport(string id, params int[] codes) - : this(id, i => codes[i]) { + Id = id; + var requestIndex = 0; + _responseFactory = _ => { return new MockPipelineResponse(codes[requestIndex++]); }; } - public MockPipelineTransport(string id, Func responseFactory) + public MockPipelineTransport(string id, Func responseFactory, bool enableLogging = false, ILoggerFactory? loggerFactory = null, bool addDelay = false) : base(enableLogging, loggerFactory) { Id = id; _responseFactory = responseFactory; + _addDelay = addDelay; } protected override PipelineMessage CreateMessageCore() { - return new RetriableTransportMessage(); + return new MockPipelineMessage(); } protected override void ProcessCore(PipelineMessage message) { - try - { - Stamp(message, "Transport"); + Stamp(message, "Transport"); - OnSendingRequest?.Invoke(_retryCount); + OnSendingRequest?.Invoke((MockPipelineMessage)message); - if (message is RetriableTransportMessage transportMessage) - { - int status = _responseFactory(_retryCount); - transportMessage.SetResponse(status); - } + ((MockPipelineMessage)message).SetResponse(_responseFactory(message)); - OnReceivedResponse?.Invoke(_retryCount); - } - finally + if (_addDelay) { - _retryCount++; + Task.Delay(TimeSpan.FromSeconds(4)).Wait(); } + + OnReceivedResponse?.Invoke((MockPipelineMessage)message); } - protected override ValueTask ProcessCoreAsync(PipelineMessage message) + protected override async ValueTask ProcessCoreAsync(PipelineMessage message) { - try - { - Stamp(message, "Transport"); + Stamp(message, "Transport"); - OnSendingRequest?.Invoke(_retryCount); + OnSendingRequest?.Invoke((MockPipelineMessage)message); - if (message is RetriableTransportMessage transportMessage) - { - int status = _responseFactory(_retryCount); - transportMessage.SetResponse(status); - } + ((MockPipelineMessage)message).SetResponse(_responseFactory(message)); - OnReceivedResponse?.Invoke(_retryCount); - } - finally + if (_addDelay) { - _retryCount++; + await Task.Delay(TimeSpan.FromSeconds(4)); } - return new ValueTask(); + OnReceivedResponse?.Invoke((MockPipelineMessage)message); } private void Stamp(PipelineMessage message, string prefix) @@ -100,90 +90,4 @@ private void Stamp(PipelineMessage message, string prefix) values.Add($"{prefix}:{Id}"); } - - private class RetriableTransportMessage : PipelineMessage - { - public RetriableTransportMessage() : this(new TransportRequest()) - { - } - - protected internal RetriableTransportMessage(PipelineRequest request) : base(request) - { - } - - public void SetResponse(int status) - { - Response = new RetriableTransportResponse(status); - } - } - - private class TransportRequest : PipelineRequest - { - private Uri? _uri; - private readonly PipelineRequestHeaders _headers; - - public TransportRequest() - { - _headers = new MockRequestHeaders(); - _uri = new Uri("https://www.example.com"); - } - - public override void Dispose() { } - - protected override BinaryContent? ContentCore - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } - - protected override PipelineRequestHeaders HeadersCore - => _headers; - - protected override string MethodCore - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } - - protected override Uri? UriCore - { - get => _uri; - set => _uri = value; - } - } - - private class RetriableTransportResponse : PipelineResponse - { - public RetriableTransportResponse(int status) - { - Status = status; - } - - public override int Status { get; } - - public override string ReasonPhrase => throw new NotImplementedException(); - - public override Stream? ContentStream - { - get => null; - set => throw new NotImplementedException(); - } - - public override BinaryData Content => throw new NotImplementedException(); - - protected override PipelineResponseHeaders HeadersCore - => new MockResponseHeaders(); - - public override void Dispose() { } - - public override BinaryData BufferContent(CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override ValueTask BufferContentAsync(CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - } } diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockRequestHeaders.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockRequestHeaders.cs index 045e3a27e4e1..acdbcf7ad2ef 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockRequestHeaders.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockRequestHeaders.cs @@ -30,7 +30,8 @@ public override void Add(string name, string value) public override IEnumerator> GetEnumerator() { - throw new NotImplementedException(); + IEnumerator> enumerator = _headers.GetEnumerator(); + return enumerator; } public override bool Remove(string name) @@ -50,6 +51,15 @@ public override bool TryGetValue(string name, out string? value) public override bool TryGetValues(string name, out IEnumerable? values) { - throw new NotImplementedException(); + bool hasValue = _headers.TryGetValue(name, out string? dictionaryValue); + + if (!hasValue || string.IsNullOrEmpty(dictionaryValue)) + { + values = null; + return false; + } + + values = dictionaryValue.Split(','); + return true; } } diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockResponseHeaders.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockResponseHeaders.cs index f297bcd6334d..1c059863cfdb 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockResponseHeaders.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/MockResponseHeaders.cs @@ -11,9 +11,9 @@ public class MockResponseHeaders : PipelineResponseHeaders { private readonly Dictionary _headers; - public MockResponseHeaders() + public MockResponseHeaders(Dictionary? headers = default) { - _headers = new Dictionary(); + _headers = headers ?? new Dictionary(); } public void SetHeader(string name, string value) @@ -21,7 +21,8 @@ public void SetHeader(string name, string value) public override IEnumerator> GetEnumerator() { - throw new NotImplementedException(); + IEnumerator> enumerator = _headers.GetEnumerator(); + return enumerator; } public override bool TryGetValue(string name, out string? value) diff --git a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/ObservableTransport.cs b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/ObservableTransport.cs index be6496cea946..d60940373472 100644 --- a/sdk/core/System.ClientModel/tests/TestFramework/Mocks/ObservableTransport.cs +++ b/sdk/core/System.ClientModel/tests/TestFramework/Mocks/ObservableTransport.cs @@ -92,42 +92,30 @@ public override void Dispose() protected override BinaryContent? ContentCore { - get => throw new NotImplementedException(); + get => null; set => throw new NotImplementedException(); } protected override PipelineRequestHeaders HeadersCore - => throw new NotImplementedException(); + => new MockRequestHeaders(); - protected override string MethodCore - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } + protected override string MethodCore { get; set; } = "GET"; - protected override Uri? UriCore - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } + protected override Uri? UriCore { get; set; } = new Uri("http://example.com"); // For the logging policy } private class TransportResponse : PipelineResponse { public override int Status => 0; - public override string ReasonPhrase => throw new NotImplementedException(); + public override string ReasonPhrase { get; } = string.Empty; - public override Stream? ContentStream - { - get => null; - set => throw new NotImplementedException(); - } + public override Stream? ContentStream { get; set; } - public override BinaryData Content => throw new NotImplementedException(); + public override BinaryData Content { get; } = new BinaryData(new byte[0]); protected override PipelineResponseHeaders HeadersCore - => throw new NotImplementedException(); + => new MockResponseHeaders(); public override void Dispose() { diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/ChangeTrackingStringListTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/ChangeTrackingStringListTests.cs new file mode 100644 index 000000000000..0e628d249059 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/ChangeTrackingStringListTests.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.Collections.Generic; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal; + +internal class ChangeTrackingStringListTests +{ + [Test] + public void CanDetectAddChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list.Add("b"); + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void CanDetectSetChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list[0] = "b"; + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void CanDetectClearChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list.Clear(); + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void ClearNotAChangeForEmptyList() + { + ChangeTrackingStringList list = new(); + + Assert.IsFalse(list.HasChanged); + + list.Clear(); + + Assert.IsFalse(list.HasChanged); + } + + [Test] + public void CanDetectInsertChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list.Insert(0, "b"); + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void CanDetectRemoveChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list.Remove("a"); + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void RemoveNotAChangeIfNotRemoved() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + bool removed = list.Remove("b"); + + Assert.IsFalse(removed); + Assert.IsFalse(list.HasChanged); + } + + [Test] + public void CanDetectRemoveAtChange() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + list.RemoveAt(0); + + Assert.IsTrue(list.HasChanged); + } + + [Test] + public void RemoveAtNotAChangeIfNotRemoved() + { + ChangeTrackingStringList list = new(["a"]); + + Assert.IsFalse(list.HasChanged); + + Assert.Throws(() => list.RemoveAt(1)); + + Assert.IsFalse(list.HasChanged); + } + + [Test] + public void CanCreateListFromCollection() + { + List originalList = ["a", "b", "c"]; + ChangeTrackingStringList changeTrackingList = new(originalList); + + Assert.AreEqual(originalList.Count, changeTrackingList.Count); + Assert.IsTrue(changeTrackingList.Contains(originalList[0])); + Assert.IsTrue(changeTrackingList.Contains(originalList[1])); + Assert.IsTrue(changeTrackingList.Contains(originalList[2])); + } + + [Test] + public void CanCreateListFromCollectionAndTrackChanges() + { + List originalList = ["a", "b", "c"]; + ChangeTrackingStringList changeTrackingList = new(originalList); + + changeTrackingList.Add("d"); + + Assert.IsTrue(changeTrackingList.HasChanged); + } + + [Test] + public void CannotModifyFrozenList() + { + ChangeTrackingStringList list = ["a"]; + + list.Add("b"); + list.Add("c"); + + list.Freeze(); + + Assert.Throws(() => list.Add("d")); + Assert.Throws(() => list[0] = "d"); + Assert.Throws(() => list.Clear()); + Assert.Throws(() => list.Insert(0, "d")); + Assert.Throws(() => list.Remove("a")); + Assert.Throws(() => list.RemoveAt(0)); + } +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/ClientLoggingOptionsTestsInternal.cs b/sdk/core/System.ClientModel/tests/internal/Internal/ClientLoggingOptionsTestsInternal.cs new file mode 100644 index 000000000000..c464df80abdf --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/ClientLoggingOptionsTestsInternal.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using Microsoft.Extensions.Logging.Abstractions; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal +{ + internal class ClientLoggingOptionsTestsInternal + { + private static HashSet s_expectedDefaultAllowedHeaderNames { get; } = [ + "traceparent", + "Accept", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent", + "WWW-Authenticate" ]; + private static HashSet s_expectedDefaultAllowedQueryParameters { get; } = ["api-version"]; + + [Test] + public void ValidOptionsAreConsideredValid() + { + List validLoggingOptions = [ + new ClientLoggingOptions(), + new ClientLoggingOptions { EnableLogging = true }, + new ClientLoggingOptions { EnableLogging = false }, + new ClientLoggingOptions { EnableMessageLogging = true }, + new ClientLoggingOptions { EnableMessageLogging = false }, + new ClientLoggingOptions { EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = true }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = false }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = false }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = true, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = true, EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = false, EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = false, EnableMessageContentLogging = false }, + ]; + + foreach (ClientLoggingOptions options in validLoggingOptions) + { + Assert.DoesNotThrow(() => options.ValidateOptions()); + options.LoggerFactory = NullLoggerFactory.Instance; + options.MessageContentSizeLimit = 15; + Assert.DoesNotThrow(() => options.ValidateOptions()); + } + } + + [Test] + public void InValidOptionsAreConsideredInValid() + { + List validLoggingOptions = [ + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = true }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableMessageLogging = false, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = true, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = true, EnableMessageContentLogging = false }, + new ClientLoggingOptions { EnableLogging = false, EnableMessageLogging = false, EnableMessageContentLogging = true }, + new ClientLoggingOptions { EnableLogging = true, EnableMessageLogging = false, EnableMessageContentLogging = true }, + ]; + + foreach (var options in validLoggingOptions) + { + Assert.Throws(() => options.ValidateOptions()); + options.LoggerFactory = NullLoggerFactory.Instance; + options.MessageContentSizeLimit = 15; + Assert.Throws(() => options.ValidateOptions()); + } + } + + [Test] + public void CanGetDefaultSanitizer() + { + ClientLoggingOptions options = new(); + PipelineMessageSanitizer sanitizer = options.GetPipelineMessageSanitizer(); + + Assert.AreEqual(s_expectedDefaultAllowedQueryParameters, sanitizer._allowedQueryParameters); + Assert.AreEqual(s_expectedDefaultAllowedHeaderNames, sanitizer._allowedHeaders); + } + + [Test] + public void CanGetCustomizedSanitizer() + { + ClientLoggingOptions options = new(); + options.AllowedHeaderNames.Add("Custom-Header"); + options.AllowedQueryParameters.Add("custom-query"); + PipelineMessageSanitizer sanitizer = options.GetPipelineMessageSanitizer(); + + HashSet customAllowedHeaders = new(s_expectedDefaultAllowedHeaderNames) + { + "Custom-Header" + }; + + HashSet customQueryParameters = new(s_expectedDefaultAllowedQueryParameters) + { + "custom-query" + }; + + Assert.AreEqual(customQueryParameters, sanitizer._allowedQueryParameters); + Assert.AreEqual(customAllowedHeaders, sanitizer._allowedHeaders); + } + } +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/ContentTypeUtilitiesTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/ContentTypeUtilitiesTests.cs new file mode 100644 index 000000000000..a8e1e11912b9 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/ContentTypeUtilitiesTests.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.Text; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal +{ + internal class ContentTypeUtilitiesTests + { + [Theory] + [TestCase(null, false, null)] + [TestCase("text/json", true, "Unicode (UTF-8)")] + [TestCase("text/xml", true, "Unicode (UTF-8)")] + [TestCase("application/json", true, "Unicode (UTF-8)")] + [TestCase("application/xml", true, "Unicode (UTF-8)")] + [TestCase("something/else+json", true, "Unicode (UTF-8)")] + [TestCase("something/else+xml", true, "Unicode (UTF-8)")] + [TestCase("random/thing; charset=utf-8", true, "Unicode (UTF-8)")] + [TestCase("application/json; odata.metadata=minimal", true, "Unicode (UTF-8)")] + [TestCase("application/json; odata.metadata=full", true, "Unicode (UTF-8)")] + [TestCase("application/json; odata.metadata=none", true, "Unicode (UTF-8)")] + [TestCase("application/x-www-form-urlencoded", true, "Unicode (UTF-8)")] + [TestCase("application/x-www-form-urlencoded; charset=utf-8", true, "Unicode (UTF-8)")] + + // No other explicit encoding besides "utf-8" is supported, so falls through to defaulting to "utf-8" based on Content-Type. + [TestCase("application/x-www-form-urlencoded; charset=us-ascii", true, "Unicode (UTF-8)")] + + public void DetectsTextContentTypes(string contentType, bool isText, string expectedEncoding) + { + Assert.AreEqual(isText, ContentTypeUtilities.TryGetTextEncoding(contentType, out Encoding? encoding)); + Assert.AreEqual(encoding?.EncodingName, expectedEncoding); + } + } +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageHeadersLogValueTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageHeadersLogValueTests.cs new file mode 100644 index 000000000000..e6ec2ab43ffc --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageHeadersLogValueTests.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel.Internal; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ClientModel.Tests.Mocks; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal; + +public class PipelineMessageHeadersLogValueTests +{ + [Test] + public void PipelineMessageHeadersLogValueToStringHidesOnlySensitiveHeaders() + { + MockRequestHeaders requestHeaders = new() + { + { "Sensitive-Header", "SensitiveValue" }, + { "NonSensitive-Header", "NonSensitiveValue" }, + { "Content-Length", "6" } + }; + Dictionary headers = new() + { + { "Sensitive-Header", "SensitiveValue" }, + { "NonSensitive-Header", "NonSensitiveValue" }, + { "Content-Length", "6" } + }; + MockResponseHeaders responseHeaders = new(headers); + + PipelineMessageSanitizer sanitizer = new([], ["NonSensitive-Header"]); + + PipelineMessageHeadersLogValue requestLogValue = new(requestHeaders, sanitizer); + PipelineMessageHeadersLogValue responseLogValue = new(responseHeaders, sanitizer); + + string loggedRequestValue = requestLogValue.ToString(); + string loggedResponseValue = responseLogValue.ToString(); + + Assert.That(loggedRequestValue, Is.Not.Null); + Assert.That(loggedResponseValue, Is.Not.Null); + + Assert.AreEqual(loggedRequestValue, "Sensitive-Header:REDACTED\r\nNonSensitive-Header:NonSensitiveValue\r\nContent-Length:REDACTED\r\n"); + Assert.AreEqual(loggedResponseValue, "Sensitive-Header:REDACTED\r\nNonSensitive-Header:NonSensitiveValue\r\nContent-Length:REDACTED\r\n"); + } +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageLoggerTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageLoggerTests.cs new file mode 100644 index 000000000000..4d748dfe9812 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageLoggerTests.cs @@ -0,0 +1,1075 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.ClientModel.Primitives; +using System.ClientModel.Tests.TestFramework; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests; +using ClientModel.Tests.Mocks; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Bson; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal; + +// Avoid running these tests in parallel with anything else that's sharing the event source +[NonParallelizable] +public class PipelineMessageLoggerTests : SyncAsyncPolicyTestBase +{ + private const int RequestEvent = 1; + private const int RequestContentEvent = 2; + private const int ResponseEvent = 5; + private const int ResponseContentEvent = 6; + private const int ErrorResponseEvent = 8; + private const int ErrorResponseContentEvent = 9; + private const int ResponseContentBlockEvent = 11; + private const int ErrorResponseContentBlockEvent = 12; + private const int ResponseContentTextEvent = 13; + private const int ErrorResponseContentTextEvent = 14; + private const int ResponseContentTextBlockEvent = 15; + private const int ErrorResponseContentTextBlockEvent = 16; + private const int RequestContentTextEvent = 17; + + private const string LoggingPolicyCategoryName = "System.ClientModel.Primitives.MessageLoggingPolicy"; + private const string SystemClientModelEventSourceName = "System.ClientModel"; + private readonly MockResponseHeaders _defaultHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + private readonly MockResponseHeaders _defaultTextHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Content-Type", "text/plain" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + + public PipelineMessageLoggerTests(bool isAsync) : base(isAsync) + { + } + + #region Unit tests + + [Test] + public void LogsAreLoggedToILoggerAndNotEventSourceWhenILoggerIsProvided() + { + using TestClientEventListener listener = new(); + using TestLoggingFactory factory = new(LogLevel.Debug); + + PipelineMessageLogger messageLogger = new(new PipelineMessageSanitizer([], []), factory); + + MockPipelineRequest request = new() + { + Uri = new Uri("http://example.com/") + }; + MockPipelineResponse response = new(500); + + messageLogger.LogRequest("requestId", request, "assembly"); + messageLogger.LogRequestContent("requestId", [1,2,3], null); + messageLogger.LogRequestContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponse("requestId", response, 1); + messageLogger.LogResponseContent("requestId", [1,2,3], null); + messageLogger.LogResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponseContentBlock("requestId", 1, [1,2,3], null); + messageLogger.LogResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponse("requestId", response, 1); + messageLogger.LogErrorResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogErrorResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogErrorResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + logger.SingleEventById(RequestEvent); + logger.SingleEventById(RequestContentEvent); + logger.SingleEventById(RequestContentTextEvent); + logger.SingleEventById(ResponseEvent); + logger.SingleEventById(ResponseContentEvent); + logger.SingleEventById(ResponseContentTextEvent); + logger.SingleEventById(ResponseContentBlockEvent); + logger.SingleEventById(ResponseContentTextBlockEvent); + logger.SingleEventById(ErrorResponseEvent); + logger.SingleEventById(ErrorResponseContentEvent); + logger.SingleEventById(ErrorResponseContentBlockEvent); + logger.SingleEventById(ErrorResponseContentTextBlockEvent); + + CollectionAssert.IsEmpty(listener.EventData); // Nothing should log to Event Source + } + + [Test] + public void LogsAreNotWrittenToEventSourceWhenILoggerIsProvidedAndLogLevelIsWarning() + { + using TestClientEventListener listener = new(); + using TestLoggingFactory factory = new(LogLevel.Warning); + + PipelineMessageLogger messageLogger = new(new PipelineMessageSanitizer([], []), factory); + + MockPipelineRequest request = new() + { + Uri = new Uri("http://example.com/") + }; + MockPipelineResponse response = new(500); + + messageLogger.LogRequest("requestId", request, "assembly"); + messageLogger.LogRequestContent("requestId", [1, 2, 3], null); + messageLogger.LogRequestContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponse("requestId", response, 1); + messageLogger.LogResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponse("requestId", response, 1); + messageLogger.LogErrorResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogErrorResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogErrorResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + + CollectionAssert.IsEmpty(listener.EventData); // Nothing should log to Event Source + } + + [Test] + public void IsEnabledILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + PipelineMessageLogger messageLogger = new(new PipelineMessageSanitizer([], []), factory); + + Assert.IsTrue(messageLogger.IsEnabled(LogLevel.Debug, EventLevel.Verbose)); + Assert.IsTrue(messageLogger.IsEnabled(LogLevel.Critical, EventLevel.Verbose)); + Assert.IsFalse(messageLogger.IsEnabled(LogLevel.Trace, EventLevel.Warning)); + } + + [Test] + public void EventsAreNotLoggedIfDisabledEventSource() + { + using TestEventListenerWarning listener = new(); + PipelineMessageLogger messageLogger = new(new PipelineMessageSanitizer([], []), null); + MockPipelineRequest request = new() + { + Uri = new Uri("http://example.com/") + }; + MockPipelineResponse response = new(500); + + messageLogger.LogRequest("requestId", request, "assembly"); + messageLogger.LogRequestContent("requestId", [1, 2, 3], null); + messageLogger.LogRequestContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponse("requestId", response, 1); + messageLogger.LogResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponse("requestId", response, 1); + messageLogger.LogErrorResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogErrorResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogErrorResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + + listener.SingleEventById(ErrorResponseEvent); + Assert.AreEqual(1, listener.EventData.Count()); + } + + [Test] + public void EventsAreNotLoggedIfDisabledILogger() + { + using TestLoggingFactory factory = new(LogLevel.Warning); + PipelineMessageLogger messageLogger = new(new PipelineMessageSanitizer([], []), factory); + MockPipelineRequest request = new() + { + Uri = new Uri("http://example.com/") + }; + MockPipelineResponse response = new(500); + + messageLogger.LogRequest("requestId", request, "assembly"); + messageLogger.LogRequestContent("requestId", [1, 2, 3], null); + messageLogger.LogRequestContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponse("requestId", response, 1); + messageLogger.LogResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponse("requestId", response, 1); + messageLogger.LogErrorResponseContent("requestId", [1, 2, 3], null); + messageLogger.LogErrorResponseContent("requestId", "Hello"u8.ToArray(), Encoding.UTF8); // text + messageLogger.LogErrorResponseContentBlock("requestId", 1, [1, 2, 3], null); + messageLogger.LogErrorResponseContentBlock("requestId", 1, "Hello"u8.ToArray(), Encoding.UTF8); // text + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + logger.SingleEventById(ErrorResponseEvent); + Assert.AreEqual(1, logger.Logs.Count()); + } + + #endregion + + #region Integration tests + + [Test] + public async Task HeadersAndQueryParametersAreSanitizedInRequestAndResponseEventsEventSource() // Request event and response event sanitize headers + { + using TestClientEventListener listener = new(); + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(200, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "secret-value" }, + { "Content-Type", "text/json" } + }; + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri); + + // Assert that headers on the request are sanitized + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", EventLevel.Informational, SystemClientModelEventSourceName); + string headers = log.GetProperty("headers"); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", headers); + StringAssert.Contains($"Custom-Header:custom-header-value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Custom-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("secret-value", headers); + + // Assert that headers on the response are sanitized + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", EventLevel.Informational, SystemClientModelEventSourceName); + headers = log.GetProperty("headers"); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("Very secret", headers); + } + + [Test] + public async Task HeadersAndQueryParametersAreSanitizedInRequestAndResponseEventsILogger() // Request event and response event sanitize headers + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(200, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "secret-value" }, + { "Content-Type", "text/json" } + }; + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri, loggingOptions: loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that headers on the request are sanitized + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", LogLevel.Information); + string headers = (log.GetValueFromArguments("headers")).ToString(); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", headers); + StringAssert.Contains($"Custom-Header:custom-header-value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Custom-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("secret-value", headers); + + // Assert that headers on the response are sanitized + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", LogLevel.Information); + headers = (log.GetValueFromArguments("headers")).ToString(); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("Very secret", headers); + } + + [Test] + public async Task HeadersAndQueryParametersAreSanitizedInErrorResponseEventEventSource() // Error response event sanitizes headers + { + using TestClientEventListener listener = new(); + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(400, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "secret-value" }, + { "Content-Type", "text/json" } + }; + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri); + + // Assert that headers on the response are sanitized + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseEvent, "ErrorResponse", EventLevel.Warning, SystemClientModelEventSourceName); + string headers = log.GetProperty("headers"); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("Very Secret", headers); + } + + [Test] + public async Task HeadersAndQueryParametersAreSanitizedInErrorResponseEventILogger() // Error response event sanitizes headers + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(400, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "secret-value" }, + { "Content-Type", "text/json" } + }; + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri, loggingOptions: loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that headers on the response are sanitized + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseEvent, "ErrorResponse", LogLevel.Warning); + string headers = (log.GetValueFromArguments("headers")).ToString(); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:REDACTED{Environment.NewLine}", headers); + StringAssert.DoesNotContain("Very Secret", headers); + } + + [Test] + public async Task HeadersAndQueryParametersAreNotSanitizedWhenStarsEventSource() + { + using TestClientEventListener listener = new(); + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(200, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + ClientLoggingOptions loggingOptions = new(); + loggingOptions.AllowedQueryParameters.Add("*"); + loggingOptions.AllowedHeaderNames.Add("*"); + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "Value" }, + { "Content-Type", "text/json" } + }; + + await CreatePipelineAndSendRequest(response, loggingOptions, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri); + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", EventLevel.Informational, SystemClientModelEventSourceName); + string headers = log.GetProperty("headers"); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", headers); + StringAssert.Contains($"Custom-Header:Value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Custom-Header:Value{Environment.NewLine}", headers); + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", EventLevel.Informational, SystemClientModelEventSourceName); + headers = log.GetProperty("headers"); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:Very secret{Environment.NewLine}", headers); + } + + [Test] + public async Task HeadersAndQueryParametersAreNotSanitizedWhenStarsILogger() + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + var mockHeaders = new MockResponseHeaders(new Dictionary { { "Custom-Response-Header", "Improved value" }, { "Secret-Response-Header", "Very secret" } }); + var response = new MockPipelineResponse(200, mockHeaders: mockHeaders); + response.SetContent([6, 7, 8, 9, 0]); + + loggingOptions.AllowedQueryParameters.Add("*"); + loggingOptions.AllowedHeaderNames.Add("*"); + + Uri requestUri = new("https://contoso.a.io?api-version=5&secret=123"); + + Dictionary requestHeaders = new() + { + { "Secret-Custom-Header", "Value" }, + { "Content-Type", "text/json" } + }; + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], requestHeaders: requestHeaders, requestUri: requestUri, loggingOptions: loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", LogLevel.Information); + string headers = (log.GetValueFromArguments("headers")).ToString(); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", headers); + StringAssert.Contains($"Custom-Header:Value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Custom-Header:Value{Environment.NewLine}", headers); + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", LogLevel.Information); + headers = (log.GetValueFromArguments("headers")).ToString(); + StringAssert.Contains($"Custom-Response-Header:Improved value{Environment.NewLine}", headers); + StringAssert.Contains($"Secret-Response-Header:Very secret{Environment.NewLine}", headers); + } + + [Test] + public async Task SendingARequestProducesRequestAndResponseLogMessagesEventSource() // RequestEvent, ResponseEvent + { + using TestClientEventListener listener = new(); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, requestContentBytes: requestContent); + + // Assert that the request log message is written and formatted correctly + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", EventLevel.Informational, SystemClientModelEventSourceName); + Assert.AreEqual("http://example.com/", log.GetProperty("uri")); + Assert.AreEqual("GET", log.GetProperty("method")); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", log.GetProperty("headers")); + StringAssert.Contains($"Custom-Header:custom-header-value{Environment.NewLine}", log.GetProperty("headers")); + + // Assert that the response log message is written and formatted correctly + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", EventLevel.Informational, SystemClientModelEventSourceName); + Assert.AreEqual(log.GetProperty("status"), 200); + StringAssert.Contains($"Custom-Response-Header:custom-response-header-value{Environment.NewLine}", log.GetProperty("headers")); + + // Assert that no other log messages were written + Assert.AreEqual(2, listener.EventData.Count()); + } + + [Test] + public async Task SendingARequestProducesRequestAndResponseLogMessagesILogger() // RequestEvent, ResponseEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + ClientLoggingOptions loggingOptions = new() + { + LoggerFactory = factory + }; + + await CreatePipelineAndSendRequest(response, requestContentBytes: requestContent, loggingOptions: loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that the request log message is written and formatted correctly + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.RequestEvent, "Request", LogLevel.Information); + Assert.AreEqual("http://example.com/", log.GetValueFromArguments("uri")); + Assert.AreEqual("GET", log.GetValueFromArguments("method")); + StringAssert.Contains($"Date:08/16/2024{Environment.NewLine}", (log.GetValueFromArguments("headers")).ToString()); + StringAssert.Contains($"Custom-Header:custom-header-value{Environment.NewLine}", (log.GetValueFromArguments("headers")).ToString()); + + // Assert that the response log message is written and formatted correctly + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseEvent, "Response", LogLevel.Information); + Assert.AreEqual(log.GetValueFromArguments("status"), 200); + StringAssert.Contains($"Custom-Response-Header:custom-response-header-value{Environment.NewLine}", (log.GetValueFromArguments("headers")).ToString()); + + // Assert that no other log messages were written + Assert.AreEqual(logger.Logs.Count(), 2); + } + + [Test] + public async Task ReceivingAnErrorResponseProducesAnErrorResponseLogMessageEventSource() // ErrorResponseEvent, ErrorResponseContentEvent + { + using TestClientEventListener listener = new(); + + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue + }; + + MockPipelineResponse response = new(400, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, loggingOptions, requestContentBytes: [1, 2, 3, 4, 5]); + + // Assert that the error response log message is written and formatted correctly + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseEvent, "ErrorResponse", EventLevel.Warning, SystemClientModelEventSourceName); + Assert.AreEqual(log.GetProperty("status"), 400); + StringAssert.Contains($"Custom-Response-Header:custom-response-header-value{Environment.NewLine}", log.GetProperty("headers")); + + // Assert that the error response content log message is written and formatted correctly + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseContentEvent, "ErrorResponseContent", EventLevel.Informational, SystemClientModelEventSourceName); + CollectionAssert.AreEqual(responseContent, log.GetProperty("content")); + } + + [Test] + public async Task ReceivingAnErrorResponseProducesAnErrorResponseLogMessageILogger() // ErrorResponseEvent, ErrorResponseContentEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(400, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, requestContentBytes: [1, 2, 3, 4, 5], loggingOptions: loggingOptions); + + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that the error response log message is written and formatted correctly + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseEvent, "ErrorResponse", LogLevel.Warning); + Assert.AreEqual(log.GetValueFromArguments("status"), 400); + StringAssert.Contains($"Custom-Response-Header:custom-response-header-value{Environment.NewLine}", (log.GetValueFromArguments("headers")).ToString()); + + // Assert that the error response content log message is written and formatted correctly + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseContentEvent, "ErrorResponseContent", LogLevel.Information); + CollectionAssert.AreEqual(responseContent, log.GetValueFromArguments("content")); + } + + [Test] + public async Task ContentLoggingEnabledProducesRequestContentAndResponseContentLogMessageEventSource() // RequestContentEvent, ResponseContentEvent + { + using TestClientEventListener listener = new(); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, loggingOptions, requestContentBytes: requestContent); + + // Assert that the request content log message is written and formatted correctly + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.RequestContentEvent, "RequestContent", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual(requestContent, log.GetProperty("content")); + + // Assert that the response content log message is written and formatted correctly + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentEvent, "ResponseContent", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual(responseContent, log.GetProperty("content")); + + // Assert content was not written as text + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.RequestContentTextEvent)); + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ResponseContentTextEvent)); + } + + [Test] + public async Task ContentLoggingEnabledProducesRequestContentAndResponseContentLogMessageILogger() // RequestContentEvent, ResponseContentEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, requestContentBytes: requestContent, loggingOptions: loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that the request content log message is written and formatted correctly + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.RequestContentEvent, "RequestContent", LogLevel.Debug); + Assert.AreEqual(requestContent, log.GetValueFromArguments("content")); + + // Assert that the response content log message is written and formatted correctly + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentEvent, "ResponseContent", LogLevel.Debug); + Assert.AreEqual(responseContent, log.GetValueFromArguments("content")); + + // Assert content was not written as text + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.RequestContentTextEvent)); + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ResponseContentTextEvent)); + } + + [Test] + public async Task ContentLoggingEnabledProducesRequestContentAsTextAndResponseContentAsTextEventSource() // RequestContentTextEvent, ResponseContentTextEvent + { + using TestClientEventListener listener = new(); + + string requestContent = "Hello"; + string responseContent = "World!"; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultTextHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, loggingOptions, requestContentString: requestContent); + + // Assert that the request content text event is written and formatted correctly + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.RequestContentTextEvent, "RequestContentText", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual(requestContent, log.GetProperty("content")); + + // Assert that the response content text event is written and formatted correctly + + log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentTextEvent, "ResponseContentText", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual(responseContent, log.GetProperty("content")); + + // Assert content was not written not as text + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.RequestContentEvent)); + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task ContentLoggingEnabledProducesRequestContentAsTextAndResponseContentAsTextILogger() // RequestContentTextEvent, ResponseContentTextEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + string requestContent = "Hello"; + string responseContent = "World!"; + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + MessageContentSizeLimit = int.MaxValue, + LoggerFactory = factory + }; + + MockPipelineResponse response = new(200, mockHeaders: _defaultTextHeaders); + response.SetContent(responseContent); + + await CreatePipelineAndSendRequest(response, requestContentString: requestContent, loggingOptions: loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + // Assert that the request content text event is written and formatted correctly + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.RequestContentTextEvent, "RequestContentText", LogLevel.Debug); + Assert.AreEqual(requestContent, log.GetValueFromArguments("content")); + + // Assert that the response content text event is written and formatted correctly + + log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentTextEvent, "ResponseContentText", LogLevel.Debug); + Assert.AreEqual(responseContent, log.GetValueFromArguments("content")); + + // Assert content was not written not as text + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.RequestContentEvent)); + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task ContentLoggingEnabledProducesResponseContentAsTextWithSeekableTextStreamEventSource() // ResponseContentTextEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(200, true, _defaultTextHeaders, new ClientLoggingOptions(), int.MaxValue); + + EventWrittenEventArgs logEvent = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentTextEvent, "ResponseContentText", EventLevel.Verbose, SystemClientModelEventSourceName); + Assert.AreEqual("Hello world", logEvent.GetProperty("content")); + } + + [Test] + public async Task ContentLoggingEnabledProducesResponseContentAsTextWithSeekableTextStreamILogger() // ResponseContentTextEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(200, true, _defaultTextHeaders, loggingOptions, int.MaxValue); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent logEvent = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseContentTextEvent, "ResponseContentText", LogLevel.Debug); + Assert.AreEqual("Hello world", logEvent.GetValueFromArguments("content")); + } + + [Test] + public async Task ContentLoggingEnabledProducesErrorResponseContentAsTextWithSeekableTextStreamEventSource() // ErrorResponseContentTextEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(500, true, _defaultTextHeaders, new ClientLoggingOptions(), 5); + + EventWrittenEventArgs logEvent = listener.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseContentTextEvent, "ErrorResponseContentText", EventLevel.Informational, SystemClientModelEventSourceName); + Assert.AreEqual("Hello", logEvent.GetProperty("content")); + } + + [Test] + public async Task ContentLoggingEnabledProducesErrorResponseContentAsTextWithSeekableTextStreamILogger() // ErrorResponseContentTextEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(500, true, _defaultTextHeaders, loggingOptions, 5); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent logEvent = logger.GetAndValidateSingleEvent(LoggingEventIds.ErrorResponseContentTextEvent, "ErrorResponseContentText", LogLevel.Information); + Assert.AreEqual("Hello", logEvent.GetValueFromArguments("content")); + } + + [Test] + public async Task NonSeekableResponsesAreLoggedInBlocksEventSource() // ResponseContentBlockEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(200, false, _defaultHeaders, new ClientLoggingOptions()); + + EventWrittenEventArgs[] contentEvents = listener.EventsById(LoggingEventIds.ResponseContentBlockEvent).ToArray(); + + Assert.AreEqual(2, contentEvents.Length); + + Assert.AreEqual(EventLevel.Verbose, contentEvents[0].Level); + Assert.AreEqual("ResponseContentBlock", contentEvents[0].EventName); + Assert.AreEqual(0, contentEvents[0].GetProperty("blockNumber")); + Assert.AreEqual(SystemClientModelEventSourceName, contentEvents[0].EventSource.Name); + CollectionAssert.AreEqual("Hello "u8.ToArray(), contentEvents[0].GetProperty("content")); + + Assert.AreEqual(EventLevel.Verbose, contentEvents[1].Level); + Assert.AreEqual("ResponseContentBlock", contentEvents[1].EventName); + Assert.AreEqual(1, contentEvents[1].GetProperty("blockNumber")); + Assert.AreEqual(SystemClientModelEventSourceName, contentEvents[1].EventSource.Name); + CollectionAssert.AreEqual("world"u8.ToArray(), contentEvents[1].GetProperty("content")); + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesAreLoggedInBlocksILogger() // ResponseContentBlockEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(200, false, _defaultHeaders, loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent[] contentEvents = logger.EventsById(LoggingEventIds.ResponseContentBlockEvent).ToArray(); + + Assert.AreEqual(2, contentEvents.Length); + + Assert.AreEqual(LogLevel.Debug, contentEvents[0].LogLevel); + Assert.AreEqual("ResponseContentBlock", contentEvents[0].EventId.Name); + Assert.AreEqual(0, contentEvents[0].GetValueFromArguments("blockNumber")); + CollectionAssert.AreEqual("Hello "u8.ToArray(), contentEvents[0].GetValueFromArguments("content")); + + Assert.AreEqual(LogLevel.Debug, contentEvents[1].LogLevel); + Assert.AreEqual("ResponseContentBlock", contentEvents[1].EventId.Name); + Assert.AreEqual(1, contentEvents[1].GetValueFromArguments("blockNumber")); + CollectionAssert.AreEqual("world"u8.ToArray(), contentEvents[1].GetValueFromArguments("content")); + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponseErrorsAreLoggedInBlocksEventSource() // ErrorResponseContentBlockEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(500, false, _defaultHeaders, new ClientLoggingOptions()); + + EventWrittenEventArgs[] errorContentEvents = listener.EventsById(LoggingEventIds.ErrorResponseContentBlockEvent).ToArray(); + + Assert.AreEqual(2, errorContentEvents.Length); + + Assert.AreEqual(EventLevel.Informational, errorContentEvents[0].Level); + Assert.AreEqual("ErrorResponseContentBlock", errorContentEvents[0].EventName); + Assert.AreEqual(0, errorContentEvents[0].GetProperty("blockNumber")); + Assert.AreEqual(SystemClientModelEventSourceName, errorContentEvents[0].EventSource.Name); + CollectionAssert.AreEqual("Hello "u8.ToArray(), errorContentEvents[0].GetProperty("content")); + + Assert.AreEqual(EventLevel.Informational, errorContentEvents[1].Level); + Assert.AreEqual("ErrorResponseContentBlock", errorContentEvents[1].EventName); + Assert.AreEqual(1, errorContentEvents[1].GetProperty("blockNumber")); + Assert.AreEqual(SystemClientModelEventSourceName, errorContentEvents[1].EventSource.Name); + CollectionAssert.AreEqual("world"u8.ToArray(), errorContentEvents[1].GetProperty("content")); + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ErrorResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesErrorsAreLoggedInBlocksILogger() // ErrorResponseContentBlockEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(500, false, _defaultHeaders, loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent[] errorContentEvents = logger.EventsById(LoggingEventIds.ErrorResponseContentBlockEvent).ToArray(); + + Assert.AreEqual(2, errorContentEvents.Length); + + Assert.AreEqual(LogLevel.Information, errorContentEvents[0].LogLevel); + Assert.AreEqual("ErrorResponseContentBlock", errorContentEvents[0].EventId.Name); + Assert.AreEqual(0, errorContentEvents[0].GetValueFromArguments("blockNumber")); + CollectionAssert.AreEqual("Hello "u8.ToArray(), errorContentEvents[0].GetValueFromArguments("content")); + + Assert.AreEqual(LogLevel.Information, errorContentEvents[1].LogLevel); + Assert.AreEqual("ErrorResponseContentBlock", errorContentEvents[1].EventId.Name); + Assert.AreEqual(1, errorContentEvents[1].GetValueFromArguments("blockNumber")); + CollectionAssert.AreEqual("world"u8.ToArray(), errorContentEvents[1].GetValueFromArguments("content")); + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ErrorResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesAreLoggedInTextBlocksEventSource() // ResponseContentTextBlockEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(200, false, _defaultTextHeaders, new ClientLoggingOptions()); + + EventWrittenEventArgs[] contentEvents = listener.EventsById(LoggingEventIds.ResponseContentTextBlockEvent).ToArray(); + + Assert.AreEqual(2, contentEvents.Length); + + Assert.AreEqual(EventLevel.Verbose, contentEvents[0].Level); + + Assert.AreEqual("ResponseContentTextBlock", contentEvents[0].EventName); + Assert.AreEqual(0, contentEvents[0].GetProperty("blockNumber")); + Assert.AreEqual("Hello ", contentEvents[0].GetProperty("content")); + Assert.AreEqual(SystemClientModelEventSourceName, contentEvents[0].EventSource.Name); + + Assert.AreEqual(EventLevel.Verbose, contentEvents[1].Level); + Assert.AreEqual("ResponseContentTextBlock", contentEvents[1].EventName); + Assert.AreEqual(1, contentEvents[1].GetProperty("blockNumber")); + Assert.AreEqual("world", contentEvents[1].GetProperty("content")); + Assert.AreEqual(SystemClientModelEventSourceName, contentEvents[1].EventSource.Name); + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesAreLoggedInTextBlocksILogger() // ResponseContentTextBlockEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(200, false, _defaultTextHeaders, loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent[] contentEvents = logger.EventsById(LoggingEventIds.ResponseContentTextBlockEvent).ToArray(); + + Assert.AreEqual(2, contentEvents.Length); + + Assert.AreEqual(LogLevel.Debug, contentEvents[0].LogLevel); + + Assert.AreEqual("ResponseContentTextBlock", contentEvents[0].EventId.Name); + Assert.AreEqual(0, contentEvents[0].GetValueFromArguments("blockNumber")); + Assert.AreEqual("Hello ", contentEvents[0].GetValueFromArguments("content")); + + Assert.AreEqual(LogLevel.Debug, contentEvents[1].LogLevel); + Assert.AreEqual("ResponseContentTextBlock", contentEvents[1].EventId.Name); + Assert.AreEqual(1, contentEvents[1].GetValueFromArguments("blockNumber")); + Assert.AreEqual("world", contentEvents[1].GetValueFromArguments("content")); + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesErrorsAreLoggedInTextBlocksEventSource() // ErrorResponseContentTextBlockEvent + { + using TestClientEventListener listener = new(); + + await CreatePipelineAndSendRequestWithStreamingResponse(500, false, _defaultTextHeaders, new ClientLoggingOptions()); + + EventWrittenEventArgs[] errorContentEvents = listener.EventsById(LoggingEventIds.ErrorResponseContentTextBlockEvent).ToArray(); + + Assert.AreEqual(2, errorContentEvents.Length); + + Assert.AreEqual(EventLevel.Informational, errorContentEvents[0].Level); + Assert.AreEqual("ErrorResponseContentTextBlock", errorContentEvents[0].EventName); + Assert.AreEqual(0, errorContentEvents[0].GetProperty("blockNumber")); + Assert.AreEqual("Hello ", errorContentEvents[0].GetProperty("content")); + Assert.AreEqual(SystemClientModelEventSourceName, errorContentEvents[0].EventSource.Name); + + Assert.AreEqual(EventLevel.Informational, errorContentEvents[1].Level); + Assert.AreEqual("ErrorResponseContentTextBlock", errorContentEvents[1].EventName); + Assert.AreEqual(1, errorContentEvents[1].GetProperty("blockNumber")); + Assert.AreEqual("world", errorContentEvents[1].GetProperty("content")); + Assert.AreEqual(SystemClientModelEventSourceName, errorContentEvents[1].EventSource.Name); + + CollectionAssert.IsEmpty(listener.EventsById(LoggingEventIds.ErrorResponseContentEvent)); + } + + [Test] + public async Task NonSeekableResponsesErrorsAreLoggedInTextBlocksILogger() // ErrorResponseContentTextBlockEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + ClientLoggingOptions loggingOptions = new() { LoggerFactory = factory }; + + await CreatePipelineAndSendRequestWithStreamingResponse(500, false, _defaultTextHeaders, loggingOptions); + TestLogger logger = factory.GetLogger(LoggingPolicyCategoryName); + + LoggerEvent[] errorContentEvents = logger.EventsById(LoggingEventIds.ErrorResponseContentTextBlockEvent).ToArray(); + + Assert.AreEqual(2, errorContentEvents.Length); + + Assert.AreEqual(LogLevel.Information, errorContentEvents[0].LogLevel); + Assert.AreEqual("ErrorResponseContentTextBlock", errorContentEvents[0].EventId.Name); + Assert.AreEqual(0, errorContentEvents[0].GetValueFromArguments("blockNumber")); + Assert.AreEqual("Hello ", errorContentEvents[0].GetValueFromArguments("content")); + + Assert.AreEqual(LogLevel.Information, errorContentEvents[1].LogLevel); + Assert.AreEqual("ErrorResponseContentTextBlock", errorContentEvents[1].EventId.Name); + Assert.AreEqual(1, errorContentEvents[1].GetValueFromArguments("blockNumber")); + Assert.AreEqual("world", errorContentEvents[1].GetValueFromArguments("content")); + + CollectionAssert.IsEmpty(logger.EventsById(LoggingEventIds.ErrorResponseContentEvent)); + } + + #endregion + + #region Helpers + + private class TestEventListenerWarning : TestClientEventListener + { + protected override void OnEventSourceCreated(EventSource eventSource) + { + if (eventSource.Name == "System.ClientModel") + { + Console.WriteLine("Warning"); + EnableEvents(eventSource, EventLevel.Warning); + } + } + } + + private async Task CreatePipelineAndSendRequestWithStreamingResponse(int statusCode, + bool isSeekable, + MockResponseHeaders responseHeaders, + ClientLoggingOptions loggingOptions, + int maxLength = int.MaxValue) + { + MockPipelineResponse response = new(status: statusCode, mockHeaders: responseHeaders); + + byte[] responseContent = Encoding.UTF8.GetBytes("Hello world"); + if (isSeekable) + { + response.ContentStream = new MemoryStream(responseContent); + } + else + { + response.ContentStream = new NonSeekableMemoryStream(responseContent); + } + + loggingOptions.EnableMessageContentLogging = true; + loggingOptions.MessageContentSizeLimit = maxLength; + + // These tests are essentially testing whether the logging policy works + // correctly when responses are buffered (memory stream) and unbuffered + // (non-seekable). In order to validate the intent of the test, we set + // message.BufferResponse accordingly here. + await CreatePipelineAndSendRequest(response, loggingOptions, bufferResponse: isSeekable); + + var buffer = new byte[11]; + + if (IsAsync) + { +#if NET462 + Assert.AreEqual(6, await response.ContentStream.ReadAsync(buffer, 5, 6)); + Assert.AreEqual(5, await response.ContentStream.ReadAsync(buffer, 6, 5)); + Assert.AreEqual(0, await response.ContentStream.ReadAsync(buffer, 0, 5)); +#else + Assert.AreEqual(6, await response.ContentStream.ReadAsync(buffer.AsMemory(5, 6))); + Assert.AreEqual(5, await response.ContentStream.ReadAsync(buffer.AsMemory(6, 5))); + Assert.AreEqual(0, await response.ContentStream.ReadAsync(buffer.AsMemory(0, 5))); +#endif + } + else + { + Assert.AreEqual(6, response.ContentStream.Read(buffer, 5, 6)); + Assert.AreEqual(5, response.ContentStream.Read(buffer, 6, 5)); + Assert.AreEqual(0, response.ContentStream.Read(buffer, 0, 5)); + } + } + + private async Task CreatePipelineAndSendRequest(MockPipelineResponse response, + ClientLoggingOptions? loggingOptions = default, + string? requestContentString = default, + byte[]? requestContentBytes = default, + Dictionary? requestHeaders = default, + Uri? requestUri = default, + bool? bufferResponse = default) + { + ClientLoggingOptions clientLoggingOptions = loggingOptions ?? new ClientLoggingOptions(); + clientLoggingOptions.AllowedHeaderNames.Add("Custom-Header"); + clientLoggingOptions.AllowedHeaderNames.Add("Custom-Response-Header"); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response), + ClientLoggingOptions = clientLoggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = requestUri ?? new Uri("http://example.com"); + + if (requestHeaders != null) + { + foreach (KeyValuePair header in requestHeaders) + { + message.Request.Headers.Add(header.Key, header.Value); + } + } + + message.Request.Headers.Add("Custom-Header", "custom-header-value"); + message.Request.Headers.Add("Date", "08/16/2024"); + + if (bufferResponse != null) + { + message.BufferResponse = bufferResponse.Value; + } + + if (requestContentBytes != null) + { + message.Request.Content = BinaryContent.Create(new BinaryData(requestContentBytes)); + } + else if (requestContentString != null) + { + message.Request.Headers.Add("Content-Type", "text/plain"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContentString)); + } + + await pipeline.SendSyncOrAsync(message, IsAsync); + } + + #endregion +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageSanitizerTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageSanitizerTests.cs new file mode 100644 index 000000000000..404f22c59f89 --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineMessageSanitizerTests.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.Collections.Generic; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal +{ + public class PipelineMessageSanitizerTests + { + [Test] + [TestCase("?a", "?a")] + [TestCase("?a=b", "?a=b")] + [TestCase("?a=b&", "?a=b&")] + [TestCase("?d=b&", "?d=*&")] + [TestCase("?d=a", "?d=*")] + [TestCase("?a=b&d", "?a=b&d")] + [TestCase("?a=b&d=1&", "?a=b&d=*&")] + [TestCase("?a=b&d=1&a1", "?a=b&d=*&a1")] + [TestCase("?a=b&d=1&a1=", "?a=b&d=*&a1=")] + [TestCase("?a=b&d=11&a1=&", "?a=b&d=*&a1=&")] + [TestCase("?d&d&d&", "?d&d&d&")] + [TestCase("?a&a&a&a", "?a&a&a&a")] + [TestCase("?&&&&&&&", "?&&&&&&&")] + [TestCase("?d", "?d")] + public void QueryIsSanitized(string input, string expected) + { + var sanitizer = new PipelineMessageSanitizer(["A", "a1", "a-2"], [], "*"); + + Assert.AreEqual("http://localhost/" + expected, sanitizer.SanitizeUrl("http://localhost/" + input)); + } + + [Test] + public void HeaderIsSanitized() + { + var sanitizer = new PipelineMessageSanitizer([], [ "header-1" ], "*"); + + Assert.AreEqual("value1", sanitizer.SanitizeHeader("header-1", "value1")); + Assert.AreEqual("*", sanitizer.SanitizeHeader("header-2", "value2")); + } + + [Test] + public void EverythingIsSanitizedWithNoAllowedHeadersOrQueries() + { + var sanitizer = new PipelineMessageSanitizer([], [], "*"); + + var uri = new Uri("http://localhost/?a=b"); + + Assert.AreEqual("http://localhost/?a=*", sanitizer.SanitizeUrl(uri.ToString())); + Assert.AreEqual("*", sanitizer.SanitizeHeader("header", "value")); + } + } +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineRetryLoggerTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineRetryLoggerTests.cs new file mode 100644 index 000000000000..f82dda9d73dc --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineRetryLoggerTests.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.ClientModel.Primitives; +using System.ClientModel.Tests.TestFramework; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests; +using ClientModel.Tests.Mocks; +using Microsoft.Extensions.Logging; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal; + +// Avoid running these tests in parallel with anything else that's sharing the event source +[NonParallelizable] +public class PipelineRetryLoggerTests : SyncAsyncPolicyTestBase +{ + private const string RetryPolicyCategoryName = "System.ClientModel.Primitives.ClientRetryPolicy"; + private const string SystemClientModelEventSourceName = "System-ClientModel"; + private readonly MockResponseHeaders _defaultHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + private readonly MockResponseHeaders _defaultTextHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Content-Type", "text/plain" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + + public PipelineRetryLoggerTests(bool isAsync) : base(isAsync) + { + } + + #region Unit tests + + [Test] + public void RetriesAreLoggedToILoggerAndNotEventSourceWhenILoggerIsProvided() + { + using TestClientEventListener listener = new(); + using TestLoggingFactory factory = new(LogLevel.Debug); + + PipelineRetryLogger retryLogger = new(factory); + retryLogger.LogRequestRetrying("requestId", 1, 1); + + TestLogger logger = factory.GetLogger(RetryPolicyCategoryName); + logger.SingleEventById(10); // RequestRetrying + + CollectionAssert.IsEmpty(listener.EventData); + } + + [Test] + public void RetriesAreLoggedToILoggerAndNotEventSourceWhenILoggerIsProvidedAndLogLevelIsWarning() + { + using TestClientEventListener listener = new(); // Verbose listener + using TestLoggingFactory factory = new(LogLevel.Warning); // Warnings only + + PipelineRetryLogger retryLogger = new(factory); + retryLogger.LogRequestRetrying("requestId", 1, 1); + + CollectionAssert.IsEmpty(listener.EventData); + CollectionAssert.IsEmpty(factory.GetLogger(RetryPolicyCategoryName).Logs); + } + + #endregion + + #region Integration tests + + [Test] + public async Task SendingRequestThatIsRetriedProducesRequestRetryingEventOnEachRetryEventSource() // RequestRetryingEvent + { + using TestClientEventListener listener = new(); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", [429, 429, 200]), + ClientLoggingOptions = new() + }; + ClientPipeline pipeline = ClientPipeline.Create(options); + + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + EventWrittenEventArgs args = listener.SingleEventById(LoggingEventIds.RequestRetryingEvent, (i => i.GetProperty("retryNumber") == 1)); + Assert.AreEqual("RequestRetrying", args.EventName); + Assert.AreEqual(EventLevel.Informational, args.Level); + Assert.Less(args.GetProperty("seconds"), 1); + + args = listener.SingleEventById(LoggingEventIds.RequestRetryingEvent, (i => i.GetProperty("retryNumber") == 2)); + Assert.AreEqual("RequestRetrying", args.EventName); + Assert.AreEqual(EventLevel.Informational, args.Level); + Assert.Less(args.GetProperty("seconds"), 1); + + // 2 retry logs + 3 request logs + 3 response logs + Assert.AreEqual(8, listener.EventData.Count()); + } + + [Test] + public async Task SendingRequestThatIsRetriedProducesRequestRetryingEventOnEachRetryILogger() // RequestRetryingEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", [429, 429, 200]), + ClientLoggingOptions = new() + { + LoggerFactory = factory + } + }; + ClientPipeline pipeline = ClientPipeline.Create(options); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + TestLogger logger = factory.GetLogger(RetryPolicyCategoryName); + + LoggerEvent log = logger.SingleEventById(LoggingEventIds.RequestRetryingEvent, (i => i.GetValueFromArguments("retryNumber") == 1)); + Assert.AreEqual("RequestRetrying", log.EventId.Name); + Assert.AreEqual(LogLevel.Information, log.LogLevel); + Assert.Less(log.GetValueFromArguments("seconds"), 1); + + log = logger.SingleEventById(LoggingEventIds.RequestRetryingEvent, (i => i.GetValueFromArguments("retryNumber") == 2)); + Assert.AreEqual("RequestRetrying", log.EventId.Name); + Assert.AreEqual(LogLevel.Information, log.LogLevel); + Assert.Less(log.GetValueFromArguments("seconds"), 1); + + // No other logs should have been written to the retry logger + Assert.AreEqual(2, logger.Logs.Count()); + } + + #endregion +} diff --git a/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineTransportLoggerTests.cs b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineTransportLoggerTests.cs new file mode 100644 index 000000000000..5273da3078fb --- /dev/null +++ b/sdk/core/System.ClientModel/tests/internal/Internal/Logging/PipelineTransportLoggerTests.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Internal; +using System.ClientModel.Primitives; +using System.ClientModel.Tests.TestFramework; +using System.Collections.Generic; +using System.Diagnostics.Tracing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using ClientModel.Tests; +using ClientModel.Tests.Mocks; +using Microsoft.Extensions.Logging; +using NUnit.Framework; + +namespace System.ClientModel.Tests.Internal; + +// Avoid running these tests in parallel with anything else that's sharing the event source +[NonParallelizable] +public class PipelineTransportLoggerTests : SyncAsyncPolicyTestBase +{ + private const string PipelineTransportCategoryName = "System.ClientModel.Primitives.PipelineTransport"; + private const string SystemClientModelEventSourceName = "System.ClientModel"; + private readonly MockResponseHeaders _defaultHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + private readonly MockResponseHeaders _defaultTextHeaders = new(new Dictionary() + { + { "Custom-Response-Header", "custom-response-header-value" }, + { "Content-Type", "text/plain" }, + { "Date", "4/29/2024" }, + { "ETag", "version1" } + }); + + public PipelineTransportLoggerTests(bool isAsync) : base(isAsync) + { + } + + #region Unit tests + + [Test] + public void LogsAreLoggedToILoggerAndNotEventSourceWhenILoggerIsProvided() + { + using TestClientEventListener listener = new(); + using TestLoggingFactory factory = new(LogLevel.Debug); + + PipelineTransportLogger transportLogger = new(factory); + + transportLogger.LogExceptionResponse("requestId", new InvalidOperationException()); + transportLogger.LogResponseDelay("requestId", 1); + + TestLogger logger = factory.GetLogger(PipelineTransportCategoryName); + logger.SingleEventById(7); // ResponseDelay + logger.SingleEventById(18); // ExceptionResponse + + CollectionAssert.IsEmpty(listener.EventData); + } + + [Test] + public void LogsAreLoggedToILoggerAndNotEventSourceWhenILoggerIsProvidedAndLogLevelIsWarning() + { + using TestClientEventListener listener = new(); + using TestLoggingFactory factory = new(LogLevel.Warning); + + PipelineTransportLogger transportLogger = new(factory); + + transportLogger.LogExceptionResponse("requestId", new InvalidOperationException()); + transportLogger.LogResponseDelay("requestId", 1); + + TestLogger logger = factory.GetLogger(PipelineTransportCategoryName); + logger.SingleEventById(7); // ResponseDelay + + CollectionAssert.IsEmpty(listener.EventData); + } + + #endregion + + #region Integration tests + + [Test] + public void GettingExceptionResponseProducesEventsEventSource() // ExceptionResponseEvent + { + using TestClientEventListener listener = new(); + + var exception = new InvalidOperationException(); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", (PipelineMessage i) => throw exception, true, null, false), + ClientLoggingOptions = new() + { + EnableMessageContentLogging = true + } + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Headers.Add("User-Agent", "agent"); + + Assert.ThrowsAsync(async () => await pipeline.SendSyncOrAsync(message, IsAsync)); + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.ExceptionResponseEvent, "ExceptionResponse", EventLevel.Informational, SystemClientModelEventSourceName); + Assert.AreEqual(exception.ToString().Split(Environment.NewLine.ToCharArray())[0], log.GetProperty("exception").Split(Environment.NewLine.ToCharArray())[0]); + } + + [Test] + public void GettingExceptionResponseProducesEventsILogger() // ExceptionResponseEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + var exception = new InvalidOperationException(); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + LoggerFactory = factory + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", (PipelineMessage i) => throw exception, true, factory), + ClientLoggingOptions = loggingOptions + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Headers.Add("User-Agent", "agent"); + + Assert.ThrowsAsync(async () => await pipeline.SendSyncOrAsync(message, IsAsync)); + TestLogger logger = factory.GetLogger(PipelineTransportCategoryName); + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.ExceptionResponseEvent, "ExceptionResponse", LogLevel.Information); + Assert.AreEqual(exception, log.Exception); + } + + [Test] + public async Task ResponseReceivedAfterThreeSecondsProducesResponseDelayEventEventSource() // ResponseDelayEvent + { + using TestClientEventListener listener = new(); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response, true, null, true), + ClientLoggingOptions = new(), + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + + // Assert that the response delay log message is written and formatted correctly + + EventWrittenEventArgs log = listener.GetAndValidateSingleEvent(LoggingEventIds.ResponseDelayEvent, "ResponseDelay", EventLevel.Warning, SystemClientModelEventSourceName); + Assert.Greater(log.GetProperty("seconds"), 3); + } + + [Test] + public async Task ResponseReceivedAfterThreeSecondsProducesResponseDelayEventILogger() // ResponseDelayEvent + { + using TestLoggingFactory factory = new(LogLevel.Debug); + + byte[] requestContent = [1, 2, 3, 4, 5]; + byte[] responseContent = [6, 7, 8, 9, 0]; + + MockPipelineResponse response = new(200, mockHeaders: _defaultHeaders); + response.SetContent(responseContent); + + ClientLoggingOptions loggingOptions = new() + { + EnableMessageContentLogging = true, + LoggerFactory = factory + }; + + ClientPipelineOptions options = new() + { + Transport = new MockPipelineTransport("Transport", i => response, true, factory, true), + ClientLoggingOptions = loggingOptions, + RetryPolicy = new ObservablePolicy("RetryPolicy") + }; + + ClientPipeline pipeline = ClientPipeline.Create(options); + + using PipelineMessage message = pipeline.CreateMessage(); + message.Request.Method = "GET"; + message.Request.Uri = new Uri("http://example.com"); + message.Request.Content = BinaryContent.Create(new BinaryData(requestContent)); + + await pipeline.SendSyncOrAsync(message, IsAsync); + TestLogger logger = factory.GetLogger(PipelineTransportCategoryName); + + // Assert that the response log message is written and formatted correctly + + LoggerEvent log = logger.GetAndValidateSingleEvent(LoggingEventIds.ResponseDelayEvent, "ResponseDelay", LogLevel.Warning); + Assert.Greater(log.GetValueFromArguments("seconds"), 3); + } + + #endregion +} diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md index b5c078c5ab78..4cbc5683a5d5 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md @@ -1,11 +1,9 @@ # Release History -## 1.6.0-beta.1 (Unreleased) +## 1.7.0-beta.1 (Unreleased) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed @@ -14,6 +12,22 @@ Convert properties of type Uri to type string in DataProtectionIdentityDetails. ### Other Changes +## 1.6.0 (2025-02-12) + +### Other Changes + +- Stable version release of 1.6.0-beta.1. + +## 1.6.0-beta.1 (2025-02-07) + +### Features Added + +- Exposed `JsonModelWriteCore` for model serialization procedure. + +### Bugs Fixed + +- Added a new property `UserAssignedIdentityId` in `DataProtectionIdentityDetails` to replace the old property `UserAssignedIdentityArmUri` with wrong type (https://github.com/Azure/azure-sdk-for-net/issues/47031). + ## 1.5.0 (2024-06-17) ### Features Added diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs index a86a5cac951a..ce7dc99f63d0 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs @@ -644,24 +644,27 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo BackupInstanceDeletionInfo(System.DateTimeOffset? deleteOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), string deleteActivityId = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo BackupInstancePolicyInfo(Azure.Core.ResourceIdentifier policyId = null, string policyVersion = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicySettings policyParameters = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails BackupInstanceProtectionStatusDetails(Azure.ResponseError errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatus? status = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatus?)) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, string backupInstanceState = null, double? dataTransferredInBytes = default(double?), string recoveryDestination = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint = null, System.Collections.Generic.IEnumerable subTasks = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails, string backupInstanceState, double? dataTransferredInBytes, string recoveryDestination, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint, System.Collections.Generic.IEnumerable subTasks, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, string backupInstanceState = null, double? dataTransferredInBytes = default(double?), string recoveryDestination = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint = null, System.Collections.Generic.IEnumerable subTasks = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint = null, System.Collections.Generic.IEnumerable warningDetails = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobSubTask BackupJobSubTask(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, int taskId = 0, string taskName = null, string taskProgress = null, string taskStatus = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string recoveryPointId) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, System.DateTimeOffset recoverOn) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationContent BackupRehydrationContent(string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority? rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority?), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string recoveryPointId, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority, System.TimeSpan rehydrationRetentionDuration) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupSupportedFeature BackupSupportedFeature(string featureName = null, Azure.ResourceManager.DataProtectionBackup.Models.FeatureSupportStatus? supportStatus = default(Azure.ResourceManager.DataProtectionBackup.Models.FeatureSupportStatus?), System.Collections.Generic.IEnumerable exposureControlledFeatures = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupVaultResourceMoveDetails BackupVaultResourceMoveDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completeOn = default(System.DateTimeOffset?), string sourceResourcePath = null, string targetResourcePath = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName = null, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset), string policyName = null, string policyVersion = null, string recoveryPointId = null, string recoveryPointType = null, string retentionTagName = null, string retentionTagVersion = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails, System.DateTimeOffset recoverOn, string policyName, string policyVersion, string recoveryPointId, string recoveryPointType, string retentionTagName, string retentionTagVersion, System.DateTimeOffset? expireOn) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName = null, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset), string policyName = null, string policyVersion = null, string recoveryPointId = null, string recoveryPointType = null, string retentionTagName = null, string retentionTagVersion = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupRecoveryPointCompletionState? recoveryPointState = default(Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupRecoveryPointCompletionState?)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupInstanceData DataProtectionBackupInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties properties = null, System.Collections.Generic.IDictionary tags = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -669,7 +672,8 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties DataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), string objectType = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties DataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string objectType = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupJobData DataProtectionBackupJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties properties = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId = null, string backupInstanceFriendlyName = null, Azure.Core.ResourceIdentifier backupInstanceId = null, Azure.Core.ResourceIdentifier dataSourceId = null, Azure.Core.AzureLocation dataSourceLocation = default(Azure.Core.AzureLocation), string dataSourceName = null, string dataSourceSetName = null, string dataSourceType = null, System.TimeSpan? duration = default(System.TimeSpan?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo = null, bool isUserTriggered = false, string operation = null, string operationCategory = null, Azure.Core.ResourceIdentifier policyId = null, string policyName = null, bool isProgressEnabled = false, System.Uri progressUri = null, string restoreType = null, string sourceResourceGroup = null, string sourceSubscriptionId = null, System.DateTimeOffset startOn = default(System.DateTimeOffset), string status = null, string subscriptionId = null, System.Collections.Generic.IEnumerable supportedActions = null, string vaultName = null, Azure.ETag? eTag = default(Azure.ETag?), string sourceDataStoreName = null, string destinationDataStoreName = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId, string backupInstanceFriendlyName, Azure.Core.ResourceIdentifier backupInstanceId, Azure.Core.ResourceIdentifier dataSourceId, Azure.Core.AzureLocation dataSourceLocation, string dataSourceName, string dataSourceSetName, string dataSourceType, System.TimeSpan? duration, System.DateTimeOffset? endOn, System.Collections.Generic.IEnumerable errorDetails, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo, bool isUserTriggered, string operation, string operationCategory, Azure.Core.ResourceIdentifier policyId, string policyName, bool isProgressEnabled, System.Uri progressUri, string restoreType, string sourceResourceGroup, string sourceSubscriptionId, System.DateTimeOffset startOn, string status, string subscriptionId, System.Collections.Generic.IEnumerable supportedActions, string vaultName, Azure.ETag? eTag, string sourceDataStoreName, string destinationDataStoreName) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId = null, string backupInstanceFriendlyName = null, Azure.Core.ResourceIdentifier backupInstanceId = null, Azure.Core.ResourceIdentifier dataSourceId = null, Azure.Core.AzureLocation dataSourceLocation = default(Azure.Core.AzureLocation), string dataSourceName = null, string dataSourceSetName = null, string dataSourceType = null, System.TimeSpan? duration = default(System.TimeSpan?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo = null, bool isUserTriggered = false, string operation = null, string operationCategory = null, Azure.Core.ResourceIdentifier policyId = null, string policyName = null, bool isProgressEnabled = false, System.Uri progressUri = null, string rehydrationPriority = null, string restoreType = null, string sourceResourceGroup = null, string sourceSubscriptionId = null, System.DateTimeOffset startOn = default(System.DateTimeOffset), string status = null, string subscriptionId = null, System.Collections.Generic.IEnumerable supportedActions = null, string vaultName = null, Azure.ETag? eTag = default(Azure.ETag?), string sourceDataStoreName = null, string destinationDataStoreName = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupNameAvailabilityResult DataProtectionBackupNameAvailabilityResult(string message = null, bool? isNameAvailable = default(bool?), string reason = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupPolicyData DataProtectionBackupPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupPolicyPropertiesBase properties = null) { throw null; } @@ -688,7 +692,8 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.DeletedDataProtectionBackupInstanceData DeletedDataProtectionBackupInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties properties = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState, Azure.ResponseError protectionErrorDetails, string provisioningState, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string objectType, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState, Azure.ResponseError protectionErrorDetails, string provisioningState, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType, string objectType, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.ItemLevelRestoreTargetInfo ItemLevelRestoreTargetInfo(Azure.ResourceManager.DataProtectionBackup.Models.RecoverySetting recoverySetting = default(Azure.ResourceManager.DataProtectionBackup.Models.RecoverySetting), Azure.Core.AzureLocation? restoreLocation = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable restoreCriteria = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo datasourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo datasourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials datasourceAuthCredentials = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.ItemPathBasedRestoreCriteria ItemPathBasedRestoreCriteria(string itemPath = null, bool isPathRelativeToBackupItem = false, System.Collections.Generic.IEnumerable subItemPathPrefix = null) { throw null; } @@ -1987,9 +1992,9 @@ public partial class DataProtectionIdentityDetails : System.ClientModel.Primitiv { public DataProtectionIdentityDetails() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] + [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityId", false)] public System.Uri UserAssignedIdentityArmUri { get { throw null; } set { } } - public string UserAssignedIdentityArmUriString { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityId { get { throw null; } set { } } public bool? UseSystemAssignedIdentity { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs index a86a5cac951a..ce7dc99f63d0 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs @@ -644,24 +644,27 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo BackupInstanceDeletionInfo(System.DateTimeOffset? deleteOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), string deleteActivityId = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo BackupInstancePolicyInfo(Azure.Core.ResourceIdentifier policyId = null, string policyVersion = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicySettings policyParameters = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails BackupInstanceProtectionStatusDetails(Azure.ResponseError errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatus? status = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatus?)) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, string backupInstanceState = null, double? dataTransferredInBytes = default(double?), string recoveryDestination = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint = null, System.Collections.Generic.IEnumerable subTasks = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails, string backupInstanceState, double? dataTransferredInBytes, string recoveryDestination, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint, System.Collections.Generic.IEnumerable subTasks, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo BackupJobExtendedInfo(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, string backupInstanceState = null, double? dataTransferredInBytes = default(double?), string recoveryDestination = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails sourceRecoverPoint = null, System.Collections.Generic.IEnumerable subTasks = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreJobRecoveryPointDetails targetRecoverPoint = null, System.Collections.Generic.IEnumerable warningDetails = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupJobSubTask BackupJobSubTask(System.Collections.Generic.IReadOnlyDictionary additionalDetails = null, int taskId = 0, string taskName = null, string taskProgress = null, string taskStatus = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string recoveryPointId) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, System.DateTimeOffset recoverOn) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationContent BackupRehydrationContent(string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority? rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority?), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreContent BackupRestoreContent(string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } + public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string recoveryPointId, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority, System.TimeSpan rehydrationRetentionDuration) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(Azure.ResourceManager.DataProtectionBackup.Models.RestoreTargetInfoBase restoreTargetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType sourceDataStoreType = default(Azure.ResourceManager.DataProtectionBackup.Models.SourceDataStoreType), Azure.Core.ResourceIdentifier sourceResourceId = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority rehydrationPriority = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupRehydrationPriority), System.TimeSpan rehydrationRetentionDuration = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupSupportedFeature BackupSupportedFeature(string featureName = null, Azure.ResourceManager.DataProtectionBackup.Models.FeatureSupportStatus? supportStatus = default(Azure.ResourceManager.DataProtectionBackup.Models.FeatureSupportStatus?), System.Collections.Generic.IEnumerable exposureControlledFeatures = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.BackupVaultResourceMoveDetails BackupVaultResourceMoveDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completeOn = default(System.DateTimeOffset?), string sourceResourcePath = null, string targetResourcePath = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName = null, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset), string policyName = null, string policyVersion = null, string recoveryPointId = null, string recoveryPointType = null, string retentionTagName = null, string retentionTagVersion = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails, System.DateTimeOffset recoverOn, string policyName, string policyVersion, string recoveryPointId, string recoveryPointType, string retentionTagName, string retentionTagVersion, System.DateTimeOffset? expireOn) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName = null, System.Collections.Generic.IEnumerable recoveryPointDataStoresDetails = null, System.DateTimeOffset recoverOn = default(System.DateTimeOffset), string policyName = null, string policyVersion = null, string recoveryPointId = null, string recoveryPointType = null, string retentionTagName = null, string retentionTagVersion = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupRecoveryPointCompletionState? recoveryPointState = default(Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupRecoveryPointCompletionState?)) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupInstanceData DataProtectionBackupInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties properties = null, System.Collections.Generic.IDictionary tags = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -669,7 +672,8 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties DataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), string objectType = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties DataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string objectType = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupJobData DataProtectionBackupJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties properties = null) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId = null, string backupInstanceFriendlyName = null, Azure.Core.ResourceIdentifier backupInstanceId = null, Azure.Core.ResourceIdentifier dataSourceId = null, Azure.Core.AzureLocation dataSourceLocation = default(Azure.Core.AzureLocation), string dataSourceName = null, string dataSourceSetName = null, string dataSourceType = null, System.TimeSpan? duration = default(System.TimeSpan?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo = null, bool isUserTriggered = false, string operation = null, string operationCategory = null, Azure.Core.ResourceIdentifier policyId = null, string policyName = null, bool isProgressEnabled = false, System.Uri progressUri = null, string restoreType = null, string sourceResourceGroup = null, string sourceSubscriptionId = null, System.DateTimeOffset startOn = default(System.DateTimeOffset), string status = null, string subscriptionId = null, System.Collections.Generic.IEnumerable supportedActions = null, string vaultName = null, Azure.ETag? eTag = default(Azure.ETag?), string sourceDataStoreName = null, string destinationDataStoreName = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId, string backupInstanceFriendlyName, Azure.Core.ResourceIdentifier backupInstanceId, Azure.Core.ResourceIdentifier dataSourceId, Azure.Core.AzureLocation dataSourceLocation, string dataSourceName, string dataSourceSetName, string dataSourceType, System.TimeSpan? duration, System.DateTimeOffset? endOn, System.Collections.Generic.IEnumerable errorDetails, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo, bool isUserTriggered, string operation, string operationCategory, Azure.Core.ResourceIdentifier policyId, string policyName, bool isProgressEnabled, System.Uri progressUri, string restoreType, string sourceResourceGroup, string sourceSubscriptionId, System.DateTimeOffset startOn, string status, string subscriptionId, System.Collections.Generic.IEnumerable supportedActions, string vaultName, Azure.ETag? eTag, string sourceDataStoreName, string destinationDataStoreName) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId = null, string backupInstanceFriendlyName = null, Azure.Core.ResourceIdentifier backupInstanceId = null, Azure.Core.ResourceIdentifier dataSourceId = null, Azure.Core.AzureLocation dataSourceLocation = default(Azure.Core.AzureLocation), string dataSourceName = null, string dataSourceSetName = null, string dataSourceType = null, System.TimeSpan? duration = default(System.TimeSpan?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupJobExtendedInfo extendedInfo = null, bool isUserTriggered = false, string operation = null, string operationCategory = null, Azure.Core.ResourceIdentifier policyId = null, string policyName = null, bool isProgressEnabled = false, System.Uri progressUri = null, string rehydrationPriority = null, string restoreType = null, string sourceResourceGroup = null, string sourceSubscriptionId = null, System.DateTimeOffset startOn = default(System.DateTimeOffset), string status = null, string subscriptionId = null, System.Collections.Generic.IEnumerable supportedActions = null, string vaultName = null, Azure.ETag? eTag = default(Azure.ETag?), string sourceDataStoreName = null, string destinationDataStoreName = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupNameAvailabilityResult DataProtectionBackupNameAvailabilityResult(string message = null, bool? isNameAvailable = default(bool?), string reason = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupPolicyData DataProtectionBackupPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupPolicyPropertiesBase properties = null) { throw null; } @@ -688,7 +692,8 @@ public static partial class ArmDataProtectionBackupModelFactory public static Azure.ResourceManager.DataProtectionBackup.DeletedDataProtectionBackupInstanceData DeletedDataProtectionBackupInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties properties = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState, Azure.ResponseError protectionErrorDetails, string provisioningState, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails, string objectType, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo) { throw null; } - public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState, Azure.ResponseError protectionErrorDetails, string provisioningState, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType, string objectType, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo dataSourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo dataSourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstancePolicyInfo policyInfo = null, System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceProtectionStatusDetails protectionStatus = null, Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState? currentProtectionState = default(Azure.ResourceManager.DataProtectionBackup.Models.CurrentProtectionState?), Azure.ResponseError protectionErrorDetails = null, string provisioningState = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType? validationType = default(Azure.ResourceManager.DataProtectionBackup.Models.BackupValidationType?), Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails identityDetails = null, string objectType = null, Azure.ResourceManager.DataProtectionBackup.Models.BackupInstanceDeletionInfo deletionInfo = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.ItemLevelRestoreTargetInfo ItemLevelRestoreTargetInfo(Azure.ResourceManager.DataProtectionBackup.Models.RecoverySetting recoverySetting = default(Azure.ResourceManager.DataProtectionBackup.Models.RecoverySetting), Azure.Core.AzureLocation? restoreLocation = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable restoreCriteria = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo datasourceInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataSourceSetInfo datasourceSetInfo = null, Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupAuthCredentials datasourceAuthCredentials = null) { throw null; } public static Azure.ResourceManager.DataProtectionBackup.Models.ItemPathBasedRestoreCriteria ItemPathBasedRestoreCriteria(string itemPath = null, bool isPathRelativeToBackupItem = false, System.Collections.Generic.IEnumerable subItemPathPrefix = null) { throw null; } @@ -1987,9 +1992,9 @@ public partial class DataProtectionIdentityDetails : System.ClientModel.Primitiv { public DataProtectionIdentityDetails() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] + [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityId", false)] public System.Uri UserAssignedIdentityArmUri { get { throw null; } set { } } - public string UserAssignedIdentityArmUriString { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityId { get { throw null; } set { } } public bool? UseSystemAssignedIdentity { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Azure.ResourceManager.DataProtectionBackup.csproj b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Azure.ResourceManager.DataProtectionBackup.csproj index 70d857f6f00b..00b3b103138d 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Azure.ResourceManager.DataProtectionBackup.csproj +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Azure.ResourceManager.DataProtectionBackup.csproj @@ -1,8 +1,8 @@ - 1.6.0-beta.1 + 1.7.0-beta.1 - 1.5.0 + 1.6.0 Azure.ResourceManager.DataProtectionBackup Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.DataProtectionBackup. azure;management;arm;resource manager;dataprotectionbackup diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/ArmDataProtectionBackupModelFactory.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/ArmDataProtectionBackupModelFactory.cs index 61956295da6f..c91e9033002d 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/ArmDataProtectionBackupModelFactory.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/ArmDataProtectionBackupModelFactory.cs @@ -82,100 +82,6 @@ public static DataProtectionBackupInstanceProperties DataProtectionBackupInstanc return new DataProtectionBackupInstanceProperties(friendlyName, dataSourceInfo, dataSourceSetInfo, policyInfo, null, protectionStatus, currentProtectionState, protectionErrorDetails, provisioningState, dataSourceAuthCredentials, validationType, null, objectType, null); } - /// - /// Initializes a new instance of DataProtectionBackupJobProperties. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId = null, string backupInstanceFriendlyName = null, ResourceIdentifier backupInstanceId = null, ResourceIdentifier dataSourceId = null, AzureLocation dataSourceLocation = default, string dataSourceName = null, string dataSourceSetName = null, string dataSourceType = null, TimeSpan? duration = null, DateTimeOffset? endOn = null, IEnumerable errorDetails = null, BackupJobExtendedInfo extendedInfo = null, bool isUserTriggered = default, string operation = null, string operationCategory = null, ResourceIdentifier policyId = null, string policyName = null, bool isProgressEnabled = default, Uri progressUri = null, string restoreType = null, string sourceResourceGroup = null, string sourceSubscriptionId = null, DateTimeOffset startOn = default, string status = null, string subscriptionId = null, IEnumerable supportedActions = null, string vaultName = null, ETag? eTag = null, string sourceDataStoreName = null, string destinationDataStoreName = null) - { - errorDetails ??= new List(); - supportedActions ??= new List(); - - return new DataProtectionBackupJobProperties(activityId, backupInstanceFriendlyName, backupInstanceId, dataSourceId, dataSourceLocation, dataSourceName, dataSourceSetName, dataSourceType, duration, endOn, errorDetails?.ToList(), extendedInfo, isUserTriggered, operation, operationCategory, policyId, policyName, isProgressEnabled, progressUri, null, restoreType, sourceResourceGroup, sourceSubscriptionId, startOn, status, subscriptionId, supportedActions?.ToList(), vaultName, eTag, sourceDataStoreName, destinationDataStoreName, null); - } - - /// - /// Initializes a new instance of DataProtectionBackupDataSourceProperties. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName = null, DataSourceInfo dataSourceInfo = null, DataSourceSetInfo dataSourceSetInfo = null, BackupInstancePolicyInfo policyInfo = null, BackupInstanceProtectionStatusDetails protectionStatus = null, CurrentProtectionState? currentProtectionState = null, ResponseError protectionErrorDetails = null, string provisioningState = null, DataProtectionBackupAuthCredentials dataSourceAuthCredentials = null, BackupValidationType? validationType = null, string objectType = null, BackupInstanceDeletionInfo deletionInfo = null) - { - return new DeletedDataProtectionBackupInstanceProperties(friendlyName, dataSourceInfo, dataSourceSetInfo, policyInfo, null, protectionStatus, currentProtectionState, protectionErrorDetails, provisioningState, dataSourceAuthCredentials, validationType, null, objectType, null, deletionInfo); - } - - /// Initializes a new instance of BackupJobExtendedInfo. - /// Job's Additional Details. - /// State of the Backup Instance. - /// Number of bytes transferred. - /// Destination where restore is done. - /// Details of the Source Recovery Point. - /// List of Sub Tasks of the job. - /// Details of the Target Recovery Point. - /// A new instance for mocking. - public static BackupJobExtendedInfo BackupJobExtendedInfo(IReadOnlyDictionary additionalDetails = null, string backupInstanceState = null, double? dataTransferredInBytes = null, string recoveryDestination = null, RestoreJobRecoveryPointDetails sourceRecoverPoint = null, IEnumerable subTasks = null, RestoreJobRecoveryPointDetails targetRecoverPoint = null) - { - return BackupJobExtendedInfo(additionalDetails, backupInstanceState, dataTransferredInBytes, recoveryDestination, sourceRecoverPoint, subTasks, targetRecoverPoint, null); - } - - /// Initializes a new instance of DataProtectionBackupDiscreteRecoveryPointProperties. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A new instance for mocking. - public static DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName = null, IEnumerable recoveryPointDataStoresDetails = null, DateTimeOffset recoverOn = default, string policyName = null, string policyVersion = null, string recoveryPointId = null, string recoveryPointType = null, string retentionTagName = null, string retentionTagVersion = null, DateTimeOffset? expireOn = null) - { - return DataProtectionBackupDiscreteRecoveryPointProperties(friendlyName, recoveryPointDataStoresDetails, recoverOn, policyName, policyVersion, recoveryPointId, recoveryPointType, retentionTagName, retentionTagVersion, expireOn, null); - } - /// Initializes a new instance of . /// Arm Id of the job created for this operation. /// A new instance for mocking. @@ -183,87 +89,5 @@ public static DataProtectionOperationJobExtendedInfo DataProtectionOperationJobE { return DataProtectionOperationJobExtendedInfo(jobResourceId.ToString()); } - - /// Initializes a new instance of . - /// - /// - /// Gets or sets the restore target information. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Gets or sets the type of the source data store. - /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. - /// - /// Contains information of the Identity Details for the BI. - /// If it is null, default will be considered as System Assigned. - /// - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackupRestoreContent BackupRestoreContent(string objectType = null, RestoreTargetInfoBase restoreTargetInfo = null, SourceDataStoreType sourceDataStoreType = default, ResourceIdentifier sourceResourceId = null, DataProtectionIdentityDetails identityDetails = null) - { - return BackupRestoreContent(objectType, restoreTargetInfo, sourceDataStoreType, sourceResourceId, null, identityDetails); - } - - /// Initializes a new instance of . - /// - /// Gets or sets the restore target information. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Gets or sets the type of the source data store. - /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. - /// - /// Contains information of the Identity Details for the BI. - /// If it is null, default will be considered as System Assigned. - /// - /// - /// Priority to be used for rehydration. Values High or Standard. - /// Retention duration in ISO 8601 format i.e P10D . - /// A new instance for mocking. - - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(RestoreTargetInfoBase restoreTargetInfo = null, SourceDataStoreType sourceDataStoreType = default, ResourceIdentifier sourceResourceId = null, DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null, BackupRehydrationPriority rehydrationPriority = default, TimeSpan rehydrationRetentionDuration = default) - { - return BackupRestoreWithRehydrationContent(restoreTargetInfo, sourceDataStoreType, sourceResourceId, null, identityDetails, recoveryPointId, rehydrationPriority, rehydrationRetentionDuration); - } - - /// Initializes a new instance of . - /// - /// Gets or sets the restore target information. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Gets or sets the type of the source data store. - /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. - /// - /// Contains information of the Identity Details for the BI. - /// If it is null, default will be considered as System Assigned. - /// - /// The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(RestoreTargetInfoBase restoreTargetInfo = null, SourceDataStoreType sourceDataStoreType = default, ResourceIdentifier sourceResourceId = null, DataProtectionIdentityDetails identityDetails = null, DateTimeOffset recoverOn = default) - { - return BackupRecoveryTimeBasedRestoreContent(restoreTargetInfo, sourceDataStoreType, sourceResourceId, null, identityDetails, recoverOn); - } - - /// Initializes a new instance of . - /// - /// Gets or sets the restore target information. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Gets or sets the type of the source data store. - /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. - /// - /// Contains information of the Identity Details for the BI. - /// If it is null, default will be considered as System Assigned. - /// - /// - /// A new instance for mocking. - public static BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(RestoreTargetInfoBase restoreTargetInfo = null, SourceDataStoreType sourceDataStoreType = default, ResourceIdentifier sourceResourceId = null, DataProtectionIdentityDetails identityDetails = null, string recoveryPointId = null) - { - return BackupRecoveryPointBasedRestoreContent(restoreTargetInfo, sourceDataStoreType, sourceResourceId, null, identityDetails, recoveryPointId); - } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs index 23416225309e..71c4cd76dcb4 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs @@ -4,10 +4,7 @@ #nullable disable using System; -using System.Collections.Generic; using System.ComponentModel; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.DataProtectionBackup.Models { @@ -16,12 +13,12 @@ public partial class DataProtectionIdentityDetails /// /// ARM URL for User Assigned Identity. /// - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - [ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This property has been replaced by UserAssignedIdentityId", false)] public Uri UserAssignedIdentityArmUri { - get => string.IsNullOrEmpty(UserAssignedIdentityArmUriString) ? null : new Uri(UserAssignedIdentityArmUriString); - set => UserAssignedIdentityArmUriString = value?.AbsoluteUri; + get => string.IsNullOrEmpty(UserAssignedIdentityId) ? null : new Uri(UserAssignedIdentityId); + set => UserAssignedIdentityId = new(value?.AbsoluteUri); } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/ArmDataProtectionBackupModelFactory.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/ArmDataProtectionBackupModelFactory.cs index 9321ce03a1be..22c608726633 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/ArmDataProtectionBackupModelFactory.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/ArmDataProtectionBackupModelFactory.cs @@ -1011,6 +1011,183 @@ public static RestoreTargetInfo RestoreTargetInfo(RecoverySetting recoverySettin dataSourceAuthCredentials); } + /// + /// Initializes a new instance of DataProtectionBackupJobProperties. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static DataProtectionBackupJobProperties DataProtectionBackupJobProperties(string activityId, string backupInstanceFriendlyName, ResourceIdentifier backupInstanceId, ResourceIdentifier dataSourceId, AzureLocation dataSourceLocation, string dataSourceName, string dataSourceSetName, string dataSourceType, TimeSpan? duration, DateTimeOffset? endOn, IEnumerable errorDetails, BackupJobExtendedInfo extendedInfo, bool isUserTriggered, string operation, string operationCategory, ResourceIdentifier policyId, string policyName, bool isProgressEnabled, Uri progressUri, string restoreType, string sourceResourceGroup, string sourceSubscriptionId, DateTimeOffset startOn, string status, string subscriptionId, IEnumerable supportedActions, string vaultName, ETag? eTag, string sourceDataStoreName, string destinationDataStoreName) + { + return DataProtectionBackupJobProperties(activityId: activityId, backupInstanceFriendlyName: backupInstanceFriendlyName, backupInstanceId: backupInstanceId, dataSourceId: dataSourceId, dataSourceLocation: dataSourceLocation, dataSourceName: dataSourceName, dataSourceSetName: dataSourceSetName, dataSourceType: dataSourceType, duration: duration, endOn: endOn, errorDetails: errorDetails, extendedInfo: extendedInfo, isUserTriggered: isUserTriggered, operation: operation, operationCategory: operationCategory, policyId: policyId, policyName: policyName, isProgressEnabled: isProgressEnabled, progressUri: progressUri, rehydrationPriority: default, restoreType: restoreType, sourceResourceGroup: sourceResourceGroup, sourceSubscriptionId: sourceSubscriptionId, startOn: startOn, status: status, subscriptionId: subscriptionId, supportedActions: supportedActions, vaultName: vaultName, eTag: eTag, sourceDataStoreName: sourceDataStoreName, destinationDataStoreName: destinationDataStoreName); + } + + /// + /// Initializes a new instance of DataProtectionBackupDataSourceProperties. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static DeletedDataProtectionBackupInstanceProperties DeletedDataProtectionBackupInstanceProperties(string friendlyName, DataSourceInfo dataSourceInfo, DataSourceSetInfo dataSourceSetInfo, BackupInstancePolicyInfo policyInfo, BackupInstanceProtectionStatusDetails protectionStatus, CurrentProtectionState? currentProtectionState, ResponseError protectionErrorDetails, string provisioningState, DataProtectionBackupAuthCredentials dataSourceAuthCredentials, BackupValidationType? validationType, string objectType, BackupInstanceDeletionInfo deletionInfo) + { + return DeletedDataProtectionBackupInstanceProperties(friendlyName: friendlyName, dataSourceInfo: dataSourceInfo, dataSourceSetInfo: dataSourceSetInfo, policyInfo: policyInfo, resourceGuardOperationRequests: default, protectionStatus: protectionStatus, currentProtectionState: currentProtectionState, protectionErrorDetails: protectionErrorDetails, provisioningState: provisioningState, dataSourceAuthCredentials: dataSourceAuthCredentials, validationType: validationType, identityDetails: default, objectType: objectType, deletionInfo: deletionInfo); + } + + /// Initializes a new instance of BackupJobExtendedInfo. + /// Job's Additional Details. + /// State of the Backup Instance. + /// Number of bytes transferred. + /// Destination where restore is done. + /// Details of the Source Recovery Point. + /// List of Sub Tasks of the job. + /// Details of the Target Recovery Point. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupJobExtendedInfo BackupJobExtendedInfo(IReadOnlyDictionary additionalDetails, string backupInstanceState, double? dataTransferredInBytes, string recoveryDestination, RestoreJobRecoveryPointDetails sourceRecoverPoint, IEnumerable subTasks, RestoreJobRecoveryPointDetails targetRecoverPoint) + { + return BackupJobExtendedInfo(additionalDetails: additionalDetails, backupInstanceState: backupInstanceState, dataTransferredInBytes: dataTransferredInBytes, recoveryDestination: recoveryDestination, sourceRecoverPoint: sourceRecoverPoint, subTasks: subTasks, targetRecoverPoint: targetRecoverPoint, warningDetails: default); + } + + /// Initializes a new instance of DataProtectionBackupDiscreteRecoveryPointProperties. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DataProtectionBackupDiscreteRecoveryPointProperties DataProtectionBackupDiscreteRecoveryPointProperties(string friendlyName, IEnumerable recoveryPointDataStoresDetails, DateTimeOffset recoverOn, string policyName, string policyVersion, string recoveryPointId, string recoveryPointType, string retentionTagName, string retentionTagVersion, DateTimeOffset? expireOn) + { + return DataProtectionBackupDiscreteRecoveryPointProperties(friendlyName: friendlyName, recoveryPointDataStoresDetails: recoveryPointDataStoresDetails, recoverOn: recoverOn, policyName: policyName, policyVersion: policyVersion, recoveryPointId: recoveryPointId, recoveryPointType: recoveryPointType, retentionTagName: retentionTagName, retentionTagVersion: retentionTagVersion, expireOn: expireOn, recoveryPointState: default); + } + + /// Initializes a new instance of . + /// + /// + /// Gets or sets the restore target information. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the type of the source data store. + /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. + /// + /// Contains information of the Identity Details for the BI. + /// If it is null, default will be considered as System Assigned. + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupRestoreContent BackupRestoreContent(string objectType, RestoreTargetInfoBase restoreTargetInfo, SourceDataStoreType sourceDataStoreType, ResourceIdentifier sourceResourceId, DataProtectionIdentityDetails identityDetails) + { + return BackupRestoreContent(objectType: objectType, restoreTargetInfo: restoreTargetInfo, sourceDataStoreType: sourceDataStoreType, sourceResourceId: sourceResourceId, resourceGuardOperationRequests: default, identityDetails: identityDetails); + } + + /// Initializes a new instance of . + /// + /// Gets or sets the restore target information. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the type of the source data store. + /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. + /// + /// Contains information of the Identity Details for the BI. + /// If it is null, default will be considered as System Assigned. + /// + /// + /// Priority to be used for rehydration. Values High or Standard. + /// Retention duration in ISO 8601 format i.e P10D . + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupRestoreWithRehydrationContent BackupRestoreWithRehydrationContent(RestoreTargetInfoBase restoreTargetInfo, SourceDataStoreType sourceDataStoreType, ResourceIdentifier sourceResourceId, DataProtectionIdentityDetails identityDetails, string recoveryPointId, BackupRehydrationPriority rehydrationPriority, TimeSpan rehydrationRetentionDuration) + { + return BackupRestoreWithRehydrationContent(restoreTargetInfo: restoreTargetInfo, sourceDataStoreType: sourceDataStoreType, sourceResourceId: sourceResourceId, resourceGuardOperationRequests: default, identityDetails: identityDetails, recoveryPointId: recoveryPointId, rehydrationPriority: rehydrationPriority, rehydrationRetentionDuration: rehydrationRetentionDuration); + } + + /// Initializes a new instance of . + /// + /// Gets or sets the restore target information. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the type of the source data store. + /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. + /// + /// Contains information of the Identity Details for the BI. + /// If it is null, default will be considered as System Assigned. + /// + /// The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupRecoveryTimeBasedRestoreContent BackupRecoveryTimeBasedRestoreContent(RestoreTargetInfoBase restoreTargetInfo, SourceDataStoreType sourceDataStoreType, ResourceIdentifier sourceResourceId, DataProtectionIdentityDetails identityDetails, DateTimeOffset recoverOn) + { + return BackupRecoveryTimeBasedRestoreContent(restoreTargetInfo: restoreTargetInfo, sourceDataStoreType: sourceDataStoreType, sourceResourceId: sourceResourceId, resourceGuardOperationRequests: default, identityDetails: identityDetails, recoverOn: recoverOn); + } + + /// Initializes a new instance of . + /// + /// Gets or sets the restore target information. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the type of the source data store. + /// Fully qualified Azure Resource Manager ID of the datasource which is being recovered. + /// + /// Contains information of the Identity Details for the BI. + /// If it is null, default will be considered as System Assigned. + /// + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupRecoveryPointBasedRestoreContent BackupRecoveryPointBasedRestoreContent(RestoreTargetInfoBase restoreTargetInfo, SourceDataStoreType sourceDataStoreType, ResourceIdentifier sourceResourceId, DataProtectionIdentityDetails identityDetails, string recoveryPointId) + { + return BackupRecoveryPointBasedRestoreContent(restoreTargetInfo: restoreTargetInfo, sourceDataStoreType: sourceDataStoreType, sourceResourceId: sourceResourceId, resourceGuardOperationRequests: default, identityDetails: identityDetails, recoveryPointId: recoveryPointId); + } + /// Initializes a new instance of . /// Monitoring Settings. /// Provisioning state of the BackupVault resource. diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs index a35aaa0b8b39..47e54d9e7e47 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs @@ -39,10 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("useSystemAssignedIdentity"u8); writer.WriteBooleanValue(UseSystemAssignedIdentity.Value); } - if (Optional.IsDefined(UserAssignedIdentityArmUriString)) + if (Optional.IsDefined(UserAssignedIdentityId)) { writer.WritePropertyName("userAssignedIdentityArmUrl"u8); - writer.WriteStringValue(UserAssignedIdentityArmUriString); + writer.WriteStringValue(UserAssignedIdentityId); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -82,7 +82,7 @@ internal static DataProtectionIdentityDetails DeserializeDataProtectionIdentityD return null; } bool? useSystemAssignedIdentity = default; - string userAssignedIdentityArmUrl = default; + ResourceIdentifier userAssignedIdentityArmUrl = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,7 +98,11 @@ internal static DataProtectionIdentityDetails DeserializeDataProtectionIdentityD } if (property.NameEquals("userAssignedIdentityArmUrl"u8)) { - userAssignedIdentityArmUrl = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityArmUrl = new ResourceIdentifier(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs index b6dbda574cfc..6154e1d34a4c 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.DataProtectionBackup.Models { @@ -52,18 +53,18 @@ public DataProtectionIdentityDetails() /// Initializes a new instance of . /// Specifies if the BI is protected by System Identity. - /// ARM URL for User Assigned Identity. + /// ARM URL for User Assigned Identity. /// Keeps track of any properties unknown to the library. - internal DataProtectionIdentityDetails(bool? useSystemAssignedIdentity, string userAssignedIdentityArmUriString, IDictionary serializedAdditionalRawData) + internal DataProtectionIdentityDetails(bool? useSystemAssignedIdentity, ResourceIdentifier userAssignedIdentityId, IDictionary serializedAdditionalRawData) { UseSystemAssignedIdentity = useSystemAssignedIdentity; - UserAssignedIdentityArmUriString = userAssignedIdentityArmUriString; + UserAssignedIdentityId = userAssignedIdentityId; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Specifies if the BI is protected by System Identity. public bool? UseSystemAssignedIdentity { get; set; } /// ARM URL for User Assigned Identity. - public string UserAssignedIdentityArmUriString { get; set; } + public ResourceIdentifier UserAssignedIdentityId { get; set; } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md index eddd616ba0fb..47cbead8d852 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md @@ -257,7 +257,7 @@ rename-mapping: SecureScoreLevel: BackupVaultSecureScoreLevel FeatureSettings: BackupVaultFeatureSettings IdentityDetails: DataProtectionIdentityDetails - IdentityDetails.userAssignedIdentityArmUrl: UserAssignedIdentityArmUriString + IdentityDetails.userAssignedIdentityArmUrl: UserAssignedIdentityId|arm-id NamespacedNameResource: NamespacedName CrossRegionRestoreDetails.sourceBackupInstanceId : -|arm-id CrossRegionRestoreDetails.sourceRegion : -|azure-location diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Customize/ArmDesktopVirtualizationModelFactory.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Customize/ArmDesktopVirtualizationModelFactory.cs deleted file mode 100644 index 25fcab112dd9..000000000000 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Customize/ArmDesktopVirtualizationModelFactory.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using System.ComponentModel; -using Azure.Core; -using Azure.ResourceManager.DesktopVirtualization.Models; -using Azure.ResourceManager.Models; -using SystemData = Azure.ResourceManager.Models.SystemData; -using Azure.ResourceManager.DesktopVirtualization; - -namespace Azure.ResourceManager.DesktopVirtualization.Models -{ - /// - /// A factory for creating Azure.ResourceManager.DesktopVirtualization.Models instances. - /// - public static partial class ArmDesktopVirtualizationModelFactory - { - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// ObjectId of HostPool. (internal use). - /// Friendly name of HostPool. - /// Description of HostPool. - /// HostPool type for desktop. - /// PersonalDesktopAssignment type for HostPool. - /// Custom rdp property of HostPool. - /// The max session limit of HostPool. - /// The type of the load balancer. - /// The ring number of HostPool. - /// Is validation environment. - /// The registration info of HostPool. - /// VM template for sessionhosts configuration within hostpool. - /// List of applicationGroup links. - /// URL to customer ADFS server for signing WVD SSO certificates. - /// ClientId for the registered Relying Party used to issue WVD SSO certificates. - /// Path to Azure KeyVault storing the secret used for communication to ADFS. - /// The type of single sign on Secret Type. - /// The type of preferred application group type, default to Desktop Application Group. - /// The flag to turn on/off StartVMOnConnect feature. - /// Is cloud pc resource. - /// The session host configuration for updating agent, monitoring agent, and stack component. - /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. - /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. - /// The resource model definition representing SKU. - /// Gets or sets the plan. - [EditorBrowsable(EditorBrowsableState.Never)] - public static HostPoolData HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IEnumerable applicationGroupReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, SessionHostAgentUpdateProperties agentUpdate, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) - => HostPoolData(id, name, resourceType, systemData, tags, location, objectId, friendlyName, description, hostPoolType, personalDesktopAssignmentType, customRdpProperty, maxSessionLimit, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, applicationGroupReferences, ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, isCloudPCResource, default, agentUpdate, default, managedBy, kind, etag, identity, sku, plan); - - /// Initializes a new instance of HostPoolPatch. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// tags to be updated. - /// Friendly name of HostPool. - /// Description of HostPool. - /// Custom rdp property of HostPool. - /// The max session limit of HostPool. - /// PersonalDesktopAssignment type for HostPool. - /// The type of the load balancer. - /// The ring number of HostPool. - /// Is validation environment. - /// The registration info of HostPool. - /// VM template for sessionhosts configuration within hostpool. - /// URL to customer ADFS server for signing WVD SSO certificates. - /// ClientId for the registered Relying Party used to issue WVD SSO certificates. - /// Path to Azure KeyVault storing the secret used for communication to ADFS. - /// The type of single sign on Secret Type. - /// The type of preferred application group type, default to Desktop Application Group. - /// The flag to turn on/off StartVMOnConnect feature. - /// The session host configuration for updating agent, monitoring agent, and stack component. - [EditorBrowsable(EditorBrowsableState.Never)] - public static HostPoolPatch HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, SessionHostAgentUpdatePatchProperties agentUpdate) - => HostPoolPatch(id, name, resourceType, systemData, tags, friendlyName, description, customRdpProperty, maxSessionLimit, personalDesktopAssignmentType, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, default, agentUpdate); - - /// Initializes a new instance of VirtualApplicationGroupData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// ObjectId of ApplicationGroup. (internal use). - /// Description of ApplicationGroup. - /// Friendly name of ApplicationGroup. - /// HostPool arm path of ApplicationGroup. - /// Workspace arm path of ApplicationGroup. - /// Resource Type of ApplicationGroup. - /// Is cloud pc resource. - /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. - /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. - /// The resource model definition representing SKU. - /// Gets or sets the plan. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, ResourceIdentifier hostPoolId, ResourceIdentifier workspaceId, VirtualApplicationGroupType applicationGroupType, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) - => VirtualApplicationGroupData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, hostPoolId, workspaceId, applicationGroupType, isCloudPCResource, default, managedBy, kind, etag, identity, sku, plan); - /// Initializes a new instance of VirtualApplicationGroupPatch. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// tags to be updated. - /// Description of ApplicationGroup. - /// Friendly name of ApplicationGroup. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualApplicationGroupPatch VirtualApplicationGroupPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string description, string friendlyName) - => VirtualApplicationGroupPatch(id, name, resourceType, systemData, tags, description, friendlyName, default); - - /// Initializes a new instance of VirtualWorkspaceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// ObjectId of Workspace. (internal use). - /// Description of Workspace. - /// Friendly name of Workspace. - /// List of applicationGroup resource Ids. - /// Is cloud pc resource. - /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. - /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. - /// The resource model definition representing SKU. - /// Gets or sets the plan. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VirtualWorkspaceData VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, IEnumerable applicationGroupReferences, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) - => VirtualWorkspaceData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, applicationGroupReferences, isCloudPCResource, default, default, managedBy, kind, etag, identity, sku, plan); - } -} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs index 4c176845faa2..41d4d2aba32f 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs @@ -979,6 +979,138 @@ public static AppAttachPackagePatch AppAttachPackagePatch(ResourceIdentifier id serializedAdditionalRawData: null); } + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// ObjectId of HostPool. (internal use). + /// Friendly name of HostPool. + /// Description of HostPool. + /// HostPool type for desktop. + /// PersonalDesktopAssignment type for HostPool. + /// Custom rdp property of HostPool. + /// The max session limit of HostPool. + /// The type of the load balancer. + /// The ring number of HostPool. + /// Is validation environment. + /// The registration info of HostPool. + /// VM template for sessionhosts configuration within hostpool. + /// List of applicationGroup links. + /// URL to customer ADFS server for signing WVD SSO certificates. + /// ClientId for the registered Relying Party used to issue WVD SSO certificates. + /// Path to Azure KeyVault storing the secret used for communication to ADFS. + /// The type of single sign on Secret Type. + /// The type of preferred application group type, default to Desktop Application Group. + /// The flag to turn on/off StartVMOnConnect feature. + /// Is cloud pc resource. + /// The session host configuration for updating agent, monitoring agent, and stack component. + /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// The resource model definition representing SKU. + /// Gets or sets the plan. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HostPoolData HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IEnumerable applicationGroupReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, SessionHostAgentUpdateProperties agentUpdate, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) + { + return HostPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, friendlyName: friendlyName, description: description, hostPoolType: hostPoolType, personalDesktopAssignmentType: personalDesktopAssignmentType, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, applicationGroupReferences: applicationGroupReferences, appAttachPackageReferences: default, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, isCloudPCResource: isCloudPCResource, publicNetworkAccess: default, agentUpdate: agentUpdate, privateEndpointConnections: default, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); + } + + /// Initializes a new instance of HostPoolPatch. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// tags to be updated. + /// Friendly name of HostPool. + /// Description of HostPool. + /// Custom rdp property of HostPool. + /// The max session limit of HostPool. + /// PersonalDesktopAssignment type for HostPool. + /// The type of the load balancer. + /// The ring number of HostPool. + /// Is validation environment. + /// The registration info of HostPool. + /// VM template for sessionhosts configuration within hostpool. + /// URL to customer ADFS server for signing WVD SSO certificates. + /// ClientId for the registered Relying Party used to issue WVD SSO certificates. + /// Path to Azure KeyVault storing the secret used for communication to ADFS. + /// The type of single sign on Secret Type. + /// The type of preferred application group type, default to Desktop Application Group. + /// The flag to turn on/off StartVMOnConnect feature. + /// The session host configuration for updating agent, monitoring agent, and stack component. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HostPoolPatch HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, SessionHostAgentUpdatePatchProperties agentUpdate) + { + return HostPoolPatch(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, friendlyName: friendlyName, description: description, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, personalDesktopAssignmentType: personalDesktopAssignmentType, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, publicNetworkAccess: default, agentUpdate: agentUpdate); + } + + /// Initializes a new instance of VirtualApplicationGroupData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// ObjectId of ApplicationGroup. (internal use). + /// Description of ApplicationGroup. + /// Friendly name of ApplicationGroup. + /// HostPool arm path of ApplicationGroup. + /// Workspace arm path of ApplicationGroup. + /// Resource Type of ApplicationGroup. + /// Is cloud pc resource. + /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// The resource model definition representing SKU. + /// Gets or sets the plan. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, ResourceIdentifier hostPoolId, ResourceIdentifier workspaceId, VirtualApplicationGroupType applicationGroupType, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) + { + return VirtualApplicationGroupData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, description: description, friendlyName: friendlyName, hostPoolId: hostPoolId, workspaceId: workspaceId, applicationGroupType: applicationGroupType, isCloudPCResource: isCloudPCResource, showInFeed: default, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); + } + + /// Initializes a new instance of VirtualApplicationGroupPatch. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// tags to be updated. + /// Description of ApplicationGroup. + /// Friendly name of ApplicationGroup. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualApplicationGroupPatch VirtualApplicationGroupPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string description, string friendlyName) + { + return VirtualApplicationGroupPatch(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, description: description, friendlyName: friendlyName, showInFeed: default); + } + + /// Initializes a new instance of VirtualWorkspaceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// ObjectId of Workspace. (internal use). + /// Description of Workspace. + /// Friendly name of Workspace. + /// List of applicationGroup resource Ids. + /// Is cloud pc resource. + /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + /// The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// The resource model definition representing SKU. + /// Gets or sets the plan. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualWorkspaceData VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, IEnumerable applicationGroupReferences, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) + { + return VirtualWorkspaceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, description: description, friendlyName: friendlyName, applicationGroupReferences: applicationGroupReferences, isCloudPCResource: isCloudPCResource, publicNetworkAccess: default, privateEndpointConnections: default, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); + } + /// Initializes a new instance of DesktopVirtualizationPrivateEndpointConnection. /// The id. /// The name. diff --git a/sdk/devcenter/Azure.Developer.DevCenter/README.md b/sdk/devcenter/Azure.Developer.DevCenter/README.md index dd689c924d87..896239da94d9 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/README.md +++ b/sdk/devcenter/Azure.Developer.DevCenter/README.md @@ -22,7 +22,7 @@ dotnet add package Azure.Developer.DevCenter --prerelease You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. -You must have [configured](https://learn.microsoft.com/azure/dev-box/quickstart-configure-dev-box-service) a DevCenter, Project, Network Connection, Dev Box Definition, and Pool before you can create Dev Boxes +You must have [configured](https://learn.microsoft.com/azure/dev-box/quickstart-configure-dev-box-service) a DevCenter, Project, Network Connection, Dev Box Definition, and Pool before you can create Dev Boxes You must have configured a DevCenter, Project, Catalog, and Environment Type before you can create Environments @@ -52,7 +52,7 @@ var devBoxesClient = new DevBoxesClient(endpoint, credential); var environmentsClient = new DeploymentEnvironmentsClient(endpoint, credential); ``` -Alternatively use `DevCenterClient` to create `DevBoxesClient` and `DeploymentEnvironmentsClient` sharing same endpoint and credential across clients. +Alternatively use `DevCenterClient` to create `DevBoxesClient` and `DeploymentEnvironmentsClient` sharing same endpoint and credential across clients. ```C# Snippet:Azure_DevCenter_CreateClientsFromDevCenterClient_Scenario devBoxesClient = devCenterClient.GetDevBoxesClient(); @@ -138,7 +138,7 @@ Console.WriteLine($"Connect using web URL {remoteConnection.WebUri}."); ### Delete the Dev Box -Deleting a DevBox is easy. It's much faster operation than creating a new DevBox. +Deleting a DevBox is easy. It's much faster operation than creating a new DevBox. ```C# Snippet:Azure_DevCenter_DeleteDevBox_Scenario Operation devBoxDeleteOperation = await devBoxesClient.DeleteDevBoxAsync( @@ -264,8 +264,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/devcenter/Azure.Developer.DevCenter/README.png) - ## Next steps For more information on Azure SDK, please refer to [this website](https://azure.github.io/azure-sdk/) diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md index aef164a59671..27fd5cac9073 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md @@ -1,20 +1,28 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.3 (Unreleased) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed ### Other Changes +## 1.0.0-beta.2 (2025-01-24) + +### Features Added + +- Added `DiscoveredAssets` and `DiscoveredAssetEndpointProfiles` resource types from Microsoft.DeviceRegistry OpenAPI spec version `2024-09-01-preview`. +- Added `SchemaRegistries`, `SchemaRegistries/Schemas` and `SchemaRegistries/Schemas/SchemaVersions` resource types from Microsoft.DeviceRegistry OpenAPI spec version `2024-09-01-preview`. +- Added `BillingContainers` resource type from Microsoft.DeviceRegistry OpenAPI spec version `2024-09-01-preview`. +- Updated `Assets` and `AssetEndpointProfiles` resource types to align to Microsoft.DeviceRegistry OpenAPI spec version `2024-09-01-preview`. +- Exposed `JsonModelWriteCore` for model serialization procedure. + ## 1.0.0-beta.1 (2024-03-27) -### General New Features +### Features Added This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md index 5dce3a96b839..7f0ee185a4b6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md @@ -1,6 +1,6 @@ # Microsoft Azure DeviceRegistry management client library for .NET -Azure Device Registry (ADR) is a unified registry projecting assets and devices as Azure resources. ADR creates a single source of truth for asset metadata across Azure, partner, and customer applications running in the cloud or on the edge. ADR streamlines and simplifies end-to-end IoT architectures built on top of widely adopted Azure constructs. +Azure Device Registry (ADR) is a unified registry projecting assets and devices as Azure resources. ADR creates a single source of truth for asset metadata across Azure, partner, and customer applications running in the cloud or on the edge. ADR streamlines and simplifies end-to-end IoT architectures built on top of widely adopted Azure constructs. This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: @@ -77,4 +77,4 @@ more information, see the [Code of Conduct FAQ][coc_faq] or contact [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs index 8f835e67d975..d8dce9c4d766 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.net8.0.cs @@ -20,30 +20,8 @@ protected DeviceRegistryAssetCollection() { } public partial class DeviceRegistryAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public System.Uri AssetEndpointProfileUri { get { throw null; } set { } } - public string AssetType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Attributes { get { throw null; } } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DefaultDataPointsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public bool? Enabled { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public string ExternalAssetId { get { throw null; } set { } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.AssetStatus Status { get { throw null; } } - public string Uuid { get { throw null; } } - public int? Version { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -71,13 +49,8 @@ protected DeviceRegistryAssetEndpointProfileCollection() { } public partial class DeviceRegistryAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public string AdditionalConfiguration { get { throw null; } set { } } public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public System.Collections.Generic.IList TransportAuthenticationOwnCertificates { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication UserAuthentication { get { throw null; } set { } } - public string Uuid { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -135,6 +108,156 @@ protected DeviceRegistryAssetResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class DeviceRegistryBillingContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryBillingContainerCollection() { } + public virtual Azure.Response Exists(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryBillingContainerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryBillingContainerData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? BillingContainerProvisioningState { get { throw null; } } + public Azure.ETag? ETag { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryBillingContainerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryBillingContainerResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string billingContainerName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryDiscoveredAssetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryDiscoveredAssetEndpointProfileResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryDiscoveredAssetResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class DeviceRegistryExtensions { public static Azure.Response GetDeviceRegistryAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string assetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -149,6 +272,184 @@ public static partial class DeviceRegistryExtensions public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetDeviceRegistryAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDeviceRegistryAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistryBillingContainer(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.Response GetDeviceRegistryDiscoveredAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistrySchemaRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class DeviceRegistrySchemaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaRegistryCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaRegistryData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaRegistryResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistrySchema(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistrySchemaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistrySchemaVersion(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistrySchemaVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaVersionData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaVersionResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Mocking @@ -158,6 +459,12 @@ public partial class MockableDeviceRegistryArmClient : Azure.ResourceManager.Arm protected MockableDeviceRegistryArmClient() { } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetResource GetDeviceRegistryAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDeviceRegistryResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -168,6 +475,15 @@ protected MockableDeviceRegistryResourceGroupResource() { } public virtual System.Threading.Tasks.Task> GetDeviceRegistryAssetEndpointProfileAsync(string assetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles() { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets() { throw null; } + public virtual Azure.Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() { throw null; } + public virtual Azure.Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableDeviceRegistrySubscriptionResource : Azure.ResourceManager.ArmResource { @@ -176,100 +492,175 @@ protected MockableDeviceRegistrySubscriptionResource() { } public virtual Azure.AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDeviceRegistryAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDeviceRegistryAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistryBillingContainer(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers() { throw null; } + public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeviceRegistrySchemaRegistries(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Models { public static partial class ArmDeviceRegistryModelFactory { - public static Azure.ResourceManager.DeviceRegistry.Models.AssetStatus AssetStatus(System.Collections.Generic.IEnumerable errors = null, int? version = default(int?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError AssetStatusError(int? code = default(int?), string message = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData DeviceRegistryAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, string assetType = null, bool? enabled = default(bool?), string externalAssetId = null, string displayName = null, string description = null, System.Uri assetEndpointProfileUri = null, int? version = default(int?), string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, System.Collections.Generic.IDictionary attributes = null, string defaultDataPointsConfiguration = null, string defaultEventsConfiguration = null, System.Collections.Generic.IEnumerable dataPoints = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.AssetStatus status = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, System.Uri targetAddress = null, Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication userAuthentication = null, System.Collections.Generic.IEnumerable transportAuthenticationOwnCertificates = null, string additionalConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError AssetEndpointProfileStatusError(int? code = default(int?), string message = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AssetProperties AssetProperties(string uuid = null, bool? isEnabled = default(bool?), string externalAssetId = null, string displayName = null, string description = null, string assetEndpointProfileRef = null, long? version = default(long?), string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, System.Collections.Generic.IDictionary attributes = null, System.Collections.Generic.IEnumerable discoveredAssetRefs = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus status = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData DeviceRegistryAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.AssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties DeviceRegistryAssetEndpointProfileProperties(string uuid = null, System.Uri targetAddress = null, string endpointProfileType = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication authentication = null, string additionalConfiguration = null, string discoveredAssetEndpointProfileRef = null, System.Collections.Generic.IEnumerable statusErrors = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus DeviceRegistryAssetStatus(System.Collections.Generic.IEnumerable errors = null, long? version = default(long?), System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset DeviceRegistryAssetStatusDataset(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError DeviceRegistryAssetStatusError(int? code = default(int?), string message = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent DeviceRegistryAssetStatusEvent(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData DeviceRegistryBillingContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? billingContainerProvisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = (long)0, string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData DeviceRegistrySchemaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties properties = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, System.Uri storageAccountContainerUri = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress = null, string additionalConfiguration = null, System.Collections.Generic.IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = (long)0, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) { throw null; } } - public partial class AssetEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetEndpointProfileStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AssetEvent(string eventNotifier) { } - public string CapabilityId { get { throw null; } set { } } - public string EventConfiguration { get { throw null; } set { } } - public string EventNotifier { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode? ObservabilityMode { get { throw null; } set { } } + internal AssetEndpointProfileStatusError() { } + public int? Code { get { throw null; } } + public string Message { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AssetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AssetStatus() { } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public int? Version { get { throw null; } } + public AssetEndpointProfileUpdateProperties() { } + public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication Authentication { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public System.Uri TargetAddress { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AssetStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AssetStatusError() { } - public int? Code { get { throw null; } } - public string Message { get { throw null; } } + public AssetProperties(string assetEndpointProfileRef) { } + public string AssetEndpointProfileRef { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList DiscoveredAssetRefs { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string ExternalAssetId { get { throw null; } set { } } + public string HardwareRevision { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus Status { get { throw null; } } + public string Uuid { get { throw null; } } + public long? Version { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DataPoint(string dataSource) { } - public string CapabilityId { get { throw null; } set { } } - public string DataPointConfiguration { get { throw null; } set { } } - public string DataSource { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode? ObservabilityMode { get { throw null; } set { } } + public AssetUpdateProperties() { } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string HardwareRevision { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DataPointsObservabilityMode : System.IEquatable + public readonly partial struct AuthenticationMethod : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public DataPointsObservabilityMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Counter { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Gauge { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Histogram { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Log { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode None { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode other) { throw null; } + public AuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Certificate { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod UsernamePassword { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod left, Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod left, Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPointObservabilityMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPointObservabilityMode(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Counter { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Gauge { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Histogram { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Log { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode right) { throw null; } public override string ToString() { throw null; } } public partial class DeviceRegistryAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetEndpointProfilePatch() { } - public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public System.Collections.Generic.IList TransportAuthenticationOwnCertificates { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate UserAuthentication { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -277,33 +668,212 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DeviceRegistryAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType) { } + public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication Authentication { get { throw null; } set { } } + public string DiscoveredAssetEndpointProfileRef { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StatusErrors { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeviceRegistryAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetPatch() { } - public string AssetType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Attributes { get { throw null; } } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DefaultDataPointsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatus() { } + public System.Collections.Generic.IReadOnlyList Datasets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Events { get { throw null; } } + public long? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusDataset() { } + public Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusError() { } + public int? Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusEvent() { } + public Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryAuthentication(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod method) { } + public Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Method { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials UsernamePasswordCredentials { get { throw null; } set { } } + public string X509CredentialsCertificateSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataPoint : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataPoint(string name, string dataSource) : base (default(string), default(string)) { } + public Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode? ObservabilityMode { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataPointBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataPointBase(string name, string dataSource) { } + public string DataPointConfiguration { get { throw null; } set { } } + public string DataSource { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataset(string name) { } + public System.Collections.Generic.IList DataPoints { get { throw null; } } + public string DatasetConfiguration { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetEndpointProfilePatch() { } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetPatch() { } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) { } + public string AssetEndpointProfileRef { get { throw null; } set { } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } public string DefaultEventsConfiguration { get { throw null; } set { } } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } public System.Uri DocumentationUri { get { throw null; } set { } } - public bool? Enabled { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } + public System.Collections.Generic.IList Events { get { throw null; } } public string HardwareRevision { get { throw null; } set { } } public string Manufacturer { get { throw null; } set { } } public System.Uri ManufacturerUri { get { throw null; } set { } } public string Model { get { throw null; } set { } } public string ProductCode { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } public string SerialNumber { get { throw null; } set { } } public string SoftwareRevision { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public long Version { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryEvent : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryEvent(string name, string eventNotifier) : base (default(string), default(string)) { } + public Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode? ObservabilityMode { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryEventBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryEventBase(string name, string eventNotifier) { } + public string EventConfiguration { get { throw null; } set { } } + public string EventNotifier { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DeviceRegistryExtendedLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -325,6 +895,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public DeviceRegistryProvisioningState(string value) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Accepted { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Succeeded { get { throw null; } } public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState other) { throw null; } @@ -338,103 +909,285 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventsObservabilityMode : System.IEquatable + public readonly partial struct DeviceRegistrySchemaFormat : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventsObservabilityMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode Log { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode None { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode other) { throw null; } + public DeviceRegistrySchemaFormat(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Delta10 { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat JsonSchemaDraft7 { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } public override string ToString() { throw null; } } - public partial class OwnCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public OwnCertificate() { } - public string CertPasswordReference { get { throw null; } set { } } - public string CertSecretReference { get { throw null; } set { } } - public string CertThumbprint { get { throw null; } set { } } + public DeviceRegistrySchemaProperties(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType) { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Format { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType SchemaType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public string Uuid { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.OwnCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.OwnCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UserAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UserAuthentication(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode mode) { } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Mode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials UsernamePasswordCredentials { get { throw null; } set { } } - public string X509CredentialsCertificateReference { get { throw null; } set { } } + public DeviceRegistrySchemaRegistryPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaRegistryProperties(string @namespace, System.Uri storageAccountContainerUri) { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public string Namespace { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Uri StorageAccountContainerUri { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct UserAuthenticationMode : System.IEquatable + public readonly partial struct DeviceRegistrySchemaType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public UserAuthenticationMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Anonymous { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Certificate { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode UsernamePassword { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode other) { throw null; } + public DeviceRegistrySchemaType(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType MessageSchema { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode left, Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode left, Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } public override string ToString() { throw null; } } - public partial class UserAuthenticationUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaVersionProperties(string schemaContent) { } + public string Description { get { throw null; } set { } } + public string Hash { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SchemaContent { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryTopic : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryTopic(string path) { } + public string Path { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType? Retain { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeviceRegistryTopicRetainType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeviceRegistryTopicRetainType(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType Keep { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeviceRegistryUsernamePasswordCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryUsernamePasswordCredentials(string usernameSecretName, string passwordSecretName) { } + public string PasswordSecretName { get { throw null; } set { } } + public string UsernameSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType, string discoveryId, long version) { } + public string AdditionalConfiguration { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public long Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredAssetEndpointProfileUpdateProperties() { } + public string AdditionalConfiguration { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public long? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UserAuthenticationUpdate() { } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode? Mode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate UsernamePasswordCredentials { get { throw null; } set { } } - public string X509CredentialsCertificateReference { get { throw null; } set { } } + public DiscoveredAssetUpdateProperties() { } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string HardwareRevision { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } + public long? Version { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UsernamePasswordCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DiscoveredDataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UsernamePasswordCredentials(string usernameReference, string passwordReference) { } - public string PasswordReference { get { throw null; } set { } } - public string UsernameReference { get { throw null; } set { } } + public DiscoveredDataPoint(string name, string dataSource) { } + public string DataPointConfiguration { get { throw null; } set { } } + public string DataSource { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } + public string Name { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UsernamePasswordCredentialsUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DiscoveredDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UsernamePasswordCredentialsUpdate() { } - public string PasswordReference { get { throw null; } set { } } - public string UsernameReference { get { throw null; } set { } } + public DiscoveredDataset(string name) { } + public System.Collections.Generic.IList DataPoints { get { throw null; } } + public string DatasetConfiguration { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredEvent(string name, string eventNotifier) { } + public string EventConfiguration { get { throw null; } set { } } + public string EventNotifier { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventObservabilityMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EventObservabilityMode(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode Log { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MessageSchemaReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageSchemaReference() { } + public string SchemaName { get { throw null; } } + public string SchemaRegistryNamespace { get { throw null; } } + public string SchemaVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SchemaRegistryUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SchemaRegistryUpdateProperties() { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs index 8f835e67d975..d8dce9c4d766 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/api/Azure.ResourceManager.DeviceRegistry.netstandard2.0.cs @@ -20,30 +20,8 @@ protected DeviceRegistryAssetCollection() { } public partial class DeviceRegistryAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public System.Uri AssetEndpointProfileUri { get { throw null; } set { } } - public string AssetType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Attributes { get { throw null; } } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DefaultDataPointsConfiguration { get { throw null; } set { } } - public string DefaultEventsConfiguration { get { throw null; } set { } } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public System.Uri DocumentationUri { get { throw null; } set { } } - public bool? Enabled { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public string ExternalAssetId { get { throw null; } set { } } - public string HardwareRevision { get { throw null; } set { } } - public string Manufacturer { get { throw null; } set { } } - public System.Uri ManufacturerUri { get { throw null; } set { } } - public string Model { get { throw null; } set { } } - public string ProductCode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public string SerialNumber { get { throw null; } set { } } - public string SoftwareRevision { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.AssetStatus Status { get { throw null; } } - public string Uuid { get { throw null; } } - public int? Version { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -71,13 +49,8 @@ protected DeviceRegistryAssetEndpointProfileCollection() { } public partial class DeviceRegistryAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } - public string AdditionalConfiguration { get { throw null; } set { } } public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public System.Collections.Generic.IList TransportAuthenticationOwnCertificates { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication UserAuthentication { get { throw null; } set { } } - public string Uuid { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -135,6 +108,156 @@ protected DeviceRegistryAssetResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class DeviceRegistryBillingContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryBillingContainerCollection() { } + public virtual Azure.Response Exists(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryBillingContainerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryBillingContainerData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? BillingContainerProvisioningState { get { throw null; } } + public Azure.ETag? ETag { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryBillingContainerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryBillingContainerResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string billingContainerName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryDiscoveredAssetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string discoveredAssetEndpointProfileName, Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.AzureLocation location, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation) { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryDiscoveredAssetEndpointProfileResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistryDiscoveredAssetResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class DeviceRegistryExtensions { public static Azure.Response GetDeviceRegistryAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string assetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -149,6 +272,184 @@ public static partial class DeviceRegistryExtensions public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetDeviceRegistryAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDeviceRegistryAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistryBillingContainer(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.Response GetDeviceRegistryDiscoveredAsset(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistryDiscoveredAssets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDeviceRegistrySchemaRegistries(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeviceRegistrySchemaRegistry(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class DeviceRegistrySchemaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaRegistryCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaRegistryName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaRegistryData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaRegistryData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaRegistryResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistrySchema(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaAsync(string schemaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistrySchemaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistrySchemaVersion(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DeviceRegistrySchemaVersionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeviceRegistrySchemaVersionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string schemaVersionName, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string schemaVersionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeviceRegistrySchemaVersionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaVersionData() { } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaVersionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeviceRegistrySchemaVersionResource() { } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Mocking @@ -158,6 +459,12 @@ public partial class MockableDeviceRegistryArmClient : Azure.ResourceManager.Arm protected MockableDeviceRegistryArmClient() { } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetResource GetDeviceRegistryAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDeviceRegistryResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -168,6 +475,15 @@ protected MockableDeviceRegistryResourceGroupResource() { } public virtual System.Threading.Tasks.Task> GetDeviceRegistryAssetEndpointProfileAsync(string assetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles() { throw null; } public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetCollection GetDeviceRegistryAssets() { throw null; } + public virtual Azure.Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() { throw null; } + public virtual Azure.Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableDeviceRegistrySubscriptionResource : Azure.ResourceManager.ArmResource { @@ -176,100 +492,175 @@ protected MockableDeviceRegistrySubscriptionResource() { } public virtual Azure.AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDeviceRegistryAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDeviceRegistryAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeviceRegistryBillingContainer(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeviceRegistryBillingContainerAsync(string billingContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers() { throw null; } + public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeviceRegistryDiscoveredAssets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeviceRegistrySchemaRegistries(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DeviceRegistry.Models { public static partial class ArmDeviceRegistryModelFactory { - public static Azure.ResourceManager.DeviceRegistry.Models.AssetStatus AssetStatus(System.Collections.Generic.IEnumerable errors = null, int? version = default(int?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError AssetStatusError(int? code = default(int?), string message = null) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData DeviceRegistryAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, string assetType = null, bool? enabled = default(bool?), string externalAssetId = null, string displayName = null, string description = null, System.Uri assetEndpointProfileUri = null, int? version = default(int?), string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, System.Collections.Generic.IDictionary attributes = null, string defaultDataPointsConfiguration = null, string defaultEventsConfiguration = null, System.Collections.Generic.IEnumerable dataPoints = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.AssetStatus status = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, System.Uri targetAddress = null, Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication userAuthentication = null, System.Collections.Generic.IEnumerable transportAuthenticationOwnCertificates = null, string additionalConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError AssetEndpointProfileStatusError(int? code = default(int?), string message = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AssetProperties AssetProperties(string uuid = null, bool? isEnabled = default(bool?), string externalAssetId = null, string displayName = null, string description = null, string assetEndpointProfileRef = null, long? version = default(long?), string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, System.Collections.Generic.IDictionary attributes = null, System.Collections.Generic.IEnumerable discoveredAssetRefs = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus status = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetData DeviceRegistryAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.AssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties DeviceRegistryAssetEndpointProfileProperties(string uuid = null, System.Uri targetAddress = null, string endpointProfileType = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication authentication = null, string additionalConfiguration = null, string discoveredAssetEndpointProfileRef = null, System.Collections.Generic.IEnumerable statusErrors = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus DeviceRegistryAssetStatus(System.Collections.Generic.IEnumerable errors = null, long? version = default(long?), System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset DeviceRegistryAssetStatusDataset(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError DeviceRegistryAssetStatusError(int? code = default(int?), string message = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent DeviceRegistryAssetStatusEvent(string name = null, Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference messageSchemaReference = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryBillingContainerData DeviceRegistryBillingContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? billingContainerProvisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties properties = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = (long)0, string manufacturer = null, System.Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, System.Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic defaultTopic = null, System.Collections.Generic.IEnumerable datasets = null, System.Collections.Generic.IEnumerable events = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaData DeviceRegistrySchemaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties properties = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?), System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, System.Uri storageAccountContainerUri = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress = null, string additionalConfiguration = null, System.Collections.Generic.IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = (long)0, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? provisioningState = default(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) { throw null; } } - public partial class AssetEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetEndpointProfileStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AssetEvent(string eventNotifier) { } - public string CapabilityId { get { throw null; } set { } } - public string EventConfiguration { get { throw null; } set { } } - public string EventNotifier { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode? ObservabilityMode { get { throw null; } set { } } + internal AssetEndpointProfileStatusError() { } + public int? Code { get { throw null; } } + public string Message { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AssetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AssetStatus() { } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } - public int? Version { get { throw null; } } + public AssetEndpointProfileUpdateProperties() { } + public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication Authentication { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public System.Uri TargetAddress { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AssetStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AssetStatusError() { } - public int? Code { get { throw null; } } - public string Message { get { throw null; } } + public AssetProperties(string assetEndpointProfileRef) { } + public string AssetEndpointProfileRef { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList DiscoveredAssetRefs { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string ExternalAssetId { get { throw null; } set { } } + public string HardwareRevision { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus Status { get { throw null; } } + public string Uuid { get { throw null; } } + public long? Version { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.AssetStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DataPoint(string dataSource) { } - public string CapabilityId { get { throw null; } set { } } - public string DataPointConfiguration { get { throw null; } set { } } - public string DataSource { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode? ObservabilityMode { get { throw null; } set { } } + public AssetUpdateProperties() { } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string HardwareRevision { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DataPointsObservabilityMode : System.IEquatable + public readonly partial struct AuthenticationMethod : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public DataPointsObservabilityMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Counter { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Gauge { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Histogram { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode Log { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode None { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode other) { throw null; } + public AuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Certificate { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod UsernamePassword { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointsObservabilityMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod left, Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod left, Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataPointObservabilityMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataPointObservabilityMode(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Counter { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Gauge { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Histogram { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode Log { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode right) { throw null; } public override string ToString() { throw null; } } public partial class DeviceRegistryAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetEndpointProfilePatch() { } - public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } - public System.Uri TargetAddress { get { throw null; } set { } } - public System.Collections.Generic.IList TransportAuthenticationOwnCertificates { get { throw null; } } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate UserAuthentication { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -277,33 +668,212 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DeviceRegistryAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType) { } + public string AdditionalConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication Authentication { get { throw null; } set { } } + public string DiscoveredAssetEndpointProfileRef { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StatusErrors { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeviceRegistryAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeviceRegistryAssetPatch() { } - public string AssetType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Attributes { get { throw null; } } - public System.Collections.Generic.IList DataPoints { get { throw null; } } - public string DefaultDataPointsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.AssetUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatus() { } + public System.Collections.Generic.IReadOnlyList Datasets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Events { get { throw null; } } + public long? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusDataset() { } + public Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusError() { } + public int? Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAssetStatusEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceRegistryAssetStatusEvent() { } + public Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference MessageSchemaReference { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetStatusEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryAuthentication(Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod method) { } + public Azure.ResourceManager.DeviceRegistry.Models.AuthenticationMethod Method { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials UsernamePasswordCredentials { get { throw null; } set { } } + public string X509CredentialsCertificateSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataPoint : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataPoint(string name, string dataSource) : base (default(string), default(string)) { } + public Azure.ResourceManager.DeviceRegistry.Models.DataPointObservabilityMode? ObservabilityMode { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataPointBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataPointBase(string name, string dataSource) { } + public string DataPointConfiguration { get { throw null; } set { } } + public string DataSource { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataPointBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDataset(string name) { } + public System.Collections.Generic.IList DataPoints { get { throw null; } } + public string DatasetConfiguration { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetEndpointProfilePatch() { } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetEndpointProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetPatch() { } + public Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryDiscoveredAssetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) { } + public string AssetEndpointProfileRef { get { throw null; } set { } } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } public string DefaultEventsConfiguration { get { throw null; } set { } } - public string Description { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } public System.Uri DocumentationUri { get { throw null; } set { } } - public bool? Enabled { get { throw null; } set { } } - public System.Collections.Generic.IList Events { get { throw null; } } + public System.Collections.Generic.IList Events { get { throw null; } } public string HardwareRevision { get { throw null; } set { } } public string Manufacturer { get { throw null; } set { } } public System.Uri ManufacturerUri { get { throw null; } set { } } public string Model { get { throw null; } set { } } public string ProductCode { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } public string SerialNumber { get { throw null; } set { } } public string SoftwareRevision { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public long Version { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryAssetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryDiscoveredAssetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryEvent : Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryEvent(string name, string eventNotifier) : base (default(string), default(string)) { } + public Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode? ObservabilityMode { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryEventBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryEventBase(string name, string eventNotifier) { } + public string EventConfiguration { get { throw null; } set { } } + public string EventNotifier { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryEventBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DeviceRegistryExtendedLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -325,6 +895,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public DeviceRegistryProvisioningState(string value) { throw null; } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Accepted { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState Succeeded { get { throw null; } } public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState other) { throw null; } @@ -338,103 +909,285 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventsObservabilityMode : System.IEquatable + public readonly partial struct DeviceRegistrySchemaFormat : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventsObservabilityMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode Log { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode None { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode other) { throw null; } + public DeviceRegistrySchemaFormat(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Delta10 { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat JsonSchemaDraft7 { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventsObservabilityMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat right) { throw null; } public override string ToString() { throw null; } } - public partial class OwnCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public OwnCertificate() { } - public string CertPasswordReference { get { throw null; } set { } } - public string CertSecretReference { get { throw null; } set { } } - public string CertThumbprint { get { throw null; } set { } } + public DeviceRegistrySchemaProperties(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat format, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType schemaType) { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaFormat Format { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType SchemaType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public string Uuid { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.OwnCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.OwnCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UserAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaRegistryPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UserAuthentication(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode mode) { } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Mode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials UsernamePasswordCredentials { get { throw null; } set { } } - public string X509CredentialsCertificateReference { get { throw null; } set { } } + public DeviceRegistrySchemaRegistryPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistrySchemaRegistryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaRegistryProperties(string @namespace, System.Uri storageAccountContainerUri) { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public string Namespace { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Uri StorageAccountContainerUri { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaRegistryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct UserAuthenticationMode : System.IEquatable + public readonly partial struct DeviceRegistrySchemaType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public UserAuthenticationMode(string value) { throw null; } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Anonymous { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode Certificate { get { throw null; } } - public static Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode UsernamePassword { get { throw null; } } - public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode other) { throw null; } + public DeviceRegistrySchemaType(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType MessageSchema { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode left, Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode right) { throw null; } - public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode left, Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode right) { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaType right) { throw null; } public override string ToString() { throw null; } } - public partial class UserAuthenticationUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeviceRegistrySchemaVersionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistrySchemaVersionProperties(string schemaContent) { } + public string Description { get { throw null; } set { } } + public string Hash { get { throw null; } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public string SchemaContent { get { throw null; } set { } } + public string Uuid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistrySchemaVersionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceRegistryTopic : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryTopic(string path) { } + public string Path { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType? Retain { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeviceRegistryTopicRetainType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeviceRegistryTopicRetainType(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType Keep { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType left, Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopicRetainType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeviceRegistryUsernamePasswordCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceRegistryUsernamePasswordCredentials(string usernameSecretName, string passwordSecretName) { } + public string PasswordSecretName { get { throw null; } set { } } + public string UsernameSecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryUsernamePasswordCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetEndpointProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredAssetEndpointProfileProperties(System.Uri targetAddress, string endpointProfileType, string discoveryId, long version) { } + public string AdditionalConfiguration { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public long Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetEndpointProfileUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredAssetEndpointProfileUpdateProperties() { } + public string AdditionalConfiguration { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public string EndpointProfileType { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAuthenticationMethods { get { throw null; } } + public System.Uri TargetAddress { get { throw null; } set { } } + public long? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetEndpointProfileUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredAssetUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UserAuthenticationUpdate() { } - public Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationMode? Mode { get { throw null; } set { } } - public Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate UsernamePasswordCredentials { get { throw null; } set { } } - public string X509CredentialsCertificateReference { get { throw null; } set { } } + public DiscoveredAssetUpdateProperties() { } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public string DefaultDatasetsConfiguration { get { throw null; } set { } } + public string DefaultEventsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic DefaultTopic { get { throw null; } set { } } + public string DiscoveryId { get { throw null; } set { } } + public System.Uri DocumentationUri { get { throw null; } set { } } + public System.Collections.Generic.IList Events { get { throw null; } } + public string HardwareRevision { get { throw null; } set { } } + public string Manufacturer { get { throw null; } set { } } + public System.Uri ManufacturerUri { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + public string ProductCode { get { throw null; } set { } } + public string SerialNumber { get { throw null; } set { } } + public string SoftwareRevision { get { throw null; } set { } } + public long? Version { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UserAuthenticationUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredAssetUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UsernamePasswordCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DiscoveredDataPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UsernamePasswordCredentials(string usernameReference, string passwordReference) { } - public string PasswordReference { get { throw null; } set { } } - public string UsernameReference { get { throw null; } set { } } + public DiscoveredDataPoint(string name, string dataSource) { } + public string DataPointConfiguration { get { throw null; } set { } } + public string DataSource { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } + public string Name { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentials System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class UsernamePasswordCredentialsUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DiscoveredDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public UsernamePasswordCredentialsUpdate() { } - public string PasswordReference { get { throw null; } set { } } - public string UsernameReference { get { throw null; } set { } } + public DiscoveredDataset(string name) { } + public System.Collections.Generic.IList DataPoints { get { throw null; } } + public string DatasetConfiguration { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoveredEvent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoveredEvent(string name, string eventNotifier) { } + public string EventConfiguration { get { throw null; } set { } } + public string EventNotifier { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedOn { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.DeviceRegistry.Models.DeviceRegistryTopic Topic { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.DiscoveredEvent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventObservabilityMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EventObservabilityMode(string value) { throw null; } + public static Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode Log { get { throw null; } } + public static Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode left, Azure.ResourceManager.DeviceRegistry.Models.EventObservabilityMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MessageSchemaReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageSchemaReference() { } + public string SchemaName { get { throw null; } } + public string SchemaRegistryNamespace { get { throw null; } } + public string SchemaVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.MessageSchemaReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SchemaRegistryUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SchemaRegistryUpdateProperties() { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.DeviceRegistry.Models.UsernamePasswordCredentialsUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DeviceRegistry.Models.SchemaRegistryUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/assets.json b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/assets.json index cac030c2a454..6e3f657269bf 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/assets.json +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/deviceregistry/Azure.ResourceManager.DeviceRegistry", - "Tag": "net/deviceregistry/Azure.ResourceManager.DeviceRegistry_926412cbdb" + "Tag": "net/deviceregistry/Azure.ResourceManager.DeviceRegistry_56381a6581" } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs index c4fb4d216693..9fca956e22da 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetCollection.cs @@ -19,10 +19,10 @@ public partial class Sample_DeviceRegistryAssetCollection { [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CreateAnAssetWithExternalAssetId() + public async Task CreateOrUpdate_CreateAssetWithDiscoveredAssetRefs() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_With_ExternalAssetId.json - // this example is just showing the usage of "Assets_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -43,44 +43,58 @@ public async Task CreateOrUpdate_CreateAnAssetWithExternalAssetId() string assetName = "my-asset"; DeviceRegistryAssetData data = new DeviceRegistryAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - AssetType = "MyAssetType", - Enabled = true, - ExternalAssetId = "8ZBA6LRHU0A458969", - DisplayName = "AssetDisplayName", - Description = "This is a sample Asset", - AssetEndpointProfileUri = new Uri("https://www.example.com/myAssetEndpointProfile"), - Manufacturer = "Contoso", - ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), - Model = "ContosoModel", - ProductCode = "SA34VDG", - HardwareRevision = "1.0", - SoftwareRevision = "2.0", - DocumentationUri = new Uri("https://www.example.com/manual"), - SerialNumber = "64-103816-519918-8", - DefaultDataPointsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DataPoints = {new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") -{ -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = DataPointsObservabilityMode.Counter, + Properties = new AssetProperties("myAssetEndpointProfile") + { + IsEnabled = true, + ExternalAssetId = "8ZBA6LRHU0A458969", + DisplayName = "AssetDisplayName", + Description = "This is a sample Asset", + Manufacturer = "Contoso", + ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), + Model = "ContosoModel", + ProductCode = "SA34VDG", + HardwareRevision = "1.0", + SoftwareRevision = "2.0", + DocumentationUri = new Uri("https://www.example.com/manual"), + SerialNumber = "64-103816-519918-8", + DiscoveredAssetRefs = { "discoveredAsset1", "discoveredAsset2" }, + DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Keep, + }, + Datasets = {new DeviceRegistryDataset("dataset1") +{ +DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", +Topic = new DeviceRegistryTopic("/path/dataset1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +DataPoints = {new DeviceRegistryDataPoint("dataPoint1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") +{ +ObservabilityMode = DataPointObservabilityMode.Counter, DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}", -}, new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") +}, new DeviceRegistryDataPoint("dataPoint2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = DataPointsObservabilityMode.None, +ObservabilityMode = DataPointObservabilityMode.None, DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}", }}, - Events = {new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") +}}, + Events = {new DeviceRegistryEvent("event1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") { -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = EventsObservabilityMode.None, +ObservabilityMode = EventObservabilityMode.None, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}", -}, new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +Topic = new DeviceRegistryTopic("/path/event1") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = EventsObservabilityMode.Log, +Retain = DeviceRegistryTopicRetainType.Keep, +}, +}, new DeviceRegistryEvent("event2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +{ +ObservabilityMode = EventObservabilityMode.Log, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}", }}, + }, Tags = { ["site"] = "building-1" @@ -98,10 +112,10 @@ public async Task CreateOrUpdate_CreateAnAssetWithExternalAssetId() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CreateAnAssetWithoutDisplayName() + public async Task CreateOrUpdate_CreateAssetWithExternalAssetId() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_Without_DisplayName.json - // this example is just showing the usage of "Assets_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -122,43 +136,57 @@ public async Task CreateOrUpdate_CreateAnAssetWithoutDisplayName() string assetName = "my-asset"; DeviceRegistryAssetData data = new DeviceRegistryAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - AssetType = "MyAssetType", - Enabled = true, - ExternalAssetId = "8ZBA6LRHU0A458969", - Description = "This is a sample Asset", - AssetEndpointProfileUri = new Uri("https://www.example.com/myAssetEndpointProfile"), - Manufacturer = "Contoso", - ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), - Model = "ContosoModel", - ProductCode = "SA34VDG", - HardwareRevision = "1.0", - SoftwareRevision = "2.0", - DocumentationUri = new Uri("https://www.example.com/manual"), - SerialNumber = "64-103816-519918-8", - DefaultDataPointsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DataPoints = {new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") -{ -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = DataPointsObservabilityMode.Counter, + Properties = new AssetProperties("myAssetEndpointProfile") + { + IsEnabled = true, + ExternalAssetId = "8ZBA6LRHU0A458969", + DisplayName = "AssetDisplayName", + Description = "This is a sample Asset", + Manufacturer = "Contoso", + ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), + Model = "ContosoModel", + ProductCode = "SA34VDG", + HardwareRevision = "1.0", + SoftwareRevision = "2.0", + DocumentationUri = new Uri("https://www.example.com/manual"), + SerialNumber = "64-103816-519918-8", + DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Keep, + }, + Datasets = {new DeviceRegistryDataset("dataset1") +{ +DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", +Topic = new DeviceRegistryTopic("/path/dataset1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +DataPoints = {new DeviceRegistryDataPoint("dataPoint1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") +{ +ObservabilityMode = DataPointObservabilityMode.Counter, DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}", -}, new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") +}, new DeviceRegistryDataPoint("dataPoint2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = DataPointsObservabilityMode.None, +ObservabilityMode = DataPointObservabilityMode.None, DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}", }}, - Events = {new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") +}}, + Events = {new DeviceRegistryEvent("event1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") { -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = EventsObservabilityMode.None, +ObservabilityMode = EventObservabilityMode.None, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}", -}, new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +Topic = new DeviceRegistryTopic("/path/event1") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = EventsObservabilityMode.Log, +Retain = DeviceRegistryTopicRetainType.Keep, +}, +}, new DeviceRegistryEvent("event2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +{ +ObservabilityMode = EventObservabilityMode.Log, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}", }}, + }, Tags = { ["site"] = "building-1" @@ -176,10 +204,10 @@ public async Task CreateOrUpdate_CreateAnAssetWithoutDisplayName() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CreateAnAssetWithoutExternalAssetId() + public async Task CreateOrUpdate_CreateAssetWithoutDisplayName() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_Without_ExternalAssetId.json - // this example is just showing the usage of "Assets_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -200,43 +228,147 @@ public async Task CreateOrUpdate_CreateAnAssetWithoutExternalAssetId() string assetName = "my-asset"; DeviceRegistryAssetData data = new DeviceRegistryAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - AssetType = "MyAssetType", - Enabled = true, - DisplayName = "AssetDisplayName", - Description = "This is a sample Asset", - AssetEndpointProfileUri = new Uri("https://www.example.com/myAssetEndpointProfile"), - Manufacturer = "Contoso", - ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), - Model = "ContosoModel", - ProductCode = "SA34VDG", - HardwareRevision = "1.0", - SoftwareRevision = "2.0", - DocumentationUri = new Uri("https://www.example.com/manual"), - SerialNumber = "64-103816-519918-8", - DefaultDataPointsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", - DataPoints = {new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") -{ -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = DataPointsObservabilityMode.Counter, + Properties = new AssetProperties("myAssetEndpointProfile") + { + IsEnabled = true, + ExternalAssetId = "8ZBA6LRHU0A458969", + Description = "This is a sample Asset", + Manufacturer = "Contoso", + ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), + Model = "ContosoModel", + ProductCode = "SA34VDG", + HardwareRevision = "1.0", + SoftwareRevision = "2.0", + DocumentationUri = new Uri("https://www.example.com/manual"), + SerialNumber = "64-103816-519918-8", + DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Keep, + }, + Datasets = {new DeviceRegistryDataset("dataset1") +{ +DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", +Topic = new DeviceRegistryTopic("/path/dataset1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +DataPoints = {new DeviceRegistryDataPoint("dataPoint1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") +{ +ObservabilityMode = DataPointObservabilityMode.Counter, DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}", -}, new DataPoint("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") +}, new DeviceRegistryDataPoint("dataPoint2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = DataPointsObservabilityMode.None, +ObservabilityMode = DataPointObservabilityMode.None, DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}", }}, - Events = {new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") +}}, + Events = {new DeviceRegistryEvent("event1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") { -CapabilityId = "dtmi:com:example:Thermostat:__temperature;1", -ObservabilityMode = EventsObservabilityMode.None, +ObservabilityMode = EventObservabilityMode.None, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}", -}, new AssetEvent("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +Topic = new DeviceRegistryTopic("/path/event1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +}, new DeviceRegistryEvent("event2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +{ +ObservabilityMode = EventObservabilityMode.Log, +EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}", +}}, + }, + Tags = +{ +["site"] = "building-1" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assetName, data); + DeviceRegistryAssetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAssetWithoutExternalAssetId() + { + // Generated from example definition: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + // this example is just showing the usage of "Asset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryAssetResource + DeviceRegistryAssetCollection collection = resourceGroupResource.GetDeviceRegistryAssets(); + + // invoke the operation + string assetName = "my-asset"; + DeviceRegistryAssetData data = new DeviceRegistryAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + { + Properties = new AssetProperties("myAssetEndpointProfile") + { + IsEnabled = true, + DisplayName = "AssetDisplayName", + Description = "This is a sample Asset", + Manufacturer = "Contoso", + ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), + Model = "ContosoModel", + ProductCode = "SA34VDG", + HardwareRevision = "1.0", + SoftwareRevision = "2.0", + DocumentationUri = new Uri("https://www.example.com/manual"), + SerialNumber = "64-103816-519918-8", + DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Keep, + }, + Datasets = {new DeviceRegistryDataset("dataset1") +{ +DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", +Topic = new DeviceRegistryTopic("/path/dataset1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +DataPoints = {new DeviceRegistryDataPoint("dataPoint1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") +{ +ObservabilityMode = DataPointObservabilityMode.Counter, +DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}", +}, new DeviceRegistryDataPoint("dataPoint2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") +{ +ObservabilityMode = DataPointObservabilityMode.None, +DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}", +}}, +}}, + Events = {new DeviceRegistryEvent("event1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") +{ +ObservabilityMode = EventObservabilityMode.None, +EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}", +Topic = new DeviceRegistryTopic("/path/event1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +}, new DeviceRegistryEvent("event2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") { -CapabilityId = "dtmi:com:example:Thermostat:__pressure;1", -ObservabilityMode = EventsObservabilityMode.Log, +ObservabilityMode = EventObservabilityMode.Log, EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}", }}, + }, Tags = { ["site"] = "building-1" @@ -254,10 +386,10 @@ public async Task CreateOrUpdate_CreateAnAssetWithoutExternalAssetId() [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAsset() + public async Task Get_GetAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -287,10 +419,10 @@ public async Task Get_GetAnAsset() [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAssetWithSyncStatus() + public async Task Get_GetAssetWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset_With_SyncStatus.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -320,10 +452,10 @@ public async Task Get_GetAnAssetWithSyncStatus() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetAll_ListAssetsInAResourceGroup() + public async Task GetAll_ListAssetsResourceGroup() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_Assets_ResourceGroup.json - // this example is just showing the usage of "Assets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/List_Assets_ResourceGroup.json + // this example is just showing the usage of "Asset_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -355,10 +487,10 @@ public async Task GetAll_ListAssetsInAResourceGroup() [Test] [Ignore("Only validating compilation of examples")] - public async Task Exists_GetAnAsset() + public async Task Exists_GetAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -384,10 +516,10 @@ public async Task Exists_GetAnAsset() [Test] [Ignore("Only validating compilation of examples")] - public async Task Exists_GetAnAssetWithSyncStatus() + public async Task Exists_GetAssetWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset_With_SyncStatus.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -413,10 +545,10 @@ public async Task Exists_GetAnAssetWithSyncStatus() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_GetAnAsset() + public async Task GetIfExists_GetAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -454,10 +586,10 @@ public async Task GetIfExists_GetAnAsset() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_GetAnAssetWithSyncStatus() + public async Task GetIfExists_GetAssetWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset_With_SyncStatus.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs index ff327927f96e..305a6d8dbc7c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileCollection.cs @@ -19,10 +19,10 @@ public partial class Sample_DeviceRegistryAssetEndpointProfileCollection { [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CreateAnAssetEndpointProfile() + public async Task CreateOrUpdate_CreateAssetEndpointProfile() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Create_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -43,8 +43,10 @@ public async Task CreateOrUpdate_CreateAnAssetEndpointProfile() string assetEndpointProfileName = "my-assetendpointprofile"; DeviceRegistryAssetEndpointProfileData data = new DeviceRegistryAssetEndpointProfileData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) { - TargetAddress = new Uri("https://www.example.com/myTargetAddress"), - UserAuthentication = new UserAuthentication(UserAuthenticationMode.Anonymous), + Properties = new DeviceRegistryAssetEndpointProfileProperties(new Uri("https://www.example.com/myTargetAddress"), "myEndpointProfileType") + { + Authentication = new DeviceRegistryAuthentication(AuthenticationMethod.Anonymous), + }, Tags = { ["site"] = "building-1" @@ -62,10 +64,89 @@ public async Task CreateOrUpdate_CreateAnAssetEndpointProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAssetEndpointProfile() + public async Task CreateOrUpdate_CreateAssetEndpointProfileWithDiscoveredAepRef() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + // this example is just showing the usage of "AssetEndpointProfile_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryAssetEndpointProfileResource + DeviceRegistryAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryAssetEndpointProfiles(); + + // invoke the operation + string assetEndpointProfileName = "my-assetendpointprofile"; + DeviceRegistryAssetEndpointProfileData data = new DeviceRegistryAssetEndpointProfileData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + { + Properties = new DeviceRegistryAssetEndpointProfileProperties(new Uri("https://www.example.com/myTargetAddress"), "myEndpointProfileType") + { + Authentication = new DeviceRegistryAuthentication(AuthenticationMethod.Anonymous), + DiscoveredAssetEndpointProfileRef = "discoveredAssetEndpointProfile1", + }, + Tags = +{ +["site"] = "building-1" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assetEndpointProfileName, data); + DeviceRegistryAssetEndpointProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryAssetEndpointProfileResource + DeviceRegistryAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryAssetEndpointProfiles(); + + // invoke the operation + string assetEndpointProfileName = "my-assetendpointprofile"; + DeviceRegistryAssetEndpointProfileResource result = await collection.GetAsync(assetEndpointProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAssetEndpointProfileWithSyncStatus() + { + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -95,10 +176,10 @@ public async Task Get_GetAnAssetEndpointProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetAll_ListAssetEndpointProfilesInAResourceGroup() + public async Task GetAll_ListAssetEndpointProfilesResourceGroup() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_AssetEndpointProfiles_ResourceGroup.json - // this example is just showing the usage of "AssetEndpointProfiles_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + // this example is just showing the usage of "AssetEndpointProfile_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -130,10 +211,10 @@ public async Task GetAll_ListAssetEndpointProfilesInAResourceGroup() [Test] [Ignore("Only validating compilation of examples")] - public async Task Exists_GetAnAssetEndpointProfile() + public async Task Exists_GetAssetEndpointProfile() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -159,10 +240,80 @@ public async Task Exists_GetAnAssetEndpointProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_GetAnAssetEndpointProfile() + public async Task Exists_GetAssetEndpointProfileWithSyncStatus() + { + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryAssetEndpointProfileResource + DeviceRegistryAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryAssetEndpointProfiles(); + + // invoke the operation + string assetEndpointProfileName = "my-assetendpointprofile"; + bool result = await collection.ExistsAsync(assetEndpointProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryAssetEndpointProfileResource + DeviceRegistryAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryAssetEndpointProfiles(); + + // invoke the operation + string assetEndpointProfileName = "my-assetendpointprofile"; + NullableResponse response = await collection.GetIfExistsAsync(assetEndpointProfileName); + DeviceRegistryAssetEndpointProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs index b5b6afe3628a..b05163bf29cd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetEndpointProfileResource.cs @@ -18,10 +18,10 @@ public partial class Sample_DeviceRegistryAssetEndpointProfileResource { [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAssetEndpointProfile() + public async Task Get_GetAssetEndpointProfile() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -48,10 +48,40 @@ public async Task Get_GetAnAssetEndpointProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task Delete_DeleteAnAssetEndpointProfile() + public async Task Get_GetAssetEndpointProfileWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Delete_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + // this example is just showing the usage of "AssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryAssetEndpointProfileResource created on azure + // for more information of creating DeviceRegistryAssetEndpointProfileResource, please refer to the document of DeviceRegistryAssetEndpointProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string assetEndpointProfileName = "my-assetendpointprofile"; + ResourceIdentifier deviceRegistryAssetEndpointProfileResourceId = DeviceRegistryAssetEndpointProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, assetEndpointProfileName); + DeviceRegistryAssetEndpointProfileResource deviceRegistryAssetEndpointProfile = client.GetDeviceRegistryAssetEndpointProfileResource(deviceRegistryAssetEndpointProfileResourceId); + + // invoke the operation + DeviceRegistryAssetEndpointProfileResource result = await deviceRegistryAssetEndpointProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Delete_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -74,10 +104,10 @@ public async Task Delete_DeleteAnAssetEndpointProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task Update_PatchAnAssetEndpointProfile() + public async Task Update_UpdateAssetEndpointProfile() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Update_AssetEndpointProfile.json - // this example is just showing the usage of "AssetEndpointProfiles_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Update_AssetEndpointProfile.json + // this example is just showing the usage of "AssetEndpointProfile_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -95,7 +125,10 @@ public async Task Update_PatchAnAssetEndpointProfile() // invoke the operation DeviceRegistryAssetEndpointProfilePatch patch = new DeviceRegistryAssetEndpointProfilePatch { - TargetAddress = new Uri("https://www.example.com/myTargetAddress"), + Properties = new AssetEndpointProfileUpdateProperties + { + TargetAddress = new Uri("https://www.example.com/myTargetAddress"), + }, }; ArmOperation lro = await deviceRegistryAssetEndpointProfile.UpdateAsync(WaitUntil.Completed, patch); DeviceRegistryAssetEndpointProfileResource result = lro.Value; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs index d876ee4ffa39..0cc013e53b30 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryAssetResource.cs @@ -18,10 +18,10 @@ public partial class Sample_DeviceRegistryAssetResource { [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAsset() + public async Task Get_GetAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -48,10 +48,10 @@ public async Task Get_GetAnAsset() [Test] [Ignore("Only validating compilation of examples")] - public async Task Get_GetAnAssetWithSyncStatus() + public async Task Get_GetAssetWithSyncStatus() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset_With_SyncStatus.json - // this example is just showing the usage of "Assets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + // this example is just showing the usage of "Asset_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -78,10 +78,10 @@ public async Task Get_GetAnAssetWithSyncStatus() [Test] [Ignore("Only validating compilation of examples")] - public async Task Delete_DeleteAnAsset() + public async Task Delete_DeleteAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Delete_Asset.json - // this example is just showing the usage of "Assets_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Delete_Asset.json + // this example is just showing the usage of "Asset_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -104,10 +104,10 @@ public async Task Delete_DeleteAnAsset() [Test] [Ignore("Only validating compilation of examples")] - public async Task Update_PatchAnAsset() + public async Task Update_UpdateAsset() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Update_Asset.json - // this example is just showing the usage of "Assets_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/Update_Asset.json + // this example is just showing the usage of "Asset_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -125,8 +125,11 @@ public async Task Update_PatchAnAsset() // invoke the operation DeviceRegistryAssetPatch patch = new DeviceRegistryAssetPatch { - Enabled = false, - DisplayName = "NewAssetDisplayName", + Properties = new AssetUpdateProperties + { + IsEnabled = false, + DisplayName = "NewAssetDisplayName", + }, }; ArmOperation lro = await deviceRegistryAsset.UpdateAsync(WaitUntil.Completed, patch); DeviceRegistryAssetResource result = lro.Value; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs new file mode 100644 index 000000000000..4f7ecc39d9db --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerCollection.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryBillingContainerCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetBillingContainer() + { + // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this DeviceRegistryBillingContainerResource + DeviceRegistryBillingContainerCollection collection = subscriptionResource.GetDeviceRegistryBillingContainers(); + + // invoke the operation + string billingContainerName = "my-billingContainer"; + DeviceRegistryBillingContainerResource result = await collection.GetAsync(billingContainerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryBillingContainerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListBillingContainersSubscription() + { + // Generated from example definition: 2024-09-01-preview/List_BillingContainers_Subscription.json + // this example is just showing the usage of "BillingContainer_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this DeviceRegistryBillingContainerResource + DeviceRegistryBillingContainerCollection collection = subscriptionResource.GetDeviceRegistryBillingContainers(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistryBillingContainerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryBillingContainerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetBillingContainer() + { + // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this DeviceRegistryBillingContainerResource + DeviceRegistryBillingContainerCollection collection = subscriptionResource.GetDeviceRegistryBillingContainers(); + + // invoke the operation + string billingContainerName = "my-billingContainer"; + bool result = await collection.ExistsAsync(billingContainerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetBillingContainer() + { + // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this DeviceRegistryBillingContainerResource + DeviceRegistryBillingContainerCollection collection = subscriptionResource.GetDeviceRegistryBillingContainers(); + + // invoke the operation + string billingContainerName = "my-billingContainer"; + NullableResponse response = await collection.GetIfExistsAsync(billingContainerName); + DeviceRegistryBillingContainerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryBillingContainerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs new file mode 100644 index 000000000000..1b6a22f1cd99 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryBillingContainerResource.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryBillingContainerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetBillingContainer() + { + // Generated from example definition: 2024-09-01-preview/Get_BillingContainer.json + // this example is just showing the usage of "BillingContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryBillingContainerResource created on azure + // for more information of creating DeviceRegistryBillingContainerResource, please refer to the document of DeviceRegistryBillingContainerResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string billingContainerName = "my-billingContainer"; + ResourceIdentifier deviceRegistryBillingContainerResourceId = DeviceRegistryBillingContainerResource.CreateResourceIdentifier(subscriptionId, billingContainerName); + DeviceRegistryBillingContainerResource deviceRegistryBillingContainer = client.GetDeviceRegistryBillingContainerResource(deviceRegistryBillingContainerResourceId); + + // invoke the operation + DeviceRegistryBillingContainerResource result = await deviceRegistryBillingContainer.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryBillingContainerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetCollection.cs new file mode 100644 index 000000000000..ceec191f5387 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetCollection.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryDiscoveredAssetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Create_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetResource + DeviceRegistryDiscoveredAssetCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssets(); + + // invoke the operation + string discoveredAssetName = "my-discoveredasset"; + DeviceRegistryDiscoveredAssetData data = new DeviceRegistryDiscoveredAssetData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + { + Properties = new DeviceRegistryDiscoveredAssetProperties("myAssetEndpointProfile", "11111111-1111-1111-1111-111111111111", 73766L) + { + Manufacturer = "Contoso", + ManufacturerUri = new Uri("https://www.contoso.com/manufacturerUri"), + Model = "ContosoModel", + ProductCode = "SA34VDG", + HardwareRevision = "1.0", + SoftwareRevision = "2.0", + DocumentationUri = new Uri("https://www.example.com/manual"), + SerialNumber = "64-103816-519918-8", + DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Keep, + }, + Datasets = {new DiscoveredDataset("dataset1") +{ +DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}", +Topic = new DeviceRegistryTopic("/path/dataset1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +DataPoints = {new DiscoveredDataPoint("dataPoint1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") +{ +DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}", +}, new DiscoveredDataPoint("dataPoint2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") +{ +DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}", +}}, +}}, + Events = {new DiscoveredEvent("event1", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") +{ +EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}", +Topic = new DeviceRegistryTopic("/path/event1") +{ +Retain = DeviceRegistryTopicRetainType.Keep, +}, +}, new DiscoveredEvent("event2", "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") +{ +EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}", +}}, + }, + Tags = +{ +["site"] = "building-1" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetName, data); + DeviceRegistryDiscoveredAssetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetResource + DeviceRegistryDiscoveredAssetCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssets(); + + // invoke the operation + string discoveredAssetName = "my-discoveredasset"; + DeviceRegistryDiscoveredAssetResource result = await collection.GetAsync(discoveredAssetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDiscoveredAssetsResourceGroup() + { + // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json + // this example is just showing the usage of "DiscoveredAsset_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetResource + DeviceRegistryDiscoveredAssetCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssets(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistryDiscoveredAssetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetResource + DeviceRegistryDiscoveredAssetCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssets(); + + // invoke the operation + string discoveredAssetName = "my-discoveredasset"; + bool result = await collection.ExistsAsync(discoveredAssetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetResource + DeviceRegistryDiscoveredAssetCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssets(); + + // invoke the operation + string discoveredAssetName = "my-discoveredasset"; + NullableResponse response = await collection.GetIfExistsAsync(discoveredAssetName); + DeviceRegistryDiscoveredAssetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs new file mode 100644 index 000000000000..3051a7a17adc --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryDiscoveredAssetEndpointProfileCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetEndpointProfileResource + DeviceRegistryDiscoveredAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // invoke the operation + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + DeviceRegistryDiscoveredAssetEndpointProfileData data = new DeviceRegistryDiscoveredAssetEndpointProfileData(new AzureLocation("West Europe"), new DeviceRegistryExtendedLocation("CustomLocation", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) + { + Properties = new DiscoveredAssetEndpointProfileProperties(new Uri("https://www.example.com/myTargetAddress"), "myEndpointProfileType", "11111111-1111-1111-1111-111111111111", 73766L) + { + AdditionalConfiguration = "{\"foo\": \"bar\"}", + SupportedAuthenticationMethods = { AuthenticationMethod.Anonymous, AuthenticationMethod.Certificate, AuthenticationMethod.UsernamePassword }, + }, + Tags = +{ +["site"] = "building-1" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetEndpointProfileName, data); + DeviceRegistryDiscoveredAssetEndpointProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetEndpointProfileResource + DeviceRegistryDiscoveredAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // invoke the operation + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + DeviceRegistryDiscoveredAssetEndpointProfileResource result = await collection.GetAsync(discoveredAssetEndpointProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDiscoveredAssetEndpointProfilesResourceGroup() + { + // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetEndpointProfileResource + DeviceRegistryDiscoveredAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistryDiscoveredAssetEndpointProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetEndpointProfileResource + DeviceRegistryDiscoveredAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // invoke the operation + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + bool result = await collection.ExistsAsync(discoveredAssetEndpointProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistryDiscoveredAssetEndpointProfileResource + DeviceRegistryDiscoveredAssetEndpointProfileCollection collection = resourceGroupResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // invoke the operation + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + NullableResponse response = await collection.GetIfExistsAsync(discoveredAssetEndpointProfileName); + DeviceRegistryDiscoveredAssetEndpointProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileResource.cs new file mode 100644 index 000000000000..33f8986e433a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetEndpointProfileResource.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryDiscoveredAssetEndpointProfileResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetEndpointProfileResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetEndpointProfileResource, please refer to the document of DeviceRegistryDiscoveredAssetEndpointProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + ResourceIdentifier deviceRegistryDiscoveredAssetEndpointProfileResourceId = DeviceRegistryDiscoveredAssetEndpointProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + DeviceRegistryDiscoveredAssetEndpointProfileResource deviceRegistryDiscoveredAssetEndpointProfile = client.GetDeviceRegistryDiscoveredAssetEndpointProfileResource(deviceRegistryDiscoveredAssetEndpointProfileResourceId); + + // invoke the operation + DeviceRegistryDiscoveredAssetEndpointProfileResource result = await deviceRegistryDiscoveredAssetEndpointProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetEndpointProfileResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetEndpointProfileResource, please refer to the document of DeviceRegistryDiscoveredAssetEndpointProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + ResourceIdentifier deviceRegistryDiscoveredAssetEndpointProfileResourceId = DeviceRegistryDiscoveredAssetEndpointProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + DeviceRegistryDiscoveredAssetEndpointProfileResource deviceRegistryDiscoveredAssetEndpointProfile = client.GetDeviceRegistryDiscoveredAssetEndpointProfileResource(deviceRegistryDiscoveredAssetEndpointProfileResourceId); + + // invoke the operation + await deviceRegistryDiscoveredAssetEndpointProfile.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateDiscoveredAssetEndpointProfile() + { + // Generated from example definition: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetEndpointProfileResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetEndpointProfileResource, please refer to the document of DeviceRegistryDiscoveredAssetEndpointProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetEndpointProfileName = "my-discoveredassetendpointprofile"; + ResourceIdentifier deviceRegistryDiscoveredAssetEndpointProfileResourceId = DeviceRegistryDiscoveredAssetEndpointProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + DeviceRegistryDiscoveredAssetEndpointProfileResource deviceRegistryDiscoveredAssetEndpointProfile = client.GetDeviceRegistryDiscoveredAssetEndpointProfileResource(deviceRegistryDiscoveredAssetEndpointProfileResourceId); + + // invoke the operation + DeviceRegistryDiscoveredAssetEndpointProfilePatch patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch + { + Properties = new DiscoveredAssetEndpointProfileUpdateProperties + { + TargetAddress = new Uri("https://www.example.com/myTargetAddress"), + AdditionalConfiguration = "{\"foo\": \"bar\"}", + SupportedAuthenticationMethods = { AuthenticationMethod.Anonymous, AuthenticationMethod.Certificate }, + EndpointProfileType = "myEndpointProfileType", + DiscoveryId = "11111111-1111-1111-1111-111111111111", + Version = 73766L, + }, + }; + ArmOperation lro = await deviceRegistryDiscoveredAssetEndpointProfile.UpdateAsync(WaitUntil.Completed, patch); + DeviceRegistryDiscoveredAssetEndpointProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetResource.cs new file mode 100644 index 000000000000..23532c57d936 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistryDiscoveredAssetResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistryDiscoveredAssetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Get_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetResource, please refer to the document of DeviceRegistryDiscoveredAssetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetName = "my-discoveredasset"; + ResourceIdentifier deviceRegistryDiscoveredAssetResourceId = DeviceRegistryDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetName); + DeviceRegistryDiscoveredAssetResource deviceRegistryDiscoveredAsset = client.GetDeviceRegistryDiscoveredAssetResource(deviceRegistryDiscoveredAssetResourceId); + + // invoke the operation + DeviceRegistryDiscoveredAssetResource result = await deviceRegistryDiscoveredAsset.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Delete_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetResource, please refer to the document of DeviceRegistryDiscoveredAssetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetName = "my-discoveredasset"; + ResourceIdentifier deviceRegistryDiscoveredAssetResourceId = DeviceRegistryDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetName); + DeviceRegistryDiscoveredAssetResource deviceRegistryDiscoveredAsset = client.GetDeviceRegistryDiscoveredAssetResource(deviceRegistryDiscoveredAssetResourceId); + + // invoke the operation + await deviceRegistryDiscoveredAsset.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateDiscoveredAsset() + { + // Generated from example definition: 2024-09-01-preview/Update_DiscoveredAsset.json + // this example is just showing the usage of "DiscoveredAsset_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistryDiscoveredAssetResource created on azure + // for more information of creating DeviceRegistryDiscoveredAssetResource, please refer to the document of DeviceRegistryDiscoveredAssetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string discoveredAssetName = "my-discoveredasset"; + ResourceIdentifier deviceRegistryDiscoveredAssetResourceId = DeviceRegistryDiscoveredAssetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, discoveredAssetName); + DeviceRegistryDiscoveredAssetResource deviceRegistryDiscoveredAsset = client.GetDeviceRegistryDiscoveredAssetResource(deviceRegistryDiscoveredAssetResourceId); + + // invoke the operation + DeviceRegistryDiscoveredAssetPatch patch = new DeviceRegistryDiscoveredAssetPatch + { + Properties = new DiscoveredAssetUpdateProperties + { + DocumentationUri = new Uri("https://www.example.com/manual-2"), + DefaultTopic = new DeviceRegistryTopic("/path/defaultTopic") + { + Retain = DeviceRegistryTopicRetainType.Never, + }, + }, + }; + ArmOperation lro = await deviceRegistryDiscoveredAsset.UpdateAsync(WaitUntil.Completed, patch); + DeviceRegistryDiscoveredAssetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaCollection.cs new file mode 100644 index 000000000000..ee1299ef824d --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaCollection.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSchema() + { + // Generated from example definition: 2024-09-01-preview/Create_Schema.json + // this example is just showing the usage of "Schema_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // get the collection of this DeviceRegistrySchemaResource + DeviceRegistrySchemaCollection collection = deviceRegistrySchemaRegistry.GetDeviceRegistrySchemas(); + + // invoke the operation + string schemaName = "my-schema"; + DeviceRegistrySchemaData data = new DeviceRegistrySchemaData + { + Properties = new DeviceRegistrySchemaProperties(DeviceRegistrySchemaFormat.JsonSchemaDraft7, DeviceRegistrySchemaType.MessageSchema) + { + DisplayName = "My Schema", + Description = "This is a sample Schema", + Tags = +{ +["sampleKey"] = "sampleValue" +}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, schemaName, data); + DeviceRegistrySchemaResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SchemasGet() + { + // Generated from example definition: 2024-09-01-preview/Get_Schema.json + // this example is just showing the usage of "Schema_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // get the collection of this DeviceRegistrySchemaResource + DeviceRegistrySchemaCollection collection = deviceRegistrySchemaRegistry.GetDeviceRegistrySchemas(); + + // invoke the operation + string schemaName = "my-schema"; + DeviceRegistrySchemaResource result = await collection.GetAsync(schemaName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListSchemasSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/List_Schemas_SchemaRegistry.json + // this example is just showing the usage of "Schema_ListBySchemaRegistry" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // get the collection of this DeviceRegistrySchemaResource + DeviceRegistrySchemaCollection collection = deviceRegistrySchemaRegistry.GetDeviceRegistrySchemas(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistrySchemaResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SchemasGet() + { + // Generated from example definition: 2024-09-01-preview/Get_Schema.json + // this example is just showing the usage of "Schema_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // get the collection of this DeviceRegistrySchemaResource + DeviceRegistrySchemaCollection collection = deviceRegistrySchemaRegistry.GetDeviceRegistrySchemas(); + + // invoke the operation + string schemaName = "my-schema"; + bool result = await collection.ExistsAsync(schemaName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SchemasGet() + { + // Generated from example definition: 2024-09-01-preview/Get_Schema.json + // this example is just showing the usage of "Schema_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // get the collection of this DeviceRegistrySchemaResource + DeviceRegistrySchemaCollection collection = deviceRegistrySchemaRegistry.GetDeviceRegistrySchemas(); + + // invoke the operation + string schemaName = "my-schema"; + NullableResponse response = await collection.GetIfExistsAsync(schemaName); + DeviceRegistrySchemaResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryCollection.cs new file mode 100644 index 000000000000..da5744529c2b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryCollection.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaRegistryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Create_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistrySchemaRegistryResource + DeviceRegistrySchemaRegistryCollection collection = resourceGroupResource.GetDeviceRegistrySchemaRegistries(); + + // invoke the operation + string schemaRegistryName = "my-schema-registry"; + DeviceRegistrySchemaRegistryData data = new DeviceRegistrySchemaRegistryData(new AzureLocation("West Europe")) + { + Properties = new DeviceRegistrySchemaRegistryProperties("sr-namespace-001", new Uri("my-blob-storage.blob.core.windows.net/my-container")) + { + DisplayName = "Schema Registry namespace 001", + Description = "This is a sample Schema Registry", + }, + Identity = new ManagedServiceIdentity("None"), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, schemaRegistryName, data); + DeviceRegistrySchemaRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistrySchemaRegistryResource + DeviceRegistrySchemaRegistryCollection collection = resourceGroupResource.GetDeviceRegistrySchemaRegistries(); + + // invoke the operation + string schemaRegistryName = "my-schema-registry"; + DeviceRegistrySchemaRegistryResource result = await collection.GetAsync(schemaRegistryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListSchemaRegistriesResourceGroup() + { + // Generated from example definition: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json + // this example is just showing the usage of "SchemaRegistry_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistrySchemaRegistryResource + DeviceRegistrySchemaRegistryCollection collection = resourceGroupResource.GetDeviceRegistrySchemaRegistries(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistrySchemaRegistryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistrySchemaRegistryResource + DeviceRegistrySchemaRegistryCollection collection = resourceGroupResource.GetDeviceRegistrySchemaRegistries(); + + // invoke the operation + string schemaRegistryName = "my-schema-registry"; + bool result = await collection.ExistsAsync(schemaRegistryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DeviceRegistrySchemaRegistryResource + DeviceRegistrySchemaRegistryCollection collection = resourceGroupResource.GetDeviceRegistrySchemaRegistries(); + + // invoke the operation + string schemaRegistryName = "my-schema-registry"; + NullableResponse response = await collection.GetIfExistsAsync(schemaRegistryName); + DeviceRegistrySchemaRegistryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryResource.cs new file mode 100644 index 000000000000..b371a949a256 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaRegistryResource.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaRegistryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // invoke the operation + DeviceRegistrySchemaRegistryResource result = await deviceRegistrySchemaRegistry.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Delete_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // invoke the operation + await deviceRegistrySchemaRegistry.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateSchemaRegistry() + { + // Generated from example definition: 2024-09-01-preview/Update_SchemaRegistry.json + // this example is just showing the usage of "SchemaRegistry_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaRegistryResource created on azure + // for more information of creating DeviceRegistrySchemaRegistryResource, please refer to the document of DeviceRegistrySchemaRegistryResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + ResourceIdentifier deviceRegistrySchemaRegistryResourceId = DeviceRegistrySchemaRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName); + DeviceRegistrySchemaRegistryResource deviceRegistrySchemaRegistry = client.GetDeviceRegistrySchemaRegistryResource(deviceRegistrySchemaRegistryResourceId); + + // invoke the operation + DeviceRegistrySchemaRegistryPatch patch = new DeviceRegistrySchemaRegistryPatch + { + Tags = { }, + Properties = new SchemaRegistryUpdateProperties + { + DisplayName = "Schema Registry namespace 001", + Description = "This is a sample Schema Registry", + }, + }; + ArmOperation lro = await deviceRegistrySchemaRegistry.UpdateAsync(WaitUntil.Completed, patch); + DeviceRegistrySchemaRegistryResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaResource.cs new file mode 100644 index 000000000000..fd03c28f4f12 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaResource.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SchemasGet() + { + // Generated from example definition: 2024-09-01-preview/Get_Schema.json + // this example is just showing the usage of "Schema_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // invoke the operation + DeviceRegistrySchemaResource result = await deviceRegistrySchema.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteSchema() + { + // Generated from example definition: 2024-09-01-preview/Delete_Schema.json + // this example is just showing the usage of "Schema_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // invoke the operation + await deviceRegistrySchema.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateSchema() + { + // Generated from example definition: 2024-09-01-preview/Create_Schema.json + // this example is just showing the usage of "Schema_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // invoke the operation + DeviceRegistrySchemaData data = new DeviceRegistrySchemaData + { + Properties = new DeviceRegistrySchemaProperties(DeviceRegistrySchemaFormat.JsonSchemaDraft7, DeviceRegistrySchemaType.MessageSchema) + { + DisplayName = "My Schema", + Description = "This is a sample Schema", + Tags = +{ +["sampleKey"] = "sampleValue" +}, + }, + }; + ArmOperation lro = await deviceRegistrySchema.UpdateAsync(WaitUntil.Completed, data); + DeviceRegistrySchemaResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionCollection.cs new file mode 100644 index 000000000000..ea11239dc0a7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionCollection.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Create_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // get the collection of this DeviceRegistrySchemaVersionResource + DeviceRegistrySchemaVersionCollection collection = deviceRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // invoke the operation + string schemaVersionName = "1"; + DeviceRegistrySchemaVersionData data = new DeviceRegistrySchemaVersionData + { + Properties = new DeviceRegistrySchemaVersionProperties("{\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"type\": \"object\",\"properties\": {\"humidity\": {\"type\": \"string\"},\"temperature\": {\"type\":\"number\"}}}") + { + Description = "Schema version 1", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, schemaVersionName, data); + DeviceRegistrySchemaVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // get the collection of this DeviceRegistrySchemaVersionResource + DeviceRegistrySchemaVersionCollection collection = deviceRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // invoke the operation + string schemaVersionName = "1"; + DeviceRegistrySchemaVersionResource result = await collection.GetAsync(schemaVersionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListSchemaVersionsSchema() + { + // Generated from example definition: 2024-09-01-preview/List_SchemaVersions_Schema.json + // this example is just showing the usage of "SchemaVersion_ListBySchema" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // get the collection of this DeviceRegistrySchemaVersionResource + DeviceRegistrySchemaVersionCollection collection = deviceRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistrySchemaVersionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // get the collection of this DeviceRegistrySchemaVersionResource + DeviceRegistrySchemaVersionCollection collection = deviceRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // invoke the operation + string schemaVersionName = "1"; + bool result = await collection.ExistsAsync(schemaVersionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaResource created on azure + // for more information of creating DeviceRegistrySchemaResource, please refer to the document of DeviceRegistrySchemaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + ResourceIdentifier deviceRegistrySchemaResourceId = DeviceRegistrySchemaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + DeviceRegistrySchemaResource deviceRegistrySchema = client.GetDeviceRegistrySchemaResource(deviceRegistrySchemaResourceId); + + // get the collection of this DeviceRegistrySchemaVersionResource + DeviceRegistrySchemaVersionCollection collection = deviceRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // invoke the operation + string schemaVersionName = "1"; + NullableResponse response = await collection.GetIfExistsAsync(schemaVersionName); + DeviceRegistrySchemaVersionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionResource.cs new file mode 100644 index 000000000000..281841d6b332 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_DeviceRegistrySchemaVersionResource.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Samples +{ + public partial class Sample_DeviceRegistrySchemaVersionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Get_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaVersionResource created on azure + // for more information of creating DeviceRegistrySchemaVersionResource, please refer to the document of DeviceRegistrySchemaVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + string schemaVersionName = "1"; + ResourceIdentifier deviceRegistrySchemaVersionResourceId = DeviceRegistrySchemaVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + DeviceRegistrySchemaVersionResource deviceRegistrySchemaVersion = client.GetDeviceRegistrySchemaVersionResource(deviceRegistrySchemaVersionResourceId); + + // invoke the operation + DeviceRegistrySchemaVersionResource result = await deviceRegistrySchemaVersion.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Delete_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaVersionResource created on azure + // for more information of creating DeviceRegistrySchemaVersionResource, please refer to the document of DeviceRegistrySchemaVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + string schemaVersionName = "1"; + ResourceIdentifier deviceRegistrySchemaVersionResourceId = DeviceRegistrySchemaVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + DeviceRegistrySchemaVersionResource deviceRegistrySchemaVersion = client.GetDeviceRegistrySchemaVersionResource(deviceRegistrySchemaVersionResourceId); + + // invoke the operation + await deviceRegistrySchemaVersion.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateSchemaVersion() + { + // Generated from example definition: 2024-09-01-preview/Create_SchemaVersion.json + // this example is just showing the usage of "SchemaVersion_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DeviceRegistrySchemaVersionResource created on azure + // for more information of creating DeviceRegistrySchemaVersionResource, please refer to the document of DeviceRegistrySchemaVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string schemaRegistryName = "my-schema-registry"; + string schemaName = "my-schema"; + string schemaVersionName = "1"; + ResourceIdentifier deviceRegistrySchemaVersionResourceId = DeviceRegistrySchemaVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + DeviceRegistrySchemaVersionResource deviceRegistrySchemaVersion = client.GetDeviceRegistrySchemaVersionResource(deviceRegistrySchemaVersionResourceId); + + // invoke the operation + DeviceRegistrySchemaVersionData data = new DeviceRegistrySchemaVersionData + { + Properties = new DeviceRegistrySchemaVersionProperties("{\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"type\": \"object\",\"properties\": {\"humidity\": {\"type\": \"string\"},\"temperature\": {\"type\":\"number\"}}}") + { + Description = "Schema version 1", + }, + }; + ArmOperation lro = await deviceRegistrySchemaVersion.UpdateAsync(WaitUntil.Completed, data); + DeviceRegistrySchemaVersionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index ea2b8e92496c..3dc49dd86e3a 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -18,10 +18,41 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfilesInASubscription() + public async Task GetDeviceRegistryAssets_ListAssetsSubscription() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_AssetEndpointProfiles_Subscription.json - // this example is just showing the usage of "AssetEndpointProfiles_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/List_Assets_Subscription.json + // this example is just showing the usage of "Asset_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistryAssetResource item in subscriptionResource.GetDeviceRegistryAssetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryAssetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfilesSubscription() + { + // Generated from example definition: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + // this example is just showing the usage of "AssetEndpointProfile_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -49,10 +80,10 @@ public async Task GetDeviceRegistryAssetEndpointProfiles_ListAssetEndpointProfil [Test] [Ignore("Only validating compilation of examples")] - public async Task GetDeviceRegistryAssets_ListAssetsInASubscription() + public async Task GetDeviceRegistryDiscoveredAssets_ListDiscoveredAssetsSubscription() { - // Generated from example definition: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_Assets_Subscription.json - // this example is just showing the usage of "Assets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json + // this example is just showing the usage of "DiscoveredAsset_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -66,11 +97,73 @@ public async Task GetDeviceRegistryAssets_ListAssetsInASubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (DeviceRegistryAssetResource item in subscriptionResource.GetDeviceRegistryAssetsAsync()) + await foreach (DeviceRegistryDiscoveredAssetResource item in subscriptionResource.GetDeviceRegistryDiscoveredAssetsAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - DeviceRegistryAssetData resourceData = item.Data; + DeviceRegistryDiscoveredAssetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDeviceRegistryDiscoveredAssetEndpointProfiles_ListDiscoveredAssetEndpointProfilesSubscription() + { + // Generated from example definition: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json + // this example is just showing the usage of "DiscoveredAssetEndpointProfile_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistryDiscoveredAssetEndpointProfileResource item in subscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistryDiscoveredAssetEndpointProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDeviceRegistrySchemaRegistries_ListSchemaRegistriesSubscription() + { + // Generated from example definition: 2024-09-01-preview/List_SchemaRegistries_Subscription.json + // this example is just showing the usage of "SchemaRegistry_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DeviceRegistrySchemaRegistryResource item in subscriptionResource.GetDeviceRegistrySchemaRegistriesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DeviceRegistrySchemaRegistryData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Azure.ResourceManager.DeviceRegistry.csproj b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Azure.ResourceManager.DeviceRegistry.csproj index 9133dfa58a9b..bd71375ce1fc 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Azure.ResourceManager.DeviceRegistry.csproj +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Azure.ResourceManager.DeviceRegistry.csproj @@ -1,6 +1,6 @@ - 1.0.0-beta.2 + 1.0.0-beta.3 Azure.ResourceManager.DeviceRegistry Azure Resource Manager client SDK for Azure resource provider DeviceRegistry. azure;management;arm;resource manager;deviceregistry diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Data/OperationStatusResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Data/OperationStatusResult.cs new file mode 100644 index 000000000000..4f98562b7c3c --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Data/OperationStatusResult.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The current status of an async operation. + internal partial class OperationStatusResult + { + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/DeviceRegistryExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/DeviceRegistryExtensions.cs new file mode 100644 index 000000000000..d883ba6916fe --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/DeviceRegistryExtensions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Mocking; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + // Todo: CodeGen should support remove operation instead of using customization code, https://github.com/Azure/autorest.csharp/issues/5191 opened + [CodeGenSuppress("GetOperationStatuAsync", typeof(SubscriptionResource), typeof(string), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("GetOperationStatu", typeof(SubscriptionResource), typeof(string), typeof(string), typeof(CancellationToken))] + public static partial class DeviceRegistryExtensions + { + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/MockableDeviceRegistrySubscriptionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/MockableDeviceRegistrySubscriptionResource.cs new file mode 100644 index 000000000000..d22543804990 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Custom/Extensions/MockableDeviceRegistrySubscriptionResource.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry.Mocking +{ + // Todo: CodeGen should support remove operation instead of using customization code, https://github.com/Azure/autorest.csharp/issues/5191 opened + [CodeGenSuppress("GetOperationStatuAsync", typeof(string), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("GetOperationStatu", typeof(string), typeof(string), typeof(CancellationToken))] + public partial class MockableDeviceRegistrySubscriptionResource : ArmResource + { + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs index 582a5f5a9e7d..d90426b2570c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/ArmDeviceRegistryModelFactory.cs @@ -16,25 +16,284 @@ namespace Azure.ResourceManager.DeviceRegistry.Models /// Model factory for models. public static partial class ArmDeviceRegistryModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DeviceRegistrySchemaVersionData DeviceRegistrySchemaVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceRegistrySchemaVersionProperties properties = null) + { + return new DeviceRegistrySchemaVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Human-readable description of the schema. + /// Schema content. + /// Hash of the schema content. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static DeviceRegistrySchemaVersionProperties DeviceRegistrySchemaVersionProperties(string uuid = null, string description = null, string schemaContent = null, string hash = null, DeviceRegistryProvisioningState? provisioningState = null) + { + return new DeviceRegistrySchemaVersionProperties( + uuid, + description, + schemaContent, + hash, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DeviceRegistrySchemaData DeviceRegistrySchemaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceRegistrySchemaProperties properties = null) + { + return new DeviceRegistrySchemaData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Human-readable display name. + /// Human-readable description of the schema. + /// Format of the schema. + /// Type of the schema. + /// Provisioning state of the resource. + /// Schema tags. + /// A new instance for mocking. + public static DeviceRegistrySchemaProperties DeviceRegistrySchemaProperties(string uuid = null, string displayName = null, string description = null, DeviceRegistrySchemaFormat format = default, DeviceRegistrySchemaType schemaType = default, DeviceRegistryProvisioningState? provisioningState = null, IDictionary tags = null) + { + tags ??= new Dictionary(); + + return new DeviceRegistrySchemaProperties( + uuid, + displayName, + description, + format, + schemaType, + provisioningState, + tags, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// The extended location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. + /// A new instance for mocking. + public static DeviceRegistrySchemaRegistryData DeviceRegistrySchemaRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistrySchemaRegistryProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DeviceRegistrySchemaRegistryData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable id. + /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. + /// Human-readable display name. + /// Human-readable description of the schema registry. + /// The Storage Account's Container URL where schemas will be stored. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static DeviceRegistrySchemaRegistryProperties DeviceRegistrySchemaRegistryProperties(string uuid = null, string @namespace = null, string displayName = null, string description = null, Uri storageAccountContainerUri = null, DeviceRegistryProvisioningState? provisioningState = null) + { + return new DeviceRegistrySchemaRegistryProperties( + uuid, + @namespace, + displayName, + description, + storageAccountContainerUri, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The extended location. + /// A new instance for mocking. + public static DeviceRegistryDiscoveredAssetEndpointProfileData DeviceRegistryDiscoveredAssetEndpointProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DiscoveredAssetEndpointProfileProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + { + tags ??= new Dictionary(); + + return new DeviceRegistryDiscoveredAssetEndpointProfileData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Defines the client authentication mechanism to the server. - /// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device. - /// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// List of supported authentication methods supported by the target server. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Identifier used to detect changes in the asset endpoint profile. + /// An integer that is incremented each time the resource is modified. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static DiscoveredAssetEndpointProfileProperties DiscoveredAssetEndpointProfileProperties(Uri targetAddress = null, string additionalConfiguration = null, IEnumerable supportedAuthenticationMethods = null, string endpointProfileType = null, string discoveryId = null, long version = default, DeviceRegistryProvisioningState? provisioningState = null) + { + supportedAuthenticationMethods ??= new List(); + + return new DiscoveredAssetEndpointProfileProperties( + targetAddress, + additionalConfiguration, + supportedAuthenticationMethods?.ToList(), + endpointProfileType, + discoveryId, + version, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The extended location. + /// A new instance for mocking. + public static DeviceRegistryDiscoveredAssetData DeviceRegistryDiscoveredAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryDiscoveredAssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + { + tags ??= new Dictionary(); + + return new DeviceRegistryDiscoveredAssetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + /// Identifier used to detect changes in the asset. + /// An integer that is incremented each time the resource is modified. + /// Asset manufacturer name. + /// Asset manufacturer URI. + /// Asset model name. + /// Asset product code. + /// Revision number of the hardware. + /// Revision number of the software. + /// Reference to the documentation. + /// Asset serial number. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. /// Provisioning state of the resource. + /// A new instance for mocking. + public static DeviceRegistryDiscoveredAssetProperties DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef = null, string discoveryId = null, long version = default, string manufacturer = null, Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, Uri documentationUri = null, string serialNumber = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, DeviceRegistryTopic defaultTopic = null, IEnumerable datasets = null, IEnumerable events = null, DeviceRegistryProvisioningState? provisioningState = null) + { + datasets ??= new List(); + events ??= new List(); + + return new DeviceRegistryDiscoveredAssetProperties( + assetEndpointProfileRef, + discoveryId, + version, + manufacturer, + manufacturerUri, + model, + productCode, + hardwareRevision, + softwareRevision, + documentationUri, + serialNumber, + defaultDatasetsConfiguration, + defaultEventsConfiguration, + defaultTopic, + datasets?.ToList(), + events?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Resource ETag. + /// A new instance for mocking. + public static DeviceRegistryBillingContainerData DeviceRegistryBillingContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeviceRegistryProvisioningState? billingContainerProvisioningState = null, ETag? etag = null) + { + return new DeviceRegistryBillingContainerData( + id, + name, + resourceType, + systemData, + billingContainerProvisioningState != null ? new BillingContainerProperties(billingContainerProvisioningState, serializedAdditionalRawData: null) : null, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The extended location. /// A new instance for mocking. - public static DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, Uri targetAddress = null, UserAuthentication userAuthentication = null, IEnumerable transportAuthenticationOwnCertificates = null, string additionalConfiguration = null, DeviceRegistryProvisioningState? provisioningState = null) + public static DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpointProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryAssetEndpointProfileProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) { tags ??= new Dictionary(); - transportAuthenticationOwnCertificates ??= new List(); return new DeviceRegistryAssetEndpointProfileData( id, @@ -43,16 +302,46 @@ public static DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpoint systemData, tags, location, + properties, extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Defines the client authentication mechanism to the server. + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// Reference to a discovered asset endpoint profile. Populated only if the asset endpoint profile has been created from discovery flow. Discovered asset endpoint profile name must be provided. + /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static DeviceRegistryAssetEndpointProfileProperties DeviceRegistryAssetEndpointProfileProperties(string uuid = null, Uri targetAddress = null, string endpointProfileType = null, DeviceRegistryAuthentication authentication = null, string additionalConfiguration = null, string discoveredAssetEndpointProfileRef = null, IEnumerable statusErrors = null, DeviceRegistryProvisioningState? provisioningState = null) + { + statusErrors ??= new List(); + + return new DeviceRegistryAssetEndpointProfileProperties( uuid, targetAddress, - userAuthentication, - transportAuthenticationOwnCertificates != null ? new TransportAuthentication(transportAuthenticationOwnCertificates?.ToList(), serializedAdditionalRawData: null) : null, + endpointProfileType, + authentication, additionalConfiguration, + discoveredAssetEndpointProfileRef, + statusErrors != null ? new AssetEndpointProfileStatus(statusErrors?.ToList(), serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Error code for classification of errors (ex: 400, 404, 500, etc.). + /// Human readable helpful error message to provide additional context for error (ex: “targetAddress 'foo' is not a valid url”). + /// A new instance for mocking. + public static AssetEndpointProfileStatusError AssetEndpointProfileStatusError(int? code = null, string message = null) + { + return new AssetEndpointProfileStatusError(code, message, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -60,14 +349,32 @@ public static DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpoint /// The systemData. /// The tags. /// The location. + /// The resource-specific properties for this resource. /// The extended location. + /// A new instance for mocking. + public static DeviceRegistryAssetData DeviceRegistryAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AssetProperties properties = null, DeviceRegistryExtendedLocation extendedLocation = null) + { + tags ??= new Dictionary(); + + return new DeviceRegistryAssetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// Globally unique, immutable, non-reusable id. - /// Resource path to asset type (model) definition. - /// Enabled/Disabled status of the asset. + /// Enabled/Disabled status of the asset. /// Asset id provided by the customer. /// Human-readable display name. /// Human-readable description of the asset. - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>. + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. /// An integer that is incremented each time the resource is modified. /// Asset manufacturer name. /// Asset manufacturer URI. @@ -78,35 +385,29 @@ public static DeviceRegistryAssetEndpointProfileData DeviceRegistryAssetEndpoint /// Reference to the documentation. /// Asset serial number. /// A set of key-value pairs that contain custom attributes set by the customer. - /// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element. - /// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element. + /// Reference to a list of discovered assets. Populated only if the asset has been created from discovery flow. Discovered asset names must be provided. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. /// Provisioning state of the resource. - /// A new instance for mocking. - public static DeviceRegistryAssetData DeviceRegistryAssetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DeviceRegistryExtendedLocation extendedLocation = null, string uuid = null, string assetType = null, bool? enabled = null, string externalAssetId = null, string displayName = null, string description = null, Uri assetEndpointProfileUri = null, int? version = null, string manufacturer = null, Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, Uri documentationUri = null, string serialNumber = null, IDictionary attributes = null, string defaultDataPointsConfiguration = null, string defaultEventsConfiguration = null, IEnumerable dataPoints = null, IEnumerable events = null, AssetStatus status = null, DeviceRegistryProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static AssetProperties AssetProperties(string uuid = null, bool? isEnabled = null, string externalAssetId = null, string displayName = null, string description = null, string assetEndpointProfileRef = null, long? version = null, string manufacturer = null, Uri manufacturerUri = null, string model = null, string productCode = null, string hardwareRevision = null, string softwareRevision = null, Uri documentationUri = null, string serialNumber = null, IDictionary attributes = null, IEnumerable discoveredAssetRefs = null, string defaultDatasetsConfiguration = null, string defaultEventsConfiguration = null, DeviceRegistryTopic defaultTopic = null, IEnumerable datasets = null, IEnumerable events = null, DeviceRegistryAssetStatus status = null, DeviceRegistryProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); attributes ??= new Dictionary(); - dataPoints ??= new List(); - events ??= new List(); + discoveredAssetRefs ??= new List(); + datasets ??= new List(); + events ??= new List(); - return new DeviceRegistryAssetData( - id, - name, - resourceType, - systemData, - tags, - location, - extendedLocation, + return new AssetProperties( uuid, - assetType, - enabled, + isEnabled, externalAssetId, displayName, description, - assetEndpointProfileUri, + assetEndpointProfileRef, version, manufacturer, manufacturerUri, @@ -117,33 +418,67 @@ public static DeviceRegistryAssetData DeviceRegistryAssetData(ResourceIdentifier documentationUri, serialNumber, attributes, - defaultDataPointsConfiguration, + discoveredAssetRefs?.ToList(), + defaultDatasetsConfiguration, defaultEventsConfiguration, - dataPoints?.ToList(), + defaultTopic, + datasets?.ToList(), events?.ToList(), status, provisioningState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Array object to transfer and persist errors that originate from the Edge. /// A read only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (Edge) state of the Asset. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. - /// A new instance for mocking. - public static AssetStatus AssetStatus(IEnumerable errors = null, int? version = null) + /// Array of dataset statuses that describe the status of each dataset. + /// Array of event statuses that describe the status of each event. + /// A new instance for mocking. + public static DeviceRegistryAssetStatus DeviceRegistryAssetStatus(IEnumerable errors = null, long? version = null, IEnumerable datasets = null, IEnumerable events = null) { - errors ??= new List(); + errors ??= new List(); + datasets ??= new List(); + events ??= new List(); - return new AssetStatus(errors?.ToList(), version, serializedAdditionalRawData: null); + return new DeviceRegistryAssetStatus(errors?.ToList(), version, datasets?.ToList(), events?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Error code for classification of errors (ex: 400, 404, 500, etc.). /// Human readable helpful error message to provide additional context for error (ex: “capability Id 'foo' does not exist”). - /// A new instance for mocking. - public static AssetStatusError AssetStatusError(int? code = null, string message = null) + /// A new instance for mocking. + public static DeviceRegistryAssetStatusError DeviceRegistryAssetStatusError(int? code = null, string message = null) + { + return new DeviceRegistryAssetStatusError(code, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. + /// The message schema reference object. + /// A new instance for mocking. + public static DeviceRegistryAssetStatusDataset DeviceRegistryAssetStatusDataset(string name = null, MessageSchemaReference messageSchemaReference = null) + { + return new DeviceRegistryAssetStatusDataset(name, messageSchemaReference, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The message schema registry namespace. + /// The message schema name. + /// The message schema version. + /// A new instance for mocking. + public static MessageSchemaReference MessageSchemaReference(string schemaRegistryNamespace = null, string schemaName = null, string schemaVersion = null) + { + return new MessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. + /// The message schema reference object. + /// A new instance for mocking. + public static DeviceRegistryAssetStatusEvent DeviceRegistryAssetStatusEvent(string name = null, MessageSchemaReference messageSchemaReference = null) { - return new AssetStatusError(code, message, serializedAdditionalRawData: null); + return new DeviceRegistryAssetStatusEvent(name, messageSchemaReference, serializedAdditionalRawData: null); } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs index 35bb4e2c71c2..b3772dc0f191 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Assets_CreateOrReplace + /// Asset_CreateOrReplace /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpd /// /// /// Operation Id - /// Assets_CreateOrReplace + /// Asset_CreateOrReplace /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -249,11 +249,11 @@ public virtual Response Get(string assetName, Cance /// /// /// Operation Id - /// Assets_ListByResourceGroup + /// Asset_ListByResourceGroup /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Operation Id - /// Assets_ListByResourceGroup + /// Asset_ListByResourceGroup /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -309,11 +309,11 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string assetName, Cancella /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -395,11 +395,11 @@ public virtual Response Exists(string assetName, CancellationToken cancell /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -440,11 +440,11 @@ public virtual async Task> GetIfEx /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.Serialization.cs index 8093ed4b75f9..c97b822f3eaf 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.Serialization.cs @@ -37,154 +37,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("extendedLocation"u8); - writer.WriteObjectValue(ExtendedLocation, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Uuid)) - { - writer.WritePropertyName("uuid"u8); - writer.WriteStringValue(Uuid); - } - if (Optional.IsDefined(AssetType)) - { - writer.WritePropertyName("assetType"u8); - writer.WriteStringValue(AssetType); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(ExternalAssetId)) - { - writer.WritePropertyName("externalAssetId"u8); - writer.WriteStringValue(ExternalAssetId); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(AssetEndpointProfileUri)) - { - writer.WritePropertyName("assetEndpointProfileUri"u8); - writer.WriteStringValue(AssetEndpointProfileUri.AbsoluteUri); - } - if (options.Format != "W" && Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version.Value); - } - if (Optional.IsDefined(Manufacturer)) - { - writer.WritePropertyName("manufacturer"u8); - writer.WriteStringValue(Manufacturer); - } - if (Optional.IsDefined(ManufacturerUri)) - { - writer.WritePropertyName("manufacturerUri"u8); - writer.WriteStringValue(ManufacturerUri.AbsoluteUri); - } - if (Optional.IsDefined(Model)) - { - writer.WritePropertyName("model"u8); - writer.WriteStringValue(Model); - } - if (Optional.IsDefined(ProductCode)) - { - writer.WritePropertyName("productCode"u8); - writer.WriteStringValue(ProductCode); - } - if (Optional.IsDefined(HardwareRevision)) - { - writer.WritePropertyName("hardwareRevision"u8); - writer.WriteStringValue(HardwareRevision); - } - if (Optional.IsDefined(SoftwareRevision)) - { - writer.WritePropertyName("softwareRevision"u8); - writer.WriteStringValue(SoftwareRevision); - } - if (Optional.IsDefined(DocumentationUri)) - { - writer.WritePropertyName("documentationUri"u8); - writer.WriteStringValue(DocumentationUri.AbsoluteUri); - } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); - } - if (Optional.IsCollectionDefined(Attributes)) - { - writer.WritePropertyName("attributes"u8); - writer.WriteStartObject(); - foreach (var item in Attributes) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(DefaultDataPointsConfiguration)) - { - writer.WritePropertyName("defaultDataPointsConfiguration"u8); - writer.WriteStringValue(DefaultDataPointsConfiguration); - } - if (Optional.IsDefined(DefaultEventsConfiguration)) - { - writer.WritePropertyName("defaultEventsConfiguration"u8); - writer.WriteStringValue(DefaultEventsConfiguration); - } - if (Optional.IsCollectionDefined(DataPoints)) - { - writer.WritePropertyName("dataPoints"u8); - writer.WriteStartArray(); - foreach (var item in DataPoints) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Events)) - { - writer.WritePropertyName("events"u8); - writer.WriteStartArray(); - foreach (var item in Events) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteObjectValue(Status, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); } DeviceRegistryAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -207,6 +66,7 @@ internal static DeviceRegistryAssetData DeserializeDeviceRegistryAssetData(JsonE { return null; } + AssetProperties properties = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; AzureLocation location = default; @@ -214,33 +74,19 @@ internal static DeviceRegistryAssetData DeserializeDeviceRegistryAssetData(JsonE string name = default; ResourceType type = default; SystemData systemData = default; - string uuid = default; - string assetType = default; - bool? enabled = default; - string externalAssetId = default; - string displayName = default; - string description = default; - Uri assetEndpointProfileUri = default; - int? version = default; - string manufacturer = default; - Uri manufacturerUri = default; - string model = default; - string productCode = default; - string hardwareRevision = default; - string softwareRevision = default; - Uri documentationUri = default; - string serialNumber = default; - IDictionary attributes = default; - string defaultDataPointsConfiguration = default; - string defaultEventsConfiguration = default; - IList dataPoints = default; - IList events = default; - AssetStatus status = default; - DeviceRegistryProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AssetProperties.DeserializeAssetProperties(property.Value, options); + continue; + } if (property.NameEquals("extendedLocation"u8)) { extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); @@ -289,195 +135,6 @@ internal static DeviceRegistryAssetData DeserializeDeviceRegistryAssetData(JsonE systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("uuid"u8)) - { - uuid = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("assetType"u8)) - { - assetType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("externalAssetId"u8)) - { - externalAssetId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("assetEndpointProfileUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - assetEndpointProfileUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("version"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("manufacturer"u8)) - { - manufacturer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("manufacturerUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - manufacturerUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("model"u8)) - { - model = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("productCode"u8)) - { - productCode = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hardwareRevision"u8)) - { - hardwareRevision = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("softwareRevision"u8)) - { - softwareRevision = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("documentationUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - documentationUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("serialNumber"u8)) - { - serialNumber = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("attributes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property1.Name, null); - } - else - { - dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); - } - } - attributes = dictionary; - continue; - } - if (property0.NameEquals("defaultDataPointsConfiguration"u8)) - { - defaultDataPointsConfiguration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("defaultEventsConfiguration"u8)) - { - defaultEventsConfiguration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dataPoints"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DataPoint.DeserializeDataPoint(item, options)); - } - dataPoints = array; - continue; - } - if (property0.NameEquals("events"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AssetEvent.DeserializeAssetEvent(item, options)); - } - events = array; - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = AssetStatus.DeserializeAssetStatus(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -491,30 +148,8 @@ internal static DeviceRegistryAssetData DeserializeDeviceRegistryAssetData(JsonE systemData, tags ?? new ChangeTrackingDictionary(), location, + properties, extendedLocation, - uuid, - assetType, - enabled, - externalAssetId, - displayName, - description, - assetEndpointProfileUri, - version, - manufacturer, - manufacturerUri, - model, - productCode, - hardwareRevision, - softwareRevision, - documentationUri, - serialNumber, - attributes ?? new ChangeTrackingDictionary(), - defaultDataPointsConfiguration, - defaultEventsConfiguration, - dataPoints ?? new ChangeTrackingList(), - events ?? new ChangeTrackingList(), - status, - provisioningState, serializedAdditionalRawData); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.cs index 607dda4f4510..3b9ea25a8bc4 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetData.cs @@ -60,9 +60,6 @@ public DeviceRegistryAssetData(AzureLocation location, DeviceRegistryExtendedLoc Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); ExtendedLocation = extendedLocation; - Attributes = new ChangeTrackingDictionary(); - DataPoints = new ChangeTrackingList(); - Events = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -72,57 +69,13 @@ public DeviceRegistryAssetData(AzureLocation location, DeviceRegistryExtendedLoc /// The systemData. /// The tags. /// The location. + /// The resource-specific properties for this resource. /// The extended location. - /// Globally unique, immutable, non-reusable id. - /// Resource path to asset type (model) definition. - /// Enabled/Disabled status of the asset. - /// Asset id provided by the customer. - /// Human-readable display name. - /// Human-readable description of the asset. - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>. - /// An integer that is incremented each time the resource is modified. - /// Asset manufacturer name. - /// Asset manufacturer URI. - /// Asset model name. - /// Asset product code. - /// Revision number of the hardware. - /// Revision number of the software. - /// Reference to the documentation. - /// Asset serial number. - /// A set of key-value pairs that contain custom attributes set by the customer. - /// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element. - /// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element. - /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. - /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryExtendedLocation extendedLocation, string uuid, string assetType, bool? enabled, string externalAssetId, string displayName, string description, Uri assetEndpointProfileUri, int? version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, IDictionary attributes, string defaultDataPointsConfiguration, string defaultEventsConfiguration, IList dataPoints, IList events, AssetStatus status, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal DeviceRegistryAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + Properties = properties; ExtendedLocation = extendedLocation; - Uuid = uuid; - AssetType = assetType; - Enabled = enabled; - ExternalAssetId = externalAssetId; - DisplayName = displayName; - Description = description; - AssetEndpointProfileUri = assetEndpointProfileUri; - Version = version; - Manufacturer = manufacturer; - ManufacturerUri = manufacturerUri; - Model = model; - ProductCode = productCode; - HardwareRevision = hardwareRevision; - SoftwareRevision = softwareRevision; - DocumentationUri = documentationUri; - SerialNumber = serialNumber; - Attributes = attributes; - DefaultDataPointsConfiguration = defaultDataPointsConfiguration; - DefaultEventsConfiguration = defaultEventsConfiguration; - DataPoints = dataPoints; - Events = events; - Status = status; - ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -131,82 +84,9 @@ internal DeviceRegistryAssetData() { } + /// The resource-specific properties for this resource. + public AssetProperties Properties { get; set; } /// The extended location. public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } - /// Globally unique, immutable, non-reusable id. - public string Uuid { get; } - /// Resource path to asset type (model) definition. - public string AssetType { get; set; } - /// Enabled/Disabled status of the asset. - public bool? Enabled { get; set; } - /// Asset id provided by the customer. - public string ExternalAssetId { get; set; } - /// Human-readable display name. - public string DisplayName { get; set; } - /// Human-readable description of the asset. - public string Description { get; set; } - /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>. - public Uri AssetEndpointProfileUri { get; set; } - /// An integer that is incremented each time the resource is modified. - public int? Version { get; } - /// Asset manufacturer name. - public string Manufacturer { get; set; } - /// Asset manufacturer URI. - public Uri ManufacturerUri { get; set; } - /// Asset model name. - public string Model { get; set; } - /// Asset product code. - public string ProductCode { get; set; } - /// Revision number of the hardware. - public string HardwareRevision { get; set; } - /// Revision number of the software. - public string SoftwareRevision { get; set; } - /// Reference to the documentation. - public Uri DocumentationUri { get; set; } - /// Asset serial number. - public string SerialNumber { get; set; } - /// - /// A set of key-value pairs that contain custom attributes set by the customer. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary Attributes { get; } - /// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - public string DefaultDataPointsConfiguration { get; set; } - /// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - public string DefaultEventsConfiguration { get; set; } - /// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element. - public IList DataPoints { get; } - /// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element. - public IList Events { get; } - /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. - public AssetStatus Status { get; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs index 78d412231ac9..177901e6383c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// AssetEndpointProfiles_CreateOrReplace + /// AssetEndpointProfile_CreateOrReplace /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -110,11 +110,11 @@ public virtual async Task /// /// Operation Id - /// AssetEndpointProfiles_CreateOrReplace + /// AssetEndpointProfile_CreateOrReplace /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOr /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -204,11 +204,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -249,11 +249,11 @@ public virtual Response Get(string a /// /// /// Operation Id - /// AssetEndpointProfiles_ListByResourceGroup + /// AssetEndpointProfile_ListByResourceGroup /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllA /// /// /// Operation Id - /// AssetEndpointProfiles_ListByResourceGroup + /// AssetEndpointProfile_ListByResourceGroup /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -309,11 +309,11 @@ public virtual Pageable GetAll(Cance /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string assetEndpointProfil /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -395,11 +395,11 @@ public virtual Response Exists(string assetEndpointProfileName, Cancellati /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -440,11 +440,11 @@ public virtual async Task /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.Serialization.cs index 6a49397fb3a4..1472ed184c6a 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.Serialization.cs @@ -37,41 +37,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("extendedLocation"u8); - writer.WriteObjectValue(ExtendedLocation, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Uuid)) - { - writer.WritePropertyName("uuid"u8); - writer.WriteStringValue(Uuid); - } - if (Optional.IsDefined(TargetAddress)) - { - writer.WritePropertyName("targetAddress"u8); - writer.WriteStringValue(TargetAddress.AbsoluteUri); - } - if (Optional.IsDefined(UserAuthentication)) - { - writer.WritePropertyName("userAuthentication"u8); - writer.WriteObjectValue(UserAuthentication, options); - } - if (Optional.IsDefined(TransportAuthentication)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("transportAuthentication"u8); - writer.WriteObjectValue(TransportAuthentication, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(AdditionalConfiguration)) - { - writer.WritePropertyName("additionalConfiguration"u8); - writer.WriteStringValue(AdditionalConfiguration); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); } DeviceRegistryAssetEndpointProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -94,6 +66,7 @@ internal static DeviceRegistryAssetEndpointProfileData DeserializeDeviceRegistry { return null; } + DeviceRegistryAssetEndpointProfileProperties properties = default; DeviceRegistryExtendedLocation extendedLocation = default; IDictionary tags = default; AzureLocation location = default; @@ -101,16 +74,19 @@ internal static DeviceRegistryAssetEndpointProfileData DeserializeDeviceRegistry string name = default; ResourceType type = default; SystemData systemData = default; - string uuid = default; - Uri targetAddress = default; - UserAuthentication userAuthentication = default; - TransportAuthentication transportAuthentication = default; - string additionalConfiguration = default; - DeviceRegistryProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeviceRegistryAssetEndpointProfileProperties.DeserializeDeviceRegistryAssetEndpointProfileProperties(property.Value, options); + continue; + } if (property.NameEquals("extendedLocation"u8)) { extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); @@ -159,64 +135,6 @@ internal static DeviceRegistryAssetEndpointProfileData DeserializeDeviceRegistry systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("uuid"u8)) - { - uuid = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("targetAddress"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - targetAddress = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("userAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - userAuthentication = UserAuthentication.DeserializeUserAuthentication(property0.Value, options); - continue; - } - if (property0.NameEquals("transportAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - transportAuthentication = TransportAuthentication.DeserializeTransportAuthentication(property0.Value, options); - continue; - } - if (property0.NameEquals("additionalConfiguration"u8)) - { - additionalConfiguration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new DeviceRegistryProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -230,13 +148,8 @@ internal static DeviceRegistryAssetEndpointProfileData DeserializeDeviceRegistry systemData, tags ?? new ChangeTrackingDictionary(), location, + properties, extendedLocation, - uuid, - targetAddress, - userAuthentication, - transportAuthentication, - additionalConfiguration, - provisioningState, serializedAdditionalRawData); } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.cs index 1b39741a3e1f..38deb6904df4 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileData.cs @@ -69,23 +69,13 @@ public DeviceRegistryAssetEndpointProfileData(AzureLocation location, DeviceRegi /// The systemData. /// The tags. /// The location. + /// The resource-specific properties for this resource. /// The extended location. - /// Globally unique, immutable, non-reusable id. - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Defines the client authentication mechanism to the server. - /// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device. - /// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryAssetEndpointProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryExtendedLocation extendedLocation, string uuid, Uri targetAddress, UserAuthentication userAuthentication, TransportAuthentication transportAuthentication, string additionalConfiguration, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal DeviceRegistryAssetEndpointProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryAssetEndpointProfileProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + Properties = properties; ExtendedLocation = extendedLocation; - Uuid = uuid; - TargetAddress = targetAddress; - UserAuthentication = userAuthentication; - TransportAuthentication = transportAuthentication; - AdditionalConfiguration = additionalConfiguration; - ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,26 +84,9 @@ internal DeviceRegistryAssetEndpointProfileData() { } + /// The resource-specific properties for this resource. + public DeviceRegistryAssetEndpointProfileProperties Properties { get; set; } /// The extended location. public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } - /// Globally unique, immutable, non-reusable id. - public string Uuid { get; } - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - public Uri TargetAddress { get; set; } - /// Defines the client authentication mechanism to the server. - public UserAuthentication UserAuthentication { get; set; } - /// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device. - internal TransportAuthentication TransportAuthentication { get; set; } - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - public IList TransportAuthenticationOwnCertificates - { - get => TransportAuthentication is null ? default : TransportAuthentication.OwnCertificates; - set => TransportAuthentication = new TransportAuthentication(value); - } - - /// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - public string AdditionalConfiguration { get; set; } - /// Provisioning state of the resource. - public DeviceRegistryProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs index b382c8ec8d2c..ce93bf73a83d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetEndpointProfileResource.cs @@ -99,11 +99,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -139,11 +139,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -179,11 +179,11 @@ public virtual Response Get(Cancella /// /// /// Operation Id - /// AssetEndpointProfiles_Delete + /// AssetEndpointProfile_Delete /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -221,11 +221,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// AssetEndpointProfiles_Delete + /// AssetEndpointProfile_Delete /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -263,11 +263,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// AssetEndpointProfiles_Update + /// AssetEndpointProfile_Update /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -309,11 +309,11 @@ public virtual async Task /// /// Operation Id - /// AssetEndpointProfiles_Update + /// AssetEndpointProfile_Update /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -355,11 +355,11 @@ public virtual ArmOperation Update(W /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -417,11 +417,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -479,11 +479,11 @@ public virtual Response AddTag(strin /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -536,11 +536,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -593,11 +593,11 @@ public virtual Response SetTags(IDic /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -653,11 +653,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs index 679917e21f6d..b4c422ebbf56 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryAssetResource.cs @@ -99,11 +99,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -139,11 +139,11 @@ public virtual async Task> GetAsync(Cancel /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -179,11 +179,11 @@ public virtual Response Get(CancellationToken cance /// /// /// Operation Id - /// Assets_Delete + /// Asset_Delete /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -221,11 +221,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Assets_Delete + /// Asset_Delete /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -263,11 +263,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Assets_Update + /// Asset_Update /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -309,11 +309,11 @@ public virtual async Task> UpdateAsync /// /// /// Operation Id - /// Assets_Update + /// Asset_Update /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -355,11 +355,11 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -417,11 +417,11 @@ public virtual async Task> AddTagAsync(str /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -479,11 +479,11 @@ public virtual Response AddTag(string key, string v /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -536,11 +536,11 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -593,11 +593,11 @@ public virtual Response SetTags(IDictionary /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -653,11 +653,11 @@ public virtual async Task> RemoveTagAsync( /// /// /// Operation Id - /// Assets_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs new file mode 100644 index 000000000000..c988a875118e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerCollection.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistryBillingContainers method from an instance of . + /// + public partial class DeviceRegistryBillingContainerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistryBillingContainerBillingContainersClientDiagnostics; + private readonly BillingContainersRestOperations _deviceRegistryBillingContainerBillingContainersRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryBillingContainerCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistryBillingContainerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryBillingContainerBillingContainersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryBillingContainerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistryBillingContainerResource.ResourceType, out string deviceRegistryBillingContainerBillingContainersApiVersion); + _deviceRegistryBillingContainerBillingContainersRestClient = new BillingContainersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryBillingContainerBillingContainersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryBillingContainerBillingContainersRestClient.GetAsync(Id.SubscriptionId, billingContainerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistryBillingContainerBillingContainersRestClient.Get(Id.SubscriptionId, billingContainerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BillingContainer resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers + /// + /// + /// Operation Id + /// BillingContainer_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryBillingContainerBillingContainersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryBillingContainerBillingContainersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryBillingContainerResource(Client, DeviceRegistryBillingContainerData.DeserializeDeviceRegistryBillingContainerData(e)), _deviceRegistryBillingContainerBillingContainersClientDiagnostics, Pipeline, "DeviceRegistryBillingContainerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BillingContainer resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers + /// + /// + /// Operation Id + /// BillingContainer_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryBillingContainerBillingContainersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryBillingContainerBillingContainersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryBillingContainerResource(Client, DeviceRegistryBillingContainerData.DeserializeDeviceRegistryBillingContainerData(e)), _deviceRegistryBillingContainerBillingContainersClientDiagnostics, Pipeline, "DeviceRegistryBillingContainerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistryBillingContainerBillingContainersRestClient.GetAsync(Id.SubscriptionId, billingContainerName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistryBillingContainerBillingContainersRestClient.Get(Id.SubscriptionId, billingContainerName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistryBillingContainerBillingContainersRestClient.GetAsync(Id.SubscriptionId, billingContainerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the billing container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistryBillingContainerBillingContainersRestClient.Get(Id.SubscriptionId, billingContainerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.Serialization.cs new file mode 100644 index 000000000000..f48fcb69c9e9 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryBillingContainerData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryBillingContainerData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + } + + DeviceRegistryBillingContainerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryBillingContainerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryBillingContainerData(document.RootElement, options); + } + + internal static DeviceRegistryBillingContainerData DeserializeDeviceRegistryBillingContainerData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BillingContainerProperties properties = default; + ETag? etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BillingContainerProperties.DeserializeBillingContainerProperties(property.Value, options); + continue; + } + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryBillingContainerData( + id, + name, + type, + systemData, + properties, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryBillingContainerData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryBillingContainerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryBillingContainerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryBillingContainerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.cs new file mode 100644 index 000000000000..e1c8d2edcce7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerData.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistryBillingContainer data model. + /// billingContainer Model as Azure resource whose sole purpose is to keep track of billables resources under a subscription. + /// + public partial class DeviceRegistryBillingContainerData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DeviceRegistryBillingContainerData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Resource ETag. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryBillingContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BillingContainerProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal BillingContainerProperties Properties { get; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? BillingContainerProvisioningState + { + get => Properties?.ProvisioningState; + } + + /// Resource ETag. + public ETag? ETag { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.Serialization.cs new file mode 100644 index 000000000000..7fe2dac27521 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryBillingContainerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistryBillingContainerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistryBillingContainerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs new file mode 100644 index 000000000000..042cd94d743e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryBillingContainerResource.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistryBillingContainer along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistryBillingContainerResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistryBillingContainer method. + /// + public partial class DeviceRegistryBillingContainerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The billingContainerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string billingContainerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistryBillingContainerBillingContainersClientDiagnostics; + private readonly BillingContainersRestOperations _deviceRegistryBillingContainerBillingContainersRestClient; + private readonly DeviceRegistryBillingContainerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/billingContainers"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryBillingContainerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistryBillingContainerResource(ArmClient client, DeviceRegistryBillingContainerData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistryBillingContainerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryBillingContainerBillingContainersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistryBillingContainerBillingContainersApiVersion); + _deviceRegistryBillingContainerBillingContainersRestClient = new BillingContainersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryBillingContainerBillingContainersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistryBillingContainerData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryBillingContainerBillingContainersRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryBillingContainerBillingContainersClientDiagnostics.CreateScope("DeviceRegistryBillingContainerResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistryBillingContainerBillingContainersRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryBillingContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs new file mode 100644 index 000000000000..ca4ac6e34ea6 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistryDiscoveredAssets method from an instance of . + /// + public partial class DeviceRegistryDiscoveredAssetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; + private readonly DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryDiscoveredAssetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistryDiscoveredAssetResource.ResourceType, out string deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); + _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient = new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Discovered Asset name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Discovered Asset name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DiscoveredAsset resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAsset resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs new file mode 100644 index 000000000000..2784870791b5 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryDiscoveredAssetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + DeviceRegistryDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement, options); + } + + internal static DeviceRegistryDiscoveredAssetData DeserializeDeviceRegistryDiscoveredAssetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeviceRegistryDiscoveredAssetProperties properties = default; + DeviceRegistryExtendedLocation extendedLocation = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeviceRegistryDiscoveredAssetProperties.DeserializeDeviceRegistryDiscoveredAssetProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDiscoveredAssetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs new file mode 100644 index 000000000000..5c9852ce6783 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistryDiscoveredAsset data model. + /// Discovered Asset definition. + /// + public partial class DeviceRegistryDiscoveredAssetData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + /// The extended location. + /// is null. + public DeviceRegistryDiscoveredAssetData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The extended location. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDiscoveredAssetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistryDiscoveredAssetProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDiscoveredAssetData() + { + } + + /// The resource-specific properties for this resource. + public DeviceRegistryDiscoveredAssetProperties Properties { get; set; } + /// The extended location. + public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs new file mode 100644 index 000000000000..c072b948605e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistryDiscoveredAssetEndpointProfiles method from an instance of . + /// + public partial class DeviceRegistryDiscoveredAssetEndpointProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; + private readonly DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryDiscoveredAssetEndpointProfileCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetEndpointProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType, out string deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); + _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient = new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Discovered Asset Endpoint Profile name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Discovered Asset Endpoint Profile name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DiscoveredAssetEndpointProfile resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAssetEndpointProfile resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, discoveredAssetEndpointProfileName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs new file mode 100644 index 000000000000..7ce6d93e075a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + DeviceRegistryDiscoveredAssetEndpointProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement, options); + } + + internal static DeviceRegistryDiscoveredAssetEndpointProfileData DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiscoveredAssetEndpointProfileProperties properties = default; + DeviceRegistryExtendedLocation extendedLocation = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DiscoveredAssetEndpointProfileProperties.DeserializeDiscoveredAssetEndpointProfileProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = DeviceRegistryExtendedLocation.DeserializeDeviceRegistryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDiscoveredAssetEndpointProfileData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDiscoveredAssetEndpointProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfileData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs new file mode 100644 index 000000000000..9f487d88541a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistryDiscoveredAssetEndpointProfile data model. + /// Discovered Asset Endpoint Profile definition. + /// + public partial class DeviceRegistryDiscoveredAssetEndpointProfileData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + /// The extended location. + /// is null. + public DeviceRegistryDiscoveredAssetEndpointProfileData(AzureLocation location, DeviceRegistryExtendedLocation extendedLocation) : base(location) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The extended location. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDiscoveredAssetEndpointProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DiscoveredAssetEndpointProfileProperties properties, DeviceRegistryExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDiscoveredAssetEndpointProfileData() + { + } + + /// The resource-specific properties for this resource. + public DiscoveredAssetEndpointProfileProperties Properties { get; set; } + /// The extended location. + public DeviceRegistryExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs new file mode 100644 index 000000000000..b6d0bc5086b3 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistryDiscoveredAssetEndpointProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistryDiscoveredAssetEndpointProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs new file mode 100644 index 000000000000..6e7b61788f5a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetEndpointProfileResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistryDiscoveredAssetEndpointProfile along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistryDiscoveredAssetEndpointProfileResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistryDiscoveredAssetEndpointProfile method. + /// + public partial class DeviceRegistryDiscoveredAssetEndpointProfileResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The discoveredAssetEndpointProfileName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; + private readonly DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; + private readonly DeviceRegistryDiscoveredAssetEndpointProfileData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryDiscoveredAssetEndpointProfileResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetEndpointProfileResource(ArmClient client, DeviceRegistryDiscoveredAssetEndpointProfileData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetEndpointProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); + _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient = new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistryDiscoveredAssetEndpointProfileData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Delete"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Delete"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Update"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.Update"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(Client), _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetEndpointProfileResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetEndpointProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs new file mode 100644 index 000000000000..9904db2f0638 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistryDiscoveredAssetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistryDiscoveredAssetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistryDiscoveredAssetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs new file mode 100644 index 000000000000..3ea76bdb734f --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistryDiscoveredAssetResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistryDiscoveredAsset along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistryDiscoveredAssetResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistryDiscoveredAsset method. + /// + public partial class DeviceRegistryDiscoveredAssetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The discoveredAssetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string discoveredAssetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; + private readonly DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; + private readonly DeviceRegistryDiscoveredAssetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/discoveredAssets"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistryDiscoveredAssetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetResource(ArmClient client, DeviceRegistryDiscoveredAssetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistryDiscoveredAssetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); + _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient = new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistryDiscoveredAssetDiscoveredAssetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistryDiscoveredAssetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Delete"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Delete"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Update"); + scope.Start(); + try + { + var response = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a DiscoveredAsset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.Update"); + scope.Start(); + try + { + var response = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistryDiscoveredAssetOperationSource(Client), _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} + /// + /// + /// Operation Id + /// DiscoveredAsset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics.CreateScope("DeviceRegistryDiscoveredAssetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistryDiscoveredAssetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistryDiscoveredAssetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs new file mode 100644 index 000000000000..d4f9187fa327 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistrySchemas method from an instance of . + /// + public partial class DeviceRegistrySchemaCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistrySchemaSchemasClientDiagnostics; + private readonly SchemasRestOperations _deviceRegistrySchemaSchemasRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistrySchemaCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaSchemasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistrySchemaResource.ResourceType, out string deviceRegistrySchemaSchemasApiVersion); + _deviceRegistrySchemaSchemasRestClient = new SchemasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaSchemasApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DeviceRegistrySchemaRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistrySchemaRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Create a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data, cancellationToken); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Schema resources by SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas + /// + /// + /// Operation Id + /// Schema_ListBySchemaRegistry + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaResource(Client, DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(e)), _deviceRegistrySchemaSchemasClientDiagnostics, Pipeline, "DeviceRegistrySchemaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Schema resources by SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas + /// + /// + /// Operation Id + /// Schema_ListBySchemaRegistry + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaSchemasRestClient.CreateListBySchemaRegistryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaResource(Client, DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(e)), _deviceRegistrySchemaSchemasClientDiagnostics, Pipeline, "DeviceRegistrySchemaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, schemaName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs new file mode 100644 index 000000000000..8dfe5b4955e5 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DeviceRegistrySchemaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaData(document.RootElement, options); + } + + internal static DeviceRegistrySchemaData DeserializeDeviceRegistrySchemaData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeviceRegistrySchemaProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeviceRegistrySchemaProperties.DeserializeDeviceRegistrySchemaProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs new file mode 100644 index 000000000000..d13f17f7b433 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistrySchema data model. + /// Schema definition. + /// + public partial class DeviceRegistrySchemaData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRegistrySchemaData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeviceRegistrySchemaProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DeviceRegistrySchemaProperties Properties { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs new file mode 100644 index 000000000000..d55dd875c8b1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistrySchemaRegistries method from an instance of . + /// + public partial class DeviceRegistrySchemaRegistryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; + private readonly SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaRegistryCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistrySchemaRegistryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaRegistryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistrySchemaRegistryResource.ResourceType, out string deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); + _deviceRegistrySchemaRegistrySchemaRegistriesRestClient = new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema registry name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema registry name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SchemaRegistry resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "DeviceRegistrySchemaRegistryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SchemaRegistry resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "DeviceRegistrySchemaRegistryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, schemaRegistryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs new file mode 100644 index 000000000000..7354fa0f6b95 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaRegistryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + } + + DeviceRegistrySchemaRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaRegistryData(document.RootElement, options); + } + + internal static DeviceRegistrySchemaRegistryData DeserializeDeviceRegistrySchemaRegistryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeviceRegistrySchemaRegistryProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeviceRegistrySchemaRegistryProperties.DeserializeDeviceRegistrySchemaRegistryProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaRegistryData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaRegistryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs new file mode 100644 index 000000000000..eb1d2e0bea9b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistrySchemaRegistry data model. + /// Schema registry definition. + /// + public partial class DeviceRegistrySchemaRegistryData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DeviceRegistrySchemaRegistryData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DeviceRegistrySchemaRegistryProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistrySchemaRegistryData() + { + } + + /// The resource-specific properties for this resource. + public DeviceRegistrySchemaRegistryProperties Properties { get; set; } + /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs new file mode 100644 index 000000000000..897d9aa090f7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaRegistryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistrySchemaRegistryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistrySchemaRegistryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs new file mode 100644 index 000000000000..505e7a6e7853 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaRegistryResource.cs @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistrySchemaRegistry along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistrySchemaRegistryResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchemaRegistry method. + /// + public partial class DeviceRegistrySchemaRegistryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The schemaRegistryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; + private readonly SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; + private readonly DeviceRegistrySchemaRegistryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaRegistryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistrySchemaRegistryResource(ArmClient client, DeviceRegistrySchemaRegistryData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistrySchemaRegistryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); + _deviceRegistrySchemaRegistrySchemaRegistriesRestClient = new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaRegistrySchemaRegistriesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistrySchemaRegistryData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DeviceRegistrySchemaResources in the DeviceRegistrySchemaRegistry. + /// An object representing collection of DeviceRegistrySchemaResources and their operations over a DeviceRegistrySchemaResource. + public virtual DeviceRegistrySchemaCollection GetDeviceRegistrySchemas() + { + return GetCachedClient(client => new DeviceRegistrySchemaCollection(client, Id)); + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistrySchemaAsync(string schemaName, CancellationToken cancellationToken = default) + { + return await GetDeviceRegistrySchemas().GetAsync(schemaName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistrySchema(string schemaName, CancellationToken cancellationToken = default) + { + return GetDeviceRegistrySchemas().Get(schemaName, cancellationToken); + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Delete"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(_deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Delete"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DeviceRegistryArmOperation(_deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Update"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Update + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.Update"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DeviceRegistryArmOperation(new DeviceRegistrySchemaRegistryOperationSource(Client), _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics.CreateScope("DeviceRegistrySchemaRegistryResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deviceRegistrySchemaRegistrySchemaRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DeviceRegistrySchemaRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DeviceRegistrySchemaRegistryPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs new file mode 100644 index 000000000000..c51484b85598 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistrySchemaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistrySchemaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs new file mode 100644 index 000000000000..1595594bf11e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaResource.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistrySchema along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistrySchemaResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchema method. + /// + public partial class DeviceRegistrySchemaResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The schemaRegistryName. + /// The schemaName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistrySchemaSchemasClientDiagnostics; + private readonly SchemasRestOperations _deviceRegistrySchemaSchemasRestClient; + private readonly DeviceRegistrySchemaData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries/schemas"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistrySchemaResource(ArmClient client, DeviceRegistrySchemaData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistrySchemaResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaSchemasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistrySchemaSchemasApiVersion); + _deviceRegistrySchemaSchemasRestClient = new SchemasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaSchemasApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistrySchemaData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DeviceRegistrySchemaVersionResources in the DeviceRegistrySchema. + /// An object representing collection of DeviceRegistrySchemaVersionResources and their operations over a DeviceRegistrySchemaVersionResource. + public virtual DeviceRegistrySchemaVersionCollection GetDeviceRegistrySchemaVersions() + { + return GetCachedClient(client => new DeviceRegistrySchemaVersionCollection(client, Id)); + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistrySchemaVersionAsync(string schemaVersionName, CancellationToken cancellationToken = default) + { + return await GetDeviceRegistrySchemaVersions().GetAsync(schemaVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistrySchemaVersion(string schemaVersionName, CancellationToken cancellationToken = default) + { + return GetDeviceRegistrySchemaVersions().Get(schemaVersionName, cancellationToken); + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Delete"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Delete"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Update"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaSchemasRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName} + /// + /// + /// Operation Id + /// Schema_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaSchemasClientDiagnostics.CreateScope("DeviceRegistrySchemaResource.Update"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaSchemasRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _deviceRegistrySchemaSchemasRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs new file mode 100644 index 000000000000..407f152b4d61 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeviceRegistrySchemaVersions method from an instance of . + /// + public partial class DeviceRegistrySchemaVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics; + private readonly SchemaVersionsRestOperations _deviceRegistrySchemaVersionSchemaVersionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaVersionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeviceRegistrySchemaVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeviceRegistrySchemaVersionResource.ResourceType, out string deviceRegistrySchemaVersionSchemaVersionsApiVersion); + _deviceRegistrySchemaVersionSchemaVersionsRestClient = new SchemaVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaVersionSchemaVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DeviceRegistrySchemaResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DeviceRegistrySchemaResource.ResourceType), nameof(id)); + } + + /// + /// Create a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema version name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Schema version name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data, cancellationToken); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SchemaVersion resources by Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions + /// + /// + /// Operation Id + /// SchemaVersion_ListBySchema + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaVersionResource(Client, DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(e)), _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics, Pipeline, "DeviceRegistrySchemaVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SchemaVersion resources by Schema + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions + /// + /// + /// Operation Id + /// SchemaVersion_ListBySchema + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateListBySchemaNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaVersionResource(Client, DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(e)), _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics, Pipeline, "DeviceRegistrySchemaVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.Exists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema version name parameter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, schemaVersionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs new file mode 100644 index 000000000000..d96a3df6d156 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaVersionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DeviceRegistrySchemaVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaVersionData(document.RootElement, options); + } + + internal static DeviceRegistrySchemaVersionData DeserializeDeviceRegistrySchemaVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeviceRegistrySchemaVersionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeviceRegistrySchemaVersionProperties.DeserializeDeviceRegistrySchemaVersionProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs new file mode 100644 index 000000000000..f586a3ab5a4e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A class representing the DeviceRegistrySchemaVersion data model. + /// Schema version's definition. + /// + public partial class DeviceRegistrySchemaVersionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRegistrySchemaVersionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeviceRegistrySchemaVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DeviceRegistrySchemaVersionProperties Properties { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs new file mode 100644 index 000000000000..d763369b0fa7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DeviceRegistry +{ + public partial class DeviceRegistrySchemaVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeviceRegistrySchemaVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeviceRegistrySchemaVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs new file mode 100644 index 000000000000..ab0953217832 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/DeviceRegistrySchemaVersionResource.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DeviceRegistry +{ + /// + /// A Class representing a DeviceRegistrySchemaVersion along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeviceRegistrySchemaVersionResource method. + /// Otherwise you can get one from its parent resource using the GetDeviceRegistrySchemaVersion method. + /// + public partial class DeviceRegistrySchemaVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The schemaRegistryName. + /// The schemaName. + /// The schemaVersionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics; + private readonly SchemaVersionsRestOperations _deviceRegistrySchemaVersionSchemaVersionsRestClient; + private readonly DeviceRegistrySchemaVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DeviceRegistry/schemaRegistries/schemas/schemaVersions"; + + /// Initializes a new instance of the class for mocking. + protected DeviceRegistrySchemaVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeviceRegistrySchemaVersionResource(ArmClient client, DeviceRegistrySchemaVersionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeviceRegistrySchemaVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deviceRegistrySchemaVersionSchemaVersionsApiVersion); + _deviceRegistrySchemaVersionSchemaVersionsRestClient = new SchemaVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceRegistrySchemaVersionSchemaVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeviceRegistrySchemaVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Get"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Get"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Delete"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_Delete + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Delete"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Update"); + scope.Start(); + try + { + var response = await _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SchemaVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName} + /// + /// + /// Operation Id + /// SchemaVersion_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deviceRegistrySchemaVersionSchemaVersionsClientDiagnostics.CreateScope("DeviceRegistrySchemaVersionResource.Update"); + scope.Start(); + try + { + var response = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _deviceRegistrySchemaVersionSchemaVersionsRestClient.CreateCreateOrReplaceRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DeviceRegistryArmOperation(Response.FromValue(new DeviceRegistrySchemaVersionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs index 9a43aad66d0e..40c653c8fa45 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/DeviceRegistryExtensions.cs @@ -32,6 +32,25 @@ private static MockableDeviceRegistrySubscriptionResource GetMockableDeviceRegis return resource.GetCachedClient(client => new MockableDeviceRegistrySubscriptionResource(client, resource.Id)); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistryAssetResource GetDeviceRegistryAssetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryAssetResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -52,352 +71,1035 @@ public static DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAssetE } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeviceRegistryAssetResource GetDeviceRegistryAssetResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryAssetResource(id); + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryBillingContainerResource(id); } /// - /// Gets a collection of DeviceRegistryAssetEndpointProfileResources in the ResourceGroupResource. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryDiscoveredAssetResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistryDiscoveredAssetEndpointProfileResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaRegistryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDeviceRegistryArmClient(client).GetDeviceRegistrySchemaVersionResource(id); + } + + /// + /// Gets a collection of DeviceRegistryAssetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeviceRegistryAssetEndpointProfileResources and their operations over a DeviceRegistryAssetEndpointProfileResource. - public static DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of DeviceRegistryAssetResources and their operations over a DeviceRegistryAssetResource. + public static DeviceRegistryAssetCollection GetDeviceRegistryAssets(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfiles(); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssets(); } /// - /// Get a AssetEndpointProfile + /// Get a Asset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Asset Endpoint Profile name parameter. + /// Asset name parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeviceRegistryAssetEndpointProfileAsync(this ResourceGroupResource resourceGroupResource, string assetEndpointProfileName, CancellationToken cancellationToken = default) + public static async Task> GetDeviceRegistryAssetAsync(this ResourceGroupResource resourceGroupResource, string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfileAsync(assetEndpointProfileName, cancellationToken).ConfigureAwait(false); + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetAsync(assetName, cancellationToken).ConfigureAwait(false); } /// - /// Get a AssetEndpointProfile + /// Get a Asset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// Asset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Asset Endpoint Profile name parameter. + /// Asset name parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeviceRegistryAssetEndpointProfile(this ResourceGroupResource resourceGroupResource, string assetEndpointProfileName, CancellationToken cancellationToken = default) + public static Response GetDeviceRegistryAsset(this ResourceGroupResource resourceGroupResource, string assetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfile(assetEndpointProfileName, cancellationToken); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAsset(assetName, cancellationToken); } /// - /// Gets a collection of DeviceRegistryAssetResources in the ResourceGroupResource. + /// Gets a collection of DeviceRegistryAssetEndpointProfileResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeviceRegistryAssetResources and their operations over a DeviceRegistryAssetResource. - public static DeviceRegistryAssetCollection GetDeviceRegistryAssets(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of DeviceRegistryAssetEndpointProfileResources and their operations over a DeviceRegistryAssetEndpointProfileResource. + public static DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssets(); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfiles(); } /// - /// Get a Asset + /// Get a AssetEndpointProfile /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName} /// /// /// Operation Id - /// Assets_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Asset name parameter. + /// Asset Endpoint Profile name parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeviceRegistryAssetAsync(this ResourceGroupResource resourceGroupResource, string assetName, CancellationToken cancellationToken = default) + public static async Task> GetDeviceRegistryAssetEndpointProfileAsync(this ResourceGroupResource resourceGroupResource, string assetEndpointProfileName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetAsync(assetName, cancellationToken).ConfigureAwait(false); + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfileAsync(assetEndpointProfileName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Asset + /// Get a AssetEndpointProfile /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName} /// /// /// Operation Id - /// Assets_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Asset name parameter. + /// Asset Endpoint Profile name parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeviceRegistryAsset(this ResourceGroupResource resourceGroupResource, string assetName, CancellationToken cancellationToken = default) + public static Response GetDeviceRegistryAssetEndpointProfile(this ResourceGroupResource resourceGroupResource, string assetEndpointProfileName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAsset(assetName, cancellationToken); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryAssetEndpointProfile(assetEndpointProfileName, cancellationToken); } /// - /// List AssetEndpointProfile resources by subscription ID + /// Gets a collection of DeviceRegistryDiscoveredAssetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DeviceRegistryDiscoveredAssetResources and their operations over a DeviceRegistryDiscoveredAssetResource. + public static DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssets(); + } + + /// + /// Get a DiscoveredAsset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} /// /// /// Operation Id - /// AssetEndpointProfiles_ListBySubscription + /// DiscoveredAsset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// Discovered Asset name parameter. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeviceRegistryDiscoveredAssetAsync(this ResourceGroupResource resourceGroupResource, string discoveredAssetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetEndpointProfilesAsync(cancellationToken); + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); } /// - /// List AssetEndpointProfile resources by subscription ID + /// Get a DiscoveredAsset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} /// /// /// Operation Id - /// AssetEndpointProfiles_ListBySubscription + /// DiscoveredAsset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// Discovered Asset name parameter. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeviceRegistryAssetEndpointProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeviceRegistryDiscoveredAsset(this ResourceGroupResource resourceGroupResource, string discoveredAssetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetEndpointProfiles(cancellationToken); + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAsset(discoveredAssetName, cancellationToken); } /// - /// List Asset resources by subscription ID + /// Gets a collection of DeviceRegistryDiscoveredAssetEndpointProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DeviceRegistryDiscoveredAssetEndpointProfileResources and their operations over a DeviceRegistryDiscoveredAssetEndpointProfileResource. + public static DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + } + + /// + /// Get a DiscoveredAssetEndpointProfile /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} /// /// /// Operation Id - /// Assets_ListBySubscription + /// DiscoveredAssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// Discovered Asset Endpoint Profile name parameter. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeviceRegistryAssetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(this ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetsAsync(cancellationToken); + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); } /// - /// List Asset resources by subscription ID + /// Get a DiscoveredAssetEndpointProfile /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} /// /// /// Operation Id - /// Assets_ListBySubscription + /// DiscoveredAssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// Discovered Asset Endpoint Profile name parameter. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeviceRegistryAssets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeviceRegistryDiscoveredAssetEndpointProfile(this ResourceGroupResource resourceGroupResource, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistryDiscoveredAssetEndpointProfile(discoveredAssetEndpointProfileName, cancellationToken); + } + + /// + /// Gets a collection of DeviceRegistrySchemaRegistryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DeviceRegistrySchemaRegistryResources and their operations over a DeviceRegistrySchemaRegistryResource. + public static DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistries(); + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Schema registry name parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeviceRegistrySchemaRegistryAsync(this ResourceGroupResource resourceGroupResource, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistryAsync(schemaRegistryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Schema registry name parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeviceRegistrySchemaRegistry(this ResourceGroupResource resourceGroupResource, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDeviceRegistryResourceGroupResource(resourceGroupResource).GetDeviceRegistrySchemaRegistry(schemaRegistryName, cancellationToken); + } + + /// + /// Gets a collection of DeviceRegistryBillingContainerResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DeviceRegistryBillingContainerResources and their operations over a DeviceRegistryBillingContainerResource. + public static DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryBillingContainers(); + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the billing container. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeviceRegistryBillingContainerAsync(this SubscriptionResource subscriptionResource, string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryBillingContainerAsync(billingContainerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BillingContainer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} + /// + /// + /// Operation Id + /// BillingContainer_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the billing container. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeviceRegistryBillingContainer(this SubscriptionResource subscriptionResource, string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryBillingContainer(billingContainerName, cancellationToken); + } + + /// + /// List Asset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets + /// + /// + /// Operation Id + /// Asset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceRegistryAssetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetsAsync(cancellationToken); + } + + /// + /// List Asset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets + /// + /// + /// Operation Id + /// Asset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceRegistryAssets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssets(cancellationToken); } + + /// + /// List AssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// + /// + /// Operation Id + /// AssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetEndpointProfilesAsync(cancellationToken); + } + + /// + /// List AssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// + /// + /// Operation Id + /// AssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceRegistryAssetEndpointProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryAssetEndpointProfiles(cancellationToken); + } + + /// + /// List DiscoveredAsset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetsAsync(cancellationToken); + } + + /// + /// List DiscoveredAsset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceRegistryDiscoveredAssets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssets(cancellationToken); + } + + /// + /// List DiscoveredAssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(cancellationToken); + } + + /// + /// List DiscoveredAssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistryDiscoveredAssetEndpointProfiles(cancellationToken); + } + + /// + /// List SchemaRegistry resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistrySchemaRegistriesAsync(cancellationToken); + } + + /// + /// List SchemaRegistry resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeviceRegistrySchemaRegistries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDeviceRegistrySubscriptionResource(subscriptionResource).GetDeviceRegistrySchemaRegistries(cancellationToken); + } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs index bfc242f9c3fe..78af7c3296d6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryArmClient.cs @@ -34,6 +34,18 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistryAssetResource GetDeviceRegistryAssetResource(ResourceIdentifier id) + { + DeviceRegistryAssetResource.ValidateResourceId(id); + return new DeviceRegistryAssetResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -47,15 +59,75 @@ public virtual DeviceRegistryAssetEndpointProfileResource GetDeviceRegistryAsset } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeviceRegistryAssetResource GetDeviceRegistryAssetResource(ResourceIdentifier id) + /// Returns a object. + public virtual DeviceRegistryBillingContainerResource GetDeviceRegistryBillingContainerResource(ResourceIdentifier id) { - DeviceRegistryAssetResource.ValidateResourceId(id); - return new DeviceRegistryAssetResource(Client, id); + DeviceRegistryBillingContainerResource.ValidateResourceId(id); + return new DeviceRegistryBillingContainerResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistryDiscoveredAssetResource GetDeviceRegistryDiscoveredAssetResource(ResourceIdentifier id) + { + DeviceRegistryDiscoveredAssetResource.ValidateResourceId(id); + return new DeviceRegistryDiscoveredAssetResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistryDiscoveredAssetEndpointProfileResource GetDeviceRegistryDiscoveredAssetEndpointProfileResource(ResourceIdentifier id) + { + DeviceRegistryDiscoveredAssetEndpointProfileResource.ValidateResourceId(id); + return new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistrySchemaRegistryResource GetDeviceRegistrySchemaRegistryResource(ResourceIdentifier id) + { + DeviceRegistrySchemaRegistryResource.ValidateResourceId(id); + return new DeviceRegistrySchemaRegistryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistrySchemaResource GetDeviceRegistrySchemaResource(ResourceIdentifier id) + { + DeviceRegistrySchemaResource.ValidateResourceId(id); + return new DeviceRegistrySchemaResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceRegistrySchemaVersionResource GetDeviceRegistrySchemaVersionResource(ResourceIdentifier id) + { + DeviceRegistrySchemaVersionResource.ValidateResourceId(id); + return new DeviceRegistrySchemaVersionResource(Client, id); } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs index 8f882041830e..fb8d8c7fc9b4 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistryResourceGroupResource.cs @@ -33,6 +33,75 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of DeviceRegistryAssetResources in the ResourceGroupResource. + /// An object representing collection of DeviceRegistryAssetResources and their operations over a DeviceRegistryAssetResource. + public virtual DeviceRegistryAssetCollection GetDeviceRegistryAssets() + { + return GetCachedClient(client => new DeviceRegistryAssetCollection(client, Id)); + } + + /// + /// Get a Asset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// + /// + /// Operation Id + /// Asset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Asset name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistryAssetAsync(string assetName, CancellationToken cancellationToken = default) + { + return await GetDeviceRegistryAssets().GetAsync(assetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Asset + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// + /// + /// Operation Id + /// Asset_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Asset name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistryAsset(string assetName, CancellationToken cancellationToken = default) + { + return GetDeviceRegistryAssets().Get(assetName, cancellationToken); + } + /// Gets a collection of DeviceRegistryAssetEndpointProfileResources in the ResourceGroupResource. /// An object representing collection of DeviceRegistryAssetEndpointProfileResources and their operations over a DeviceRegistryAssetEndpointProfileResource. public virtual DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAssetEndpointProfiles() @@ -49,11 +118,11 @@ public virtual DeviceRegistryAssetEndpointProfileCollection GetDeviceRegistryAss /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -80,11 +149,11 @@ public virtual async Task> /// /// /// Operation Id - /// AssetEndpointProfiles_Get + /// AssetEndpointProfile_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -102,73 +171,211 @@ public virtual Response GetDeviceReg return GetDeviceRegistryAssetEndpointProfiles().Get(assetEndpointProfileName, cancellationToken); } - /// Gets a collection of DeviceRegistryAssetResources in the ResourceGroupResource. - /// An object representing collection of DeviceRegistryAssetResources and their operations over a DeviceRegistryAssetResource. - public virtual DeviceRegistryAssetCollection GetDeviceRegistryAssets() + /// Gets a collection of DeviceRegistryDiscoveredAssetResources in the ResourceGroupResource. + /// An object representing collection of DeviceRegistryDiscoveredAssetResources and their operations over a DeviceRegistryDiscoveredAssetResource. + public virtual DeviceRegistryDiscoveredAssetCollection GetDeviceRegistryDiscoveredAssets() { - return GetCachedClient(client => new DeviceRegistryAssetCollection(client, Id)); + return GetCachedClient(client => new DeviceRegistryDiscoveredAssetCollection(client, Id)); } /// - /// Get a Asset + /// Get a DiscoveredAsset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} /// /// /// Operation Id - /// Assets_Get + /// DiscoveredAsset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Asset name parameter. + /// Discovered Asset name parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeviceRegistryAssetAsync(string assetName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeviceRegistryDiscoveredAssetAsync(string discoveredAssetName, CancellationToken cancellationToken = default) { - return await GetDeviceRegistryAssets().GetAsync(assetName, cancellationToken).ConfigureAwait(false); + return await GetDeviceRegistryDiscoveredAssets().GetAsync(discoveredAssetName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Asset + /// Get a DiscoveredAsset /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName} /// /// /// Operation Id - /// Assets_Get + /// DiscoveredAsset_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Asset name parameter. + /// Discovered Asset name parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeviceRegistryAsset(string assetName, CancellationToken cancellationToken = default) + public virtual Response GetDeviceRegistryDiscoveredAsset(string discoveredAssetName, CancellationToken cancellationToken = default) { - return GetDeviceRegistryAssets().Get(assetName, cancellationToken); + return GetDeviceRegistryDiscoveredAssets().Get(discoveredAssetName, cancellationToken); + } + + /// Gets a collection of DeviceRegistryDiscoveredAssetEndpointProfileResources in the ResourceGroupResource. + /// An object representing collection of DeviceRegistryDiscoveredAssetEndpointProfileResources and their operations over a DeviceRegistryDiscoveredAssetEndpointProfileResource. + public virtual DeviceRegistryDiscoveredAssetEndpointProfileCollection GetDeviceRegistryDiscoveredAssetEndpointProfiles() + { + return GetCachedClient(client => new DeviceRegistryDiscoveredAssetEndpointProfileCollection(client, Id)); + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistryDiscoveredAssetEndpointProfileAsync(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + return await GetDeviceRegistryDiscoveredAssetEndpointProfiles().GetAsync(discoveredAssetEndpointProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DiscoveredAssetEndpointProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName} + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistryDiscoveredAssetEndpointProfile(string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + return GetDeviceRegistryDiscoveredAssetEndpointProfiles().Get(discoveredAssetEndpointProfileName, cancellationToken); + } + + /// Gets a collection of DeviceRegistrySchemaRegistryResources in the ResourceGroupResource. + /// An object representing collection of DeviceRegistrySchemaRegistryResources and their operations over a DeviceRegistrySchemaRegistryResource. + public virtual DeviceRegistrySchemaRegistryCollection GetDeviceRegistrySchemaRegistries() + { + return GetCachedClient(client => new DeviceRegistrySchemaRegistryCollection(client, Id)); + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistrySchemaRegistryAsync(string schemaRegistryName, CancellationToken cancellationToken = default) + { + return await GetDeviceRegistrySchemaRegistries().GetAsync(schemaRegistryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SchemaRegistry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName} + /// + /// + /// Operation Id + /// SchemaRegistry_Get + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Schema registry name parameter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistrySchemaRegistry(string schemaRegistryName, CancellationToken cancellationToken = default) + { + return GetDeviceRegistrySchemaRegistries().Get(schemaRegistryName, cancellationToken); } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs index e4f3fc6c74f3..5f97882a97f9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Extensions/MockableDeviceRegistrySubscriptionResource.cs @@ -5,7 +5,9 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; @@ -15,10 +17,16 @@ namespace Azure.ResourceManager.DeviceRegistry.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockableDeviceRegistrySubscriptionResource : ArmResource { - private ClientDiagnostics _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics; - private AssetEndpointProfilesRestOperations _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient; private ClientDiagnostics _deviceRegistryAssetAssetsClientDiagnostics; private AssetsRestOperations _deviceRegistryAssetAssetsRestClient; + private ClientDiagnostics _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics; + private AssetEndpointProfilesRestOperations _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient; + private ClientDiagnostics _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics; + private DiscoveredAssetsRestOperations _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient; + private ClientDiagnostics _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics; + private DiscoveredAssetEndpointProfilesRestOperations _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient; + private ClientDiagnostics _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics; + private SchemaRegistriesRestOperations _deviceRegistrySchemaRegistrySchemaRegistriesRestClient; /// Initializes a new instance of the class for mocking. protected MockableDeviceRegistrySubscriptionResource() @@ -32,10 +40,16 @@ internal MockableDeviceRegistrySubscriptionResource(ArmClient client, ResourceId { } - private ClientDiagnostics DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); - private AssetEndpointProfilesRestOperations DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient ??= new AssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryAssetEndpointProfileResource.ResourceType)); private ClientDiagnostics DeviceRegistryAssetAssetsClientDiagnostics => _deviceRegistryAssetAssetsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryAssetResource.ResourceType.Namespace, Diagnostics); private AssetsRestOperations DeviceRegistryAssetAssetsRestClient => _deviceRegistryAssetAssetsRestClient ??= new AssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryAssetResource.ResourceType)); + private ClientDiagnostics DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); + private AssetEndpointProfilesRestOperations DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient => _deviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient ??= new AssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryAssetEndpointProfileResource.ResourceType)); + private ClientDiagnostics DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics => _deviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetResource.ResourceType.Namespace, Diagnostics); + private DiscoveredAssetsRestOperations DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient => _deviceRegistryDiscoveredAssetDiscoveredAssetsRestClient ??= new DiscoveredAssetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryDiscoveredAssetResource.ResourceType)); + private ClientDiagnostics DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType.Namespace, Diagnostics); + private DiscoveredAssetEndpointProfilesRestOperations DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient => _deviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient ??= new DiscoveredAssetEndpointProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistryDiscoveredAssetEndpointProfileResource.ResourceType)); + private ClientDiagnostics DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics => _deviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DeviceRegistry", DeviceRegistrySchemaRegistryResource.ResourceType.Namespace, Diagnostics); + private SchemaRegistriesRestOperations DeviceRegistrySchemaRegistrySchemaRegistriesRestClient => _deviceRegistrySchemaRegistrySchemaRegistriesRestClient ??= new SchemaRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeviceRegistrySchemaRegistryResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -43,64 +57,73 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of DeviceRegistryBillingContainerResources in the SubscriptionResource. + /// An object representing collection of DeviceRegistryBillingContainerResources and their operations over a DeviceRegistryBillingContainerResource. + public virtual DeviceRegistryBillingContainerCollection GetDeviceRegistryBillingContainers() + { + return GetCachedClient(client => new DeviceRegistryBillingContainerCollection(client, Id)); + } + /// - /// List AssetEndpointProfile resources by subscription ID + /// Get a BillingContainer /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} /// /// /// Operation Id - /// AssetEndpointProfiles_ListBySubscription + /// BillingContainer_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// + /// Name of the billing container. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceRegistryBillingContainerAsync(string billingContainerName, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetEndpointProfileResource(Client, DeviceRegistryAssetEndpointProfileData.DeserializeDeviceRegistryAssetEndpointProfileData(e)), DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssetEndpointProfiles", "value", "nextLink", cancellationToken); + return await GetDeviceRegistryBillingContainers().GetAsync(billingContainerName, cancellationToken).ConfigureAwait(false); } /// - /// List AssetEndpointProfile resources by subscription ID + /// Get a BillingContainer /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName} /// /// /// Operation Id - /// AssetEndpointProfiles_ListBySubscription + /// BillingContainer_Get /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource - /// + /// /// /// /// + /// Name of the billing container. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDeviceRegistryAssetEndpointProfiles(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceRegistryBillingContainer(string billingContainerName, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetEndpointProfileResource(Client, DeviceRegistryAssetEndpointProfileData.DeserializeDeviceRegistryAssetEndpointProfileData(e)), DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssetEndpointProfiles", "value", "nextLink", cancellationToken); + return GetDeviceRegistryBillingContainers().Get(billingContainerName, cancellationToken); } /// @@ -112,11 +135,11 @@ public virtual Pageable GetDeviceReg /// /// /// Operation Id - /// Assets_ListBySubscription + /// Asset_ListBySubscription /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -142,11 +165,11 @@ public virtual AsyncPageable GetDeviceRegistryAsset /// /// /// Operation Id - /// Assets_ListBySubscription + /// Asset_ListBySubscription /// /// /// Default Api Version - /// 2023-11-01-preview + /// 2024-09-01-preview /// /// /// Resource @@ -162,5 +185,245 @@ public virtual Pageable GetDeviceRegistryAssets(Can HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetAssetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetResource(Client, DeviceRegistryAssetData.DeserializeDeviceRegistryAssetData(e)), DeviceRegistryAssetAssetsClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssets", "value", "nextLink", cancellationToken); } + + /// + /// List AssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// + /// + /// Operation Id + /// AssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeviceRegistryAssetEndpointProfilesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetEndpointProfileResource(Client, DeviceRegistryAssetEndpointProfileData.DeserializeDeviceRegistryAssetEndpointProfileData(e)), DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssetEndpointProfiles", "value", "nextLink", cancellationToken); + } + + /// + /// List AssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles + /// + /// + /// Operation Id + /// AssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeviceRegistryAssetEndpointProfiles(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryAssetEndpointProfileAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryAssetEndpointProfileResource(Client, DeviceRegistryAssetEndpointProfileData.DeserializeDeviceRegistryAssetEndpointProfileData(e)), DeviceRegistryAssetEndpointProfileAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryAssetEndpointProfiles", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAsset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeviceRegistryDiscoveredAssetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssets", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAsset resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets + /// + /// + /// Operation Id + /// DiscoveredAsset_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeviceRegistryDiscoveredAssets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetDiscoveredAssetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetResource(Client, DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(e)), DeviceRegistryDiscoveredAssetDiscoveredAssetsClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssets", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoveredAssetEndpointProfile resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles + /// + /// + /// Operation Id + /// DiscoveredAssetEndpointProfile_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeviceRegistryDiscoveredAssetEndpointProfiles(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistryDiscoveredAssetEndpointProfileResource(Client, DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(e)), DeviceRegistryDiscoveredAssetEndpointProfileDiscoveredAssetEndpointProfilesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistryDiscoveredAssetEndpointProfiles", "value", "nextLink", cancellationToken); + } + + /// + /// List SchemaRegistry resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDeviceRegistrySchemaRegistriesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistrySchemaRegistries", "value", "nextLink", cancellationToken); + } + + /// + /// List SchemaRegistry resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries + /// + /// + /// Operation Id + /// SchemaRegistry_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDeviceRegistrySchemaRegistries(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceRegistrySchemaRegistrySchemaRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceRegistrySchemaRegistryResource(Client, DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(e)), DeviceRegistrySchemaRegistrySchemaRegistriesClientDiagnostics, Pipeline, "MockableDeviceRegistrySubscriptionResource.GetDeviceRegistrySchemaRegistries", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs new file mode 100644 index 000000000000..54bb00650051 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetEndpointProfileOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class DeviceRegistryDiscoveredAssetEndpointProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeviceRegistryDiscoveredAssetEndpointProfileOperationSource(ArmClient client) + { + _client = client; + } + + DeviceRegistryDiscoveredAssetEndpointProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); + return new DeviceRegistryDiscoveredAssetEndpointProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); + return new DeviceRegistryDiscoveredAssetEndpointProfileResource(_client, data); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs new file mode 100644 index 000000000000..a739fa7c4dd1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistryDiscoveredAssetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class DeviceRegistryDiscoveredAssetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeviceRegistryDiscoveredAssetOperationSource(ArmClient client) + { + _client = client; + } + + DeviceRegistryDiscoveredAssetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); + return new DeviceRegistryDiscoveredAssetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); + return new DeviceRegistryDiscoveredAssetResource(_client, data); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs new file mode 100644 index 000000000000..360604a614b0 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/LongRunningOperation/DeviceRegistrySchemaRegistryOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal class DeviceRegistrySchemaRegistryOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeviceRegistrySchemaRegistryOperationSource(ArmClient client) + { + _client = client; + } + + DeviceRegistrySchemaRegistryResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); + return new DeviceRegistrySchemaRegistryResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); + return new DeviceRegistrySchemaRegistryResource(_client, data); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileListResult.Serialization.cs index e9e4c098bdee..57a4ca4d3797 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileListResult.Serialization.cs @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(NextLink)) + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.Serialization.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.Serialization.cs index f7cc67a41871..4c4a5636720e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class AssetStatus : IUtf8JsonSerializable, IJsonModel + internal partial class AssetEndpointProfileStatus : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,13 +28,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetStatus)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AssetEndpointProfileStatus)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Errors)) + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) { writer.WritePropertyName("errors"u8); writer.WriteStartArray(); @@ -44,11 +44,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteNumberValue(Version.Value); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssetStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AssetEndpointProfileStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetStatus)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AssetEndpointProfileStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssetStatus(document.RootElement, options); + return DeserializeAssetEndpointProfileStatus(document.RootElement, options); } - internal static AssetStatus DeserializeAssetStatus(JsonElement element, ModelReaderWriterOptions options = null) + internal static AssetEndpointProfileStatus DeserializeAssetEndpointProfileStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,8 +81,7 @@ internal static AssetStatus DeserializeAssetStatus(JsonElement element, ModelRea { return null; } - IReadOnlyList errors = default; - int? version = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,61 +92,52 @@ internal static AssetStatus DeserializeAssetStatus(JsonElement element, ModelRea { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AssetStatusError.DeserializeAssetStatusError(item, options)); + array.Add(AssetEndpointProfileStatusError.DeserializeAssetEndpointProfileStatusError(item, options)); } errors = array; continue; } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt32(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AssetStatus(errors ?? new ChangeTrackingList(), version, serializedAdditionalRawData); + return new AssetEndpointProfileStatus(errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssetStatus)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AssetEndpointProfileStatus)} does not support writing '{options.Format}' format."); } } - AssetStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AssetEndpointProfileStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssetStatus(document.RootElement, options); + return DeserializeAssetEndpointProfileStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssetStatus)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AssetEndpointProfileStatus)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.cs similarity index 65% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.cs index 406221579567..73b4bf3ecc8d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatus.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatus.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - /// Defines the asset status properties. - public partial class AssetStatus + /// Defines the asset endpoint profile status properties. + internal partial class AssetEndpointProfileStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ public partial class AssetStatus /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AssetStatus() + /// Initializes a new instance of . + internal AssetEndpointProfileStatus() { - Errors = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Array object to transfer and persist errors that originate from the Edge. - /// A read only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (Edge) state of the Asset. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. /// Keeps track of any properties unknown to the library. - internal AssetStatus(IReadOnlyList errors, int? version, IDictionary serializedAdditionalRawData) + internal AssetEndpointProfileStatus(IReadOnlyList errors, IDictionary serializedAdditionalRawData) { Errors = errors; - Version = version; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Array object to transfer and persist errors that originate from the Edge. - public IReadOnlyList Errors { get; } - /// A read only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (Edge) state of the Asset. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. - public int? Version { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs new file mode 100644 index 000000000000..1b398c9f0a09 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs +namespace Azure.ResourceManager.Compute.Models +{ + public partial class ComputeGalleryPlatformAttribute : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class AssetEndpointProfileStatusError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeGalleryPlatformAttribute)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetEndpointProfileStatusError)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteNumberValue(Code.Value); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + ComputeGalleryPlatformAttribute IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeGalleryPlatformAttribute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeGalleryPlatformAttribute(document.RootElement, options); + } + + internal static ComputeGalleryPlatformAttribute DeserializeComputeGalleryPlatformAttribute(JsonElement element, ModelReaderWriterOptions options = null) +======== + AssetEndpointProfileStatusError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetEndpointProfileStatusError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetEndpointProfileStatusError(document.RootElement, options); + } + + internal static AssetEndpointProfileStatusError DeserializeAssetEndpointProfileStatusError(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + string name = default; + string value = default; +======== + int? code = default; + string message = default; +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); +======== + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + return new ComputeGalleryPlatformAttribute(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new AssetEndpointProfileStatusError(code, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + throw new FormatException($"The model {nameof(ComputeGalleryPlatformAttribute)} does not support writing '{options.Format}' format."); + } + } + + ComputeGalleryPlatformAttribute IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(AssetEndpointProfileStatusError)} does not support writing '{options.Format}' format."); + } + } + + AssetEndpointProfileStatusError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeGalleryPlatformAttribute.Serialization.cs + return DeserializeComputeGalleryPlatformAttribute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeGalleryPlatformAttribute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeAssetEndpointProfileStatusError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetEndpointProfileStatusError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.Serialization.cs + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.cs new file mode 100644 index 000000000000..361e9a256c37 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileStatusError.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the asset endpoint profile status error properties. + public partial class AssetEndpointProfileStatusError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssetEndpointProfileStatusError() + { + } + + /// Initializes a new instance of . + /// Error code for classification of errors (ex: 400, 404, 500, etc.). + /// Human readable helpful error message to provide additional context for error (ex: “targetAddress 'foo' is not a valid url”). + /// Keeps track of any properties unknown to the library. + internal AssetEndpointProfileStatusError(int? code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Error code for classification of errors (ex: 400, 404, 500, etc.). + public int? Code { get; } + /// Human readable helpful error message to provide additional context for error (ex: “targetAddress 'foo' is not a valid url”). + public string Message { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..1439930dd4b7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class AssetEndpointProfileUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetEndpointProfileUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetAddress)) + { + writer.WritePropertyName("targetAddress"u8); + writer.WriteStringValue(TargetAddress.AbsoluteUri); + } + if (Optional.IsDefined(EndpointProfileType)) + { + writer.WritePropertyName("endpointProfileType"u8); + writer.WriteStringValue(EndpointProfileType); + } + if (Optional.IsDefined(Authentication)) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (Optional.IsDefined(AdditionalConfiguration)) + { + writer.WritePropertyName("additionalConfiguration"u8); + writer.WriteStringValue(AdditionalConfiguration); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssetEndpointProfileUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetEndpointProfileUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetEndpointProfileUpdateProperties(document.RootElement, options); + } + + internal static AssetEndpointProfileUpdateProperties DeserializeAssetEndpointProfileUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri targetAddress = default; + string endpointProfileType = default; + DeviceRegistryAuthentication authentication = default; + string additionalConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetAddress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetAddress = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointProfileType"u8)) + { + endpointProfileType = property.Value.GetString(); + continue; + } + if (property.NameEquals("authentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = DeviceRegistryAuthentication.DeserializeDeviceRegistryAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("additionalConfiguration"u8)) + { + additionalConfiguration = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetEndpointProfileUpdateProperties(targetAddress, endpointProfileType, authentication, additionalConfiguration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetEndpointProfileUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AssetEndpointProfileUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssetEndpointProfileUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetEndpointProfileUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.cs new file mode 100644 index 000000000000..90504fc6d069 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEndpointProfileUpdateProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The updatable properties of the AssetEndpointProfile. + public partial class AssetEndpointProfileUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssetEndpointProfileUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Defines the client authentication mechanism to the server. + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// Keeps track of any properties unknown to the library. + internal AssetEndpointProfileUpdateProperties(Uri targetAddress, string endpointProfileType, DeviceRegistryAuthentication authentication, string additionalConfiguration, IDictionary serializedAdditionalRawData) + { + TargetAddress = targetAddress; + EndpointProfileType = endpointProfileType; + Authentication = authentication; + AdditionalConfiguration = additionalConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + public Uri TargetAddress { get; set; } + /// Defines the configuration for the connector type that is being used with the endpoint profile. + public string EndpointProfileType { get; set; } + /// Defines the client authentication mechanism to the server. + public DeviceRegistryAuthentication Authentication { get; set; } + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + public string AdditionalConfiguration { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetListResult.Serialization.cs index 422f4d0eabcb..4f6383435b96 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetListResult.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetListResult.Serialization.cs @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(NextLink)) + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.Serialization.cs new file mode 100644 index 000000000000..36963554776d --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.Serialization.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class AssetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Uuid)) + { + writer.WritePropertyName("uuid"u8); + writer.WriteStringValue(Uuid); + } + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(ExternalAssetId)) + { + writer.WritePropertyName("externalAssetId"u8); + writer.WriteStringValue(ExternalAssetId); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("assetEndpointProfileRef"u8); + writer.WriteStringValue(AssetEndpointProfileRef); + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.Value); + } + if (Optional.IsDefined(Manufacturer)) + { + writer.WritePropertyName("manufacturer"u8); + writer.WriteStringValue(Manufacturer); + } + if (Optional.IsDefined(ManufacturerUri)) + { + writer.WritePropertyName("manufacturerUri"u8); + writer.WriteStringValue(ManufacturerUri.AbsoluteUri); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(HardwareRevision)) + { + writer.WritePropertyName("hardwareRevision"u8); + writer.WriteStringValue(HardwareRevision); + } + if (Optional.IsDefined(SoftwareRevision)) + { + writer.WritePropertyName("softwareRevision"u8); + writer.WriteStringValue(SoftwareRevision); + } + if (Optional.IsDefined(DocumentationUri)) + { + writer.WritePropertyName("documentationUri"u8); + writer.WriteStringValue(DocumentationUri.AbsoluteUri); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartObject(); + foreach (var item in Attributes) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(DiscoveredAssetRefs)) + { + writer.WritePropertyName("discoveredAssetRefs"u8); + writer.WriteStartArray(); + foreach (var item in DiscoveredAssetRefs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultDatasetsConfiguration)) + { + writer.WritePropertyName("defaultDatasetsConfiguration"u8); + writer.WriteStringValue(DefaultDatasetsConfiguration); + } + if (Optional.IsDefined(DefaultEventsConfiguration)) + { + writer.WritePropertyName("defaultEventsConfiguration"u8); + writer.WriteStringValue(DefaultEventsConfiguration); + } + if (Optional.IsDefined(DefaultTopic)) + { + writer.WritePropertyName("defaultTopic"u8); + writer.WriteObjectValue(DefaultTopic, options); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"u8); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetProperties(document.RootElement, options); + } + + internal static AssetProperties DeserializeAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uuid = default; + bool? enabled = default; + string externalAssetId = default; + string displayName = default; + string description = default; + string assetEndpointProfileRef = default; + long? version = default; + string manufacturer = default; + Uri manufacturerUri = default; + string model = default; + string productCode = default; + string hardwareRevision = default; + string softwareRevision = default; + Uri documentationUri = default; + string serialNumber = default; + IDictionary attributes = default; + IList discoveredAssetRefs = default; + string defaultDatasetsConfiguration = default; + string defaultEventsConfiguration = default; + DeviceRegistryTopic defaultTopic = default; + IList datasets = default; + IList events = default; + DeviceRegistryAssetStatus status = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("externalAssetId"u8)) + { + externalAssetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("assetEndpointProfileRef"u8)) + { + assetEndpointProfileRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("manufacturer"u8)) + { + manufacturer = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturerUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manufacturerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareRevision"u8)) + { + hardwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareRevision"u8)) + { + softwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + documentationUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + attributes = dictionary; + continue; + } + if (property.NameEquals("discoveredAssetRefs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + discoveredAssetRefs = array; + continue; + } + if (property.NameEquals("defaultDatasetsConfiguration"u8)) + { + defaultDatasetsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultEventsConfiguration"u8)) + { + defaultEventsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultTopic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryDataset.DeserializeDeviceRegistryDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("events"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryEvent.DeserializeDeviceRegistryEvent(item, options)); + } + events = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = DeviceRegistryAssetStatus.DeserializeDeviceRegistryAssetStatus(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetProperties( + uuid, + enabled, + externalAssetId, + displayName, + description, + assetEndpointProfileRef, + version, + manufacturer, + manufacturerUri, + model, + productCode, + hardwareRevision, + softwareRevision, + documentationUri, + serialNumber, + attributes ?? new ChangeTrackingDictionary(), + discoveredAssetRefs ?? new ChangeTrackingList(), + defaultDatasetsConfiguration, + defaultEventsConfiguration, + defaultTopic, + datasets ?? new ChangeTrackingList(), + events ?? new ChangeTrackingList(), + status, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetProperties)} does not support writing '{options.Format}' format."); + } + } + + AssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.cs new file mode 100644 index 000000000000..669a5651b199 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetProperties.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the asset properties. + public partial class AssetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + /// is null. + public AssetProperties(string assetEndpointProfileRef) + { + Argument.AssertNotNull(assetEndpointProfileRef, nameof(assetEndpointProfileRef)); + + AssetEndpointProfileRef = assetEndpointProfileRef; + Attributes = new ChangeTrackingDictionary(); + DiscoveredAssetRefs = new ChangeTrackingList(); + Datasets = new ChangeTrackingList(); + Events = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Enabled/Disabled status of the asset. + /// Asset id provided by the customer. + /// Human-readable display name. + /// Human-readable description of the asset. + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + /// An integer that is incremented each time the resource is modified. + /// Asset manufacturer name. + /// Asset manufacturer URI. + /// Asset model name. + /// Asset product code. + /// Revision number of the hardware. + /// Revision number of the software. + /// Reference to the documentation. + /// Asset serial number. + /// A set of key-value pairs that contain custom attributes set by the customer. + /// Reference to a list of discovered assets. Populated only if the asset has been created from discovery flow. Discovered asset names must be provided. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. + /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal AssetProperties(string uuid, bool? isEnabled, string externalAssetId, string displayName, string description, string assetEndpointProfileRef, long? version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, IDictionary attributes, IList discoveredAssetRefs, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, DeviceRegistryAssetStatus status, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Uuid = uuid; + IsEnabled = isEnabled; + ExternalAssetId = externalAssetId; + DisplayName = displayName; + Description = description; + AssetEndpointProfileRef = assetEndpointProfileRef; + Version = version; + Manufacturer = manufacturer; + ManufacturerUri = manufacturerUri; + Model = model; + ProductCode = productCode; + HardwareRevision = hardwareRevision; + SoftwareRevision = softwareRevision; + DocumentationUri = documentationUri; + SerialNumber = serialNumber; + Attributes = attributes; + DiscoveredAssetRefs = discoveredAssetRefs; + DefaultDatasetsConfiguration = defaultDatasetsConfiguration; + DefaultEventsConfiguration = defaultEventsConfiguration; + DefaultTopic = defaultTopic; + Datasets = datasets; + Events = events; + Status = status; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssetProperties() + { + } + + /// Globally unique, immutable, non-reusable id. + public string Uuid { get; } + /// Enabled/Disabled status of the asset. + public bool? IsEnabled { get; set; } + /// Asset id provided by the customer. + public string ExternalAssetId { get; set; } + /// Human-readable display name. + public string DisplayName { get; set; } + /// Human-readable description of the asset. + public string Description { get; set; } + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + public string AssetEndpointProfileRef { get; set; } + /// An integer that is incremented each time the resource is modified. + public long? Version { get; } + /// Asset manufacturer name. + public string Manufacturer { get; set; } + /// Asset manufacturer URI. + public Uri ManufacturerUri { get; set; } + /// Asset model name. + public string Model { get; set; } + /// Asset product code. + public string ProductCode { get; set; } + /// Revision number of the hardware. + public string HardwareRevision { get; set; } + /// Revision number of the software. + public string SoftwareRevision { get; set; } + /// Reference to the documentation. + public Uri DocumentationUri { get; set; } + /// Asset serial number. + public string SerialNumber { get; set; } + /// + /// A set of key-value pairs that contain custom attributes set by the customer. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Attributes { get; } + /// Reference to a list of discovered assets. Populated only if the asset has been created from discovery flow. Discovered asset names must be provided. + public IList DiscoveredAssetRefs { get; } + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + public string DefaultDatasetsConfiguration { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + public string DefaultEventsConfiguration { get; set; } + /// Object that describes the default topic information for the asset. + public DeviceRegistryTopic DefaultTopic { get; set; } + /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + public IList Datasets { get; } + /// Array of events that are part of the asset. Each event can have per-event configuration. + public IList Events { get; } + /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. + public DeviceRegistryAssetStatus Status { get; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..6f0e454b4f42 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.Serialization.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class AssetUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Manufacturer)) + { + writer.WritePropertyName("manufacturer"u8); + writer.WriteStringValue(Manufacturer); + } + if (Optional.IsDefined(ManufacturerUri)) + { + writer.WritePropertyName("manufacturerUri"u8); + writer.WriteStringValue(ManufacturerUri.AbsoluteUri); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(HardwareRevision)) + { + writer.WritePropertyName("hardwareRevision"u8); + writer.WriteStringValue(HardwareRevision); + } + if (Optional.IsDefined(SoftwareRevision)) + { + writer.WritePropertyName("softwareRevision"u8); + writer.WriteStringValue(SoftwareRevision); + } + if (Optional.IsDefined(DocumentationUri)) + { + writer.WritePropertyName("documentationUri"u8); + writer.WriteStringValue(DocumentationUri.AbsoluteUri); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartObject(); + foreach (var item in Attributes) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(DefaultDatasetsConfiguration)) + { + writer.WritePropertyName("defaultDatasetsConfiguration"u8); + writer.WriteStringValue(DefaultDatasetsConfiguration); + } + if (Optional.IsDefined(DefaultEventsConfiguration)) + { + writer.WritePropertyName("defaultEventsConfiguration"u8); + writer.WriteStringValue(DefaultEventsConfiguration); + } + if (Optional.IsDefined(DefaultTopic)) + { + writer.WritePropertyName("defaultTopic"u8); + writer.WriteObjectValue(DefaultTopic, options); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"u8); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssetUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetUpdateProperties(document.RootElement, options); + } + + internal static AssetUpdateProperties DeserializeAssetUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + string displayName = default; + string description = default; + string manufacturer = default; + Uri manufacturerUri = default; + string model = default; + string productCode = default; + string hardwareRevision = default; + string softwareRevision = default; + Uri documentationUri = default; + string serialNumber = default; + IDictionary attributes = default; + string defaultDatasetsConfiguration = default; + string defaultEventsConfiguration = default; + DeviceRegistryTopic defaultTopic = default; + IList datasets = default; + IList events = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturer"u8)) + { + manufacturer = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturerUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manufacturerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareRevision"u8)) + { + hardwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareRevision"u8)) + { + softwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + documentationUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + attributes = dictionary; + continue; + } + if (property.NameEquals("defaultDatasetsConfiguration"u8)) + { + defaultDatasetsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultEventsConfiguration"u8)) + { + defaultEventsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultTopic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryDataset.DeserializeDeviceRegistryDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("events"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryEvent.DeserializeDeviceRegistryEvent(item, options)); + } + events = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetUpdateProperties( + enabled, + displayName, + description, + manufacturer, + manufacturerUri, + model, + productCode, + hardwareRevision, + softwareRevision, + documentationUri, + serialNumber, + attributes ?? new ChangeTrackingDictionary(), + defaultDatasetsConfiguration, + defaultEventsConfiguration, + defaultTopic, + datasets ?? new ChangeTrackingList(), + events ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AssetUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssetUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.cs new file mode 100644 index 000000000000..7decd6bf9e4d --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetUpdateProperties.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The updatable properties of the Asset. + public partial class AssetUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssetUpdateProperties() + { + Attributes = new ChangeTrackingDictionary(); + Datasets = new ChangeTrackingList(); + Events = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Enabled/Disabled status of the asset. + /// Human-readable display name. + /// Human-readable description of the asset. + /// Asset manufacturer name. + /// Asset manufacturer URI. + /// Asset model name. + /// Asset product code. + /// Revision number of the hardware. + /// Revision number of the software. + /// Reference to the documentation. + /// Asset serial number. + /// A set of key-value pairs that contain custom attributes set by the customer. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. + /// Keeps track of any properties unknown to the library. + internal AssetUpdateProperties(bool? isEnabled, string displayName, string description, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, IDictionary attributes, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + DisplayName = displayName; + Description = description; + Manufacturer = manufacturer; + ManufacturerUri = manufacturerUri; + Model = model; + ProductCode = productCode; + HardwareRevision = hardwareRevision; + SoftwareRevision = softwareRevision; + DocumentationUri = documentationUri; + SerialNumber = serialNumber; + Attributes = attributes; + DefaultDatasetsConfiguration = defaultDatasetsConfiguration; + DefaultEventsConfiguration = defaultEventsConfiguration; + DefaultTopic = defaultTopic; + Datasets = datasets; + Events = events; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enabled/Disabled status of the asset. + public bool? IsEnabled { get; set; } + /// Human-readable display name. + public string DisplayName { get; set; } + /// Human-readable description of the asset. + public string Description { get; set; } + /// Asset manufacturer name. + public string Manufacturer { get; set; } + /// Asset manufacturer URI. + public Uri ManufacturerUri { get; set; } + /// Asset model name. + public string Model { get; set; } + /// Asset product code. + public string ProductCode { get; set; } + /// Revision number of the hardware. + public string HardwareRevision { get; set; } + /// Revision number of the software. + public string SoftwareRevision { get; set; } + /// Reference to the documentation. + public Uri DocumentationUri { get; set; } + /// Asset serial number. + public string SerialNumber { get; set; } + /// + /// A set of key-value pairs that contain custom attributes set by the customer. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Attributes { get; } + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + public string DefaultDatasetsConfiguration { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + public string DefaultEventsConfiguration { get; set; } + /// Object that describes the default topic information for the asset. + public DeviceRegistryTopic DefaultTopic { get; set; } + /// Array of datasets that are part of the asset. Each dataset describes the data points that make up the set. + public IList Datasets { get; } + /// Array of events that are part of the asset. Each event can have per-event configuration. + public IList Events { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AuthenticationMethod.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AuthenticationMethod.cs new file mode 100644 index 000000000000..510d66a6e78a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AuthenticationMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The method to authenticate the user of the client at the server. + public readonly partial struct AuthenticationMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthenticationMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AnonymousValue = "Anonymous"; + private const string CertificateValue = "Certificate"; + private const string UsernamePasswordValue = "UsernamePassword"; + + /// The user authentication method is anonymous. + public static AuthenticationMethod Anonymous { get; } = new AuthenticationMethod(AnonymousValue); + /// The user authentication method is an x509 certificate. + public static AuthenticationMethod Certificate { get; } = new AuthenticationMethod(CertificateValue); + /// The user authentication method is a username and password. + public static AuthenticationMethod UsernamePassword { get; } = new AuthenticationMethod(UsernamePasswordValue); + /// Determines if two values are the same. + public static bool operator ==(AuthenticationMethod left, AuthenticationMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthenticationMethod left, AuthenticationMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AuthenticationMethod(string value) => new AuthenticationMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthenticationMethod other && Equals(other); + /// + public bool Equals(AuthenticationMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.Serialization.cs new file mode 100644 index 000000000000..68308896cc1b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class BillingContainerListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingContainerListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BillingContainerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingContainerListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBillingContainerListResult(document.RootElement, options); + } + + internal static BillingContainerListResult DeserializeBillingContainerListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryBillingContainerData.DeserializeDeviceRegistryBillingContainerData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BillingContainerListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BillingContainerListResult)} does not support writing '{options.Format}' format."); + } + } + + BillingContainerListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBillingContainerListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BillingContainerListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.cs new file mode 100644 index 000000000000..2743f53f25e0 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The response of a BillingContainer list operation. + internal partial class BillingContainerListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BillingContainer items on this page. + /// is null. + internal BillingContainerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BillingContainer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BillingContainerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BillingContainerListResult() + { + } + + /// The BillingContainer items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.Serialization.cs new file mode 100644 index 000000000000..6b2389fd396f --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class BillingContainerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingContainerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BillingContainerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingContainerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBillingContainerProperties(document.RootElement, options); + } + + internal static BillingContainerProperties DeserializeBillingContainerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BillingContainerProperties(provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BillingContainerProperties)} does not support writing '{options.Format}' format."); + } + } + + BillingContainerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBillingContainerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BillingContainerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.cs similarity index 66% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.cs index fd94448bc61f..65c77d98627d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/BillingContainerProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - /// The x509 certificate for authentication mode Certificate. - internal partial class X509CredentialsUpdate + /// Defines the billingContainer properties. + internal partial class BillingContainerProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ internal partial class X509CredentialsUpdate /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public X509CredentialsUpdate() + /// Initializes a new instance of . + internal BillingContainerProperties() { } - /// Initializes a new instance of . - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + /// Initializes a new instance of . + /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal X509CredentialsUpdate(string certificateReference, IDictionary serializedAdditionalRawData) + internal BillingContainerProperties(DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { - CertificateReference = certificateReference; + ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). - public string CertificateReference { get; set; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointObservabilityMode.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointObservabilityMode.cs new file mode 100644 index 000000000000..cc083a56a6c9 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointObservabilityMode.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the data point observability mode. + public readonly partial struct DataPointObservabilityMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataPointObservabilityMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string CounterValue = "Counter"; + private const string GaugeValue = "Gauge"; + private const string HistogramValue = "Histogram"; + private const string LogValue = "Log"; + + /// No mapping to OpenTelemetry. + public static DataPointObservabilityMode None { get; } = new DataPointObservabilityMode(NoneValue); + /// Map as counter to OpenTelemetry. + public static DataPointObservabilityMode Counter { get; } = new DataPointObservabilityMode(CounterValue); + /// Map as gauge to OpenTelemetry. + public static DataPointObservabilityMode Gauge { get; } = new DataPointObservabilityMode(GaugeValue); + /// Map as histogram to OpenTelemetry. + public static DataPointObservabilityMode Histogram { get; } = new DataPointObservabilityMode(HistogramValue); + /// Map as log to OpenTelemetry. + public static DataPointObservabilityMode Log { get; } = new DataPointObservabilityMode(LogValue); + /// Determines if two values are the same. + public static bool operator ==(DataPointObservabilityMode left, DataPointObservabilityMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataPointObservabilityMode left, DataPointObservabilityMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataPointObservabilityMode(string value) => new DataPointObservabilityMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataPointObservabilityMode other && Equals(other); + /// + public bool Equals(DataPointObservabilityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointsObservabilityMode.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointsObservabilityMode.cs deleted file mode 100644 index d270b2a15267..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPointsObservabilityMode.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// An indication of how the data point should be mapped to OpenTelemetry. - public readonly partial struct DataPointsObservabilityMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataPointsObservabilityMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string CounterValue = "counter"; - private const string GaugeValue = "gauge"; - private const string HistogramValue = "histogram"; - private const string LogValue = "log"; - - /// No mapping to OpenTelemetry. - public static DataPointsObservabilityMode None { get; } = new DataPointsObservabilityMode(NoneValue); - /// Map as counter to OpenTelemetry. - public static DataPointsObservabilityMode Counter { get; } = new DataPointsObservabilityMode(CounterValue); - /// Map as gauge to OpenTelemetry. - public static DataPointsObservabilityMode Gauge { get; } = new DataPointsObservabilityMode(GaugeValue); - /// Map as histogram to OpenTelemetry. - public static DataPointsObservabilityMode Histogram { get; } = new DataPointsObservabilityMode(HistogramValue); - /// Map as log to OpenTelemetry. - public static DataPointsObservabilityMode Log { get; } = new DataPointsObservabilityMode(LogValue); - /// Determines if two values are the same. - public static bool operator ==(DataPointsObservabilityMode left, DataPointsObservabilityMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataPointsObservabilityMode left, DataPointsObservabilityMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DataPointsObservabilityMode(string value) => new DataPointsObservabilityMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataPointsObservabilityMode other && Equals(other); - /// - public bool Equals(DataPointsObservabilityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.Serialization.cs index 03429cf9ff29..3539d91da4a8 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.Serialization.cs @@ -45,29 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(TargetAddress)) - { - writer.WritePropertyName("targetAddress"u8); - writer.WriteStringValue(TargetAddress.AbsoluteUri); - } - if (Optional.IsDefined(UserAuthentication)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("userAuthentication"u8); - writer.WriteObjectValue(UserAuthentication, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(TransportAuthentication)) - { - writer.WritePropertyName("transportAuthentication"u8); - writer.WriteObjectValue(TransportAuthentication, options); - } - if (Optional.IsDefined(AdditionalConfiguration)) - { - writer.WritePropertyName("additionalConfiguration"u8); - writer.WriteStringValue(AdditionalConfiguration); - } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -106,10 +88,7 @@ internal static DeviceRegistryAssetEndpointProfilePatch DeserializeDeviceRegistr return null; } IDictionary tags = default; - Uri targetAddress = default; - UserAuthenticationUpdate userAuthentication = default; - TransportAuthenticationUpdate transportAuthentication = default; - string additionalConfiguration = default; + AssetEndpointProfileUpdateProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -132,44 +111,9 @@ internal static DeviceRegistryAssetEndpointProfilePatch DeserializeDeviceRegistr { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("targetAddress"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - targetAddress = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("userAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - userAuthentication = UserAuthenticationUpdate.DeserializeUserAuthenticationUpdate(property0.Value, options); - continue; - } - if (property0.NameEquals("transportAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - transportAuthentication = TransportAuthenticationUpdate.DeserializeTransportAuthenticationUpdate(property0.Value, options); - continue; - } - if (property0.NameEquals("additionalConfiguration"u8)) - { - additionalConfiguration = property0.Value.GetString(); - continue; - } - } + properties = AssetEndpointProfileUpdateProperties.DeserializeAssetEndpointProfileUpdateProperties(property.Value, options); continue; } if (options.Format != "W") @@ -178,13 +122,7 @@ internal static DeviceRegistryAssetEndpointProfilePatch DeserializeDeviceRegistr } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryAssetEndpointProfilePatch( - tags ?? new ChangeTrackingDictionary(), - targetAddress, - userAuthentication, - transportAuthentication, - additionalConfiguration, - serializedAdditionalRawData); + return new DeviceRegistryAssetEndpointProfilePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.cs index d3c9cc57db1c..40fd9d1161dd 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfilePatch.cs @@ -53,41 +53,18 @@ public DeviceRegistryAssetEndpointProfilePatch() /// Initializes a new instance of . /// Resource tags. - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - /// Defines the client authentication mechanism to the server. - /// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device. - /// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryAssetEndpointProfilePatch(IDictionary tags, Uri targetAddress, UserAuthenticationUpdate userAuthentication, TransportAuthenticationUpdate transportAuthentication, string additionalConfiguration, IDictionary serializedAdditionalRawData) + internal DeviceRegistryAssetEndpointProfilePatch(IDictionary tags, AssetEndpointProfileUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; - TargetAddress = targetAddress; - UserAuthentication = userAuthentication; - TransportAuthentication = transportAuthentication; - AdditionalConfiguration = additionalConfiguration; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } - /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. - public Uri TargetAddress { get; set; } - /// Defines the client authentication mechanism to the server. - public UserAuthenticationUpdate UserAuthentication { get; set; } - /// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device. - internal TransportAuthenticationUpdate TransportAuthentication { get; set; } - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - public IList TransportAuthenticationOwnCertificates - { - get - { - if (TransportAuthentication is null) - TransportAuthentication = new TransportAuthenticationUpdate(); - return TransportAuthentication.OwnCertificates; - } - } - - /// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - public string AdditionalConfiguration { get; set; } + /// The resource-specific properties for this resource. + public AssetEndpointProfileUpdateProperties Properties { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.Serialization.cs new file mode 100644 index 000000000000..22a2c8b816ea --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryAssetEndpointProfileProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetEndpointProfileProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Uuid)) + { + writer.WritePropertyName("uuid"u8); + writer.WriteStringValue(Uuid); + } + writer.WritePropertyName("targetAddress"u8); + writer.WriteStringValue(TargetAddress.AbsoluteUri); + writer.WritePropertyName("endpointProfileType"u8); + writer.WriteStringValue(EndpointProfileType); + if (Optional.IsDefined(Authentication)) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (Optional.IsDefined(AdditionalConfiguration)) + { + writer.WritePropertyName("additionalConfiguration"u8); + writer.WriteStringValue(AdditionalConfiguration); + } + if (Optional.IsDefined(DiscoveredAssetEndpointProfileRef)) + { + writer.WritePropertyName("discoveredAssetEndpointProfileRef"u8); + writer.WriteStringValue(DiscoveredAssetEndpointProfileRef); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryAssetEndpointProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetEndpointProfileProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryAssetEndpointProfileProperties(document.RootElement, options); + } + + internal static DeviceRegistryAssetEndpointProfileProperties DeserializeDeviceRegistryAssetEndpointProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uuid = default; + Uri targetAddress = default; + string endpointProfileType = default; + DeviceRegistryAuthentication authentication = default; + string additionalConfiguration = default; + string discoveredAssetEndpointProfileRef = default; + AssetEndpointProfileStatus status = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAddress"u8)) + { + targetAddress = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointProfileType"u8)) + { + endpointProfileType = property.Value.GetString(); + continue; + } + if (property.NameEquals("authentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = DeviceRegistryAuthentication.DeserializeDeviceRegistryAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("additionalConfiguration"u8)) + { + additionalConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveredAssetEndpointProfileRef"u8)) + { + discoveredAssetEndpointProfileRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = AssetEndpointProfileStatus.DeserializeAssetEndpointProfileStatus(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryAssetEndpointProfileProperties( + uuid, + targetAddress, + endpointProfileType, + authentication, + additionalConfiguration, + discoveredAssetEndpointProfileRef, + status, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetEndpointProfileProperties)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryAssetEndpointProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryAssetEndpointProfileProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetEndpointProfileProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.cs new file mode 100644 index 000000000000..95c368849b4b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetEndpointProfileProperties.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the Asset Endpoint Profile properties. + public partial class DeviceRegistryAssetEndpointProfileProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// or is null. + public DeviceRegistryAssetEndpointProfileProperties(Uri targetAddress, string endpointProfileType) + { + Argument.AssertNotNull(targetAddress, nameof(targetAddress)); + Argument.AssertNotNull(endpointProfileType, nameof(endpointProfileType)); + + TargetAddress = targetAddress; + EndpointProfileType = endpointProfileType; + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Defines the client authentication mechanism to the server. + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// Reference to a discovered asset endpoint profile. Populated only if the asset endpoint profile has been created from discovery flow. Discovered asset endpoint profile name must be provided. + /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryAssetEndpointProfileProperties(string uuid, Uri targetAddress, string endpointProfileType, DeviceRegistryAuthentication authentication, string additionalConfiguration, string discoveredAssetEndpointProfileRef, AssetEndpointProfileStatus status, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Uuid = uuid; + TargetAddress = targetAddress; + EndpointProfileType = endpointProfileType; + Authentication = authentication; + AdditionalConfiguration = additionalConfiguration; + DiscoveredAssetEndpointProfileRef = discoveredAssetEndpointProfileRef; + Status = status; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryAssetEndpointProfileProperties() + { + } + + /// Globally unique, immutable, non-reusable id. + public string Uuid { get; } + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + public Uri TargetAddress { get; set; } + /// Defines the configuration for the connector type that is being used with the endpoint profile. + public string EndpointProfileType { get; set; } + /// Defines the client authentication mechanism to the server. + public DeviceRegistryAuthentication Authentication { get; set; } + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + public string AdditionalConfiguration { get; set; } + /// Reference to a discovered asset endpoint profile. Populated only if the asset endpoint profile has been created from discovery flow. Discovered asset endpoint profile name must be provided. + public string DiscoveredAssetEndpointProfileRef { get; set; } + /// Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources. + internal AssetEndpointProfileStatus Status { get; } + /// Array object to transfer and persist errors that originate from the Edge. + public IReadOnlyList StatusErrors + { + get => Status?.Errors; + } + + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.Serialization.cs index 1ad488271362..d443863ebcf6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.Serialization.cs @@ -45,122 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AssetType)) - { - writer.WritePropertyName("assetType"u8); - writer.WriteStringValue(AssetType); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(Manufacturer)) - { - writer.WritePropertyName("manufacturer"u8); - writer.WriteStringValue(Manufacturer); - } - if (Optional.IsDefined(ManufacturerUri)) - { - writer.WritePropertyName("manufacturerUri"u8); - writer.WriteStringValue(ManufacturerUri.AbsoluteUri); - } - if (Optional.IsDefined(Model)) - { - writer.WritePropertyName("model"u8); - writer.WriteStringValue(Model); - } - if (Optional.IsDefined(ProductCode)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("productCode"u8); - writer.WriteStringValue(ProductCode); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsDefined(HardwareRevision)) - { - writer.WritePropertyName("hardwareRevision"u8); - writer.WriteStringValue(HardwareRevision); - } - if (Optional.IsDefined(SoftwareRevision)) - { - writer.WritePropertyName("softwareRevision"u8); - writer.WriteStringValue(SoftwareRevision); - } - if (Optional.IsDefined(DocumentationUri)) - { - writer.WritePropertyName("documentationUri"u8); - writer.WriteStringValue(DocumentationUri.AbsoluteUri); - } - if (Optional.IsDefined(SerialNumber)) - { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); - } - if (Optional.IsCollectionDefined(Attributes)) - { - writer.WritePropertyName("attributes"u8); - writer.WriteStartObject(); - foreach (var item in Attributes) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(DefaultDataPointsConfiguration)) - { - writer.WritePropertyName("defaultDataPointsConfiguration"u8); - writer.WriteStringValue(DefaultDataPointsConfiguration); - } - if (Optional.IsDefined(DefaultEventsConfiguration)) - { - writer.WritePropertyName("defaultEventsConfiguration"u8); - writer.WriteStringValue(DefaultEventsConfiguration); - } - if (Optional.IsCollectionDefined(DataPoints)) - { - writer.WritePropertyName("dataPoints"u8); - writer.WriteStartArray(); - foreach (var item in DataPoints) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Events)) - { - writer.WritePropertyName("events"u8); - writer.WriteStartArray(); - foreach (var item in Events) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -199,23 +88,7 @@ internal static DeviceRegistryAssetPatch DeserializeDeviceRegistryAssetPatch(Jso return null; } IDictionary tags = default; - string assetType = default; - bool? enabled = default; - string displayName = default; - string description = default; - string manufacturer = default; - Uri manufacturerUri = default; - string model = default; - string productCode = default; - string hardwareRevision = default; - string softwareRevision = default; - Uri documentationUri = default; - string serialNumber = default; - IDictionary attributes = default; - string defaultDataPointsConfiguration = default; - string defaultEventsConfiguration = default; - IList dataPoints = default; - IList events = default; + AssetUpdateProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -238,143 +111,9 @@ internal static DeviceRegistryAssetPatch DeserializeDeviceRegistryAssetPatch(Jso { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("assetType"u8)) - { - assetType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("manufacturer"u8)) - { - manufacturer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("manufacturerUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - manufacturerUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("model"u8)) - { - model = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("productCode"u8)) - { - productCode = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hardwareRevision"u8)) - { - hardwareRevision = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("softwareRevision"u8)) - { - softwareRevision = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("documentationUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - documentationUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("serialNumber"u8)) - { - serialNumber = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("attributes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property1.Name, null); - } - else - { - dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); - } - } - attributes = dictionary; - continue; - } - if (property0.NameEquals("defaultDataPointsConfiguration"u8)) - { - defaultDataPointsConfiguration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("defaultEventsConfiguration"u8)) - { - defaultEventsConfiguration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dataPoints"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DataPoint.DeserializeDataPoint(item, options)); - } - dataPoints = array; - continue; - } - if (property0.NameEquals("events"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AssetEvent.DeserializeAssetEvent(item, options)); - } - events = array; - continue; - } - } + properties = AssetUpdateProperties.DeserializeAssetUpdateProperties(property.Value, options); continue; } if (options.Format != "W") @@ -383,26 +122,7 @@ internal static DeviceRegistryAssetPatch DeserializeDeviceRegistryAssetPatch(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new DeviceRegistryAssetPatch( - tags ?? new ChangeTrackingDictionary(), - assetType, - enabled, - displayName, - description, - manufacturer, - manufacturerUri, - model, - productCode, - hardwareRevision, - softwareRevision, - documentationUri, - serialNumber, - attributes ?? new ChangeTrackingDictionary(), - defaultDataPointsConfiguration, - defaultEventsConfiguration, - dataPoints ?? new ChangeTrackingList(), - events ?? new ChangeTrackingList(), - serializedAdditionalRawData); + return new DeviceRegistryAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.cs index f7415ffe242d..9dd9551f120d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetPatch.cs @@ -49,118 +49,22 @@ public partial class DeviceRegistryAssetPatch public DeviceRegistryAssetPatch() { Tags = new ChangeTrackingDictionary(); - Attributes = new ChangeTrackingDictionary(); - DataPoints = new ChangeTrackingList(); - Events = new ChangeTrackingList(); } /// Initializes a new instance of . /// Resource tags. - /// Resource path to asset type (model) definition. - /// Enabled/Disabled status of the asset. - /// Human-readable display name. - /// Human-readable description of the asset. - /// Asset manufacturer name. - /// Asset manufacturer URI. - /// Asset model name. - /// Asset product code. - /// Revision number of the hardware. - /// Revision number of the software. - /// Reference to the documentation. - /// Asset serial number. - /// A set of key-value pairs that contain custom attributes set by the customer. - /// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - /// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element. - /// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal DeviceRegistryAssetPatch(IDictionary tags, string assetType, bool? enabled, string displayName, string description, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, IDictionary attributes, string defaultDataPointsConfiguration, string defaultEventsConfiguration, IList dataPoints, IList events, IDictionary serializedAdditionalRawData) + internal DeviceRegistryAssetPatch(IDictionary tags, AssetUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; - AssetType = assetType; - Enabled = enabled; - DisplayName = displayName; - Description = description; - Manufacturer = manufacturer; - ManufacturerUri = manufacturerUri; - Model = model; - ProductCode = productCode; - HardwareRevision = hardwareRevision; - SoftwareRevision = softwareRevision; - DocumentationUri = documentationUri; - SerialNumber = serialNumber; - Attributes = attributes; - DefaultDataPointsConfiguration = defaultDataPointsConfiguration; - DefaultEventsConfiguration = defaultEventsConfiguration; - DataPoints = dataPoints; - Events = events; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } - /// Resource path to asset type (model) definition. - public string AssetType { get; set; } - /// Enabled/Disabled status of the asset. - public bool? Enabled { get; set; } - /// Human-readable display name. - public string DisplayName { get; set; } - /// Human-readable description of the asset. - public string Description { get; set; } - /// Asset manufacturer name. - public string Manufacturer { get; set; } - /// Asset manufacturer URI. - public Uri ManufacturerUri { get; set; } - /// Asset model name. - public string Model { get; set; } - /// Asset product code. - public string ProductCode { get; set; } - /// Revision number of the hardware. - public string HardwareRevision { get; set; } - /// Revision number of the software. - public string SoftwareRevision { get; set; } - /// Reference to the documentation. - public Uri DocumentationUri { get; set; } - /// Asset serial number. - public string SerialNumber { get; set; } - /// - /// A set of key-value pairs that contain custom attributes set by the customer. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary Attributes { get; } - /// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - public string DefaultDataPointsConfiguration { get; set; } - /// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol. - public string DefaultEventsConfiguration { get; set; } - /// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element. - public IList DataPoints { get; } - /// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element. - public IList Events { get; } + /// The resource-specific properties for this resource. + public AssetUpdateProperties Properties { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.Serialization.cs new file mode 100644 index 000000000000..73042cc2f4a8 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryAssetStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"u8); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryAssetStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryAssetStatus(document.RootElement, options); + } + + internal static DeviceRegistryAssetStatus DeserializeDeviceRegistryAssetStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList errors = default; + long? version = default; + IReadOnlyList datasets = default; + IReadOnlyList events = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryAssetStatusError.DeserializeDeviceRegistryAssetStatusError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryAssetStatusDataset.DeserializeDeviceRegistryAssetStatusDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("events"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryAssetStatusEvent.DeserializeDeviceRegistryAssetStatusEvent(item, options)); + } + events = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryAssetStatus(errors ?? new ChangeTrackingList(), version, datasets ?? new ChangeTrackingList(), events ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatus)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryAssetStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryAssetStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.cs new file mode 100644 index 000000000000..608492bab244 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatus.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the asset status properties. + public partial class DeviceRegistryAssetStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DeviceRegistryAssetStatus() + { + Errors = new ChangeTrackingList(); + Datasets = new ChangeTrackingList(); + Events = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Array object to transfer and persist errors that originate from the Edge. + /// A read only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (Edge) state of the Asset. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. + /// Array of dataset statuses that describe the status of each dataset. + /// Array of event statuses that describe the status of each event. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryAssetStatus(IReadOnlyList errors, long? version, IReadOnlyList datasets, IReadOnlyList events, IDictionary serializedAdditionalRawData) + { + Errors = errors; + Version = version; + Datasets = datasets; + Events = events; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array object to transfer and persist errors that originate from the Edge. + public IReadOnlyList Errors { get; } + /// A read only incremental counter indicating the number of times the configuration has been modified from the perspective of the current actual (Edge) state of the Asset. Edge would be the only writer of this value and would sync back up to the cloud. In steady state, this should equal version. + public long? Version { get; } + /// Array of dataset statuses that describe the status of each dataset. + public IReadOnlyList Datasets { get; } + /// Array of event statuses that describe the status of each event. + public IReadOnlyList Events { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.Serialization.cs new file mode 100644 index 000000000000..f166f84c1bd3 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryAssetStatusDataset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusDataset)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(MessageSchemaReference)) + { + writer.WritePropertyName("messageSchemaReference"u8); + writer.WriteObjectValue(MessageSchemaReference, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryAssetStatusDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusDataset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryAssetStatusDataset(document.RootElement, options); + } + + internal static DeviceRegistryAssetStatusDataset DeserializeDeviceRegistryAssetStatusDataset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + MessageSchemaReference messageSchemaReference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageSchemaReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + messageSchemaReference = MessageSchemaReference.DeserializeMessageSchemaReference(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryAssetStatusDataset(name, messageSchemaReference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusDataset)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryAssetStatusDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryAssetStatusDataset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusDataset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.cs new file mode 100644 index 000000000000..42bfbbab746a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusDataset.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the asset status dataset properties. + public partial class DeviceRegistryAssetStatusDataset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. + internal DeviceRegistryAssetStatusDataset(string name) + { + Name = name; + } + + /// Initializes a new instance of . + /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. + /// The message schema reference object. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryAssetStatusDataset(string name, MessageSchemaReference messageSchemaReference, IDictionary serializedAdditionalRawData) + { + Name = name; + MessageSchemaReference = messageSchemaReference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryAssetStatusDataset() + { + } + + /// The name of the dataset. Must be unique within the status.datasets array. This name is used to correlate between the spec and status dataset information. + public string Name { get; } + /// The message schema reference object. + public MessageSchemaReference MessageSchemaReference { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.Serialization.cs similarity index 63% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.Serialization.cs index 82334ac285a5..e401b4462af6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class AssetStatusError : IUtf8JsonSerializable, IJsonModel + public partial class DeviceRegistryAssetStatusError : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,18 +28,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetStatusError)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusError)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Code)) + if (options.Format != "W" && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); writer.WriteNumberValue(Code.Value); } - if (Optional.IsDefined(Message)) + if (options.Format != "W" && Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssetStatusError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeviceRegistryAssetStatusError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetStatusError)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusError)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssetStatusError(document.RootElement, options); + return DeserializeDeviceRegistryAssetStatusError(document.RootElement, options); } - internal static AssetStatusError DeserializeAssetStatusError(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeviceRegistryAssetStatusError DeserializeDeviceRegistryAssetStatusError(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,38 +107,38 @@ internal static AssetStatusError DeserializeAssetStatusError(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new AssetStatusError(code, message, serializedAdditionalRawData); + return new DeviceRegistryAssetStatusError(code, message, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssetStatusError)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusError)} does not support writing '{options.Format}' format."); } } - AssetStatusError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeviceRegistryAssetStatusError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssetStatusError(document.RootElement, options); + return DeserializeDeviceRegistryAssetStatusError(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssetStatusError)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusError)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.cs similarity index 84% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.cs index a48a66b15fd3..762686e57b9d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetStatusError.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusError.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the asset status error properties. - public partial class AssetStatusError + public partial class DeviceRegistryAssetStatusError { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class AssetStatusError /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AssetStatusError() + /// Initializes a new instance of . + internal DeviceRegistryAssetStatusError() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Error code for classification of errors (ex: 400, 404, 500, etc.). /// Human readable helpful error message to provide additional context for error (ex: “capability Id 'foo' does not exist”). /// Keeps track of any properties unknown to the library. - internal AssetStatusError(int? code, string message, IDictionary serializedAdditionalRawData) + internal DeviceRegistryAssetStatusError(int? code, string message, IDictionary serializedAdditionalRawData) { Code = code; Message = message; diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.Serialization.cs new file mode 100644 index 000000000000..24e34f7bac09 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryAssetStatusEvent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusEvent)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(MessageSchemaReference)) + { + writer.WritePropertyName("messageSchemaReference"u8); + writer.WriteObjectValue(MessageSchemaReference, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryAssetStatusEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusEvent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryAssetStatusEvent(document.RootElement, options); + } + + internal static DeviceRegistryAssetStatusEvent DeserializeDeviceRegistryAssetStatusEvent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + MessageSchemaReference messageSchemaReference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageSchemaReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + messageSchemaReference = MessageSchemaReference.DeserializeMessageSchemaReference(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryAssetStatusEvent(name, messageSchemaReference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusEvent)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryAssetStatusEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryAssetStatusEvent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryAssetStatusEvent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.cs new file mode 100644 index 000000000000..d754e315ae13 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAssetStatusEvent.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the asset status event properties. + public partial class DeviceRegistryAssetStatusEvent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. + internal DeviceRegistryAssetStatusEvent(string name) + { + Name = name; + } + + /// Initializes a new instance of . + /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. + /// The message schema reference object. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryAssetStatusEvent(string name, MessageSchemaReference messageSchemaReference, IDictionary serializedAdditionalRawData) + { + Name = name; + MessageSchemaReference = messageSchemaReference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryAssetStatusEvent() + { + } + + /// The name of the event. Must be unique within the status.events array. This name is used to correlate between the spec and status event information. + public string Name { get; } + /// The message schema reference object. + public MessageSchemaReference MessageSchemaReference { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.Serialization.cs similarity index 59% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.Serialization.cs index 59706b3bce9a..4e3ea3fb2f8b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class UserAuthentication : IUtf8JsonSerializable, IJsonModel + public partial class DeviceRegistryAuthentication : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UserAuthentication)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAuthentication)} does not support writing '{format}' format."); } - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.ToString()); + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); if (Optional.IsDefined(UsernamePasswordCredentials)) { writer.WritePropertyName("usernamePasswordCredentials"u8); @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeviceRegistryAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UserAuthentication)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAuthentication)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUserAuthentication(document.RootElement, options); + return DeserializeDeviceRegistryAuthentication(document.RootElement, options); } - internal static UserAuthentication DeserializeUserAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeviceRegistryAuthentication DeserializeDeviceRegistryAuthentication(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,16 +83,16 @@ internal static UserAuthentication DeserializeUserAuthentication(JsonElement ele { return null; } - UserAuthenticationMode mode = default; - UsernamePasswordCredentials usernamePasswordCredentials = default; - X509Credentials x509Credentials = default; + AuthenticationMethod method = default; + DeviceRegistryUsernamePasswordCredentials usernamePasswordCredentials = default; + DeviceRegistryX509Credentials x509Credentials = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("mode"u8)) + if (property.NameEquals("method"u8)) { - mode = new UserAuthenticationMode(property.Value.GetString()); + method = new AuthenticationMethod(property.Value.GetString()); continue; } if (property.NameEquals("usernamePasswordCredentials"u8)) @@ -101,7 +101,7 @@ internal static UserAuthentication DeserializeUserAuthentication(JsonElement ele { continue; } - usernamePasswordCredentials = UsernamePasswordCredentials.DeserializeUsernamePasswordCredentials(property.Value, options); + usernamePasswordCredentials = DeviceRegistryUsernamePasswordCredentials.DeserializeDeviceRegistryUsernamePasswordCredentials(property.Value, options); continue; } if (property.NameEquals("x509Credentials"u8)) @@ -110,7 +110,7 @@ internal static UserAuthentication DeserializeUserAuthentication(JsonElement ele { continue; } - x509Credentials = X509Credentials.DeserializeX509Credentials(property.Value, options); + x509Credentials = DeviceRegistryX509Credentials.DeserializeDeviceRegistryX509Credentials(property.Value, options); continue; } if (options.Format != "W") @@ -119,38 +119,38 @@ internal static UserAuthentication DeserializeUserAuthentication(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new UserAuthentication(mode, usernamePasswordCredentials, x509Credentials, serializedAdditionalRawData); + return new DeviceRegistryAuthentication(method, usernamePasswordCredentials, x509Credentials, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UserAuthentication)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAuthentication)} does not support writing '{options.Format}' format."); } } - UserAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeviceRegistryAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUserAuthentication(document.RootElement, options); + return DeserializeDeviceRegistryAuthentication(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UserAuthentication)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryAuthentication)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.cs index 9cbf420d03b1..6b25a5db924d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthentication.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryAuthentication.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Definition of the client authentication mechanism to the server. - public partial class UserAuthentication + public partial class DeviceRegistryAuthentication { /// /// Keeps track of any properties unknown to the library. @@ -45,42 +45,42 @@ public partial class UserAuthentication /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Defines the mode to authenticate the user of the client at the server. - public UserAuthentication(UserAuthenticationMode mode) + /// Initializes a new instance of . + /// Defines the method to authenticate the user of the client at the server. + public DeviceRegistryAuthentication(AuthenticationMethod method) { - Mode = mode; + Method = method; } - /// Initializes a new instance of . - /// Defines the mode to authenticate the user of the client at the server. + /// Initializes a new instance of . + /// Defines the method to authenticate the user of the client at the server. /// Defines the username and password references when UsernamePassword user authentication mode is selected. /// Defines the certificate reference when Certificate user authentication mode is selected. /// Keeps track of any properties unknown to the library. - internal UserAuthentication(UserAuthenticationMode mode, UsernamePasswordCredentials usernamePasswordCredentials, X509Credentials x509Credentials, IDictionary serializedAdditionalRawData) + internal DeviceRegistryAuthentication(AuthenticationMethod method, DeviceRegistryUsernamePasswordCredentials usernamePasswordCredentials, DeviceRegistryX509Credentials x509Credentials, IDictionary serializedAdditionalRawData) { - Mode = mode; + Method = method; UsernamePasswordCredentials = usernamePasswordCredentials; X509Credentials = x509Credentials; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal UserAuthentication() + /// Initializes a new instance of for deserialization. + internal DeviceRegistryAuthentication() { } - /// Defines the mode to authenticate the user of the client at the server. - public UserAuthenticationMode Mode { get; set; } + /// Defines the method to authenticate the user of the client at the server. + public AuthenticationMethod Method { get; set; } /// Defines the username and password references when UsernamePassword user authentication mode is selected. - public UsernamePasswordCredentials UsernamePasswordCredentials { get; set; } + public DeviceRegistryUsernamePasswordCredentials UsernamePasswordCredentials { get; set; } /// Defines the certificate reference when Certificate user authentication mode is selected. - internal X509Credentials X509Credentials { get; set; } - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). - public string X509CredentialsCertificateReference + internal DeviceRegistryX509Credentials X509Credentials { get; set; } + /// The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + public string X509CredentialsCertificateSecretName { - get => X509Credentials is null ? default : X509Credentials.CertificateReference; - set => X509Credentials = new X509Credentials(value); + get => X509Credentials is null ? default : X509Credentials.CertificateSecretName; + set => X509Credentials = new DeviceRegistryX509Credentials(value); } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.Serialization.cs new file mode 100644 index 000000000000..93050bc20c88 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryDataPoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDataPoint)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ObservabilityMode)) + { + writer.WritePropertyName("observabilityMode"u8); + writer.WriteStringValue(ObservabilityMode.Value.ToString()); + } + } + + DeviceRegistryDataPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDataPoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDataPoint(document.RootElement, options); + } + + internal static DeviceRegistryDataPoint DeserializeDeviceRegistryDataPoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataPointObservabilityMode? observabilityMode = default; + string name = default; + string dataSource = default; + string dataPointConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("observabilityMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observabilityMode = new DataPointObservabilityMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSource"u8)) + { + dataSource = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataPointConfiguration"u8)) + { + dataPointConfiguration = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDataPoint(name, dataSource, dataPointConfiguration, serializedAdditionalRawData, observabilityMode); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDataPoint)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDataPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDataPoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDataPoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.cs new file mode 100644 index 000000000000..c335db22bd36 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPoint.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the data point properties. + public partial class DeviceRegistryDataPoint : DeviceRegistryDataPointBase + { + /// Initializes a new instance of . + /// The name of the data point. + /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + /// or is null. + public DeviceRegistryDataPoint(string name, string dataSource) : base(name, dataSource) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(dataSource, nameof(dataSource)); + } + + /// Initializes a new instance of . + /// The name of the data point. + /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Keeps track of any properties unknown to the library. + /// An indication of how the data point should be mapped to OpenTelemetry. + internal DeviceRegistryDataPoint(string name, string dataSource, string dataPointConfiguration, IDictionary serializedAdditionalRawData, DataPointObservabilityMode? observabilityMode) : base(name, dataSource, dataPointConfiguration, serializedAdditionalRawData) + { + ObservabilityMode = observabilityMode; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDataPoint() + { + } + + /// An indication of how the data point should be mapped to OpenTelemetry. + public DataPointObservabilityMode? ObservabilityMode { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.Serialization.cs similarity index 58% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.Serialization.cs index bdc7c7adca26..93e0fbc197d9 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class UsernamePasswordCredentials : IUtf8JsonSerializable, IJsonModel + public partial class DeviceRegistryDataPointBase : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UsernamePasswordCredentials)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryDataPointBase)} does not support writing '{format}' format."); } - writer.WritePropertyName("usernameReference"u8); - writer.WriteStringValue(UsernameReference); - writer.WritePropertyName("passwordReference"u8); - writer.WriteStringValue(PasswordReference); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("dataSource"u8); + writer.WriteStringValue(DataSource); + if (Optional.IsDefined(DataPointConfiguration)) + { + writer.WritePropertyName("dataPointConfiguration"u8); + writer.WriteStringValue(DataPointConfiguration); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -55,19 +60,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UsernamePasswordCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeviceRegistryDataPointBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UsernamePasswordCredentials)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryDataPointBase)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUsernamePasswordCredentials(document.RootElement, options); + return DeserializeDeviceRegistryDataPointBase(document.RootElement, options); } - internal static UsernamePasswordCredentials DeserializeUsernamePasswordCredentials(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeviceRegistryDataPointBase DeserializeDeviceRegistryDataPointBase(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -75,20 +80,26 @@ internal static UsernamePasswordCredentials DeserializeUsernamePasswordCredentia { return null; } - string usernameReference = default; - string passwordReference = default; + string name = default; + string dataSource = default; + string dataPointConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("usernameReference"u8)) + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSource"u8)) { - usernameReference = property.Value.GetString(); + dataSource = property.Value.GetString(); continue; } - if (property.NameEquals("passwordReference"u8)) + if (property.NameEquals("dataPointConfiguration"u8)) { - passwordReference = property.Value.GetString(); + dataPointConfiguration = property.Value.GetString(); continue; } if (options.Format != "W") @@ -97,38 +108,38 @@ internal static UsernamePasswordCredentials DeserializeUsernamePasswordCredentia } } serializedAdditionalRawData = rawDataDictionary; - return new UsernamePasswordCredentials(usernameReference, passwordReference, serializedAdditionalRawData); + return new DeviceRegistryDataPointBase(name, dataSource, dataPointConfiguration, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UsernamePasswordCredentials)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryDataPointBase)} does not support writing '{options.Format}' format."); } } - UsernamePasswordCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeviceRegistryDataPointBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUsernamePasswordCredentials(document.RootElement, options); + return DeserializeDeviceRegistryDataPointBase(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UsernamePasswordCredentials)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeviceRegistryDataPointBase)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.cs new file mode 100644 index 000000000000..dfe2d2c25a09 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataPointBase.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the data point properties. + public partial class DeviceRegistryDataPointBase + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the data point. + /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + /// or is null. + public DeviceRegistryDataPointBase(string name, string dataSource) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(dataSource, nameof(dataSource)); + + Name = name; + DataSource = dataSource; + } + + /// Initializes a new instance of . + /// The name of the data point. + /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDataPointBase(string name, string dataSource, string dataPointConfiguration, IDictionary serializedAdditionalRawData) + { + Name = name; + DataSource = dataSource; + DataPointConfiguration = dataPointConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDataPointBase() + { + } + + /// The name of the data point. + public string Name { get; set; } + /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. + public string DataSource { get; set; } + /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + public string DataPointConfiguration { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.Serialization.cs new file mode 100644 index 000000000000..2dcc2f66b07b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryDataset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDataset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(DatasetConfiguration)) + { + writer.WritePropertyName("datasetConfiguration"u8); + writer.WriteStringValue(DatasetConfiguration); + } + if (Optional.IsDefined(Topic)) + { + writer.WritePropertyName("topic"u8); + writer.WriteObjectValue(Topic, options); + } + if (Optional.IsCollectionDefined(DataPoints)) + { + writer.WritePropertyName("dataPoints"u8); + writer.WriteStartArray(); + foreach (var item in DataPoints) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDataset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDataset(document.RootElement, options); + } + + internal static DeviceRegistryDataset DeserializeDeviceRegistryDataset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string datasetConfiguration = default; + DeviceRegistryTopic topic = default; + IList dataPoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("datasetConfiguration"u8)) + { + datasetConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("topic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("dataPoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryDataPoint.DeserializeDeviceRegistryDataPoint(item, options)); + } + dataPoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDataset(name, datasetConfiguration, topic, dataPoints ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDataset)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDataset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDataset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.cs new file mode 100644 index 000000000000..ed281d44ee3b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDataset.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the dataset properties. + public partial class DeviceRegistryDataset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the dataset. + /// is null. + public DeviceRegistryDataset(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + DataPoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the dataset. + /// Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. + /// Object that describes the topic information for the specific dataset. + /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDataset(string name, string datasetConfiguration, DeviceRegistryTopic topic, IList dataPoints, IDictionary serializedAdditionalRawData) + { + Name = name; + DatasetConfiguration = datasetConfiguration; + Topic = topic; + DataPoints = dataPoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDataset() + { + } + + /// Name of the dataset. + public string Name { get; set; } + /// Stringified JSON that contains connector-specific JSON string that describes configuration for the specific dataset. + public string DatasetConfiguration { get; set; } + /// Object that describes the topic information for the specific dataset. + public DeviceRegistryTopic Topic { get; set; } + /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. + public IList DataPoints { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs new file mode 100644 index 000000000000..c88f921b4fab --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryDiscoveredAssetEndpointProfilePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(document.RootElement, options); + } + + internal static DeviceRegistryDiscoveredAssetEndpointProfilePatch DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DiscoveredAssetEndpointProfileUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DiscoveredAssetEndpointProfileUpdateProperties.DeserializeDiscoveredAssetEndpointProfileUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDiscoveredAssetEndpointProfilePatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDiscoveredAssetEndpointProfilePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDiscoveredAssetEndpointProfilePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetEndpointProfilePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs similarity index 58% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs index b7e68aa108e3..453a08d4ba5d 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthenticationUpdate.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetEndpointProfilePatch.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - /// Definition of the authentication mechanism for the southbound connector. - internal partial class TransportAuthenticationUpdate + /// The type used for update operations of the DiscoveredAssetEndpointProfile. + public partial class DeviceRegistryDiscoveredAssetEndpointProfilePatch { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,26 @@ internal partial class TransportAuthenticationUpdate /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public TransportAuthenticationUpdate() + /// Initializes a new instance of . + public DeviceRegistryDiscoveredAssetEndpointProfilePatch() { - OwnCertificates = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal TransportAuthenticationUpdate(IList ownCertificates, IDictionary serializedAdditionalRawData) + internal DeviceRegistryDiscoveredAssetEndpointProfilePatch(IDictionary tags, DiscoveredAssetEndpointProfileUpdateProperties properties, IDictionary serializedAdditionalRawData) { - OwnCertificates = ownCertificates; + Tags = tags; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - public IList OwnCertificates { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public DiscoveredAssetEndpointProfileUpdateProperties Properties { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs new file mode 100644 index 000000000000..a1dd38d62e10 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryDiscoveredAssetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryDiscoveredAssetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDiscoveredAssetPatch(document.RootElement, options); + } + + internal static DeviceRegistryDiscoveredAssetPatch DeserializeDeviceRegistryDiscoveredAssetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DiscoveredAssetUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DiscoveredAssetUpdateProperties.DeserializeDiscoveredAssetUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDiscoveredAssetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDiscoveredAssetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDiscoveredAssetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs new file mode 100644 index 000000000000..08c89ec146f6 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The type used for update operations of the DiscoveredAsset. + public partial class DeviceRegistryDiscoveredAssetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRegistryDiscoveredAssetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDiscoveredAssetPatch(IDictionary tags, DiscoveredAssetUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public DiscoveredAssetUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs new file mode 100644 index 000000000000..d2fdb98730af --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.Serialization.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryDiscoveredAssetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("assetEndpointProfileRef"u8); + writer.WriteStringValue(AssetEndpointProfileRef); + writer.WritePropertyName("discoveryId"u8); + writer.WriteStringValue(DiscoveryId); + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version); + if (Optional.IsDefined(Manufacturer)) + { + writer.WritePropertyName("manufacturer"u8); + writer.WriteStringValue(Manufacturer); + } + if (Optional.IsDefined(ManufacturerUri)) + { + writer.WritePropertyName("manufacturerUri"u8); + writer.WriteStringValue(ManufacturerUri.AbsoluteUri); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(HardwareRevision)) + { + writer.WritePropertyName("hardwareRevision"u8); + writer.WriteStringValue(HardwareRevision); + } + if (Optional.IsDefined(SoftwareRevision)) + { + writer.WritePropertyName("softwareRevision"u8); + writer.WriteStringValue(SoftwareRevision); + } + if (Optional.IsDefined(DocumentationUri)) + { + writer.WritePropertyName("documentationUri"u8); + writer.WriteStringValue(DocumentationUri.AbsoluteUri); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (Optional.IsDefined(DefaultDatasetsConfiguration)) + { + writer.WritePropertyName("defaultDatasetsConfiguration"u8); + writer.WriteStringValue(DefaultDatasetsConfiguration); + } + if (Optional.IsDefined(DefaultEventsConfiguration)) + { + writer.WritePropertyName("defaultEventsConfiguration"u8); + writer.WriteStringValue(DefaultEventsConfiguration); + } + if (Optional.IsDefined(DefaultTopic)) + { + writer.WritePropertyName("defaultTopic"u8); + writer.WriteObjectValue(DefaultTopic, options); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"u8); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryDiscoveredAssetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryDiscoveredAssetProperties(document.RootElement, options); + } + + internal static DeviceRegistryDiscoveredAssetProperties DeserializeDeviceRegistryDiscoveredAssetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string assetEndpointProfileRef = default; + string discoveryId = default; + long version = default; + string manufacturer = default; + Uri manufacturerUri = default; + string model = default; + string productCode = default; + string hardwareRevision = default; + string softwareRevision = default; + Uri documentationUri = default; + string serialNumber = default; + string defaultDatasetsConfiguration = default; + string defaultEventsConfiguration = default; + DeviceRegistryTopic defaultTopic = default; + IList datasets = default; + IList events = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assetEndpointProfileRef"u8)) + { + assetEndpointProfileRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveryId"u8)) + { + discoveryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("manufacturer"u8)) + { + manufacturer = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturerUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manufacturerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareRevision"u8)) + { + hardwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareRevision"u8)) + { + softwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + documentationUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultDatasetsConfiguration"u8)) + { + defaultDatasetsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultEventsConfiguration"u8)) + { + defaultEventsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultTopic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoveredDataset.DeserializeDiscoveredDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("events"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoveredEvent.DeserializeDiscoveredEvent(item, options)); + } + events = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryDiscoveredAssetProperties( + assetEndpointProfileRef, + discoveryId, + version, + manufacturer, + manufacturerUri, + model, + productCode, + hardwareRevision, + softwareRevision, + documentationUri, + serialNumber, + defaultDatasetsConfiguration, + defaultEventsConfiguration, + defaultTopic, + datasets ?? new ChangeTrackingList(), + events ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryDiscoveredAssetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryDiscoveredAssetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryDiscoveredAssetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs new file mode 100644 index 000000000000..d09dc205a5b7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryDiscoveredAssetProperties.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the discovered asset properties. + public partial class DeviceRegistryDiscoveredAssetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + /// Identifier used to detect changes in the asset. + /// An integer that is incremented each time the resource is modified. + /// or is null. + public DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version) + { + Argument.AssertNotNull(assetEndpointProfileRef, nameof(assetEndpointProfileRef)); + Argument.AssertNotNull(discoveryId, nameof(discoveryId)); + + AssetEndpointProfileRef = assetEndpointProfileRef; + DiscoveryId = discoveryId; + Version = version; + Datasets = new ChangeTrackingList(); + Events = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + /// Identifier used to detect changes in the asset. + /// An integer that is incremented each time the resource is modified. + /// Asset manufacturer name. + /// Asset manufacturer URI. + /// Asset model name. + /// Asset product code. + /// Revision number of the hardware. + /// Revision number of the software. + /// Reference to the documentation. + /// Asset serial number. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryDiscoveredAssetProperties(string assetEndpointProfileRef, string discoveryId, long version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AssetEndpointProfileRef = assetEndpointProfileRef; + DiscoveryId = discoveryId; + Version = version; + Manufacturer = manufacturer; + ManufacturerUri = manufacturerUri; + Model = model; + ProductCode = productCode; + HardwareRevision = hardwareRevision; + SoftwareRevision = softwareRevision; + DocumentationUri = documentationUri; + SerialNumber = serialNumber; + DefaultDatasetsConfiguration = defaultDatasetsConfiguration; + DefaultEventsConfiguration = defaultEventsConfiguration; + DefaultTopic = defaultTopic; + Datasets = datasets; + Events = events; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryDiscoveredAssetProperties() + { + } + + /// A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. + public string AssetEndpointProfileRef { get; set; } + /// Identifier used to detect changes in the asset. + public string DiscoveryId { get; set; } + /// An integer that is incremented each time the resource is modified. + public long Version { get; set; } + /// Asset manufacturer name. + public string Manufacturer { get; set; } + /// Asset manufacturer URI. + public Uri ManufacturerUri { get; set; } + /// Asset model name. + public string Model { get; set; } + /// Asset product code. + public string ProductCode { get; set; } + /// Revision number of the hardware. + public string HardwareRevision { get; set; } + /// Revision number of the software. + public string SoftwareRevision { get; set; } + /// Reference to the documentation. + public Uri DocumentationUri { get; set; } + /// Asset serial number. + public string SerialNumber { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + public string DefaultDatasetsConfiguration { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + public string DefaultEventsConfiguration { get; set; } + /// Object that describes the default topic information for the asset. + public DeviceRegistryTopic DefaultTopic { get; set; } + /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + public IList Datasets { get; } + /// Array of events that are part of the asset. Each event can have per-event configuration. + public IList Events { get; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.Serialization.cs new file mode 100644 index 000000000000..ebf1f775073c --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryEvent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryEvent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ObservabilityMode)) + { + writer.WritePropertyName("observabilityMode"u8); + writer.WriteStringValue(ObservabilityMode.Value.ToString()); + } + } + + DeviceRegistryEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryEvent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryEvent(document.RootElement, options); + } + + internal static DeviceRegistryEvent DeserializeDeviceRegistryEvent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EventObservabilityMode? observabilityMode = default; + string name = default; + string eventNotifier = default; + string eventConfiguration = default; + DeviceRegistryTopic topic = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("observabilityMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observabilityMode = new EventObservabilityMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventNotifier"u8)) + { + eventNotifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventConfiguration"u8)) + { + eventConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("topic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryEvent( + name, + eventNotifier, + eventConfiguration, + topic, + serializedAdditionalRawData, + observabilityMode); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryEvent)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryEvent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryEvent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.cs new file mode 100644 index 000000000000..8d37a46d5413 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEvent.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the event properties. + public partial class DeviceRegistryEvent : DeviceRegistryEventBase + { + /// Initializes a new instance of . + /// The name of the event. + /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + /// or is null. + public DeviceRegistryEvent(string name, string eventNotifier) : base(name, eventNotifier) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(eventNotifier, nameof(eventNotifier)); + } + + /// Initializes a new instance of . + /// The name of the event. + /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Object that describes the topic information for the specific event. + /// Keeps track of any properties unknown to the library. + /// An indication of how the event should be mapped to OpenTelemetry. + internal DeviceRegistryEvent(string name, string eventNotifier, string eventConfiguration, DeviceRegistryTopic topic, IDictionary serializedAdditionalRawData, EventObservabilityMode? observabilityMode) : base(name, eventNotifier, eventConfiguration, topic, serializedAdditionalRawData) + { + ObservabilityMode = observabilityMode; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryEvent() + { + } + + /// An indication of how the event should be mapped to OpenTelemetry. + public EventObservabilityMode? ObservabilityMode { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.Serialization.cs new file mode 100644 index 000000000000..3867c4b89033 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryEventBase : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryEventBase)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("eventNotifier"u8); + writer.WriteStringValue(EventNotifier); + if (Optional.IsDefined(EventConfiguration)) + { + writer.WritePropertyName("eventConfiguration"u8); + writer.WriteStringValue(EventConfiguration); + } + if (Optional.IsDefined(Topic)) + { + writer.WritePropertyName("topic"u8); + writer.WriteObjectValue(Topic, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryEventBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryEventBase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryEventBase(document.RootElement, options); + } + + internal static DeviceRegistryEventBase DeserializeDeviceRegistryEventBase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string eventNotifier = default; + string eventConfiguration = default; + DeviceRegistryTopic topic = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventNotifier"u8)) + { + eventNotifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventConfiguration"u8)) + { + eventConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("topic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryEventBase(name, eventNotifier, eventConfiguration, topic, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryEventBase)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryEventBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryEventBase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryEventBase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.cs new file mode 100644 index 000000000000..18ba8138b91e --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryEventBase.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the event properties. + public partial class DeviceRegistryEventBase + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the event. + /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + /// or is null. + public DeviceRegistryEventBase(string name, string eventNotifier) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(eventNotifier, nameof(eventNotifier)); + + Name = name; + EventNotifier = eventNotifier; + } + + /// Initializes a new instance of . + /// The name of the event. + /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Object that describes the topic information for the specific event. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryEventBase(string name, string eventNotifier, string eventConfiguration, DeviceRegistryTopic topic, IDictionary serializedAdditionalRawData) + { + Name = name; + EventNotifier = eventNotifier; + EventConfiguration = eventConfiguration; + Topic = topic; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryEventBase() + { + } + + /// The name of the event. + public string Name { get; set; } + /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. + public string EventNotifier { get; set; } + /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + public string EventConfiguration { get; set; } + /// Object that describes the topic information for the specific event. + public DeviceRegistryTopic Topic { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryProvisioningState.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryProvisioningState.cs index 9dff56b64acb..1c253031dde6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryProvisioningState.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryProvisioningState.cs @@ -26,6 +26,7 @@ public DeviceRegistryProvisioningState(string value) private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; private const string AcceptedValue = "Accepted"; + private const string DeletingValue = "Deleting"; /// Resource has been created. public static DeviceRegistryProvisioningState Succeeded { get; } = new DeviceRegistryProvisioningState(SucceededValue); @@ -35,6 +36,8 @@ public DeviceRegistryProvisioningState(string value) public static DeviceRegistryProvisioningState Canceled { get; } = new DeviceRegistryProvisioningState(CanceledValue); /// Resource has been accepted by the server. public static DeviceRegistryProvisioningState Accepted { get; } = new DeviceRegistryProvisioningState(AcceptedValue); + /// Resource is deleting. + public static DeviceRegistryProvisioningState Deleting { get; } = new DeviceRegistryProvisioningState(DeletingValue); /// Determines if two values are the same. public static bool operator ==(DeviceRegistryProvisioningState left, DeviceRegistryProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs new file mode 100644 index 000000000000..6a0aac44a946 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the schema format. + public readonly partial struct DeviceRegistrySchemaFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeviceRegistrySchemaFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string JsonSchemaDraft7Value = "JsonSchema/draft-07"; + private const string Delta10Value = "Delta/1.0"; + + /// JSON Schema version draft 7 format. + public static DeviceRegistrySchemaFormat JsonSchemaDraft7 { get; } = new DeviceRegistrySchemaFormat(JsonSchemaDraft7Value); + /// Delta format. + public static DeviceRegistrySchemaFormat Delta10 { get; } = new DeviceRegistrySchemaFormat(Delta10Value); + /// Determines if two values are the same. + public static bool operator ==(DeviceRegistrySchemaFormat left, DeviceRegistrySchemaFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeviceRegistrySchemaFormat left, DeviceRegistrySchemaFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeviceRegistrySchemaFormat(string value) => new DeviceRegistrySchemaFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeviceRegistrySchemaFormat other && Equals(other); + /// + public bool Equals(DeviceRegistrySchemaFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs new file mode 100644 index 000000000000..8fbb6df82eb8 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.Serialization.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistrySchemaProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Uuid)) + { + writer.WritePropertyName("uuid"u8); + writer.WriteStringValue(Uuid); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format.ToString()); + writer.WritePropertyName("schemaType"u8); + writer.WriteStringValue(SchemaType.ToString()); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistrySchemaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaProperties(document.RootElement, options); + } + + internal static DeviceRegistrySchemaProperties DeserializeDeviceRegistrySchemaProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uuid = default; + string displayName = default; + string description = default; + DeviceRegistrySchemaFormat format = default; + DeviceRegistrySchemaType schemaType = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("format"u8)) + { + format = new DeviceRegistrySchemaFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("schemaType"u8)) + { + schemaType = new DeviceRegistrySchemaType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaProperties( + uuid, + displayName, + description, + format, + schemaType, + provisioningState, + tags ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs new file mode 100644 index 000000000000..7863d8ea1f2b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaProperties.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the schema properties. + public partial class DeviceRegistrySchemaProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Format of the schema. + /// Type of the schema. + public DeviceRegistrySchemaProperties(DeviceRegistrySchemaFormat format, DeviceRegistrySchemaType schemaType) + { + Format = format; + SchemaType = schemaType; + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Human-readable display name. + /// Human-readable description of the schema. + /// Format of the schema. + /// Type of the schema. + /// Provisioning state of the resource. + /// Schema tags. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaProperties(string uuid, string displayName, string description, DeviceRegistrySchemaFormat format, DeviceRegistrySchemaType schemaType, DeviceRegistryProvisioningState? provisioningState, IDictionary tags, IDictionary serializedAdditionalRawData) + { + Uuid = uuid; + DisplayName = displayName; + Description = description; + Format = format; + SchemaType = schemaType; + ProvisioningState = provisioningState; + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistrySchemaProperties() + { + } + + /// Globally unique, immutable, non-reusable id. + public string Uuid { get; } + /// Human-readable display name. + public string DisplayName { get; set; } + /// Human-readable description of the schema. + public string Description { get; set; } + /// Format of the schema. + public DeviceRegistrySchemaFormat Format { get; set; } + /// Type of the schema. + public DeviceRegistrySchemaType SchemaType { get; set; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + /// Schema tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs new file mode 100644 index 000000000000..0ed57195ecb4 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistrySchemaRegistryPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistrySchemaRegistryPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaRegistryPatch(document.RootElement, options); + } + + internal static DeviceRegistrySchemaRegistryPatch DeserializeDeviceRegistrySchemaRegistryPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + IDictionary tags = default; + SchemaRegistryUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = SchemaRegistryUpdateProperties.DeserializeSchemaRegistryUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaRegistryPatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaRegistryPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaRegistryPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs new file mode 100644 index 000000000000..39dfa47de47f --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryPatch.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The type used for update operations of the SchemaRegistry. + public partial class DeviceRegistrySchemaRegistryPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeviceRegistrySchemaRegistryPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaRegistryPatch(ManagedServiceIdentity identity, IDictionary tags, SchemaRegistryUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. Current supported identity types: None, SystemAssigned. + public ManagedServiceIdentity Identity { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public SchemaRegistryUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs new file mode 100644 index 000000000000..cf5bd474a3e4 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistrySchemaRegistryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Uuid)) + { + writer.WritePropertyName("uuid"u8); + writer.WriteStringValue(Uuid); + } + writer.WritePropertyName("namespace"u8); + writer.WriteStringValue(Namespace); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("storageAccountContainerUrl"u8); + writer.WriteStringValue(StorageAccountContainerUri.AbsoluteUri); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistrySchemaRegistryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaRegistryProperties(document.RootElement, options); + } + + internal static DeviceRegistrySchemaRegistryProperties DeserializeDeviceRegistrySchemaRegistryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uuid = default; + string @namespace = default; + string displayName = default; + string description = default; + Uri storageAccountContainerUrl = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespace"u8)) + { + @namespace = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountContainerUrl"u8)) + { + storageAccountContainerUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaRegistryProperties( + uuid, + @namespace, + displayName, + description, + storageAccountContainerUrl, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaRegistryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaRegistryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaRegistryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs new file mode 100644 index 000000000000..402afa0db927 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaRegistryProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the schema registry properties. + public partial class DeviceRegistrySchemaRegistryProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. + /// The Storage Account's Container URL where schemas will be stored. + /// or is null. + public DeviceRegistrySchemaRegistryProperties(string @namespace, Uri storageAccountContainerUri) + { + Argument.AssertNotNull(@namespace, nameof(@namespace)); + Argument.AssertNotNull(storageAccountContainerUri, nameof(storageAccountContainerUri)); + + Namespace = @namespace; + StorageAccountContainerUri = storageAccountContainerUri; + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. + /// Human-readable display name. + /// Human-readable description of the schema registry. + /// The Storage Account's Container URL where schemas will be stored. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaRegistryProperties(string uuid, string @namespace, string displayName, string description, Uri storageAccountContainerUri, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Uuid = uuid; + Namespace = @namespace; + DisplayName = displayName; + Description = description; + StorageAccountContainerUri = storageAccountContainerUri; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistrySchemaRegistryProperties() + { + } + + /// Globally unique, immutable, non-reusable id. + public string Uuid { get; } + /// Schema registry namespace. Uniquely identifies a schema registry within a tenant. + public string Namespace { get; set; } + /// Human-readable display name. + public string DisplayName { get; set; } + /// Human-readable description of the schema registry. + public string Description { get; set; } + /// The Storage Account's Container URL where schemas will be stored. + public Uri StorageAccountContainerUri { get; set; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs new file mode 100644 index 000000000000..a5a143bcbd26 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the schema type. + public readonly partial struct DeviceRegistrySchemaType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeviceRegistrySchemaType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MessageSchemaValue = "MessageSchema"; + + /// Message Schema schema type. + public static DeviceRegistrySchemaType MessageSchema { get; } = new DeviceRegistrySchemaType(MessageSchemaValue); + /// Determines if two values are the same. + public static bool operator ==(DeviceRegistrySchemaType left, DeviceRegistrySchemaType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeviceRegistrySchemaType left, DeviceRegistrySchemaType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeviceRegistrySchemaType(string value) => new DeviceRegistrySchemaType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeviceRegistrySchemaType other && Equals(other); + /// + public bool Equals(DeviceRegistrySchemaType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs new file mode 100644 index 000000000000..a4468d02ca4d --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistrySchemaVersionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Uuid)) + { + writer.WritePropertyName("uuid"u8); + writer.WriteStringValue(Uuid); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("schemaContent"u8); + writer.WriteStringValue(SchemaContent); + if (options.Format != "W" && Optional.IsDefined(Hash)) + { + writer.WritePropertyName("hash"u8); + writer.WriteStringValue(Hash); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistrySchemaVersionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistrySchemaVersionProperties(document.RootElement, options); + } + + internal static DeviceRegistrySchemaVersionProperties DeserializeDeviceRegistrySchemaVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string uuid = default; + string description = default; + string schemaContent = default; + string hash = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaContent"u8)) + { + schemaContent = property.Value.GetString(); + continue; + } + if (property.NameEquals("hash"u8)) + { + hash = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistrySchemaVersionProperties( + uuid, + description, + schemaContent, + hash, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistrySchemaVersionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistrySchemaVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistrySchemaVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs new file mode 100644 index 000000000000..12ec0a826707 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistrySchemaVersionProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the schema version properties. + public partial class DeviceRegistrySchemaVersionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Schema content. + /// is null. + public DeviceRegistrySchemaVersionProperties(string schemaContent) + { + Argument.AssertNotNull(schemaContent, nameof(schemaContent)); + + SchemaContent = schemaContent; + } + + /// Initializes a new instance of . + /// Globally unique, immutable, non-reusable id. + /// Human-readable description of the schema. + /// Schema content. + /// Hash of the schema content. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistrySchemaVersionProperties(string uuid, string description, string schemaContent, string hash, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Uuid = uuid; + Description = description; + SchemaContent = schemaContent; + Hash = hash; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistrySchemaVersionProperties() + { + } + + /// Globally unique, immutable, non-reusable id. + public string Uuid { get; } + /// Human-readable description of the schema. + public string Description { get; set; } + /// Schema content. + public string SchemaContent { get; set; } + /// Hash of the schema content. + public string Hash { get; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.Serialization.cs new file mode 100644 index 000000000000..70ae1baf2f43 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryTopic : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryTopic)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + if (Optional.IsDefined(Retain)) + { + writer.WritePropertyName("retain"u8); + writer.WriteStringValue(Retain.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryTopic IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryTopic)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryTopic(document.RootElement, options); + } + + internal static DeviceRegistryTopic DeserializeDeviceRegistryTopic(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string path = default; + DeviceRegistryTopicRetainType? retain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("retain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retain = new DeviceRegistryTopicRetainType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryTopic(path, retain, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryTopic)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryTopic IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryTopic(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryTopic)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.cs new file mode 100644 index 000000000000..90ac20b1eb3a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopic.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Object that describes the topic information. + public partial class DeviceRegistryTopic + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The topic path for messages published to an MQTT broker. + /// is null. + public DeviceRegistryTopic(string path) + { + Argument.AssertNotNull(path, nameof(path)); + + Path = path; + } + + /// Initializes a new instance of . + /// The topic path for messages published to an MQTT broker. + /// When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryTopic(string path, DeviceRegistryTopicRetainType? retain, IDictionary serializedAdditionalRawData) + { + Path = path; + Retain = retain; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryTopic() + { + } + + /// The topic path for messages published to an MQTT broker. + public string Path { get; set; } + /// When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. + public DeviceRegistryTopicRetainType? Retain { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopicRetainType.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopicRetainType.cs new file mode 100644 index 000000000000..ef1ce7618e50 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryTopicRetainType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Topic retain types. + public readonly partial struct DeviceRegistryTopicRetainType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeviceRegistryTopicRetainType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeepValue = "Keep"; + private const string NeverValue = "Never"; + + /// Retain the messages. + public static DeviceRegistryTopicRetainType Keep { get; } = new DeviceRegistryTopicRetainType(KeepValue); + /// Never retain messages. + public static DeviceRegistryTopicRetainType Never { get; } = new DeviceRegistryTopicRetainType(NeverValue); + /// Determines if two values are the same. + public static bool operator ==(DeviceRegistryTopicRetainType left, DeviceRegistryTopicRetainType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeviceRegistryTopicRetainType left, DeviceRegistryTopicRetainType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeviceRegistryTopicRetainType(string value) => new DeviceRegistryTopicRetainType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeviceRegistryTopicRetainType other && Equals(other); + /// + public bool Equals(DeviceRegistryTopicRetainType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.Serialization.cs new file mode 100644 index 000000000000..86a65c6598f2 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DeviceRegistryUsernamePasswordCredentials : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryUsernamePasswordCredentials)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("usernameSecretName"u8); + writer.WriteStringValue(UsernameSecretName); + writer.WritePropertyName("passwordSecretName"u8); + writer.WriteStringValue(PasswordSecretName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryUsernamePasswordCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryUsernamePasswordCredentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryUsernamePasswordCredentials(document.RootElement, options); + } + + internal static DeviceRegistryUsernamePasswordCredentials DeserializeDeviceRegistryUsernamePasswordCredentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string usernameSecretName = default; + string passwordSecretName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usernameSecretName"u8)) + { + usernameSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("passwordSecretName"u8)) + { + passwordSecretName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryUsernamePasswordCredentials(usernameSecretName, passwordSecretName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryUsernamePasswordCredentials)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryUsernamePasswordCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryUsernamePasswordCredentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryUsernamePasswordCredentials)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.cs similarity index 51% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.cs index 48c765c69436..5a91f99bda7c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentials.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryUsernamePasswordCredentials.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// The credentials for authentication mode UsernamePassword. - public partial class UsernamePasswordCredentials + public partial class DeviceRegistryUsernamePasswordCredentials { /// /// Keeps track of any properties unknown to the library. @@ -45,38 +45,38 @@ public partial class UsernamePasswordCredentials /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// A reference to secret containing the username. - /// A reference to secret containing the password. - /// or is null. - public UsernamePasswordCredentials(string usernameReference, string passwordReference) + /// Initializes a new instance of . + /// The name of the secret containing the username. + /// The name of the secret containing the password. + /// or is null. + public DeviceRegistryUsernamePasswordCredentials(string usernameSecretName, string passwordSecretName) { - Argument.AssertNotNull(usernameReference, nameof(usernameReference)); - Argument.AssertNotNull(passwordReference, nameof(passwordReference)); + Argument.AssertNotNull(usernameSecretName, nameof(usernameSecretName)); + Argument.AssertNotNull(passwordSecretName, nameof(passwordSecretName)); - UsernameReference = usernameReference; - PasswordReference = passwordReference; + UsernameSecretName = usernameSecretName; + PasswordSecretName = passwordSecretName; } - /// Initializes a new instance of . - /// A reference to secret containing the username. - /// A reference to secret containing the password. + /// Initializes a new instance of . + /// The name of the secret containing the username. + /// The name of the secret containing the password. /// Keeps track of any properties unknown to the library. - internal UsernamePasswordCredentials(string usernameReference, string passwordReference, IDictionary serializedAdditionalRawData) + internal DeviceRegistryUsernamePasswordCredentials(string usernameSecretName, string passwordSecretName, IDictionary serializedAdditionalRawData) { - UsernameReference = usernameReference; - PasswordReference = passwordReference; + UsernameSecretName = usernameSecretName; + PasswordSecretName = passwordSecretName; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal UsernamePasswordCredentials() + /// Initializes a new instance of for deserialization. + internal DeviceRegistryUsernamePasswordCredentials() { } - /// A reference to secret containing the username. - public string UsernameReference { get; set; } - /// A reference to secret containing the password. - public string PasswordReference { get; set; } + /// The name of the secret containing the username. + public string UsernameSecretName { get; set; } + /// The name of the secret containing the password. + public string PasswordSecretName { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.Serialization.cs new file mode 100644 index 000000000000..09c497543738 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class DeviceRegistryX509Credentials : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryX509Credentials)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("certificateSecretName"u8); + writer.WriteStringValue(CertificateSecretName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeviceRegistryX509Credentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceRegistryX509Credentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceRegistryX509Credentials(document.RootElement, options); + } + + internal static DeviceRegistryX509Credentials DeserializeDeviceRegistryX509Credentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string certificateSecretName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("certificateSecretName"u8)) + { + certificateSecretName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceRegistryX509Credentials(certificateSecretName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceRegistryX509Credentials)} does not support writing '{options.Format}' format."); + } + } + + DeviceRegistryX509Credentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceRegistryX509Credentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceRegistryX509Credentials)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.cs new file mode 100644 index 000000000000..9c9adc1cb2e9 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DeviceRegistryX509Credentials.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The x509 certificate for authentication mode Certificate. + internal partial class DeviceRegistryX509Credentials + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + /// is null. + public DeviceRegistryX509Credentials(string certificateSecretName) + { + Argument.AssertNotNull(certificateSecretName, nameof(certificateSecretName)); + + CertificateSecretName = certificateSecretName; + } + + /// Initializes a new instance of . + /// The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + /// Keeps track of any properties unknown to the library. + internal DeviceRegistryX509Credentials(string certificateSecretName, IDictionary serializedAdditionalRawData) + { + CertificateSecretName = certificateSecretName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceRegistryX509Credentials() + { + } + + /// The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + public string CertificateSecretName { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs new file mode 100644 index 000000000000..0e4d21adf0c7 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class DiscoveredAssetEndpointProfileListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredAssetEndpointProfileListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement, options); + } + + internal static DiscoveredAssetEndpointProfileListResult DeserializeDiscoveredAssetEndpointProfileListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredAssetEndpointProfileListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredAssetEndpointProfileListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs new file mode 100644 index 000000000000..e842dc9788bd --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The response of a DiscoveredAssetEndpointProfile list operation. + internal partial class DiscoveredAssetEndpointProfileListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The DiscoveredAssetEndpointProfile items on this page. + /// is null. + internal DiscoveredAssetEndpointProfileListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DiscoveredAssetEndpointProfile items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DiscoveredAssetEndpointProfileListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoveredAssetEndpointProfileListResult() + { + } + + /// The DiscoveredAssetEndpointProfile items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs new file mode 100644 index 000000000000..fe43ac62e719 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DiscoveredAssetEndpointProfileProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targetAddress"u8); + writer.WriteStringValue(TargetAddress.AbsoluteUri); + if (Optional.IsDefined(AdditionalConfiguration)) + { + writer.WritePropertyName("additionalConfiguration"u8); + writer.WriteStringValue(AdditionalConfiguration); + } + if (Optional.IsCollectionDefined(SupportedAuthenticationMethods)) + { + writer.WritePropertyName("supportedAuthenticationMethods"u8); + writer.WriteStartArray(); + foreach (var item in SupportedAuthenticationMethods) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointProfileType"u8); + writer.WriteStringValue(EndpointProfileType); + writer.WritePropertyName("discoveryId"u8); + writer.WriteStringValue(DiscoveryId); + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredAssetEndpointProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredAssetEndpointProfileProperties(document.RootElement, options); + } + + internal static DiscoveredAssetEndpointProfileProperties DeserializeDiscoveredAssetEndpointProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri targetAddress = default; + string additionalConfiguration = default; + IList supportedAuthenticationMethods = default; + string endpointProfileType = default; + string discoveryId = default; + long version = default; + DeviceRegistryProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetAddress"u8)) + { + targetAddress = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("additionalConfiguration"u8)) + { + additionalConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedAuthenticationMethods"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AuthenticationMethod(item.GetString())); + } + supportedAuthenticationMethods = array; + continue; + } + if (property.NameEquals("endpointProfileType"u8)) + { + endpointProfileType = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveryId"u8)) + { + discoveryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeviceRegistryProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredAssetEndpointProfileProperties( + targetAddress, + additionalConfiguration, + supportedAuthenticationMethods ?? new ChangeTrackingList(), + endpointProfileType, + discoveryId, + version, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredAssetEndpointProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredAssetEndpointProfileProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs new file mode 100644 index 000000000000..44f41ea969ce --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileProperties.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the Discovered Asset Endpoint Profile properties. + public partial class DiscoveredAssetEndpointProfileProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Identifier used to detect changes in the asset endpoint profile. + /// An integer that is incremented each time the resource is modified. + /// , or is null. + public DiscoveredAssetEndpointProfileProperties(Uri targetAddress, string endpointProfileType, string discoveryId, long version) + { + Argument.AssertNotNull(targetAddress, nameof(targetAddress)); + Argument.AssertNotNull(endpointProfileType, nameof(endpointProfileType)); + Argument.AssertNotNull(discoveryId, nameof(discoveryId)); + + TargetAddress = targetAddress; + SupportedAuthenticationMethods = new ChangeTrackingList(); + EndpointProfileType = endpointProfileType; + DiscoveryId = discoveryId; + Version = version; + } + + /// Initializes a new instance of . + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// List of supported authentication methods supported by the target server. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Identifier used to detect changes in the asset endpoint profile. + /// An integer that is incremented each time the resource is modified. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal DiscoveredAssetEndpointProfileProperties(Uri targetAddress, string additionalConfiguration, IList supportedAuthenticationMethods, string endpointProfileType, string discoveryId, long version, DeviceRegistryProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + TargetAddress = targetAddress; + AdditionalConfiguration = additionalConfiguration; + SupportedAuthenticationMethods = supportedAuthenticationMethods; + EndpointProfileType = endpointProfileType; + DiscoveryId = discoveryId; + Version = version; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoveredAssetEndpointProfileProperties() + { + } + + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + public Uri TargetAddress { get; set; } + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + public string AdditionalConfiguration { get; set; } + /// List of supported authentication methods supported by the target server. + public IList SupportedAuthenticationMethods { get; } + /// Defines the configuration for the connector type that is being used with the endpoint profile. + public string EndpointProfileType { get; set; } + /// Identifier used to detect changes in the asset endpoint profile. + public string DiscoveryId { get; set; } + /// An integer that is incremented each time the resource is modified. + public long Version { get; set; } + /// Provisioning state of the resource. + public DeviceRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..73bdab54ce8d --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DiscoveredAssetEndpointProfileUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetAddress)) + { + writer.WritePropertyName("targetAddress"u8); + writer.WriteStringValue(TargetAddress.AbsoluteUri); + } + if (Optional.IsDefined(AdditionalConfiguration)) + { + writer.WritePropertyName("additionalConfiguration"u8); + writer.WriteStringValue(AdditionalConfiguration); + } + if (Optional.IsCollectionDefined(SupportedAuthenticationMethods)) + { + writer.WritePropertyName("supportedAuthenticationMethods"u8); + writer.WriteStartArray(); + foreach (var item in SupportedAuthenticationMethods) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EndpointProfileType)) + { + writer.WritePropertyName("endpointProfileType"u8); + writer.WriteStringValue(EndpointProfileType); + } + if (Optional.IsDefined(DiscoveryId)) + { + writer.WritePropertyName("discoveryId"u8); + writer.WriteStringValue(DiscoveryId); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredAssetEndpointProfileUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredAssetEndpointProfileUpdateProperties(document.RootElement, options); + } + + internal static DiscoveredAssetEndpointProfileUpdateProperties DeserializeDiscoveredAssetEndpointProfileUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri targetAddress = default; + string additionalConfiguration = default; + IList supportedAuthenticationMethods = default; + string endpointProfileType = default; + string discoveryId = default; + long? version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetAddress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetAddress = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("additionalConfiguration"u8)) + { + additionalConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedAuthenticationMethods"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AuthenticationMethod(item.GetString())); + } + supportedAuthenticationMethods = array; + continue; + } + if (property.NameEquals("endpointProfileType"u8)) + { + endpointProfileType = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveryId"u8)) + { + discoveryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredAssetEndpointProfileUpdateProperties( + targetAddress, + additionalConfiguration, + supportedAuthenticationMethods ?? new ChangeTrackingList(), + endpointProfileType, + discoveryId, + version, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredAssetEndpointProfileUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredAssetEndpointProfileUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredAssetEndpointProfileUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs new file mode 100644 index 000000000000..13d6727b30ab --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetEndpointProfileUpdateProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The updatable properties of the DiscoveredAssetEndpointProfile. + public partial class DiscoveredAssetEndpointProfileUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiscoveredAssetEndpointProfileUpdateProperties() + { + SupportedAuthenticationMethods = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + /// List of supported authentication methods supported by the target server. + /// Defines the configuration for the connector type that is being used with the endpoint profile. + /// Identifier used to detect changes in the asset endpoint profile. + /// An integer that is incremented each time the resource is modified. + /// Keeps track of any properties unknown to the library. + internal DiscoveredAssetEndpointProfileUpdateProperties(Uri targetAddress, string additionalConfiguration, IList supportedAuthenticationMethods, string endpointProfileType, string discoveryId, long? version, IDictionary serializedAdditionalRawData) + { + TargetAddress = targetAddress; + AdditionalConfiguration = additionalConfiguration; + SupportedAuthenticationMethods = supportedAuthenticationMethods; + EndpointProfileType = endpointProfileType; + DiscoveryId = discoveryId; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. + public Uri TargetAddress { get; set; } + /// Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). + public string AdditionalConfiguration { get; set; } + /// List of supported authentication methods supported by the target server. + public IList SupportedAuthenticationMethods { get; } + /// Defines the configuration for the connector type that is being used with the endpoint profile. + public string EndpointProfileType { get; set; } + /// Identifier used to detect changes in the asset endpoint profile. + public string DiscoveryId { get; set; } + /// An integer that is incremented each time the resource is modified. + public long? Version { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs new file mode 100644 index 000000000000..1f09da57e4ec --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class DiscoveredAssetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredAssetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredAssetListResult(document.RootElement, options); + } + + internal static DiscoveredAssetListResult DeserializeDiscoveredAssetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredAssetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredAssetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredAssetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredAssetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs similarity index 55% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs index 55285384275b..1182e1bde8a7 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.DeviceRegistry.Models { - /// Certificate or private key that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - public partial class OwnCertificate + /// The response of a DiscoveredAsset list operation. + internal partial class DiscoveredAssetListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,29 +46,35 @@ public partial class OwnCertificate /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public OwnCertificate() + /// Initializes a new instance of . + /// The DiscoveredAsset items on this page. + /// is null. + internal DiscoveredAssetListResult(IEnumerable value) { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// Certificate thumbprint. - /// Secret Reference name (cert and private key). - /// Secret Reference Name (Pfx or Pem password). + /// Initializes a new instance of . + /// The DiscoveredAsset items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal OwnCertificate(string certThumbprint, string certSecretReference, string certPasswordReference, IDictionary serializedAdditionalRawData) + internal DiscoveredAssetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - CertThumbprint = certThumbprint; - CertSecretReference = certSecretReference; - CertPasswordReference = certPasswordReference; + Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Certificate thumbprint. - public string CertThumbprint { get; set; } - /// Secret Reference name (cert and private key). - public string CertSecretReference { get; set; } - /// Secret Reference Name (Pfx or Pem password). - public string CertPasswordReference { get; set; } + /// Initializes a new instance of for deserialization. + internal DiscoveredAssetListResult() + { + } + + /// The DiscoveredAsset items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..555ed3a9fc16 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.Serialization.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DiscoveredAssetUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DiscoveryId)) + { + writer.WritePropertyName("discoveryId"u8); + writer.WriteStringValue(DiscoveryId); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.Value); + } + if (Optional.IsDefined(Manufacturer)) + { + writer.WritePropertyName("manufacturer"u8); + writer.WriteStringValue(Manufacturer); + } + if (Optional.IsDefined(ManufacturerUri)) + { + writer.WritePropertyName("manufacturerUri"u8); + writer.WriteStringValue(ManufacturerUri.AbsoluteUri); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(HardwareRevision)) + { + writer.WritePropertyName("hardwareRevision"u8); + writer.WriteStringValue(HardwareRevision); + } + if (Optional.IsDefined(SoftwareRevision)) + { + writer.WritePropertyName("softwareRevision"u8); + writer.WriteStringValue(SoftwareRevision); + } + if (Optional.IsDefined(DocumentationUri)) + { + writer.WritePropertyName("documentationUri"u8); + writer.WriteStringValue(DocumentationUri.AbsoluteUri); + } + if (Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (Optional.IsDefined(DefaultDatasetsConfiguration)) + { + writer.WritePropertyName("defaultDatasetsConfiguration"u8); + writer.WriteStringValue(DefaultDatasetsConfiguration); + } + if (Optional.IsDefined(DefaultEventsConfiguration)) + { + writer.WritePropertyName("defaultEventsConfiguration"u8); + writer.WriteStringValue(DefaultEventsConfiguration); + } + if (Optional.IsDefined(DefaultTopic)) + { + writer.WritePropertyName("defaultTopic"u8); + writer.WriteObjectValue(DefaultTopic, options); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"u8); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredAssetUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredAssetUpdateProperties(document.RootElement, options); + } + + internal static DiscoveredAssetUpdateProperties DeserializeDiscoveredAssetUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string discoveryId = default; + long? version = default; + string manufacturer = default; + Uri manufacturerUri = default; + string model = default; + string productCode = default; + string hardwareRevision = default; + string softwareRevision = default; + Uri documentationUri = default; + string serialNumber = default; + string defaultDatasetsConfiguration = default; + string defaultEventsConfiguration = default; + DeviceRegistryTopic defaultTopic = default; + IList datasets = default; + IList events = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("discoveryId"u8)) + { + discoveryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("manufacturer"u8)) + { + manufacturer = property.Value.GetString(); + continue; + } + if (property.NameEquals("manufacturerUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manufacturerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareRevision"u8)) + { + hardwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareRevision"u8)) + { + softwareRevision = property.Value.GetString(); + continue; + } + if (property.NameEquals("documentationUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + documentationUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultDatasetsConfiguration"u8)) + { + defaultDatasetsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultEventsConfiguration"u8)) + { + defaultEventsConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultTopic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultTopic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoveredDataset.DeserializeDiscoveredDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("events"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoveredEvent.DeserializeDiscoveredEvent(item, options)); + } + events = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredAssetUpdateProperties( + discoveryId, + version, + manufacturer, + manufacturerUri, + model, + productCode, + hardwareRevision, + softwareRevision, + documentationUri, + serialNumber, + defaultDatasetsConfiguration, + defaultEventsConfiguration, + defaultTopic, + datasets ?? new ChangeTrackingList(), + events ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredAssetUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredAssetUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredAssetUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs new file mode 100644 index 000000000000..a296876891ef --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredAssetUpdateProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The updatable properties of the DiscoveredAsset. + public partial class DiscoveredAssetUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiscoveredAssetUpdateProperties() + { + Datasets = new ChangeTrackingList(); + Events = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Identifier used to detect changes in the asset. + /// An integer that is incremented each time the resource is modified. + /// Asset manufacturer name. + /// Asset manufacturer URI. + /// Asset model name. + /// Asset product code. + /// Revision number of the hardware. + /// Revision number of the software. + /// Reference to the documentation. + /// Asset serial number. + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + /// Object that describes the default topic information for the asset. + /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + /// Array of events that are part of the asset. Each event can have per-event configuration. + /// Keeps track of any properties unknown to the library. + internal DiscoveredAssetUpdateProperties(string discoveryId, long? version, string manufacturer, Uri manufacturerUri, string model, string productCode, string hardwareRevision, string softwareRevision, Uri documentationUri, string serialNumber, string defaultDatasetsConfiguration, string defaultEventsConfiguration, DeviceRegistryTopic defaultTopic, IList datasets, IList events, IDictionary serializedAdditionalRawData) + { + DiscoveryId = discoveryId; + Version = version; + Manufacturer = manufacturer; + ManufacturerUri = manufacturerUri; + Model = model; + ProductCode = productCode; + HardwareRevision = hardwareRevision; + SoftwareRevision = softwareRevision; + DocumentationUri = documentationUri; + SerialNumber = serialNumber; + DefaultDatasetsConfiguration = defaultDatasetsConfiguration; + DefaultEventsConfiguration = defaultEventsConfiguration; + DefaultTopic = defaultTopic; + Datasets = datasets; + Events = events; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identifier used to detect changes in the asset. + public string DiscoveryId { get; set; } + /// An integer that is incremented each time the resource is modified. + public long? Version { get; set; } + /// Asset manufacturer name. + public string Manufacturer { get; set; } + /// Asset manufacturer URI. + public Uri ManufacturerUri { get; set; } + /// Asset model name. + public string Model { get; set; } + /// Asset product code. + public string ProductCode { get; set; } + /// Revision number of the hardware. + public string HardwareRevision { get; set; } + /// Revision number of the software. + public string SoftwareRevision { get; set; } + /// Reference to the documentation. + public Uri DocumentationUri { get; set; } + /// Asset serial number. + public string SerialNumber { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. + public string DefaultDatasetsConfiguration { get; set; } + /// Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. + public string DefaultEventsConfiguration { get; set; } + /// Object that describes the default topic information for the asset. + public DeviceRegistryTopic DefaultTopic { get; set; } + /// Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. + public IList Datasets { get; } + /// Array of events that are part of the asset. Each event can have per-event configuration. + public IList Events { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs index d8f8b0864535..5249c8529804 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class DataPoint : IUtf8JsonSerializable, IJsonModel + public partial class DiscoveredDataPoint : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,34 +28,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataPoint)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); writer.WritePropertyName("dataSource"u8); writer.WriteStringValue(DataSource); - if (Optional.IsDefined(CapabilityId)) - { - writer.WritePropertyName("capabilityId"u8); - writer.WriteStringValue(CapabilityId); - } - if (Optional.IsDefined(ObservabilityMode)) - { - writer.WritePropertyName("observabilityMode"u8); - writer.WriteStringValue(ObservabilityMode.Value.ToString()); - } if (Optional.IsDefined(DataPointConfiguration)) { writer.WritePropertyName("dataPointConfiguration"u8); writer.WriteStringValue(DataPointConfiguration); } + if (Optional.IsDefined(LastUpdatedOn)) + { + writer.WritePropertyName("lastUpdatedOn"u8); + writer.WriteStringValue(LastUpdatedOn.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DiscoveredDataPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataPoint)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataPoint(document.RootElement, options); + return DeserializeDiscoveredDataPoint(document.RootElement, options); } - internal static DataPoint DeserializeDataPoint(JsonElement element, ModelReaderWriterOptions options = null) + internal static DiscoveredDataPoint DeserializeDiscoveredDataPoint(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -95,9 +87,8 @@ internal static DataPoint DeserializeDataPoint(JsonElement element, ModelReaderW } string name = default; string dataSource = default; - string capabilityId = default; - DataPointsObservabilityMode? observabilityMode = default; string dataPointConfiguration = default; + DateTimeOffset? lastUpdatedOn = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,23 +103,18 @@ internal static DataPoint DeserializeDataPoint(JsonElement element, ModelReaderW dataSource = property.Value.GetString(); continue; } - if (property.NameEquals("capabilityId"u8)) + if (property.NameEquals("dataPointConfiguration"u8)) { - capabilityId = property.Value.GetString(); + dataPointConfiguration = property.Value.GetString(); continue; } - if (property.NameEquals("observabilityMode"u8)) + if (property.NameEquals("lastUpdatedOn"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - observabilityMode = new DataPointsObservabilityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("dataPointConfiguration"u8)) - { - dataPointConfiguration = property.Value.GetString(); + lastUpdatedOn = property.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") @@ -137,44 +123,38 @@ internal static DataPoint DeserializeDataPoint(JsonElement element, ModelReaderW } } serializedAdditionalRawData = rawDataDictionary; - return new DataPoint( - name, - dataSource, - capabilityId, - observabilityMode, - dataPointConfiguration, - serializedAdditionalRawData); + return new DiscoveredDataPoint(name, dataSource, dataPointConfiguration, lastUpdatedOn, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DataPoint)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support writing '{options.Format}' format."); } } - DataPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DiscoveredDataPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataPoint(document.RootElement, options); + return DeserializeDiscoveredDataPoint(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DataPoint)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscoveredDataPoint)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs similarity index 65% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs index f870594aed49..14ff31fca939 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DataPoint.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataPoint.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the data point properties. - public partial class DataPoint + public partial class DiscoveredDataPoint { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,36 @@ public partial class DataPoint /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The name of the data point. /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - /// is null. - public DataPoint(string dataSource) + /// or is null. + public DiscoveredDataPoint(string name, string dataSource) { + Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(dataSource, nameof(dataSource)); + Name = name; DataSource = dataSource; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the data point. /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. - /// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:_contents:__prop1;1. - /// An indication of how the data point should be mapped to OpenTelemetry. - /// Protocol-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// UTC timestamp indicating when the data point was added or modified. /// Keeps track of any properties unknown to the library. - internal DataPoint(string name, string dataSource, string capabilityId, DataPointsObservabilityMode? observabilityMode, string dataPointConfiguration, IDictionary serializedAdditionalRawData) + internal DiscoveredDataPoint(string name, string dataSource, string dataPointConfiguration, DateTimeOffset? lastUpdatedOn, IDictionary serializedAdditionalRawData) { Name = name; DataSource = dataSource; - CapabilityId = capabilityId; - ObservabilityMode = observabilityMode; DataPointConfiguration = dataPointConfiguration; + LastUpdatedOn = lastUpdatedOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataPoint() + /// Initializes a new instance of for deserialization. + internal DiscoveredDataPoint() { } @@ -81,11 +82,9 @@ internal DataPoint() public string Name { get; set; } /// The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. public string DataSource { get; set; } - /// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:_contents:__prop1;1. - public string CapabilityId { get; set; } - /// An indication of how the data point should be mapped to OpenTelemetry. - public DataPointsObservabilityMode? ObservabilityMode { get; set; } - /// Protocol-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. public string DataPointConfiguration { get; set; } + /// UTC timestamp indicating when the data point was added or modified. + public DateTimeOffset? LastUpdatedOn { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs new file mode 100644 index 000000000000..aa0436223f2a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class DiscoveredDataset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(DatasetConfiguration)) + { + writer.WritePropertyName("datasetConfiguration"u8); + writer.WriteStringValue(DatasetConfiguration); + } + if (Optional.IsDefined(Topic)) + { + writer.WritePropertyName("topic"u8); + writer.WriteObjectValue(Topic, options); + } + if (Optional.IsCollectionDefined(DataPoints)) + { + writer.WritePropertyName("dataPoints"u8); + writer.WriteStartArray(); + foreach (var item in DataPoints) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredDataset(document.RootElement, options); + } + + internal static DiscoveredDataset DeserializeDiscoveredDataset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string datasetConfiguration = default; + DeviceRegistryTopic topic = default; + IList dataPoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("datasetConfiguration"u8)) + { + datasetConfiguration = property.Value.GetString(); + continue; + } + if (property.NameEquals("topic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); + continue; + } + if (property.NameEquals("dataPoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoveredDataPoint.DeserializeDiscoveredDataPoint(item, options)); + } + dataPoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredDataset(name, datasetConfiguration, topic, dataPoints ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiscoveredDataset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredDataset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs new file mode 100644 index 000000000000..048e9382f363 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredDataset.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the dataset properties. + public partial class DiscoveredDataset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the dataset. + /// is null. + public DiscoveredDataset(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + DataPoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the dataset. + /// Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. + /// Object that describes the topic information for the specific dataset. + /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. + /// Keeps track of any properties unknown to the library. + internal DiscoveredDataset(string name, string datasetConfiguration, DeviceRegistryTopic topic, IList dataPoints, IDictionary serializedAdditionalRawData) + { + Name = name; + DatasetConfiguration = datasetConfiguration; + Topic = topic; + DataPoints = dataPoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoveredDataset() + { + } + + /// Name of the dataset. + public string Name { get; set; } + /// Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. + public string DatasetConfiguration { get; set; } + /// Object that describes the topic information for the specific dataset. + public DeviceRegistryTopic Topic { get; set; } + /// Array of data points that are part of the dataset. Each data point can have per-data point configuration. + public IList DataPoints { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs similarity index 62% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs index 4bacbd195dd6..bfdaf1d4d06a 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - public partial class AssetEvent : IUtf8JsonSerializable, IJsonModel + public partial class DiscoveredEvent : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,33 +28,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetEvent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); writer.WritePropertyName("eventNotifier"u8); writer.WriteStringValue(EventNotifier); - if (Optional.IsDefined(CapabilityId)) + if (Optional.IsDefined(EventConfiguration)) { - writer.WritePropertyName("capabilityId"u8); - writer.WriteStringValue(CapabilityId); + writer.WritePropertyName("eventConfiguration"u8); + writer.WriteStringValue(EventConfiguration); } - if (Optional.IsDefined(ObservabilityMode)) + if (Optional.IsDefined(Topic)) { - writer.WritePropertyName("observabilityMode"u8); - writer.WriteStringValue(ObservabilityMode.Value.ToString()); + writer.WritePropertyName("topic"u8); + writer.WriteObjectValue(Topic, options); } - if (Optional.IsDefined(EventConfiguration)) + if (Optional.IsDefined(LastUpdatedOn)) { - writer.WritePropertyName("eventConfiguration"u8); - writer.WriteStringValue(EventConfiguration); + writer.WritePropertyName("lastUpdatedOn"u8); + writer.WriteStringValue(LastUpdatedOn.Value, "O"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -73,19 +70,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssetEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DiscoveredEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssetEvent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssetEvent(document.RootElement, options); + return DeserializeDiscoveredEvent(document.RootElement, options); } - internal static AssetEvent DeserializeAssetEvent(JsonElement element, ModelReaderWriterOptions options = null) + internal static DiscoveredEvent DeserializeDiscoveredEvent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -95,9 +92,9 @@ internal static AssetEvent DeserializeAssetEvent(JsonElement element, ModelReade } string name = default; string eventNotifier = default; - string capabilityId = default; - EventsObservabilityMode? observabilityMode = default; string eventConfiguration = default; + DeviceRegistryTopic topic = default; + DateTimeOffset? lastUpdatedOn = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,23 +109,27 @@ internal static AssetEvent DeserializeAssetEvent(JsonElement element, ModelReade eventNotifier = property.Value.GetString(); continue; } - if (property.NameEquals("capabilityId"u8)) + if (property.NameEquals("eventConfiguration"u8)) { - capabilityId = property.Value.GetString(); + eventConfiguration = property.Value.GetString(); continue; } - if (property.NameEquals("observabilityMode"u8)) + if (property.NameEquals("topic"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - observabilityMode = new EventsObservabilityMode(property.Value.GetString()); + topic = DeviceRegistryTopic.DeserializeDeviceRegistryTopic(property.Value, options); continue; } - if (property.NameEquals("eventConfiguration"u8)) + if (property.NameEquals("lastUpdatedOn"u8)) { - eventConfiguration = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastUpdatedOn = property.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") @@ -137,44 +138,44 @@ internal static AssetEvent DeserializeAssetEvent(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new AssetEvent( + return new DiscoveredEvent( name, eventNotifier, - capabilityId, - observabilityMode, eventConfiguration, + topic, + lastUpdatedOn, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssetEvent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support writing '{options.Format}' format."); } } - AssetEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DiscoveredEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssetEvent(document.RootElement, options); + return DeserializeDiscoveredEvent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssetEvent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiscoveredEvent)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs similarity index 60% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs index c1fbd0abf33e..9fe81c213d45 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/AssetEvent.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/DiscoveredEvent.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { /// Defines the event properties. - public partial class AssetEvent + public partial class DiscoveredEvent { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,38 @@ public partial class AssetEvent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The name of the event. /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - /// is null. - public AssetEvent(string eventNotifier) + /// or is null. + public DiscoveredEvent(string name, string eventNotifier) { + Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(eventNotifier, nameof(eventNotifier)); + Name = name; EventNotifier = eventNotifier; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the event. /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. - /// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:_contents:__prop1;1. - /// An indication of how the event should be mapped to OpenTelemetry. - /// Protocol-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Object that describes the topic information for the specific event. + /// UTC timestamp indicating when the event was added or modified. /// Keeps track of any properties unknown to the library. - internal AssetEvent(string name, string eventNotifier, string capabilityId, EventsObservabilityMode? observabilityMode, string eventConfiguration, IDictionary serializedAdditionalRawData) + internal DiscoveredEvent(string name, string eventNotifier, string eventConfiguration, DeviceRegistryTopic topic, DateTimeOffset? lastUpdatedOn, IDictionary serializedAdditionalRawData) { Name = name; EventNotifier = eventNotifier; - CapabilityId = capabilityId; - ObservabilityMode = observabilityMode; EventConfiguration = eventConfiguration; + Topic = topic; + LastUpdatedOn = lastUpdatedOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssetEvent() + /// Initializes a new instance of for deserialization. + internal DiscoveredEvent() { } @@ -81,11 +84,11 @@ internal AssetEvent() public string Name { get; set; } /// The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. public string EventNotifier { get; set; } - /// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:_contents:__prop1;1. - public string CapabilityId { get; set; } - /// An indication of how the event should be mapped to OpenTelemetry. - public EventsObservabilityMode? ObservabilityMode { get; set; } - /// Protocol-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. + /// Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. public string EventConfiguration { get; set; } + /// Object that describes the topic information for the specific event. + public DeviceRegistryTopic Topic { get; set; } + /// UTC timestamp indicating when the event was added or modified. + public DateTimeOffset? LastUpdatedOn { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventObservabilityMode.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventObservabilityMode.cs new file mode 100644 index 000000000000..64392c15f8c1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventObservabilityMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the event observability mode. + public readonly partial struct EventObservabilityMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EventObservabilityMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string LogValue = "Log"; + + /// No mapping to OpenTelemetry. + public static EventObservabilityMode None { get; } = new EventObservabilityMode(NoneValue); + /// Map as log to OpenTelemetry. + public static EventObservabilityMode Log { get; } = new EventObservabilityMode(LogValue); + /// Determines if two values are the same. + public static bool operator ==(EventObservabilityMode left, EventObservabilityMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventObservabilityMode left, EventObservabilityMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EventObservabilityMode(string value) => new EventObservabilityMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EventObservabilityMode other && Equals(other); + /// + public bool Equals(EventObservabilityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventsObservabilityMode.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventsObservabilityMode.cs deleted file mode 100644 index 4073e2f7d2db..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/EventsObservabilityMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// An indication of how the event should be mapped to OpenTelemetry. - public readonly partial struct EventsObservabilityMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EventsObservabilityMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string LogValue = "log"; - - /// No mapping to OpenTelemetry. - public static EventsObservabilityMode None { get; } = new EventsObservabilityMode(NoneValue); - /// Map as log to OpenTelemetry. - public static EventsObservabilityMode Log { get; } = new EventsObservabilityMode(LogValue); - /// Determines if two values are the same. - public static bool operator ==(EventsObservabilityMode left, EventsObservabilityMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventsObservabilityMode left, EventsObservabilityMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EventsObservabilityMode(string value) => new EventsObservabilityMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventsObservabilityMode other && Equals(other); - /// - public bool Equals(EventsObservabilityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.Serialization.cs new file mode 100644 index 000000000000..db3846882e88 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class MessageSchemaReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageSchemaReference)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("schemaRegistryNamespace"u8); + writer.WriteStringValue(SchemaRegistryNamespace); + } + if (options.Format != "W") + { + writer.WritePropertyName("schemaName"u8); + writer.WriteStringValue(SchemaName); + } + if (options.Format != "W") + { + writer.WritePropertyName("schemaVersion"u8); + writer.WriteStringValue(SchemaVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageSchemaReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageSchemaReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageSchemaReference(document.RootElement, options); + } + + internal static MessageSchemaReference DeserializeMessageSchemaReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string schemaRegistryNamespace = default; + string schemaName = default; + string schemaVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("schemaRegistryNamespace"u8)) + { + schemaRegistryNamespace = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaName"u8)) + { + schemaName = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaVersion"u8)) + { + schemaVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageSchemaReference(schemaRegistryNamespace, schemaName, schemaVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MessageSchemaReference)} does not support writing '{options.Format}' format."); + } + } + + MessageSchemaReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMessageSchemaReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageSchemaReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.cs new file mode 100644 index 000000000000..f23f6513828c --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/MessageSchemaReference.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// Defines the message schema reference properties. + public partial class MessageSchemaReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The message schema registry namespace. + /// The message schema name. + /// The message schema version. + internal MessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion) + { + SchemaRegistryNamespace = schemaRegistryNamespace; + SchemaName = schemaName; + SchemaVersion = schemaVersion; + } + + /// Initializes a new instance of . + /// The message schema registry namespace. + /// The message schema name. + /// The message schema version. + /// Keeps track of any properties unknown to the library. + internal MessageSchemaReference(string schemaRegistryNamespace, string schemaName, string schemaVersion, IDictionary serializedAdditionalRawData) + { + SchemaRegistryNamespace = schemaRegistryNamespace; + SchemaName = schemaName; + SchemaVersion = schemaVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MessageSchemaReference() + { + } + + /// The message schema registry namespace. + public string SchemaRegistryNamespace { get; } + /// The message schema name. + public string SchemaName { get; } + /// The message schema version. + public string SchemaVersion { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs new file mode 100644 index 000000000000..b7c7478fcfb5 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class SchemaListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SchemaListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSchemaListResult(document.RootElement, options); + } + + internal static SchemaListResult DeserializeSchemaListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SchemaListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SchemaListResult)} does not support writing '{options.Format}' format."); + } + } + + SchemaListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSchemaListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SchemaListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs new file mode 100644 index 000000000000..3d8a3357a74a --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The response of a Schema list operation. + internal partial class SchemaListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Schema items on this page. + /// is null. + internal SchemaListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Schema items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SchemaListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SchemaListResult() + { + } + + /// The Schema items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs new file mode 100644 index 000000000000..5e1d1d358577 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + internal partial class SchemaRegistryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SchemaRegistryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSchemaRegistryListResult(document.RootElement, options); + } + + internal static SchemaRegistryListResult DeserializeSchemaRegistryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SchemaRegistryListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support writing '{options.Format}' format."); + } + } + + SchemaRegistryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSchemaRegistryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SchemaRegistryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs new file mode 100644 index 000000000000..dc15f9d75cf1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The response of a SchemaRegistry list operation. + internal partial class SchemaRegistryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SchemaRegistry items on this page. + /// is null. + internal SchemaRegistryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SchemaRegistry items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SchemaRegistryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SchemaRegistryListResult() + { + } + + /// The SchemaRegistry items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..4881a28a04bb --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + public partial class SchemaRegistryUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SchemaRegistryUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSchemaRegistryUpdateProperties(document.RootElement, options); + } + + internal static SchemaRegistryUpdateProperties DeserializeSchemaRegistryUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string displayName = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SchemaRegistryUpdateProperties(displayName, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + SchemaRegistryUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSchemaRegistryUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SchemaRegistryUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs index 83ba7d1e9ea2..525f5d5fb6ef 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaRegistryUpdateProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - /// The credentials for authentication mode UsernamePassword. - public partial class UsernamePasswordCredentialsUpdate + /// The updatable properties of the SchemaRegistry. + public partial class SchemaRegistryUpdateProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,25 @@ public partial class UsernamePasswordCredentialsUpdate /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public UsernamePasswordCredentialsUpdate() + /// Initializes a new instance of . + public SchemaRegistryUpdateProperties() { } - /// Initializes a new instance of . - /// A reference to secret containing the username. - /// A reference to secret containing the password. + /// Initializes a new instance of . + /// Human-readable display name. + /// Human-readable description of the schema registry. /// Keeps track of any properties unknown to the library. - internal UsernamePasswordCredentialsUpdate(string usernameReference, string passwordReference, IDictionary serializedAdditionalRawData) + internal SchemaRegistryUpdateProperties(string displayName, string description, IDictionary serializedAdditionalRawData) { - UsernameReference = usernameReference; - PasswordReference = passwordReference; + DisplayName = displayName; + Description = description; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// A reference to secret containing the username. - public string UsernameReference { get; set; } - /// A reference to secret containing the password. - public string PasswordReference { get; set; } + /// Human-readable display name. + public string DisplayName { get; set; } + /// Human-readable description of the schema registry. + public string Description { get; set; } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.Serialization.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs similarity index 59% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.Serialization.cs rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs index 9945959dca2a..c7b4a19d0eaf 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.Serialization.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.DeviceRegistry.Models { - internal partial class TransportAuthentication : IUtf8JsonSerializable, IJsonModel + internal partial class SchemaVersionListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,19 +28,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TransportAuthentication)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("ownCertificates"u8); + writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in OwnCertificates) + foreach (var item in Value) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TransportAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SchemaVersionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TransportAuthentication)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTransportAuthentication(document.RootElement, options); + return DeserializeSchemaVersionListResult(document.RootElement, options); } - internal static TransportAuthentication DeserializeTransportAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + internal static SchemaVersionListResult DeserializeSchemaVersionListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,19 +83,29 @@ internal static TransportAuthentication DeserializeTransportAuthentication(JsonE { return null; } - IList ownCertificates = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ownCertificates"u8)) + if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(OwnCertificate.DeserializeOwnCertificate(item, options)); + array.Add(DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; } - ownCertificates = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -99,38 +114,38 @@ internal static TransportAuthentication DeserializeTransportAuthentication(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new TransportAuthentication(ownCertificates, serializedAdditionalRawData); + return new SchemaVersionListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TransportAuthentication)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support writing '{options.Format}' format."); } } - TransportAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SchemaVersionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTransportAuthentication(document.RootElement, options); + return DeserializeSchemaVersionListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TransportAuthentication)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SchemaVersionListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs new file mode 100644 index 000000000000..66fd4612a901 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/SchemaVersionListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DeviceRegistry.Models +{ + /// The response of a SchemaVersion list operation. + internal partial class SchemaVersionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SchemaVersion items on this page. + /// is null. + internal SchemaVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SchemaVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SchemaVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SchemaVersionListResult() + { + } + + /// The SchemaVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.cs deleted file mode 100644 index 565d91f512af..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/TransportAuthentication.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Definition of the authentication mechanism for the southbound connector. - internal partial class TransportAuthentication - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - /// is null. - public TransportAuthentication(IEnumerable ownCertificates) - { - Argument.AssertNotNull(ownCertificates, nameof(ownCertificates)); - - OwnCertificates = ownCertificates.ToList(); - } - - /// Initializes a new instance of . - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - /// Keeps track of any properties unknown to the library. - internal TransportAuthentication(IList ownCertificates, IDictionary serializedAdditionalRawData) - { - OwnCertificates = ownCertificates; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TransportAuthentication() - { - } - - /// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys. - public IList OwnCertificates { get; } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationMode.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationMode.cs deleted file mode 100644 index 410c606aa2b5..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Defines the mode to authenticate the user of the client at the server. - public readonly partial struct UserAuthenticationMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public UserAuthenticationMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AnonymousValue = "Anonymous"; - private const string CertificateValue = "Certificate"; - private const string UsernamePasswordValue = "UsernamePassword"; - - /// The user authentication mode is anonymous. - public static UserAuthenticationMode Anonymous { get; } = new UserAuthenticationMode(AnonymousValue); - /// The user authentication mode is an x509 certificate. - public static UserAuthenticationMode Certificate { get; } = new UserAuthenticationMode(CertificateValue); - /// The user authentication mode is a username and password. - public static UserAuthenticationMode UsernamePassword { get; } = new UserAuthenticationMode(UsernamePasswordValue); - /// Determines if two values are the same. - public static bool operator ==(UserAuthenticationMode left, UserAuthenticationMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(UserAuthenticationMode left, UserAuthenticationMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator UserAuthenticationMode(string value) => new UserAuthenticationMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is UserAuthenticationMode other && Equals(other); - /// - public bool Equals(UserAuthenticationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.cs deleted file mode 100644 index 44bb33e150a4..000000000000 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.DeviceRegistry.Models -{ - /// Definition of the client authentication mechanism to the server. - public partial class UserAuthenticationUpdate - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public UserAuthenticationUpdate() - { - } - - /// Initializes a new instance of . - /// Defines the mode to authenticate the user of the client at the server. - /// Defines the username and password references when UsernamePassword user authentication mode is selected. - /// Defines the certificate reference when Certificate user authentication mode is selected. - /// Keeps track of any properties unknown to the library. - internal UserAuthenticationUpdate(UserAuthenticationMode? mode, UsernamePasswordCredentialsUpdate usernamePasswordCredentials, X509CredentialsUpdate x509Credentials, IDictionary serializedAdditionalRawData) - { - Mode = mode; - UsernamePasswordCredentials = usernamePasswordCredentials; - X509Credentials = x509Credentials; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Defines the mode to authenticate the user of the client at the server. - public UserAuthenticationMode? Mode { get; set; } - /// Defines the username and password references when UsernamePassword user authentication mode is selected. - public UsernamePasswordCredentialsUpdate UsernamePasswordCredentials { get; set; } - /// Defines the certificate reference when Certificate user authentication mode is selected. - internal X509CredentialsUpdate X509Credentials { get; set; } - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). - public string X509CredentialsCertificateReference - { - get => X509Credentials is null ? default : X509Credentials.CertificateReference; - set - { - if (X509Credentials is null) - X509Credentials = new X509CredentialsUpdate(); - X509Credentials.CertificateReference = value; - } - } - } -} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs index 210440453682..dde0609678c6 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetEndpointProfilesRestOperations.cs @@ -25,181 +25,17 @@ internal partial class AssetEndpointProfilesRestOperations /// Initializes a new instance of AssetEndpointProfilesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public AssetEndpointProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-01-preview"; + _apiVersion = apiVersion ?? "2024-09-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List AssetEndpointProfile resources by subscription ID. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List AssetEndpointProfile resources by subscription ID. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List AssetEndpointProfile resources by resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AssetEndpointProfileListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List AssetEndpointProfile resources by resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AssetEndpointProfileListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string assetEndpointProfileName) { var uri = new RawRequestUriBuilder(); @@ -235,7 +71,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The cancellation token to use. @@ -266,7 +102,7 @@ public async Task> GetAsync(str } /// Get a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The cancellation token to use. @@ -335,7 +171,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string } /// Create a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// Resource create parameters. @@ -362,7 +198,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r } /// Create a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// Resource create parameters. @@ -427,7 +263,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The resource properties to be updated. @@ -454,7 +290,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The resource properties to be updated. @@ -515,7 +351,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The cancellation token to use. @@ -540,7 +376,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a AssetEndpointProfile. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset Endpoint Profile name parameter. /// The cancellation token to use. @@ -564,22 +400,114 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssetEndpointProfile resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssetEndpointProfile resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -587,17 +515,15 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st } /// List AssetEndpointProfile resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. + /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -614,17 +540,15 @@ public async Task> ListBySubscriptionNe } /// List AssetEndpointProfile resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. + /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -664,7 +588,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// List AssetEndpointProfile resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -693,7 +617,7 @@ public async Task> ListByResourceGroupN /// List AssetEndpointProfile resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -719,5 +643,81 @@ public Response ListByResourceGroupNextPage(stri throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssetEndpointProfile resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssetEndpointProfile resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetEndpointProfileListResult.DeserializeAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs index 5915b8dd6768..de8b3c8894e3 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/AssetsRestOperations.cs @@ -25,181 +25,17 @@ internal partial class AssetsRestOperations /// Initializes a new instance of AssetsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public AssetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-01-preview"; + _apiVersion = apiVersion ?? "2024-09-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Asset resources by subscription ID. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AssetListResult.DeserializeAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Asset resources by subscription ID. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AssetListResult.DeserializeAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Asset resources by resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AssetListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AssetListResult.DeserializeAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Asset resources by resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AssetListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AssetListResult.DeserializeAssetListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string assetName) { var uri = new RawRequestUriBuilder(); @@ -235,7 +71,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The cancellation token to use. @@ -266,7 +102,7 @@ public async Task> GetAsync(string subscriptio } /// Get a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The cancellation token to use. @@ -335,7 +171,7 @@ internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string } /// Create a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// Resource create parameters. @@ -362,7 +198,7 @@ public async Task CreateOrReplaceAsync(string subscriptionId, string r } /// Create a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// Resource create parameters. @@ -427,7 +263,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The resource properties to be updated. @@ -454,7 +290,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The resource properties to be updated. @@ -515,7 +351,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The cancellation token to use. @@ -540,7 +376,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Asset. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Asset name parameter. /// The cancellation token to use. @@ -564,22 +400,114 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Asset resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetListResult.DeserializeAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Asset resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetListResult.DeserializeAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -587,17 +515,15 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st } /// List Asset resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. + /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -614,17 +540,15 @@ public async Task> ListBySubscriptionNextPageAsync(str } /// List Asset resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. + /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -664,7 +588,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// List Asset resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -693,7 +617,7 @@ public async Task> ListByResourceGroupNextPageAsync(st /// List Asset resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -719,5 +643,81 @@ public Response ListByResourceGroupNextPage(string nextLink, st throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Asset resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetListResult.DeserializeAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Asset resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetListResult.DeserializeAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs new file mode 100644 index 000000000000..c6239c813952 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/BillingContainersRestOperations.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class BillingContainersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BillingContainersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BillingContainersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string billingContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/billingContainers/", false); + uri.AppendPath(billingContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string billingContainerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/billingContainers/", false); + uri.AppendPath(billingContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BillingContainer. + /// The ID of the target subscription. The value must be an UUID. + /// Name of the billing container. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var message = CreateGetRequest(subscriptionId, billingContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryBillingContainerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistryBillingContainerData.DeserializeDeviceRegistryBillingContainerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryBillingContainerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BillingContainer. + /// The ID of the target subscription. The value must be an UUID. + /// Name of the billing container. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string billingContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(billingContainerName, nameof(billingContainerName)); + + using var message = CreateGetRequest(subscriptionId, billingContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryBillingContainerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistryBillingContainerData.DeserializeDeviceRegistryBillingContainerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryBillingContainerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/billingContainers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/billingContainers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BillingContainer resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BillingContainerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BillingContainerListResult.DeserializeBillingContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BillingContainer resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BillingContainerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BillingContainerListResult.DeserializeBillingContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BillingContainer resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BillingContainerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BillingContainerListResult.DeserializeBillingContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BillingContainer resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BillingContainerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BillingContainerListResult.DeserializeBillingContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs new file mode 100644 index 000000000000..5859b759be61 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetEndpointProfilesRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class DiscoveredAssetEndpointProfilesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DiscoveredAssetEndpointProfilesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DiscoveredAssetEndpointProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryDiscoveredAssetEndpointProfileData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryDiscoveredAssetEndpointProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryDiscoveredAssetEndpointProfileData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistryDiscoveredAssetEndpointProfileData.DeserializeDeviceRegistryDiscoveredAssetEndpointProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryDiscoveredAssetEndpointProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, DeviceRegistryDiscoveredAssetEndpointProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/", false); + uri.AppendPath(discoveredAssetEndpointProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DiscoveredAssetEndpointProfile. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset Endpoint Profile name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string discoveredAssetEndpointProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetEndpointProfileName, nameof(discoveredAssetEndpointProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetEndpointProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAssetEndpointProfile resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAssetEndpointProfile resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAssetEndpointProfile resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAssetEndpointProfile resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAssetEndpointProfile resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAssetEndpointProfile resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAssetEndpointProfile resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAssetEndpointProfile resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetEndpointProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetEndpointProfileListResult.DeserializeDiscoveredAssetEndpointProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs new file mode 100644 index 000000000000..839b478826a1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/DiscoveredAssetsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class DiscoveredAssetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DiscoveredAssetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DiscoveredAssetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryDiscoveredAssetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryDiscoveredAssetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, discoveredAssetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistryDiscoveredAssetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistryDiscoveredAssetData.DeserializeDeviceRegistryDiscoveredAssetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistryDiscoveredAssetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, discoveredAssetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string discoveredAssetName, DeviceRegistryDiscoveredAssetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, discoveredAssetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string discoveredAssetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string discoveredAssetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets/", false); + uri.AppendPath(discoveredAssetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DiscoveredAsset. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Discovered Asset name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string discoveredAssetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(discoveredAssetName, nameof(discoveredAssetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, discoveredAssetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAsset resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAsset resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/discoveredAssets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAsset resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAsset resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAsset resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAsset resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoveredAsset resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoveredAsset resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoveredAssetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiscoveredAssetListResult.DeserializeDiscoveredAssetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs new file mode 100644 index 000000000000..93ef9b14a942 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaRegistriesRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class SchemaRegistriesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SchemaRegistriesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SchemaRegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaRegistryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaRegistryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaRegistryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistrySchemaRegistryData.DeserializeDeviceRegistrySchemaRegistryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaRegistryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, schemaRegistryName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string schemaRegistryName, DeviceRegistrySchemaRegistryPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, schemaRegistryName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaRegistry resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaRegistry resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaRegistry resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaRegistry resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaRegistry resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaRegistry resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaRegistry resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaRegistry resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaRegistryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaRegistryListResult.DeserializeSchemaRegistryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs new file mode 100644 index 000000000000..30a08ad23e0b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemaVersionsRestOperations.cs @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class SchemaVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SchemaVersionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SchemaVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DeviceRegistrySchemaVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, DeviceRegistrySchemaVersionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DeviceRegistrySchemaVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistrySchemaVersionData.DeserializeDeviceRegistrySchemaVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions/", false); + uri.AppendPath(schemaVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SchemaVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Schema version name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, string schemaVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNullOrEmpty(schemaVersionName, nameof(schemaVersionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySchemaRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySchemaRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendPath("/schemaVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaVersion resources by Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySchemaAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateListBySchemaRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaVersion resources by Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListBySchema(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateListBySchemaRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySchemaNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySchemaNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SchemaVersion resources by Schema. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySchemaNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateListBySchemaNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SchemaVersion resources by Schema. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListBySchemaNextPage(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateListBySchemaNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaVersionListResult.DeserializeSchemaVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs new file mode 100644 index 000000000000..572b8b04aaf1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/RestOperations/SchemasRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DeviceRegistry.Models; + +namespace Azure.ResourceManager.DeviceRegistry +{ + internal partial class SchemasRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SchemasRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public SchemasRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeviceRegistrySchemaData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeviceRegistrySchemaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DeviceRegistrySchemaData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, DeviceRegistrySchemaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DeviceRegistrySchemaData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeviceRegistrySchemaData.DeserializeDeviceRegistrySchemaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas/", false); + uri.AppendPath(schemaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Schema. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// Schema name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string schemaRegistryName, string schemaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + Argument.AssertNotNullOrEmpty(schemaName, nameof(schemaName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, schemaRegistryName, schemaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySchemaRegistryRequestUri(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySchemaRegistryRequest(string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DeviceRegistry/schemaRegistries/", false); + uri.AppendPath(schemaRegistryName, true); + uri.AppendPath("/schemas", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Schema resources by SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListBySchemaRegistryAsync(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateListBySchemaRegistryRequest(subscriptionId, resourceGroupName, schemaRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Schema resources by SchemaRegistry. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListBySchemaRegistry(string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateListBySchemaRegistryRequest(subscriptionId, resourceGroupName, schemaRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySchemaRegistryNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySchemaRegistryNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Schema resources by SchemaRegistry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListBySchemaRegistryNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateListBySchemaRegistryNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SchemaListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Schema resources by SchemaRegistry. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Schema registry name parameter. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListBySchemaRegistryNextPage(string nextLink, string subscriptionId, string resourceGroupName, string schemaRegistryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(schemaRegistryName, nameof(schemaRegistryName)); + + using var message = CreateListBySchemaRegistryNextPageRequest(nextLink, subscriptionId, resourceGroupName, schemaRegistryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SchemaListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SchemaListResult.DeserializeSchemaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Properties/AssemblyInfo.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Properties/AssemblyInfo.cs index f484237f57d0..8e8389ed81b8 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Properties/AssemblyInfo.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; -[assembly: Azure.Core.AzureResourceProviderNamespace("DeviceRegistry")] +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.DeviceRegistry")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] [assembly: InternalsVisibleTo("Azure.ResourceManager.DeviceRegistry.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md.bak similarity index 79% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md rename to sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md.bak index ff3ea9e5901e..077b6c6772c1 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/autorest.md.bak @@ -7,8 +7,8 @@ azure-arm: true csharp: true library-name: DeviceRegistry namespace: Azure.ResourceManager.DeviceRegistry -require: https://github.com/Azure/azure-rest-api-specs/blob/9549a0e63c97d766ddadd56c71b4ad04c096dd3f/specification/deviceregistry/resource-manager/readme.md -#tag: package-preview-2023-11 +require: https://github.com/Azure/azure-rest-api-specs/blob/b440cf2c8cffa273a680b49b082faef69a4bee13/specification/deviceregistry/resource-manager/readme.md +tag: package-preview-2024-09 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -22,12 +22,15 @@ use-model-reader-writer: true #mgmt-debug: # show-serialized-names: true -rename-mapping: - Event: AssetEvent - prepend-rp-prefix: - Asset - AssetEndpointProfile + - DiscoveredAsset + - DiscoveredAssetEndpointProfile + - SchemaRegistry + - Schema + - SchemaVersion + - BillingContainer - ExtendedLocation - ProvisioningState diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/DeviceRegistryManagementTestBase.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/DeviceRegistryManagementTestBase.cs index 4b227a74004f..0a727ede8646 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/DeviceRegistryManagementTestBase.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/DeviceRegistryManagementTestBase.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; using Azure.ResourceManager.Resources; using Azure.ResourceManager.TestFramework; using NUnit.Framework; -using System.Threading.Tasks; namespace Azure.ResourceManager.DeviceRegistry.Tests { diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetEndpointProfilesOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetEndpointProfilesOperationsTest.cs index e5ba67260346..36a120533aea 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetEndpointProfilesOperationsTest.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetEndpointProfilesOperationsTest.cs @@ -2,20 +2,22 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; -using Azure.Core.TestFramework; using Azure.Core; -using NUnit.Framework; +using Azure.Core.TestFramework; using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario { public class DeviceRegistryAssetEndpointProfilesOperationsTest : DeviceRegistryManagementTestBase { private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; - private readonly string _rgNamePrefix = "adr-test-sdk-rg"; - private readonly string _assetNamePrefix = "deviceregistry-test-assetendpointprofile-sdk"; + private readonly string _rgNamePrefix = "adr-test-sdk-rg-assetendpointprofiles"; + private readonly string _assetEndpointProfileNamePrefix = "deviceregistry-test-assetendpointprofile-sdk"; private readonly string _extendedLocationName = "/subscriptions/8c64812d-6e59-4e65-96b3-14a7cdb1a4e4/resourceGroups/adr-sdk-test-rg/providers/Microsoft.ExtendedLocation/customLocations/adr-sdk-test-cluster-cl"; public DeviceRegistryAssetEndpointProfilesOperationsTest(bool isAsync) : base(isAsync) @@ -25,7 +27,7 @@ public DeviceRegistryAssetEndpointProfilesOperationsTest(bool isAsync) : base(is [RecordedTest] public async Task AssetEndpointProfilesCrudOperationsTest() { - var assetEndpointProfileName = Recording.GenerateAssetName(_assetNamePrefix); + var assetEndpointProfileName = Recording.GenerateAssetName(_assetEndpointProfileNamePrefix); var subscription = Client.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{_subscriptionId}")); var rg = await CreateResourceGroup(subscription, _rgNamePrefix, AzureLocation.WestUS); @@ -36,34 +38,80 @@ public async Task AssetEndpointProfilesCrudOperationsTest() // Create DeviceRegistry AssetEndpointProfile var assetEndpointProfileData = new DeviceRegistryAssetEndpointProfileData(AzureLocation.WestUS, extendedLocation) { - TargetAddress = new Uri("opc.tcp://aep-uri"), - UserAuthentication = new UserAuthentication + Properties = new() { - Mode = UserAuthenticationMode.Anonymous + TargetAddress = new Uri("opc.tcp://aep-uri"), + EndpointProfileType = "Microsoft.OpcUa", + Authentication = new() + { + Method = AuthenticationMethod.UsernamePassword, + UsernamePasswordCredentials = new() + { + UsernameSecretName = "usernameSecretNameRef", + PasswordSecretName = "passwordSecretNameRef" + } + } } }; - var assetCreateOrUpdateResponse = await assetEndpointProfilesCollection.CreateOrUpdateAsync(WaitUntil.Completed, assetEndpointProfileName, assetEndpointProfileData, CancellationToken.None); - Assert.IsNotNull(assetCreateOrUpdateResponse.Value); - Assert.IsTrue(Guid.TryParse(assetCreateOrUpdateResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.TargetAddress, assetEndpointProfileData.TargetAddress); + var assetEndpointProfileCreateOrUpdateResponse = await assetEndpointProfilesCollection.CreateOrUpdateAsync(WaitUntil.Completed, assetEndpointProfileName, assetEndpointProfileData, CancellationToken.None); + Assert.IsNotNull(assetEndpointProfileCreateOrUpdateResponse.Value); + Assert.IsTrue(Guid.TryParse(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.TargetAddress, assetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.EndpointProfileType, assetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.Authentication.Method, assetEndpointProfileData.Properties.Authentication.Method); + Assert.AreEqual(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName); + Assert.AreEqual(assetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName); // Read DeviceRegistry AssetEndpointProfile var assetEndpointProfileReadResponse = await assetEndpointProfilesCollection.GetAsync(assetEndpointProfileName, CancellationToken.None); Assert.IsNotNull(assetEndpointProfileReadResponse.Value); - Assert.IsTrue(Guid.TryParse(assetEndpointProfileReadResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.TargetAddress, assetEndpointProfileData.TargetAddress); + Assert.IsTrue(Guid.TryParse(assetEndpointProfileReadResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.Properties.TargetAddress, assetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.Properties.EndpointProfileType, assetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.Properties.Authentication.Method, assetEndpointProfileData.Properties.Authentication.Method); + Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName); + Assert.AreEqual(assetEndpointProfileReadResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName); + + // List DeviceRegistry AssetEndpointProfile by Resource Group + var assetEndpointProfileResourcesListByResourceGroup = new List(); + var assetEndpointProfileResourceListByResourceGroupAsyncIteratorPage = assetEndpointProfilesCollection.GetAllAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var assetEndpointProfileEntryPage in assetEndpointProfileResourceListByResourceGroupAsyncIteratorPage) + { + assetEndpointProfileResourcesListByResourceGroup.AddRange(assetEndpointProfileEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(assetEndpointProfileResourcesListByResourceGroup); + Assert.GreaterOrEqual(assetEndpointProfileResourcesListByResourceGroup.Count, 1); + + // List DeviceRegistry AssetEndpointProfile by Subscription + var assetEndpointProfileResourcesListBySubscription = new List(); + var assetEndpointProfileResourceListBySubscriptionAsyncIteratorPage = subscription.GetDeviceRegistryAssetEndpointProfilesAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var assetEndpointProfileEntryPage in assetEndpointProfileResourceListBySubscriptionAsyncIteratorPage) + { + assetEndpointProfileResourcesListBySubscription.AddRange(assetEndpointProfileEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(assetEndpointProfileResourcesListBySubscription); + Assert.GreaterOrEqual(assetEndpointProfileResourcesListBySubscription.Count, 1); // Update DeviceRegistry AssetEndpointProfile var assetEndpointProfile = assetEndpointProfileReadResponse.Value; - var assetPatchData = new DeviceRegistryAssetEndpointProfilePatch + var assetEndpointProfilePatchData = new DeviceRegistryAssetEndpointProfilePatch { - AdditionalConfiguration = "{\"foo\":\"bar\"}" + Properties = new() + { + AdditionalConfiguration = "{\"refreshIntervalMs\":1000}" + } }; - var assetEndpointProfileUpdateResponse = await assetEndpointProfile.UpdateAsync(WaitUntil.Completed, assetPatchData, CancellationToken.None); + var assetEndpointProfileUpdateResponse = await assetEndpointProfile.UpdateAsync(WaitUntil.Completed, assetEndpointProfilePatchData, CancellationToken.None); Assert.IsNotNull(assetEndpointProfileUpdateResponse.Value); - Assert.IsTrue(Guid.TryParse(assetEndpointProfileUpdateResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.TargetAddress, assetEndpointProfileData.TargetAddress); - Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.AdditionalConfiguration, assetPatchData.AdditionalConfiguration); + Assert.IsTrue(Guid.TryParse(assetEndpointProfileUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.TargetAddress, assetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.EndpointProfileType, assetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.Authentication.Method, assetEndpointProfileData.Properties.Authentication.Method); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.UsernameSecretName); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName, assetEndpointProfileData.Properties.Authentication.UsernamePasswordCredentials.PasswordSecretName); + Assert.AreEqual(assetEndpointProfileUpdateResponse.Value.Data.Properties.AdditionalConfiguration, assetEndpointProfilePatchData.Properties.AdditionalConfiguration); // Delete DeviceRegistry AssetEndpointProfile await assetEndpointProfile.DeleteAsync(WaitUntil.Completed, CancellationToken.None); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetsOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetsOperationsTest.cs index 21a8c7c52792..7ee27686ef8e 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetsOperationsTest.cs +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryAssetsOperationsTest.cs @@ -2,19 +2,21 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; -using Azure.Core.TestFramework; using Azure.Core; -using NUnit.Framework; +using Azure.Core.TestFramework; using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario { public class DeviceRegistryAssetsOperationsTest : DeviceRegistryManagementTestBase { private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; - private readonly string _rgNamePrefix = "adr-test-sdk-rg"; + private readonly string _rgNamePrefix = "adr-test-sdk-rg-assets"; private readonly string _assetNamePrefix = "deviceregistry-test-asset-sdk"; private readonly string _extendedLocationName = "/subscriptions/8c64812d-6e59-4e65-96b3-14a7cdb1a4e4/resourceGroups/adr-sdk-test-rg/providers/Microsoft.ExtendedLocation/customLocations/adr-sdk-test-cluster-cl"; @@ -36,44 +38,71 @@ public async Task AssetsCrudOperationsTest() // Create DeviceRegistry Asset var assetData = new DeviceRegistryAssetData(AzureLocation.WestUS, extendedLocation) { - Description = "This is an asset.", - AssetEndpointProfileUri = new Uri("http://assetendpointprofileref"), + Properties = new("assetEndpointProfileReference") + { + Description = "This is an asset." + } }; var assetCreateOrUpdateResponse = await assetsCollection.CreateOrUpdateAsync(WaitUntil.Completed, assetName, assetData, CancellationToken.None); Assert.IsNotNull(assetCreateOrUpdateResponse.Value); - Assert.IsTrue(Guid.TryParse(assetCreateOrUpdateResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.ExternalAssetId, assetCreateOrUpdateResponse.Value.Data.Uuid); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.AssetEndpointProfileUri, assetData.AssetEndpointProfileUri); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.DisplayName, assetCreateOrUpdateResponse.Value.Data.Name); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Description, assetData.Description); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Version, 1); - Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Enabled, true); + Assert.IsTrue(Guid.TryParse(assetCreateOrUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.ExternalAssetId, assetCreateOrUpdateResponse.Value.Data.Properties.Uuid); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.AssetEndpointProfileRef, assetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.DisplayName, assetCreateOrUpdateResponse.Value.Data.Name); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.Description, assetData.Properties.Description); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.Version, 1); + Assert.AreEqual(assetCreateOrUpdateResponse.Value.Data.Properties.IsEnabled, true); // Read DeviceRegistry Asset var assetReadResponse = await assetsCollection.GetAsync(assetName, CancellationToken.None); Assert.IsNotNull(assetReadResponse.Value); - Assert.IsTrue(Guid.TryParse(assetReadResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetReadResponse.Value.Data.ExternalAssetId, assetReadResponse.Value.Data.Uuid); - Assert.AreEqual(assetReadResponse.Value.Data.AssetEndpointProfileUri, assetData.AssetEndpointProfileUri); - Assert.AreEqual(assetReadResponse.Value.Data.DisplayName, assetReadResponse.Value.Data.Name); - Assert.AreEqual(assetReadResponse.Value.Data.Version, 1); - Assert.AreEqual(assetReadResponse.Value.Data.Enabled, true); + Assert.IsTrue(Guid.TryParse(assetReadResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetReadResponse.Value.Data.Properties.ExternalAssetId, assetReadResponse.Value.Data.Properties.Uuid); + Assert.AreEqual(assetReadResponse.Value.Data.Properties.AssetEndpointProfileRef, assetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(assetReadResponse.Value.Data.Properties.DisplayName, assetReadResponse.Value.Data.Name); + Assert.AreEqual(assetReadResponse.Value.Data.Properties.Version, 1); + Assert.AreEqual(assetReadResponse.Value.Data.Properties.IsEnabled, true); + + // List DeviceRegistry Asset by Resource Group + var assetResourcesListByResourceGroup = new List(); + var assetResourceListByResourceGroupAsyncIteratorPage = assetsCollection.GetAllAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var assetEntryPage in assetResourceListByResourceGroupAsyncIteratorPage) + { + assetResourcesListByResourceGroup.AddRange(assetEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(assetResourcesListByResourceGroup); + Assert.GreaterOrEqual(assetResourcesListByResourceGroup.Count, 1); + + // List DeviceRegistry Asset by Subscription + var assetResourcesListBySubscription = new List(); + var assetResourceListBySubscriptionAsyncIteratorPage = subscription.GetDeviceRegistryAssetsAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var assetEntryPage in assetResourceListBySubscriptionAsyncIteratorPage) + { + assetResourcesListBySubscription.AddRange(assetEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(assetResourcesListBySubscription); + Assert.GreaterOrEqual(assetResourcesListBySubscription.Count, 1); // Update DeviceRegistry Asset var asset = assetReadResponse.Value; var assetPatchData = new DeviceRegistryAssetPatch { - Description = "This is a patched Asset." + Properties = new() + { + Description = "This is a patched Asset." + } }; var assetUpdateResponse = await asset.UpdateAsync(WaitUntil.Completed, assetPatchData, CancellationToken.None); Assert.IsNotNull(assetUpdateResponse.Value); - Assert.IsTrue(Guid.TryParse(assetUpdateResponse.Value.Data.Uuid, out _)); - Assert.AreEqual(assetUpdateResponse.Value.Data.ExternalAssetId, assetUpdateResponse.Value.Data.Uuid); - Assert.AreEqual(assetUpdateResponse.Value.Data.AssetEndpointProfileUri, assetData.AssetEndpointProfileUri); - Assert.AreEqual(assetUpdateResponse.Value.Data.DisplayName, assetUpdateResponse.Value.Data.Name); - Assert.AreEqual(assetUpdateResponse.Value.Data.Description, assetPatchData.Description); - Assert.AreEqual(assetUpdateResponse.Value.Data.Version, 2); - Assert.AreEqual(assetUpdateResponse.Value.Data.Enabled, true); + Assert.IsTrue(Guid.TryParse(assetUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.ExternalAssetId, assetUpdateResponse.Value.Data.Properties.Uuid); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.AssetEndpointProfileRef, assetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.DisplayName, assetUpdateResponse.Value.Data.Name); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.Description, assetPatchData.Properties.Description); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.Version, 2); + Assert.AreEqual(assetUpdateResponse.Value.Data.Properties.IsEnabled, true); // Delete DeviceRegistry Asset await asset.DeleteAsync(WaitUntil.Completed, CancellationToken.None); diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryBillingContainersOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryBillingContainersOperationsTest.cs new file mode 100644 index 000000000000..ff29ec830dcb --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryBillingContainersOperationsTest.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario +{ + public class DeviceRegistryBillingContainersOperationsTest : DeviceRegistryManagementTestBase + { + private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; + private readonly string _billingContainerName = "adr-billing"; + + public DeviceRegistryBillingContainersOperationsTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task BillingContainersCrudOperationsTest() + { + var subscription = Client.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{_subscriptionId}")); + + // Read DeviceRegistry BillingContainer + var billingContainerReadResponse = await subscription.GetDeviceRegistryBillingContainerAsync(_billingContainerName, CancellationToken.None); + Assert.IsNotNull(billingContainerReadResponse.Value); + Assert.AreEqual(billingContainerReadResponse.Value.Data.Properties.ProvisioningState, DeviceRegistryProvisioningState.Succeeded); + + // List DeviceRegistry BillingContainer by Subscription + var billingContainerResourcesListBySubscription = new List(); + var billingContainerResourceListBySubscriptionAsyncIterator = subscription.GetDeviceRegistryBillingContainers(); + await foreach (var billingContainerEntry in billingContainerResourceListBySubscriptionAsyncIterator) + { + billingContainerResourcesListBySubscription.Add(billingContainerEntry); + } + Assert.IsNotEmpty(billingContainerResourcesListBySubscription); + Assert.AreEqual(billingContainerResourcesListBySubscription.Count, 1); + Assert.AreEqual(billingContainerResourcesListBySubscription[0].Data.Properties.ProvisioningState, DeviceRegistryProvisioningState.Succeeded); + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest.cs new file mode 100644 index 000000000000..8a85dde56318 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario +{ + public class DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest : DeviceRegistryManagementTestBase + { + private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; + private readonly string _rgNamePrefix = "adr-test-sdk-rg-discoveredassetendpointprofiles"; + private readonly string _discoveredAssetEndpointProfileNamePrefix = "deviceregistry-test-discoveredassetendpointprofile-sdk"; + private readonly string _extendedLocationName = "/subscriptions/8c64812d-6e59-4e65-96b3-14a7cdb1a4e4/resourceGroups/adr-sdk-test-rg/providers/Microsoft.ExtendedLocation/customLocations/adr-sdk-test-cluster-cl"; + + public DeviceRegistryDiscoveredAssetEndpointProfilesOperationsTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task DiscoveredAssetEndpointProfilesCrudOperationsTest() + { + var discoveredAssetEndpointProfileName = Recording.GenerateAssetName(_discoveredAssetEndpointProfileNamePrefix); + + var subscription = Client.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{_subscriptionId}")); + var rg = await CreateResourceGroup(subscription, _rgNamePrefix, AzureLocation.WestUS); + var extendedLocation = new DeviceRegistryExtendedLocation() { ExtendedLocationType = "CustomLocation", Name = _extendedLocationName }; + + var discoveredAssetEndpointProfilesCollection = rg.GetDeviceRegistryDiscoveredAssetEndpointProfiles(); + + // Create DeviceRegistry DiscoveredAssetEndpointProfile + var discoveredAssetEndpointProfileData = new DeviceRegistryDiscoveredAssetEndpointProfileData(AzureLocation.WestUS, extendedLocation) + { + Properties = new(new Uri("opc.tcp://aep-uri"), "Microsoft.OpcUa", "sampleDiscoveryId", 1) + }; + discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods.Add("Anonymous"); + discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods.Add("UsernamePassword"); + + var discoveredAssetEndpointProfileCreateOrUpdateResponse = await discoveredAssetEndpointProfilesCollection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetEndpointProfileName, discoveredAssetEndpointProfileData, CancellationToken.None); + Assert.IsNotNull(discoveredAssetEndpointProfileCreateOrUpdateResponse.Value); + Assert.AreEqual(discoveredAssetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.TargetAddress, discoveredAssetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(discoveredAssetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.EndpointProfileType, discoveredAssetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(discoveredAssetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.SupportedAuthenticationMethods[0], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[0]); + Assert.AreEqual(discoveredAssetEndpointProfileCreateOrUpdateResponse.Value.Data.Properties.SupportedAuthenticationMethods[1], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[1]); + + // Read DeviceRegistry DiscoveredAssetEndpointProfile + var discoveredAssetEndpointProfileReadResponse = await discoveredAssetEndpointProfilesCollection.GetAsync(discoveredAssetEndpointProfileName, CancellationToken.None); + Assert.IsNotNull(discoveredAssetEndpointProfileReadResponse.Value); + Assert.AreEqual(discoveredAssetEndpointProfileReadResponse.Value.Data.Properties.TargetAddress, discoveredAssetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(discoveredAssetEndpointProfileReadResponse.Value.Data.Properties.EndpointProfileType, discoveredAssetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(discoveredAssetEndpointProfileReadResponse.Value.Data.Properties.SupportedAuthenticationMethods[0], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[0]); + Assert.AreEqual(discoveredAssetEndpointProfileReadResponse.Value.Data.Properties.SupportedAuthenticationMethods[1], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[1]); + + // List DeviceRegistry DiscoveredAssetEndpointProfile by Resource Group + var discoveredAssetEndpointProfileResourcesListByResourceGroup = new List(); + var discoveredAssetEndpointProfileResourceListByResourceGroupAsyncIteratorPage = discoveredAssetEndpointProfilesCollection.GetAllAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var discoveredAssetEndpointProfileEntryPage in discoveredAssetEndpointProfileResourceListByResourceGroupAsyncIteratorPage) + { + discoveredAssetEndpointProfileResourcesListByResourceGroup.AddRange(discoveredAssetEndpointProfileEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(discoveredAssetEndpointProfileResourcesListByResourceGroup); + Assert.GreaterOrEqual(discoveredAssetEndpointProfileResourcesListByResourceGroup.Count, 1); + + // List DeviceRegistry DiscoveredAssetEndpointProfile by Subscription + var discoveredAssetEndpointProfileResourcesListBySubscription = new List(); + var discoveredAssetEndpointProfileResourceListBySubscriptionAsyncIteratorPage = subscription.GetDeviceRegistryDiscoveredAssetEndpointProfilesAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var discoveredAssetEndpointProfileEntryPage in discoveredAssetEndpointProfileResourceListBySubscriptionAsyncIteratorPage) + { + discoveredAssetEndpointProfileResourcesListBySubscription.AddRange(discoveredAssetEndpointProfileEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(discoveredAssetEndpointProfileResourcesListBySubscription); + Assert.GreaterOrEqual(discoveredAssetEndpointProfileResourcesListBySubscription.Count, 1); + + // Update DeviceRegistry DiscoveredAssetEndpointProfile + var discoveredAssetEndpointProfile = discoveredAssetEndpointProfileReadResponse.Value; + var discoveredAssetEndpointProfilePatchData = new DeviceRegistryDiscoveredAssetEndpointProfilePatch + { + Properties = new() + { + AdditionalConfiguration = "{\"refreshIntervalMs\":1000}" + } + }; + var discoveredAssetEndpointProfileUpdateResponse = await discoveredAssetEndpointProfile.UpdateAsync(WaitUntil.Completed, discoveredAssetEndpointProfilePatchData, CancellationToken.None); + Assert.IsNotNull(discoveredAssetEndpointProfileUpdateResponse.Value); + Assert.AreEqual(discoveredAssetEndpointProfileUpdateResponse.Value.Data.Properties.TargetAddress, discoveredAssetEndpointProfileData.Properties.TargetAddress); + Assert.AreEqual(discoveredAssetEndpointProfileUpdateResponse.Value.Data.Properties.EndpointProfileType, discoveredAssetEndpointProfileData.Properties.EndpointProfileType); + Assert.AreEqual(discoveredAssetEndpointProfileUpdateResponse.Value.Data.Properties.SupportedAuthenticationMethods[0], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[0]); + Assert.AreEqual(discoveredAssetEndpointProfileUpdateResponse.Value.Data.Properties.SupportedAuthenticationMethods[1], discoveredAssetEndpointProfileData.Properties.SupportedAuthenticationMethods[1]); + Assert.AreEqual(discoveredAssetEndpointProfileUpdateResponse.Value.Data.Properties.AdditionalConfiguration, discoveredAssetEndpointProfilePatchData.Properties.AdditionalConfiguration); + + // Delete DeviceRegistry DiscoveredAssetEndpointProfile + try + { + await discoveredAssetEndpointProfile.DeleteAsync(WaitUntil.Completed, CancellationToken.None); + } + catch (RequestFailedException ex) + { + // Delete returns 200 from K8s Bridge if the Arc-enabled resource is not available on the Edge + if (ex.Status != 200) + { + throw; + } + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetsOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetsOperationsTest.cs new file mode 100644 index 000000000000..a6dd0d818e1b --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistryDiscoveredAssetsOperationsTest.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.DeviceRegistry.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario +{ + public class DeviceRegistryDiscoveredAssetsOperationsTest : DeviceRegistryManagementTestBase + { + private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; + private readonly string _rgNamePrefix = "adr-test-sdk-rg-discoveredassets"; + private readonly string _discoveredAssetNamePrefix = "deviceregistry-test-discoveredasset-sdk"; + private readonly string _extendedLocationName = "/subscriptions/8c64812d-6e59-4e65-96b3-14a7cdb1a4e4/resourceGroups/adr-sdk-test-rg/providers/Microsoft.ExtendedLocation/customLocations/adr-sdk-test-cluster-cl"; + + public DeviceRegistryDiscoveredAssetsOperationsTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task DiscoveredAssetsCrudOperationsTest() + { + var discoveredAssetName = Recording.GenerateAssetName(_discoveredAssetNamePrefix); + + var subscription = Client.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{_subscriptionId}")); + var rg = await CreateResourceGroup(subscription, _rgNamePrefix, AzureLocation.WestUS); + var extendedLocation = new DeviceRegistryExtendedLocation() { ExtendedLocationType = "CustomLocation", Name = _extendedLocationName }; + + var discoveredAssetsCollection = rg.GetDeviceRegistryDiscoveredAssets(); + + // Create DeviceRegistry DiscoveredAsset + var discoveredAssetData = new DeviceRegistryDiscoveredAssetData(AzureLocation.WestUS, extendedLocation) + { + Properties = new("assetEndpointProfileReference", "discoveryIdSample", 1) + { + Manufacturer = "Contoso", + ManufacturerUri = new Uri("http://contoso.com/") + } + }; + var discoveredAssetCreateOrUpdateResponse = await discoveredAssetsCollection.CreateOrUpdateAsync(WaitUntil.Completed, discoveredAssetName, discoveredAssetData, CancellationToken.None); + Assert.IsNotNull(discoveredAssetCreateOrUpdateResponse.Value); + Assert.AreEqual(discoveredAssetCreateOrUpdateResponse.Value.Data.Properties.AssetEndpointProfileRef, discoveredAssetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(discoveredAssetCreateOrUpdateResponse.Value.Data.Properties.Manufacturer, discoveredAssetData.Properties.Manufacturer); + + // Read DeviceRegistry DiscoveredAsset + var discoveredAssetReadResponse = await discoveredAssetsCollection.GetAsync(discoveredAssetName, CancellationToken.None); + Assert.IsNotNull(discoveredAssetReadResponse.Value); + Assert.AreEqual(discoveredAssetReadResponse.Value.Data.Properties.AssetEndpointProfileRef, discoveredAssetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(discoveredAssetReadResponse.Value.Data.Properties.Manufacturer, discoveredAssetData.Properties.Manufacturer); + + // List DeviceRegistry DiscoveredAsset by Resource Group + var discoveredAssetResourcesListByResourceGroup = new List(); + var discoveredAssetResourceListByResourceGroupAsyncIteratorPage = discoveredAssetsCollection.GetAllAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var discoveredAssetEntryPage in discoveredAssetResourceListByResourceGroupAsyncIteratorPage) + { + discoveredAssetResourcesListByResourceGroup.AddRange(discoveredAssetEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(discoveredAssetResourcesListByResourceGroup); + Assert.AreEqual(discoveredAssetResourcesListByResourceGroup.Count, 1); + + // List DeviceRegistry Asset by Subscription + var discoveredAssetResourcesListBySubscription = new List(); + var discoveredAssetResourceListBySubscriptionAsyncIteratorPage = subscription.GetDeviceRegistryDiscoveredAssetsAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var discoveredAssetEntryPage in discoveredAssetResourceListBySubscriptionAsyncIteratorPage) + { + discoveredAssetResourcesListBySubscription.AddRange(discoveredAssetEntryPage.Values); + break; // limit to the the first page of results + } + Assert.IsNotEmpty(discoveredAssetResourcesListBySubscription); + Assert.GreaterOrEqual(discoveredAssetResourcesListBySubscription.Count, 1); + + // Update DeviceRegistry DiscoveredAsset + var discoveredAsset = discoveredAssetReadResponse.Value; + var discoveredAssetPatchData = new DeviceRegistryDiscoveredAssetPatch + { + Properties = new() + { + Manufacturer = "Fabrikam" + } + }; + var discoveredAssetUpdateResponse = await discoveredAsset.UpdateAsync(WaitUntil.Completed, discoveredAssetPatchData, CancellationToken.None); + Assert.IsNotNull(discoveredAssetUpdateResponse.Value); + Assert.AreEqual(discoveredAssetUpdateResponse.Value.Data.Properties.AssetEndpointProfileRef, discoveredAssetData.Properties.AssetEndpointProfileRef); + Assert.AreEqual(discoveredAssetUpdateResponse.Value.Data.Properties.Manufacturer, discoveredAssetPatchData.Properties.Manufacturer); + + // Delete DeviceRegistry DiscoveredAsset + try + { + await discoveredAsset.DeleteAsync(WaitUntil.Completed, CancellationToken.None); + } + catch (RequestFailedException ex) + { + // Delete returns 200 from K8s Bridge if the Arc-enabled resource is not available on the Edge + if (ex.Status != 200) + { + throw; + } + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistrySchemaRegistriesOperationsTest.cs b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistrySchemaRegistriesOperationsTest.cs new file mode 100644 index 000000000000..eb6f30a74950 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tests/Scenario/DeviceRegistrySchemaRegistriesOperationsTest.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.DeviceRegistry.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DeviceRegistry.Tests.Scenario +{ + public class DeviceRegistrySchemaRegistriesOperationsTest : DeviceRegistryManagementTestBase + { + private readonly string _subscriptionId = "8c64812d-6e59-4e65-96b3-14a7cdb1a4e4"; + private readonly string _rgNamePrefix = "adr-test-sdk-rg-schemaregistries"; + private readonly string _assetschemaRegistryNamespacePrefix = "namespace-sdk-test"; + private readonly string _assetSchemaRegistryNamePrefix = "deviceregistry-test-schemaregistry-sdk"; + private readonly string _assetSchemaRegistrySchemaNamePrefix = "deviceregistry-test-schemaregistryschema-sdk"; + private readonly string _assetSchemaRegistrySchemaVersionNamePrefix = "1"; + + public DeviceRegistrySchemaRegistriesOperationsTest(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task SchemaRegistriesCrudOperationsTest() + { + var schemaRegistryName = Recording.GenerateAssetName(_assetSchemaRegistryNamePrefix); + var schemaRegistrySchemaName = Recording.GenerateAssetName(_assetSchemaRegistrySchemaNamePrefix); + var schemaRegistrySchemaVersionName = Recording.GenerateAssetName(_assetSchemaRegistrySchemaVersionNamePrefix); + var schemaRegistryNamespace = Recording.GenerateAssetName(_assetschemaRegistryNamespacePrefix); + + var subscription = Client.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{_subscriptionId}")); + var rg = await CreateResourceGroup(subscription, _rgNamePrefix, AzureLocation.WestUS); + + #region SchemaRegistries + /******************* + * SchemaRegistries * + *******************/ + + var schemaRegistriesCollection = rg.GetDeviceRegistrySchemaRegistries(); + + // Create DeviceRegistry SchemaRegistry + var schemaRegistryData = new DeviceRegistrySchemaRegistryData(AzureLocation.WestUS) + { + Properties = new() + { + Namespace = schemaRegistryNamespace, + Description = "This is a Schema Registry instance.", + DisplayName = "Schema Registry SDK test", + StorageAccountContainerUri = new Uri("https://schemaregistrysdktest.blob.core.windows.net/schemaregistrysdkcontainertest") + }, + Identity = new(ManagedServiceIdentityType.SystemAssigned) + }; + var schemaRegistryCreateOrUpdateResponse = await schemaRegistriesCollection.CreateOrUpdateAsync(WaitUntil.Completed, schemaRegistryName, schemaRegistryData, CancellationToken.None); + Assert.IsNotNull(schemaRegistryCreateOrUpdateResponse.Value); + Assert.IsNotNull(schemaRegistryCreateOrUpdateResponse.Value.Data.Identity.TenantId); + Assert.IsNotNull(schemaRegistryCreateOrUpdateResponse.Value.Data.Identity.PrincipalId); + Assert.AreEqual(schemaRegistryCreateOrUpdateResponse.Value.Data.Identity.ManagedServiceIdentityType, ManagedServiceIdentityType.SystemAssigned); + Assert.IsTrue(Guid.TryParse(schemaRegistryCreateOrUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistryCreateOrUpdateResponse.Value.Data.Properties.Namespace, schemaRegistryData.Properties.Namespace); + Assert.AreEqual(schemaRegistryCreateOrUpdateResponse.Value.Data.Properties.Description, schemaRegistryData.Properties.Description); + Assert.AreEqual(schemaRegistryCreateOrUpdateResponse.Value.Data.Properties.DisplayName, schemaRegistryData.Properties.DisplayName); + Assert.AreEqual(schemaRegistryCreateOrUpdateResponse.Value.Data.Properties.StorageAccountContainerUri, schemaRegistryData.Properties.StorageAccountContainerUri); + + // Read DeviceRegistry SchemaRegistry + var schemaRegistryReadResponse = await schemaRegistriesCollection.GetAsync(schemaRegistryName, CancellationToken.None); + Assert.IsNotNull(schemaRegistryReadResponse.Value); + Assert.IsNotNull(schemaRegistryReadResponse.Value.Data.Identity.TenantId); + Assert.IsNotNull(schemaRegistryReadResponse.Value.Data.Identity.PrincipalId); + Assert.AreEqual(schemaRegistryReadResponse.Value.Data.Identity.ManagedServiceIdentityType, ManagedServiceIdentityType.SystemAssigned); + Assert.IsTrue(Guid.TryParse(schemaRegistryReadResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistryReadResponse.Value.Data.Properties.Namespace, schemaRegistryData.Properties.Namespace); + Assert.AreEqual(schemaRegistryReadResponse.Value.Data.Properties.Description, schemaRegistryData.Properties.Description); + Assert.AreEqual(schemaRegistryReadResponse.Value.Data.Properties.DisplayName, schemaRegistryData.Properties.DisplayName); + Assert.AreEqual(schemaRegistryReadResponse.Value.Data.Properties.StorageAccountContainerUri, schemaRegistryData.Properties.StorageAccountContainerUri); + + // List DeviceRegistry SchemaRegistry by Resource Group + var schemaRegistryResourcesListByResourceGroup = new List(); + var schemaRegistryResourceListByResourceGroupAsyncIteratorPage = schemaRegistriesCollection.GetAllAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var schemaRegistryEntryPage in schemaRegistryResourceListByResourceGroupAsyncIteratorPage) + { + schemaRegistryResourcesListByResourceGroup.AddRange(schemaRegistryEntryPage.Values); + } + Assert.IsNotEmpty(schemaRegistryResourcesListByResourceGroup); + Assert.GreaterOrEqual(schemaRegistryResourcesListByResourceGroup.Count, 1); + + // List DeviceRegistry SchemaRegistry by Subscription + var schemaRegistryResourcesListBySubscription = new List(); + var schemaRegistryResourceListBySubscriptionAsyncIteratorPage = subscription.GetDeviceRegistrySchemaRegistriesAsync(CancellationToken.None).AsPages(null, 5); + await foreach (var schemaRegistryEntryPage in schemaRegistryResourceListBySubscriptionAsyncIteratorPage) + { + schemaRegistryResourcesListBySubscription.AddRange(schemaRegistryEntryPage.Values); + } + Assert.IsNotEmpty(schemaRegistryResourcesListBySubscription); + Assert.GreaterOrEqual(schemaRegistryResourcesListBySubscription.Count, 1); + + // Update DeviceRegistry SchemaRegistry + var schemaRegistry = schemaRegistryReadResponse.Value; + var schemaRegistryPatchData = new DeviceRegistrySchemaRegistryPatch + { + Properties = new() + { + Description = "This is a patched Schema Registry instance." + } + }; + var schemaRegistryUpdateResponse = await schemaRegistry.UpdateAsync(WaitUntil.Completed, schemaRegistryPatchData, CancellationToken.None); + Assert.IsNotNull(schemaRegistryUpdateResponse.Value); + Assert.IsNotNull(schemaRegistryUpdateResponse.Value.Data.Identity.TenantId); + Assert.IsNotNull(schemaRegistryUpdateResponse.Value.Data.Identity.PrincipalId); + Assert.AreEqual(schemaRegistryUpdateResponse.Value.Data.Identity.ManagedServiceIdentityType, ManagedServiceIdentityType.SystemAssigned); + Assert.IsTrue(Guid.TryParse(schemaRegistryUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistryUpdateResponse.Value.Data.Properties.Namespace, schemaRegistryData.Properties.Namespace); + Assert.AreEqual(schemaRegistryUpdateResponse.Value.Data.Properties.Description, schemaRegistryPatchData.Properties.Description); + Assert.AreEqual(schemaRegistryUpdateResponse.Value.Data.Properties.DisplayName, schemaRegistryData.Properties.DisplayName); + Assert.AreEqual(schemaRegistryUpdateResponse.Value.Data.Properties.StorageAccountContainerUri, schemaRegistryData.Properties.StorageAccountContainerUri); + + #endregion + + #region SchemaRegistries/Schemas + /*************************** + * SchemaRegistries/Schemas * + ***************************/ + + var schemaRegistriesSchemasCollection = schemaRegistry.GetDeviceRegistrySchemas(); + + // Create DeviceRegistry SchemaRegistry Schema + var schemaRegistrySchemaData = new DeviceRegistrySchemaData() + { + Properties = new(DeviceRegistrySchemaFormat.JsonSchemaDraft7, DeviceRegistrySchemaType.MessageSchema) + { + Description = "This is a Schema instance.", + DisplayName = "Schema SDK test" + } + }; + var schemaRegistrySchemaCreateOrUpdateResponse = await schemaRegistriesSchemasCollection.CreateOrUpdateAsync(WaitUntil.Completed, schemaRegistrySchemaName, schemaRegistrySchemaData, CancellationToken.None); + Assert.IsNotNull(schemaRegistrySchemaCreateOrUpdateResponse.Value); + Assert.IsTrue(Guid.TryParse(schemaRegistrySchemaCreateOrUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistrySchemaCreateOrUpdateResponse.Value.Data.Properties.SchemaType, schemaRegistrySchemaData.Properties.SchemaType); + Assert.AreEqual(schemaRegistrySchemaCreateOrUpdateResponse.Value.Data.Properties.Format, schemaRegistrySchemaData.Properties.Format); + Assert.AreEqual(schemaRegistrySchemaCreateOrUpdateResponse.Value.Data.Properties.Description, schemaRegistrySchemaData.Properties.Description); + Assert.AreEqual(schemaRegistrySchemaCreateOrUpdateResponse.Value.Data.Properties.DisplayName, schemaRegistrySchemaData.Properties.DisplayName); + + // Read DeviceRegistry SchemaRegistry Schema + var schemaRegistrySchemaReadResponse = await schemaRegistriesSchemasCollection.GetAsync(schemaRegistrySchemaName, CancellationToken.None); + Assert.IsNotNull(schemaRegistrySchemaReadResponse.Value); + Assert.IsTrue(Guid.TryParse(schemaRegistrySchemaReadResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistrySchemaReadResponse.Value.Data.Properties.SchemaType, schemaRegistrySchemaData.Properties.SchemaType); + Assert.AreEqual(schemaRegistrySchemaReadResponse.Value.Data.Properties.Format, schemaRegistrySchemaData.Properties.Format); + Assert.AreEqual(schemaRegistrySchemaReadResponse.Value.Data.Properties.Description, schemaRegistrySchemaData.Properties.Description); + Assert.AreEqual(schemaRegistrySchemaReadResponse.Value.Data.Properties.DisplayName, schemaRegistrySchemaData.Properties.DisplayName); + + // List DeviceRegistry SchemaRegistry Schema by SchemaRegistry + var schemaResourcesListBySchemaRegistry = new List(); + var schemaRegistrySchemaListBySchemaRegistryAsyncIterator = schemaRegistriesSchemasCollection.GetAllAsync(CancellationToken.None); + await foreach (var schemaEntry in schemaRegistrySchemaListBySchemaRegistryAsyncIterator) + { + schemaResourcesListBySchemaRegistry.Add(schemaEntry); + } + Assert.IsNotEmpty(schemaResourcesListBySchemaRegistry); + Assert.AreEqual(schemaResourcesListBySchemaRegistry.Count, 1); + Assert.IsTrue(Guid.TryParse(schemaResourcesListBySchemaRegistry[0].Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaResourcesListBySchemaRegistry[0].Data.Properties.SchemaType, schemaRegistrySchemaData.Properties.SchemaType); + Assert.AreEqual(schemaResourcesListBySchemaRegistry[0].Data.Properties.Format, schemaRegistrySchemaData.Properties.Format); + Assert.AreEqual(schemaResourcesListBySchemaRegistry[0].Data.Properties.Description, schemaRegistrySchemaData.Properties.Description); + Assert.AreEqual(schemaResourcesListBySchemaRegistry[0].Data.Properties.DisplayName, schemaRegistrySchemaData.Properties.DisplayName); + + var schemaRegistrySchema = schemaRegistrySchemaReadResponse.Value; + + #endregion + + #region SchemaRegistries/Schemas/SchemaVersions + /****************************************** + * SchemaRegistries/Schemas/SchemaVersions * + ******************************************/ + + var schemaRegistriesSchemaVersionsCollection = schemaRegistrySchema.GetDeviceRegistrySchemaVersions(); + + // ** Uncomment during recording ** + // Manually add the Role Assignment to the target storage container + //int delayMs = 120000; + //Console.Error.WriteLine($"Waiting {delayMs/1000}s. Please add MI \"{schemaRegistryName}\" as \"Storage Blob Data Contributor\" Role to storage account container \"{schemaRegistryData.Properties.StorageAccountContainerUri}\"."); + //await Task.Delay(delayMs); + + // Create DeviceRegistry SchemaRegistry Schema Version + var schemaRegistrySchemaVersionData = new DeviceRegistrySchemaVersionData() + { + Properties = new() + { + SchemaContent = "{\"foo\":\"bar\"}", + Description = "This is a Schema Version instance." + } + }; + var schemaRegistrySchemaVersionCreateOrUpdateResponse = await schemaRegistriesSchemaVersionsCollection.CreateOrUpdateAsync(WaitUntil.Completed, schemaRegistrySchemaVersionName, schemaRegistrySchemaVersionData, CancellationToken.None); + Assert.IsNotNull(schemaRegistrySchemaVersionCreateOrUpdateResponse.Value); + Assert.IsTrue(Guid.TryParse(schemaRegistrySchemaVersionCreateOrUpdateResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistrySchemaVersionCreateOrUpdateResponse.Value.Data.Properties.SchemaContent, schemaRegistrySchemaVersionData.Properties.SchemaContent); + Assert.AreEqual(schemaRegistrySchemaVersionCreateOrUpdateResponse.Value.Data.Properties.Description, schemaRegistrySchemaVersionData.Properties.Description); + + // Read DeviceRegistry SchemaRegistry Schema Version + var schemaRegistrySchemaVersionReadResponse = await schemaRegistriesSchemaVersionsCollection.GetAsync(schemaRegistrySchemaVersionName, CancellationToken.None); + Assert.IsNotNull(schemaRegistrySchemaVersionReadResponse.Value); + Assert.IsTrue(Guid.TryParse(schemaRegistrySchemaVersionReadResponse.Value.Data.Properties.Uuid, out _)); + Assert.AreEqual(schemaRegistrySchemaVersionReadResponse.Value.Data.Properties.SchemaContent, schemaRegistrySchemaVersionData.Properties.SchemaContent); + Assert.AreEqual(schemaRegistrySchemaVersionReadResponse.Value.Data.Properties.Description, schemaRegistrySchemaVersionData.Properties.Description); + + var schemaRegistrySchemaVersion = schemaRegistrySchemaVersionReadResponse.Value; + + #endregion + + // Delete DeviceRegistry SchemaRegistry Schema Version + await schemaRegistrySchemaVersion.DeleteAsync(WaitUntil.Completed, CancellationToken.None); + + // Delete DeviceRegistry SchemaRegistry Schema + await schemaRegistrySchema.DeleteAsync(WaitUntil.Completed, CancellationToken.None); + + // Delete DeviceRegistry SchemaRegistry + try + { + await schemaRegistry.DeleteAsync(WaitUntil.Completed, CancellationToken.None); + } + catch (RequestFailedException ex) + { + // Delete temporary returns 200 since async operation is defined for the resource but not implemented in RP + if (ex.Status != 200) + { + throw; + } + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml new file mode 100644 index 000000000000..eccde3b929d1 --- /dev/null +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification\deviceregistry\DeviceRegistry.Management +commit: 6b24ef84f11c4f58c2d4a846ccee1eb04f0c877e +repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md index 8eb873fe9d2e..f422dbea8e12 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md @@ -593,8 +593,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fdocumentintelligence%2FAzure.AI.DocumentIntelligence%2FREADME.png) - [docint_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src [docint_docs]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/ @@ -643,5 +641,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.png) diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/README.md b/sdk/easm/Azure.Analytics.Defender.Easm/README.md index 3e895427e6f2..93ae03abaa31 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/README.md +++ b/sdk/easm/Azure.Analytics.Defender.Easm/README.md @@ -98,7 +98,7 @@ foreach (AssetResource asset in response) ``` ### Create discovery group - + You can call the client's `DiscoGroupCreateOrReplace` method to create or replace your disco group ```C# Snippet:Sample2_DiscoveryGroups_Create_Discovery_Group @@ -176,5 +176,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/easm/Azure.Analytics.Defender.Easm/README.png) diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticVersionListProperties.Serialization.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticVersionListProperties.Serialization.cs new file mode 100644 index 000000000000..82919a051099 --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticVersionListProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Elastic.Models +{ + internal partial class ElasticVersionListProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticVersionListProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ElasticVersionListProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticVersionListProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticVersionListProperties(document.RootElement, options); + } + + internal static ElasticVersionListProperties DeserializeElasticVersionListProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ElasticVersionListProperties(version, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ElasticVersionListProperties)} does not support writing '{options.Format}' format."); + } + } + + ElasticVersionListProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeElasticVersionListProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticVersionListProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ExternalUserCreationResponse.Serialization.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ExternalUserCreationResponse.Serialization.cs new file mode 100644 index 000000000000..27584627f0da --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ExternalUserCreationResponse.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Elastic.Models +{ + public partial class ExternalUserCreationResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalUserCreationResponse)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Created)) + { + writer.WritePropertyName("created"u8); + writer.WriteBooleanValue(Created.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExternalUserCreationResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalUserCreationResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalUserCreationResponse(document.RootElement, options); + } + + internal static ExternalUserCreationResponse DeserializeExternalUserCreationResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? created = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("created"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + created = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalUserCreationResponse(created, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExternalUserCreationResponse)} does not support writing '{options.Format}' format."); + } + } + + ExternalUserCreationResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExternalUserCreationResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalUserCreationResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/MarketplaceSaaSInfoMarketplaceSubscription.Serialization.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/MarketplaceSaaSInfoMarketplaceSubscription.Serialization.cs new file mode 100644 index 000000000000..940e7254127c --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/MarketplaceSaaSInfoMarketplaceSubscription.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Elastic.Models +{ + public partial class MarketplaceSaaSInfoMarketplaceSubscription : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSaaSInfoMarketplaceSubscription)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(PublisherId)) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + } + if (Optional.IsDefined(OfferId)) + { + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MarketplaceSaaSInfoMarketplaceSubscription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSaaSInfoMarketplaceSubscription)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceSaaSInfoMarketplaceSubscription(document.RootElement, options); + } + + internal static MarketplaceSaaSInfoMarketplaceSubscription DeserializeMarketplaceSaaSInfoMarketplaceSubscription(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string publisherId = default; + string offerId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceSaaSInfoMarketplaceSubscription(id, publisherId, offerId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MarketplaceSaaSInfoMarketplaceSubscription)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceSaaSInfoMarketplaceSubscription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketplaceSaaSInfoMarketplaceSubscription(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceSaaSInfoMarketplaceSubscription)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponse.Serialization.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponse.Serialization.cs new file mode 100644 index 000000000000..858979bb8daf --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponse.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Elastic.Models +{ + public partial class OpenAIIntegrationStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponse)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAIIntegrationStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIIntegrationStatusResponse(document.RootElement, options); + } + + internal static OpenAIIntegrationStatusResponse DeserializeOpenAIIntegrationStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenAIIntegrationStatusResponseProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = OpenAIIntegrationStatusResponseProperties.DeserializeOpenAIIntegrationStatusResponseProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIIntegrationStatusResponse(properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + OpenAIIntegrationStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIIntegrationStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponseProperties.Serialization.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponseProperties.Serialization.cs new file mode 100644 index 000000000000..1608b2801aef --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/OpenAIIntegrationStatusResponseProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Elastic.Models +{ + internal partial class OpenAIIntegrationStatusResponseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponseProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAIIntegrationStatusResponseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIIntegrationStatusResponseProperties(document.RootElement, options); + } + + internal static OpenAIIntegrationStatusResponseProperties DeserializeOpenAIIntegrationStatusResponseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIIntegrationStatusResponseProperties(status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponseProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIIntegrationStatusResponseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIIntegrationStatusResponseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIIntegrationStatusResponseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/MonitoredSubscriptionPropertyResource.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 000000000000..541d76ed9a1f --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Elastic +{ + /// + /// A Class representing a MonitoredSubscriptionProperty along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMonitoredSubscriptionPropertyResource method. + /// Otherwise you can get one from its parent resource using the GetMonitoredSubscriptionProperty method. + /// + public partial class MonitoredSubscriptionPropertyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The monitorName. + /// The configurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics; + private readonly MonitoredSubscriptionsRestOperations _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient; + private readonly MonitoredSubscriptionPropertyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Elastic/monitors/monitoredSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected MonitoredSubscriptionPropertyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MonitoredSubscriptionPropertyResource(ArmClient client, MonitoredSubscriptionPropertyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MonitoredSubscriptionPropertyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Elastic", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); + _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MonitoredSubscriptionPropertyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the Elastic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ElasticArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the Elastic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ElasticArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the Elastic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Update + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ElasticArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the Elastic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Update + /// + /// + /// Default Api Version + /// 2024-06-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ElasticArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs new file mode 100644 index 000000000000..c1d6696e8468 --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Elastic.Models; + +namespace Azure.ResourceManager.Elastic +{ + internal partial class MonitoredSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MonitoredSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MonitoredSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-06-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateorUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateorUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Add the subscriptions that should be monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateorUpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateorUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add the subscriptions that should be monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateorUpdate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateorUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the subscriptions that are being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the subscriptions that are being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Elastic/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Updates the subscriptions that are being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the subscriptions that are being monitored by the Elastic monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the subscriptions currently being monitored by the Elastic monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/README.md b/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/README.md index 66bc7de81724..6dc0aba2d7e8 100644 --- a/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/README.md +++ b/sdk/entra/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/README.md @@ -31,7 +31,7 @@ dotnet add package Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents ### Authenticate the client -There are three ways to set up authentication for your Azure Function: +There are three ways to set up authentication for your Azure Function: - [Set up authentication in the Azure portal using environment variables](#set-up-authentication-in-the-azure-portal-using-environment-variables) (recommended) - [Set up authentication in your code using `WebJobsAuthenticationEventsTriggerAttribute`](#set-up-authentication-in-your-code-using-webjobsauthenticationeventstriggerattribute) @@ -40,17 +40,17 @@ There are three ways to set up authentication for your Azure Function: By default, the code has been set up for authentication in the Azure portal using environment variables. Use the tabs below to select your preferred method of implementing environment variables, or alternatively, refer to the built-in [Azure App service authentication and authorization](https://learn.microsoft.com/azure/app-service/overview-authentication-authorization). For setting up environment variables, use the following values: | Name | Value | - | ---- | ----- | + | ---- | ----- | | *AuthenticationEvents__AudienceAppId* | *Custom authentication extension app ID* which is set up in [Configure a custom claim provider for a token issuance event](https://learn.microsoft.com/entra/identity-platform/custom-extension-tokenissuancestart-configuration) | - | *AuthenticationEvents__AuthorityUrl* | • Workforce tenant `https://login.microsoftonline.com/`
• External tenant `https://.ciamlogin.com/` | - | *AuthenticationEvents__AuthorizedPartyAppId* | `99045fe1-7639-4a75-9d4a-577b6ca3810f` or another authorized party | + | *AuthenticationEvents__AuthorityUrl* | • Workforce tenant `https://login.microsoftonline.com/`
• External tenant `https://.ciamlogin.com/` | + | *AuthenticationEvents__AuthorizedPartyAppId* | `99045fe1-7639-4a75-9d4a-577b6ca3810f` or another authorized party | #### Set up authentication in the Azure portal using environment variables 1. Sign in to the [Azure portal](https://portal.azure.com) as at least an [Application Administrator](https://learn.microsoft.com/entra/identity/role-based-access-control/permissions-reference#application-developer) or [Authentication Administrator](https://learn.microsoft.com/entra/identity/role-based-access-control/permissions-reference#authentication-administrator). 2. Navigate to the function app you created, and under **Settings**, select **Configuration**. -3. Under **Application settings**, select **New application setting** and add the environment variables from the table and their associated values. +3. Under **Application settings**, select **New application setting** and add the environment variables from the table and their associated values. 4. Select **Save** to save the application settings. #### Set up authentication in your code using `WebJobsAuthenticationEventsTriggerAttribute` @@ -75,7 +75,7 @@ Key concepts of the Azure .NET SDK can be found [here](https://azure.github.io/a ### Microsoft Entra custom extensions -Custom extensions allow you to handle Microsoft Entra authentication events, integrate with external systems, and customize what happens in your application authentication experience. For example, a custom claims provider is a custom extension that allows you to enrich or customize application tokens with information from external systems that can't be stored as part of the Microsoft Entra directory. +Custom extensions allow you to handle Microsoft Entra authentication events, integrate with external systems, and customize what happens in your application authentication experience. For example, a custom claims provider is a custom extension that allows you to enrich or customize application tokens with information from external systems that can't be stored as part of the Microsoft Entra directory. ### Authentication events trigger @@ -218,7 +218,7 @@ It's a good idea to test the function locally before deploying it to Azure. We c "customClaim1": "customClaimValue1", "customClaim2": [ "customClaimString1", - "customClaimString2" + "customClaimString2" ] } } @@ -271,8 +271,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fentra%2FMicrosoft.Azure.WebJobs.Extensions.AuthenticationEvents%2FREADME.png) - [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md index 4f688226f52c..902a219836a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md @@ -105,5 +105,3 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft. [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md index 9d996a9de982..d782217c44f4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md @@ -159,5 +159,3 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft. [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index 16d3b95d107d..b59442d9e6e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.30.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.29.0 (2025-01-21) ### Features Added diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid/README.md index 045ccfe7329f..02a6a092ae4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/README.md @@ -376,5 +376,3 @@ You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 6c1d0de5096a..fc5ac91a8c28 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,9 +2,9 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.29.0 + 4.30.0-beta.1 - 4.28.0 + 4.29.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; true $(RequiredTargetFrameworks) diff --git a/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md b/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md index a25ab02fc29e..33487caa7ac8 100644 --- a/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md +++ b/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md @@ -98,7 +98,5 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventgrid%2FMicrosoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents%2FREADME.png) - [code_of_conduct]: https://opensource.microsoft.com/codeofconduct [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md b/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md index 507b11a09c1f..1cc2428a65c3 100644 --- a/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md +++ b/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md @@ -197,8 +197,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.EventGrid%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.EventGrid/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventGrid/ diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md old mode 100755 new mode 100644 index 2e392a4e9af4..f6b3e452bdaf --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 5.12.0-beta.2 (Unreleased) +## 5.12.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 5.12.0-beta.2 (2025-02-11) ### Acknowledgments @@ -10,10 +20,23 @@ Thank you to our developer community members who helped to make the Event Hubs c ### Features Added -### Breaking Changes +- Support for the Event Hubs geographic data replication feature has been enabled. Checking for whether or not this feature is enabled for your namespace can be done by querying for Event Hub properties using `EventHubProducerClient` or `EventHubConsumerClient` and referencing the the `IsGeoReplicationEnabled` property of the result. -### Bugs Fixed + As part of this feature, the type of offset-related data has been changed from `long` to `string` to align with changes to the Event Hubs service API. To preserve backwards compatibility, the existing offset-related members have not been changed, and new members with names similar to `OffsetString` and string-based parameters for method overloads have been introduced. + + The long-based offset members will continue to work for Event Hubs namespaces that do not have GeoDR replication enabled, but are discouraged for use and have been marked as obsolete. + + Obsoleted properties: + - `EventData.Offset` + - `LastEnqueuedEventProperties.Offset` + - `PartitionProperties.LastEnqueuedOffset` + Obsoleted method overloads: + - EventPosition.FromOffset + - EventHubsModelFactory.EventData + - BlobCheckpointStore.UpdateCheckpointAsync + - EventProcessorClient.UpdateCheckpointAsync + ### Other Changes - Added annotations to make the package compatible with trimming and native AOT compilation. @@ -22,6 +45,12 @@ Thank you to our developer community members who helped to make the Event Hubs c - Updated the `Microsoft.Azure.Amqp` dependency to 2.6.9, which contains several bug fixes. _(see: [commits](https://github.com/Azure/azure-amqp/commits/hotfix/))_ +## 5.11.6 (2025-02-11) + +### Other Changes + +- Bump `Azure.Messaging.EventHubs` dependency to 5.11.6, which includes bumps to several transitive dependencies. + ## 5.11.5 (2024-08-14) ### Other Changes diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md index 249e00b10454..2caf23417e13 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/README.md @@ -32,11 +32,11 @@ The Event Processor client library is a companion to the Azure Event Hubs client Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal. - You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). - + You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). + **Important Note:** In order to build or run the [examples](#examples) and the [samples](#next-steps) without modification, use of C# 11.0 is necessary. You can still run the samples if you decide to tweak them for other language versions. -To quickly create the needed resources in Azure and to receive connection strings for them, you can deploy our sample template by clicking: +To quickly create the needed resources in Azure and to receive connection strings for them, you can deploy our sample template by clicking: [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-sdk-for-net%2Fmain%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Processor%2Fassets%2Fsamples-azure-deploy.json) @@ -62,7 +62,7 @@ Once you have the connection strings, see [Creating an Event Processor Client](# ## Key concepts -- An **event processor** is a construct intended to manage the responsibilities associated with connecting to a given Event Hub and processing events from each of its partitions, in the context of a specific consumer group. The act of processing events read from the partition and handling any errors that occur is delegated by the event processor to code that you provide, allowing your logic to concentrate on delivering business value while the processor handles the tasks associated with reading events, managing the partitions, and allowing state to be persisted in the form of checkpoints. +- An **event processor** is a construct intended to manage the responsibilities associated with connecting to a given Event Hub and processing events from each of its partitions, in the context of a specific consumer group. The act of processing events read from the partition and handling any errors that occur is delegated by the event processor to code that you provide, allowing your logic to concentrate on delivering business value while the processor handles the tasks associated with reading events, managing the partitions, and allowing state to be persisted in the form of checkpoints. - **Checkpointing** is a process by which readers mark and persist their position for events that have been processed for a partition. Checkpointing is the responsibility of the consumer and occurs on a per-partition, typically in the context of a specific consumer group. For the `EventProcessorClient`, this means that, for a consumer group and partition combination, the processor must keep track of its current position in the event stream. If you would like more information, please refer to [checkpointing ](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#checkpointing) in the Event Hubs product documentation. @@ -255,7 +255,7 @@ The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/blob/mai To make use of an Active Directory principal, one of the available credentials from the `Azure.Identity` library is specified when creating the Event Hubs client. In addition, the fully qualified Event Hubs namespace and the name of desired Event Hub are supplied in lieu of the Event Hubs connection string. -To make use of an Active Directory principal with Azure Storage blob containers, the fully qualified URL to the container must be provided when creating the storage client. Details about the valid URI formats for accessing Blob storage may be found in [Naming and Referencing Containers, Blobs, and Metadata](https://learn.microsoft.com/rest/api/storageservices/Naming-and-Referencing-Containers--Blobs--and-Metadata#resource-uri-syntax). +To make use of an Active Directory principal with Azure Storage blob containers, the fully qualified URL to the container must be provided when creating the storage client. Details about the valid URI formats for accessing Blob storage may be found in [Naming and Referencing Containers, Blobs, and Metadata](https://learn.microsoft.com/rest/api/storageservices/Naming-and-Referencing-Containers--Blobs--and-Metadata#resource-uri-syntax). ```C# Snippet:EventHubs_Processor_ReadMe_CreateWithIdentity var credential = new DefaultAzureCredential(); @@ -300,13 +300,13 @@ For detailed troubleshooting information, please refer to the [Event Hubs Troubl The Event Processor client makes every attempt to be resilient in the face of exceptions and will take the necessary actions to continue processing unless it is impossible to do so. **_No action from developers is needed_** for this to take place; it is natively part of the processor's behavior. -In order to allow developers the opportunity to inspect and react to exceptions that occur within the Event Processor client operations, they are surfaced via the `ProcessError` event. The arguments for this event offer details about the exception and the context in which it was observed. Developers may perform normal operations on the Event Processor client from within this event handler, such as stopping and/or restarting it in response to errors, but may not otherwise influence the processor's exception behavior. +In order to allow developers the opportunity to inspect and react to exceptions that occur within the Event Processor client operations, they are surfaced via the `ProcessError` event. The arguments for this event offer details about the exception and the context in which it was observed. Developers may perform normal operations on the Event Processor client from within this event handler, such as stopping and/or restarting it in response to errors, but may not otherwise influence the processor's exception behavior. For a basic example of implementing the error handler, please see the sample: [Event Processor Handlers](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md#process-error). #### Exceptions in event handlers -Because the Event Processor client lacks the appropriate context to understand the severity of exceptions within the event handlers that developers provide, it cannot assume what actions would be a reasonable response to them. As a result, developers are considered responsible for exceptions that occur within the event handlers they provide using `try/catch` blocks and other standard language constructs. +Because the Event Processor client lacks the appropriate context to understand the severity of exceptions within the event handlers that developers provide, it cannot assume what actions would be a reasonable response to them. As a result, developers are considered responsible for exceptions that occur within the event handlers they provide using `try/catch` blocks and other standard language constructs. The Event Processor client will not attempt to detect exceptions in developer code nor surface them explicitly. The resulting behavior will depend on the processor's hosting environment and the context in which the event handler was called. Because this may vary between different scenarios, it is strongly recommended that developers code their event handlers defensively and account for potential exceptions. @@ -322,7 +322,7 @@ The Event Processor library is also instrumented for distributed tracing using A Beyond the scenarios discussed, the Azure Event Hubs Processor library offers support for additional scenarios to help take advantage of the full feature set of the `EventProcessorClient`. In order to help explore some of these scenarios, the Event Hubs Processor client library offers a project of samples to serve as an illustration for common scenarios. Please see the samples [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/README.md) for details. -## Contributing +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -331,5 +331,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Processor%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/perf/README.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/perf/README.md index a5528c7885e6..f7b83b4cc062 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/perf/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/perf/README.md @@ -5,8 +5,8 @@ The assets in this area comprise a set of performance tests for the [Azure Event ## Running performance tests The Event Hubs client library performance tests by executing the command-line application using the `dotnet run` command or, in some environments, your operating system's executable support. The performance tests rely on the same set of environment variables used by the Event Hubs client library's test suite. Full details can be found in the [Running tests](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md#running-tests) section of the contributing guide. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -15,5 +15,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Processor.Perf%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/README.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/README.md index 7b5355de0196..f96cd220b5fa 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/README.md @@ -15,7 +15,7 @@ The Azure Event Hubs Processor client library offers samples in two forms. Comm The markdown-based samples are ordered by increasing complexity, starting with more basic scenarios to help get started quickly. Though each sample is independent, they will assume an understanding of the content discussed in earlier samples. -Each of the application samples are intended to be self-contained and focused on illustrating one specific scenario. The simplest way to begin is to launch the project for debugging in Visual Studio, or your preferred IDE, and provide the Event Hubs connection information in response to the prompts. Each of these sample applications is accompanied by a dedicated README, offering more specific detail about its hosting needs and operation. +Each of the application samples are intended to be self-contained and focused on illustrating one specific scenario. The simplest way to begin is to launch the project for debugging in Visual Studio, or your preferred IDE, and provide the Event Hubs connection information in response to the prompts. Each of these sample applications is accompanied by a dedicated README, offering more specific detail about its hosting needs and operation. ## Getting started @@ -27,11 +27,11 @@ Each of the application samples are intended to be self-contained and focused on - **Azure Storage blob container:** Checkpoint and ownership data in Azure Storage will be written to blobs in a specific container. The `EventProcessorClient` requires an existing container and will not implicitly create one to help guard against accidental misconfiguration. It is recommended that you use a unique container for each Event Hub and consumer group combination. If you are not familiar with Azure Storage containers, you may wish to refer to the documentation on [managing containers](https://learn.microsoft.com/azure/storage/blobs/storage-blob-container-create?tabs=dotnet). There, you can find detailed instructions for using .NET, the Azure CLI, or Azure PowerShell to create a container. -- **C# 8.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. +- **C# 8.0:** The Azure Event Hubs client library makes use of new features that were introduced in C# 8.0. In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. Visual Studio users wishing to take full advantage of the C# 8.0 syntax will need to use Visual Studio 2019 or later. Visual Studio 2019, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). Users of Visual Studio 2017 can take advantage of the C# 8 syntax by making use of the [Microsoft.Net.Compilers NuGet package](https://www.nuget.org/packages/Microsoft.Net.Compilers/) and setting the language version, though the editing experience may not be ideal. - You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). + You can still use the library with previous C# language versions, but will need to manage asynchronous enumerable and asynchronous disposable members manually rather than benefiting from the new syntax. You may still target any framework version supported by your .NET Core SDK, including earlier versions of .NET Core or the .NET framework. For more information, see: [how to specify target frameworks](https://learn.microsoft.com/dotnet/standard/frameworks#how-to-specify-target-frameworks). To quickly create a basic set of resources in Azure and to receive a connection string for them, you can deploy our sample template by clicking: @@ -57,34 +57,34 @@ For the event processor client to make use of Azure Storage blobs for checkpoint ## Common samples -- [Hello world](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md) - An introduction to the Event Processor client, illustrating how to create the client and perform basic operations. - -- [Event Processor Configuration](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md) - A demonstration of the options for customizing the Event Processor client configuration, such as specifying a proxy. - -- [Event Processor Handlers](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md) +- [Hello world](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md) + An introduction to the Event Processor client, illustrating how to create the client and perform basic operations. + +- [Event Processor Configuration](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample02_EventProcessorConfiguration.md) + A demonstration of the options for customizing the Event Processor client configuration, such as specifying a proxy. + +- [Event Processor Handlers](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample03_EventProcessorHandlers.md) A discussion of using event handlers for interacting with the Event Processor client as it is running, illustrating the available events and common usage scenarios like processing events, detecting errors, and specifying a position to begin reading events if a checkpoint does not exist. - -- [Processing Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md) - A deep dive into processing events, handling errors, and creating checkpoints using the Event Processor client. - -- [Identity and Shared Access Credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md) + +- [Processing Events](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md) + A deep dive into processing events, handling errors, and creating checkpoints using the Event Processor client. + +- [Identity and Shared Access Credentials](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample05_IdentityAndSharedAccessCredentials.md) A discussion of the different types of authorization supported, focusing on identity-based credentials for Azure Active Directory and use the of shared access signatures and keys. - -- [Requesting Azure Storage Service Versions](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md) + +- [Requesting Azure Storage Service Versions](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample06_RequestingStorageServiceVersions.md) An illustration of configuring the Blob Storage client to use a specific version of the service, rather than the default (latest). This is useful when the Azure host environment that you are targeting supports a different version of Blob Storage service than is available in the Azure public cloud, such as Azure Stack Hub 2002. -- [Processing Events in Batches](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md) +- [Processing Events in Batches](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample07_BatchProcessing.md) A demonstration of how events can be processed in batches rather than individually. - -- [Mocking Client Types](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md) + +- [Mocking Client Types](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md) A demonstration of how to mock the types in the Event Hubs Processor client library, focusing on common application scenarios. -- [Using the Event Processor with an ASP.NET hosted service](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/README.md) +- [Using the Event Processor with an ASP.NET hosted service](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/aspnet-hosted-service/README.md) An example of how to create and configure the Event Processor client in an ASP.NET context as a hosted service implementation. -## Contributing +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -93,5 +93,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Processor/samples/%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj index 0dee15d11d0f..4b5570fe1844 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj @@ -1,7 +1,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This library extends its Event Processor with durable storage for checkpoint information using Azure Blob storage. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.12.0-beta.2 + 5.12.0-beta.3 5.11.5 Azure;Event Hubs;EventHubs;.NET;Event Processor;EventProcessor;$(PackageCommonTags) @@ -16,9 +16,8 @@ - - - + + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/README.md b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/README.md index f3c6a0aad88a..7de7ef07abef 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/README.md @@ -3,8 +3,8 @@ This library is intended to serve as a common location for non-public code that is shared amongst the packages that comprise the [Azure Event Hubs client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs) development ecosystem. The artifacts in this library are intended to be small and cohesive units of work with minimal dependencies, which offer common building blocks for internal implementation. These artifacts should be accompanied by their suite of unit tests, allowing the `Shared` library to have sole responsibility for them. The other libraries within the Azure Event Hubs ecosystem are expected to include these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -13,5 +13,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Shared%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs index daca314fa2d8..ca61d2f8404a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs @@ -223,9 +223,11 @@ public override async Task> ClaimO { // This is an unlikely corner case that indicates that the blob was unexpectedly deleted while the // processor is running. Attempt to recover by resetting the ETag and considering it an upload scenario - // to be handled by the next block. + // to be handled by the next block. Additionally clear the IfMatch to ensure next block does not have + // an outdated ETag. ownership.Version = null; + blobRequestConditions.IfMatch = null; } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs index e821e99379c6..ada68d390e78 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs @@ -309,9 +309,11 @@ public async Task ClaimOwnershipCompensatesWhenABlobIsDeleted() setMetadataCalled = true; }; - client.UploadAsyncCallback = (_, _, _, _, _, _, _, _) => + client.UploadAsyncCallback = (_, _, _, conditions, _, _, _, _) => { uploadBlobCalled = true; + Assert.That(conditions.IfNoneMatch, Is.EqualTo(new ETag("*")), "The IfNoneMatch condition should be set."); + Assert.That(conditions.IfMatch, Is.Null, "The IfMatch condition should be null."); }; }); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md old mode 100755 new mode 100644 index 2f8b8e4d1cfb..0e0e512dcf86 --- a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 5.12.0-beta.2 (Unreleased) +## 5.12.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 5.12.0-beta.2 (2025-02-11) ### Acknowledgments @@ -10,12 +20,29 @@ Thank you to our developer community members who helped to make the Event Hubs c ### Features Added -### Breaking Changes +- Support for the Event Hubs geographic data replication feature has been enabled. Checking for whether or not this feature is enabled for your namespace can be done by querying for Event Hub properties using `EventHubProducerClient` or `EventHubConsumerClient` and referencing the the `IsGeoReplicationEnabled` property of the result. + + As part of this feature, the type of offset-related data has been changed from `long` to `string` to align with changes to the Event Hubs service API. To preserve backwards compatibility, the existing offset-related members have not been changed, and new members with names similar to `OffsetString` and string-based parameters for method overloads have been introduced. + + The long-based offset members will continue to work for Event Hubs namespaces that do not have GeoDR replication enabled, but are discouraged for use and have been marked as obsolete. + + Obsoleted properties: + - `EventData.Offset` + - `LastEnqueuedEventProperties.Offset` + - `PartitionProperties.LastEnqueuedOffset` + + Obsoleted method overloads: + - `EventPosition.FromOffset` + - `EventHubsModelFactory.EventData` + - `BlobCheckpointStore.UpdateCheckpointAsync` + - `EventProcessorClient.UpdateCheckpointAsync` ### Bugs Fixed - Querying runtime data and other management operations will now correctly guards against the race condition where an AMQP link is in the process of closing as the operation attempts to use it. These errors will now properly be classified as retriable as they are for producer and consumer operations. +- Fixed an obscure edge case in the `EventHubBufferedProducer` client where an obscure race condition when flushing/enqueuing events concurrently with disposing the producer could cause a semaphore to be released inappropriately. This error superseded the `TaskCanceledException` that should have been surfaced. + ### Other Changes - Added annotations to make the package compatible with trimming and native AOT compilation. @@ -24,6 +51,12 @@ Thank you to our developer community members who helped to make the Event Hubs c - Updated the `Microsoft.Azure.Amqp` dependency to 2.6.9, which contains several bug fixes. _(see: [commits](https://github.com/Azure/azure-amqp/commits/hotfix/))_ +## 5.11.6 (2025-02-11) + +### Bugs Fixed + +- Fixed an obscure edge case in the `EventHubBufferedProducer` client where an obscure race condition when flushing/enqueuing events concurrently with disposing the producer could cause a semaphore to be released inappropriately. This error superseded the `TaskCanceledException` that should have been surfaced. + ## 5.11.5 (2024-07-31) ### Other Changes diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/README.md b/sdk/eventhub/Azure.Messaging.EventHubs/README.md index 8470eb1c1fbc..8b1f7e06a95a 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/README.md @@ -386,5 +386,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs index 091f1b9a6203..b4379c3acdf3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs @@ -541,6 +541,7 @@ public partial struct CheckpointPosition : System.IEquatable CreateManagementLinkAsync( var linkSettings = new AmqpLinkSettings { OperationTimeout = operationTimeout }; linkSettings.AddProperty(AmqpProperty.Timeout, (uint)linkTimeout.TotalMilliseconds); + linkSettings.DesiredCapabilities ??= new Multiple(); + linkSettings.DesiredCapabilities.Add(AmqpProperty.GeoReplication); + link = new RequestResponseAmqpLink(AmqpManagement.LinkType, session, AmqpManagement.Address, linkSettings.Properties); // Track the link before returning it, so that it can be managed with the scope. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs index 197ce100d923..c15500547661 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs @@ -65,6 +65,12 @@ internal static class AmqpError /// public static AmqpSymbol ProducerStolenError { get; } = AmqpConstants.Vendor + ":producer-epoch-stolen"; + /// + /// Indicates that an offset is invalid for a GeoDR-enabled namespace. + /// + /// + public static AmqpSymbol InvalidGeolocationOffset { get; } = AmqpConstants.Vendor + ":georeplication:invalid-offset"; + /// /// The expression to test for when the service returns a "Not Found" response to determine the context. /// @@ -224,6 +230,13 @@ private static Exception CreateException(string condition, return new EventHubsException(eventHubsResource, description, EventHubsException.FailureReason.InvalidClientState, innerException); } + // An offset was rejected as invalid for a GeoDR-enabled namespace. + + if (string.Equals(condition, InvalidGeolocationOffset.Value, StringComparison.InvariantCultureIgnoreCase)) + { + return new FormatException(IncludeTroubleshootingGuideLink(description), innerException); + } + // Authorization was denied. if (string.Equals(condition, AmqpErrorCode.UnauthorizedAccess.Value, StringComparison.InvariantCultureIgnoreCase)) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj index 3886bff09ec5..e766b94f5218 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj @@ -1,7 +1,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This client library allows for both publishing and consuming events using Azure Event Hubs. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ - 5.12.0-beta.2 + 5.12.0-beta.3 5.11.4 Azure;Event Hubs;EventHubs;.NET;AMQP;IoT;$(PackageCommonTags) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventHubsEventSource.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventHubsEventSource.cs index b4a66fc2c8b7..d94a23cdfca9 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventHubsEventSource.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventHubsEventSource.cs @@ -2789,6 +2789,27 @@ public virtual void EventProcessorFatalTaskError(string identifier, } } + /// + /// Indicates that an instance used an invalid offset format from a legacy checkpoint when initializing a partition for processing. + /// + /// + /// The identifier of the Event Hub partition whose processing is taking place. + /// A unique name used to identify the event processor. + /// The name of the Event Hub that the processor is associated with. + /// The name of the consumer group that the processor is associated with. + /// + [Event(131, Level = EventLevel.Error, Message = "The checkpoint data for partition '{0}' contains a legacy offset that is invalid after a geo-replication fail over has taken place. This checkpoint will be automatically reset. The processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3} will attempt to fall back to the default starting position for partition '{0}'.")] + public virtual void EventProcessorPartitionLegacyCheckpointFormat(string partitionId, + string identifier, + string eventHubName, + string consumerGroup) + { + if (IsEnabled()) + { + WriteEvent(141, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); + } + } + /// /// Gets the current value of formatted /// for use in logs. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs index d0d2e8650bd1..79c7791aa381 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs @@ -47,8 +47,8 @@ namespace Azure.Messaging.EventHubs.Primitives [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] public abstract class EventProcessor where TPartition : EventProcessorPartition, new() { - /// The maximum number of failed consumers to allow when processing a partition; failed consumers are those which have been unable to receive and process events. - private const int MaximumFailedConsumerCount = 1; + /// The maximum number of times to restart a failed consumer when processing a partition; failed consumers are those which have been unable to receive events. + private const int MaximumConsumerRestartCount = 1; /// Indicates whether or not the consumer should consider itself invalid when a partition is stolen by another consumer, as determined by the Event Hubs service. private const bool InvalidateConsumerWhenPartitionIsStolen = true; @@ -742,6 +742,28 @@ LastEnqueuedEventProperties readLastEnqueuedEventProperties() return new LastEnqueuedEventProperties(consumer.LastReceivedEvent); } + async Task initializeStartingPositionAsync(TPartition initializePartition, + EventPosition? overridePosition, + CancellationToken initializeCancellation) + { + // Determine the position to start processing from; this will occur during partition initialization normally, but may be superseded + // if an override was passed. In the event that initialization is run and encounters an exception, it takes responsibility for firing + // the error handler. + + var (startingPosition, checkpoint) = overridePosition switch + { + _ when overridePosition.HasValue => (overridePosition.Value, null), + _ => await InitializePartitionForProcessingAsync(initializePartition, initializeCancellation).ConfigureAwait(false) + }; + + var checkpointUsed = (checkpoint != null); + var checkpointLastModified = checkpointUsed ? checkpoint.LastModified : null; + var checkpointAuthor = checkpointUsed ? checkpoint.ClientIdentifier : null; + + Logger.EventProcessorPartitionProcessingEventPositionDetermined(Identifier, EventHubName, ConsumerGroup, initializePartition.PartitionId, startingPosition.ToString(), checkpointUsed, checkpointAuthor, checkpointLastModified); + return startingPosition; + } + // Define the routine to handle processing for the partition. async Task performProcessing() @@ -754,24 +776,9 @@ async Task performProcessing() var eventBatch = default(IReadOnlyList); var lastEvent = default(EventData); var failedAttemptCount = 0; - var failedConsumerCount = 0; - - // Determine the position to start processing from; this will occur during - // partition initialization normally, but may be superseded if an override - // was passed. In the event that initialization is run and encounters an - // exception, it takes responsibility for firing the error handler. - - var (startingPosition, checkpoint) = startingPositionOverride switch - { - _ when startingPositionOverride.HasValue => (startingPositionOverride.Value, null), - _ => await InitializePartitionForProcessingAsync(partition, cancellationSource.Token).ConfigureAwait(false) - }; - - var checkpointUsed = (checkpoint != null); - var checkpointLastModified = checkpointUsed ? checkpoint.LastModified : null; - var checkpointAuthor = checkpointUsed ? checkpoint.ClientIdentifier : null; + var resetConsumerCount = 0; - Logger.EventProcessorPartitionProcessingEventPositionDetermined(Identifier, EventHubName, ConsumerGroup, partition.PartitionId, startingPosition.ToString(), checkpointUsed, checkpointAuthor, checkpointLastModified); + var startingPosition = await initializeStartingPositionAsync(partition, startingPositionOverride, cancellationSource.Token).ConfigureAwait(false); // Create the connection to be used for spawning consumers; if the creation // fails, then consider the processing task to be failed. The main processing @@ -797,7 +804,7 @@ async Task performProcessing() // Continue processing the partition until cancellation is signaled or until the count of failed consumers is too great. // Consumers which been consistently unable to receive and process events will be considered invalid and abandoned for a new consumer. - while ((!cancellationSource.IsCancellationRequested) && (failedConsumerCount <= MaximumFailedConsumerCount)) + while ((!cancellationSource.IsCancellationRequested) && (resetConsumerCount <= MaximumConsumerRestartCount)) { try { @@ -844,7 +851,7 @@ async Task performProcessing() // satisfied, and the failure counts should reset. failedAttemptCount = 0; - failedConsumerCount = 0; + resetConsumerCount = 0; } catch (TaskCanceledException) when (cancellationSource.IsCancellationRequested) { @@ -933,6 +940,45 @@ async Task performProcessing() ExceptionDispatchInfo.Capture(ex.InnerException).Throw(); } + catch (FormatException ex) + { + // This is a special case that occurs when the starting position is invalid due to a legacy checkpoint format + // after a GeoDR fail over. There is no way to recover checkpoint data in this scenario, the checkpoint will + // need to be removed or ignored and the default position used. To avoid requiring callers to manually remove + // checkpoints, the processor will invalidate the checkpoint automatically to allow processing to continue + // for a retry. + + Logger.EventProcessorPartitionLegacyCheckpointFormat(partition.PartitionId, Identifier, EventHubName, ConsumerGroup); + + // Because this can be non-obvious to developers who are not capturing logs, also surface an exception to the error handler + // to ensure that the checkpoint reset does not go unnoticed. + + var handlerExceptionMessage = ex.Message ?? ex.InnerException?.Message; + var handlerException = new EventHubsException(false, EventHubName, handlerExceptionMessage, EventHubsException.FailureReason.GeneralError, ex.InnerException); + _ = InvokeOnProcessingErrorAsync(handlerException, partition, Resources.OperationReadEvents, CancellationToken.None); + + // Attempt to clear checkpoint data. This will cause the next initialization attempt to use the default starting position. + + try + { + await UpdateCheckpointAsync(partition.PartitionId, new CheckpointPosition(), cancellationSource.Token).ConfigureAwait(false); + } + catch (Exception clearEx) + { + // If we couldn't clear the checkpoint, capture the error and follow general error flow. This will fault the task + // and allow load balancing to reassign the partition or retry. + + Logger.EventProcessorPartitionProcessingError(partition.PartitionId, Identifier, EventHubName, ConsumerGroup, clearEx.Message); + + ++resetConsumerCount; + capturedException = ex; + } + + // Reinitialize the partition to force the full evaluation for determining the default position, including any custom logic + // in handlers. Initialization is responsible for its own logging and error handling; allow the exception to be bubbled. + + startingPosition = await initializeStartingPositionAsync(partition, startingPositionOverride, cancellationSource.Token).ConfigureAwait(false); + } catch (EventHubsException ex) when (ex.Reason == EventHubsException.FailureReason.ConsumerDisconnected) { // If the partition was stolen, the consumer should not be recreated as that would reassert ownership @@ -949,7 +995,9 @@ async Task performProcessing() } catch (Exception ex) { - ++failedConsumerCount; + Logger.EventProcessorPartitionProcessingError(partition.PartitionId, Identifier, EventHubName, ConsumerGroup, ex.Message); + + ++resetConsumerCount; capturedException = ex; } finally diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs index 1db828bc6b07..7f254a31c126 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs @@ -2,10 +2,8 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; using System.ComponentModel; using System.Globalization; -using System.Text; using Azure.Core; using Azure.Messaging.EventHubs.Core; @@ -110,6 +108,17 @@ public CheckpointPosition(string offsetString, OffsetString = offsetString; } + /// + /// Initializes an empty which can be used + /// to clear existing checkpoint data. + /// + /// + public CheckpointPosition() + { + SequenceNumber = long.MinValue; + OffsetString = null; + } + /// /// Initializes a new instance of the from an instance. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventHubBufferedProducerClient.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventHubBufferedProducerClient.cs index f265e0a36d7f..b01c214a78af 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventHubBufferedProducerClient.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventHubBufferedProducerClient.cs @@ -196,7 +196,7 @@ public virtual bool IsClosed /// The total number of events that are currently buffered and waiting to be published, across all partitions. /// /// - public virtual int TotalBufferedEventCount => _totalBufferedEventCount; + public virtual int TotalBufferedEventCount => Volatile.Read(ref _totalBufferedEventCount); /// /// The instance of which can be mocked for testing. @@ -603,7 +603,7 @@ private EventHubBufferedProducerClient(string fullyQualifiedNamespace, { TokenCredential tokenCred => new EventHubProducerClient(fullyQualifiedNamespace, eventHubName, tokenCred, options), AzureSasCredential sasCred => new EventHubProducerClient(fullyQualifiedNamespace, eventHubName, sasCred, options), - AzureNamedKeyCredential keyCred => new EventHubProducerClient(fullyQualifiedNamespace, eventHubName, keyCred, options), + AzureNamedKeyCredential keyCred => new EventHubProducerClient(fullyQualifiedNamespace, eventHubName, keyCred, options), _ => throw new ArgumentException(Resources.UnsupportedCredential, nameof(credential)) }; @@ -772,13 +772,13 @@ public virtual async Task EnqueueEventAsync(EventData eventData, if ((!IsPublishing) || (_producerManagementTask?.IsCompleted ?? false)) { - try + if (!_stateGuard.Wait(0, cancellationToken)) { - if (!_stateGuard.Wait(0, cancellationToken)) - { - await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); - } + await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); + } + try + { Argument.AssertNotClosed(_isClosed, nameof(EventHubBufferedProducerClient)); // StartPublishingAsync will verify that publishing is not already taking @@ -935,13 +935,13 @@ public virtual async Task EnqueueEventsAsync(IEnumerable events, if ((!IsPublishing) || (_producerManagementTask?.IsCompleted ?? false)) { - try + if (!_stateGuard.Wait(0, cancellationToken)) { - if (!_stateGuard.Wait(0, cancellationToken)) - { - await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); - } + await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); + } + try + { Argument.AssertNotClosed(_isClosed, nameof(EventHubBufferedProducerClient)); // StartPublishingAsync will verify that publishing is not already taking @@ -1059,6 +1059,15 @@ public virtual async Task FlushAsync(CancellationToken cancellationToken = defau await StopPublishingAsync(cancelActiveSendOperations: false, cancellationToken).ConfigureAwait(false); await FlushInternalAsync(cancellationToken).ConfigureAwait(false); + + // There's an unlikely race condition where it is possible that an event batch was being enqueued before publishing + // stopped and was not written to the partition buffer until after the flush for that partition completed. To guard + // against this, restart publishing if any events are pending. + + if (Volatile.Read(ref _totalBufferedEventCount) > 0) + { + await StartPublishingAsync(cancellationToken).ConfigureAwait(false); + } } finally { @@ -1092,15 +1101,13 @@ public virtual async Task CloseAsync(bool flush = true, var capturedExceptions = default(List); - try + if (!_stateGuard.Wait(0, cancellationToken)) { - if (!_stateGuard.Wait(0, cancellationToken)) - { - await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); - } - - // If we've reached this point without an exception, the guard is held. + await _stateGuard.WaitAsync(cancellationToken).ConfigureAwait(false); + } + try + { if (_isClosed) { return; @@ -1675,7 +1682,7 @@ internal virtual async Task DrainAndPublishPartitionEvents(PartitionPublishingSt } var partitionStateDelta = (partitionState.BufferedEventCount * -1); - var totalDeltaZero = (_totalBufferedEventCount * -1); + var totalDeltaZero = (Volatile.Read(ref _totalBufferedEventCount) * -1); Interlocked.Add(ref _totalBufferedEventCount, Math.Max(totalDeltaZero, partitionStateDelta)); Interlocked.Exchange(ref partitionState.BufferedEventCount, 0); @@ -1840,7 +1847,7 @@ private async Task StartPublishingAsync(CancellationToken cancellationToken) // If there is already a task running for the background management process, // then no further initialization is needed. - if ((IsPublishing) && (!_producerManagementTask.IsCompleted)) + if ((IsPublishing) && (!_producerManagementTask.IsCompleted) || (_isClosed)) { return; } @@ -1954,13 +1961,12 @@ private async Task StopPublishingAsync(bool cancelActiveSendOperations, _producerManagementTask = null; } + catch (OperationCanceledException ex) when (ex is not TaskCanceledException) + { + throw new TaskCanceledException(ex.Message, ex); + } catch (Exception ex) { - if (ex is OperationCanceledException opEx) - { - throw new TaskCanceledException(opEx.Message, opEx); - } - Logger.BufferedProducerBackgroundProcessingStopError(Identifier, EventHubName, ex.Message); (capturedExceptions ??= new List()).Add(ex); } @@ -2247,7 +2253,7 @@ private Task RunPublishingAsync(CancellationToken cancellationToken) => if ((!cancellationToken.IsCancellationRequested) && (_activePartitionStateMap.TryGetValue(partition, out var partitionState)) && (partitionState.BufferedEventCount > 0) - && ((partitionState.PartitionGuard.Wait(0, cancellationToken)) || (await partitionState.PartitionGuard.WaitAsync(PartitionPublishingGuardAcquireLimitMilliseconds, cancellationToken).ConfigureAwait((false))))) + && ((partitionState.PartitionGuard.Wait(0, cancellationToken)) || (await partitionState.PartitionGuard.WaitAsync(PartitionPublishingGuardAcquireLimitMilliseconds, cancellationToken).ConfigureAwait(false)))) { // Responsibility for releasing the guard semaphore is passed to the task. @@ -2257,7 +2263,7 @@ private Task RunPublishingAsync(CancellationToken cancellationToken) => // If there are no events in the buffer, avoid a tight loop by blocking to wait for events to be enqueued // after a small delay. - if (_totalBufferedEventCount == 0) + if (Volatile.Read(ref _totalBufferedEventCount) == 0) { // If completion source doesn't exist or was already set, then swap in a new completion source to be // set when an event is enqueued. Allow the publishing loop to tick for one additional check of the @@ -2281,10 +2287,15 @@ private Task RunPublishingAsync(CancellationToken cancellationToken) => var idleWatch = ValueStopwatch.StartNew(); - await _eventEnqueuedCompletionSource.Task.AwaitWithCancellation(cancellationToken); - _eventEnqueuedCompletionSource = null; - - Logger.BufferedProducerIdleComplete(Identifier, EventHubName, operationId, idleWatch.GetElapsedTime().TotalSeconds); + try + { + await _eventEnqueuedCompletionSource.Task.AwaitWithCancellation(cancellationToken); + _eventEnqueuedCompletionSource = null; + } + finally + { + Logger.BufferedProducerIdleComplete(Identifier, EventHubName, operationId, idleWatch.GetElapsedTime().TotalSeconds); + } } } } @@ -2332,7 +2343,7 @@ private Task RunPublishingAsync(CancellationToken cancellationToken) => /// set of Event Hub partitions has changed since they were last queried. /// /// - /// A instance to signal the request to cancel the operation. + /// v /// /// /// This method will potentially modify class state, overwriting the tracked set of partitions. @@ -2468,12 +2479,12 @@ internal sealed class PartitionPublishingState : IDisposable /// The writer to use for enqueuing events to be published. public ChannelWriter PendingEventsWriter => _pendingEvents.Writer; - /// The identifier of the partition that is being published. - public readonly string PartitionId; - /// The primitive for synchronizing access for publishing to the partition. public readonly SemaphoreSlim PartitionGuard; + /// The identifier of the partition that is being published. + public readonly string PartitionId; + /// The number of events that are currently buffered and waiting to be published for this partition. public int BufferedEventCount; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md b/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md index cef1fef14217..00a2217540e1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md @@ -36,7 +36,7 @@ The user is required to input the connection strings upon request on the command (env) /artifacts/bin/Azure.Messaging.EventHubs.Stress/Release/net6.0> dotnet Azure.Messaging.EventHubs.Stress.dll --tests --interactive ``` -To see the variable names for the environment file, see `EnvironmentVariables.cs`, The path to the environment file needs to be stored in the environment variable `$ENV_FILE`. In this case, do not include the `--interactive flag`. For more information about what specific resources are needed for each test, see the "Scenario Information" section below. +To see the variable names for the environment file, see `EnvironmentVariables.cs`, The path to the environment file needs to be stored in the environment variable `$ENV_FILE`. In this case, do not include the `--interactive flag`. For more information about what specific resources are needed for each test, see the "Scenario Information" section below. The recommended approach is to run tests one at a time when running locally. To run any one test, run the following: @@ -109,7 +109,7 @@ Without a .env file: ### Deploying a stress test In order to deploy stress tests to be run in kubernetes clusters, run: -```cmd +```cmd (env) /eng/common/scripts/stress-testing/deploy-stress-tests.ps1 ` >> -Login ` >> -PushImages @@ -125,5 +125,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs%2Fstress%2FREADME.png) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs index f87b02c24f3e..6a8dcd5d07a6 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpErrorTests.cs @@ -36,6 +36,7 @@ public static IEnumerable SimpleConditionExceptionMatchTestCases() yield return new object[] { AmqpError.SequenceOutOfOrderError, typeof(EventHubsException), EventHubsException.FailureReason.InvalidClientState }; yield return new object[] { AmqpError.ArgumentError, typeof(ArgumentException), null }; yield return new object[] { AmqpError.ArgumentOutOfRangeError, typeof(ArgumentOutOfRangeException), null }; + yield return new object[] { AmqpError.InvalidGeolocationOffset, typeof(FormatException), null } ; // Stock conditions. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs index b3ed9df576ed..93f9a14adf0c 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs @@ -792,31 +792,73 @@ public async Task ConsumerCanReadFromLatest() var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - // Begin reading though no events have been published. This is necessary to open the connection and - // ensure that the consumer is watching the partition. + // Begin reading in the background, though no events should be read until the next publish. This is necessary to open the connection and + // ensure that the receiver is watching the partition. - var readTask = ReadEventsFromPartitionAsync(consumer, partition,sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, EventPosition.Latest); + var eventsRead = 0; - // Give the consumer a moment to ensure that it is established and then send events for it to read. + var readTask = Task.Run(async () => + { + await Task.Yield(); - await Task.Delay(250); - await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + try + { + await foreach (var item in consumer.ReadEventsFromPartitionAsync(partition, EventPosition.Latest, cancellationSource.Token)) + { + // If more than one event was read, no need to keep going. + + if (++eventsRead > 1) + { + break; + } + } + } + catch (TaskCanceledException) + { + // Expected + } + }); - // Await reading of the events and validate the resulting state. + // Give the receiver a moment to ensure that it is established and then send events for it to read. - var readState = await readTask; - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - Assert.That(readState.Events.Count, Is.EqualTo(sourceEvents.Count), "Only the source events should have been read."); + var sendTask = Task.Run(async () => + { + try + { + while (!cancellationSource.IsCancellationRequested) + { + await Task.Delay(150); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(5), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + } + } + catch (TaskCanceledException) + { + // Expected + } + }); - foreach (var sourceEvent in sourceEvents) + while ((eventsRead < 1) && (!cancellationSource.IsCancellationRequested)) { - var sourceId = sourceEvent.MessageId; - Assert.That(readState.Events.TryGetValue(sourceId, out var readEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed."); - Assert.That(sourceEvent.IsEquivalentTo(readEvent.Data), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event."); + try + { + await Task.Delay(250, cancellationSource.Token); + } + catch (TaskCanceledException) + { + // Expected + } } - } - cancellationSource.Cancel(); + // Await reading of the events and validate that we were able to read at least one event. + + Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + Assert.That(eventsRead, Is.GreaterThanOrEqualTo(1), "At least one event should have been read."); + + cancellationSource.Cancel(); + + await readTask; + await sendTask; + } } } @@ -1333,41 +1375,6 @@ public async Task ConsumerCannotReadFromInvalidConsumerGroup() } } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service and perform operations. - /// - /// - [Test] - public async Task ConsumerCannotReadWithInvalidProxy() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - using var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - - var clientOptions = new EventHubConsumerClientOptions(); - clientOptions.RetryOptions.MaximumRetries = 0; - clientOptions.RetryOptions.MaximumDelay = TimeSpan.FromMilliseconds(5); - clientOptions.RetryOptions.TryTimeout = TimeSpan.FromSeconds(45); - clientOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); - clientOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) - await using (var invalidProxyConsumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, clientOptions)) - { - var partition = (await producer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - - // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and - // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to - // invoke a timeout exception in these cases. - - Assert.That(async () => await ReadNothingAsync(invalidProxyConsumer, partition, cancellationSource.Token, iterationCount: 25), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - } - } - } - /// /// Verifies that the is able to /// connect to the Event Hubs service and perform operations. @@ -2200,53 +2207,6 @@ public async Task ConsumerCannotRetrievePartitionPropertiesWithInvalidPartitionI } } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service. - /// - /// - [Test] - public async Task ConsumerCannotRetrieveMetadataWithInvalidProxy() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - using var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - - var invalidProxyOptions = new EventHubConsumerClientOptions(); - invalidProxyOptions.RetryOptions.MaximumRetries = 0; - invalidProxyOptions.RetryOptions.MaximumDelay = TimeSpan.FromMilliseconds(5); - invalidProxyOptions.RetryOptions.TryTimeout = TimeSpan.FromSeconds(45); - invalidProxyOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); - invalidProxyOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - - await using (var consumer = new EventHubConsumerClient( - EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, - scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential)) - - await using (var invalidProxyConsumer = new EventHubConsumerClient( - EventHubConsumerClient.DefaultConsumerGroupName, - EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, - scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential, - invalidProxyOptions)) - { - var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); - - // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and - // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to - // invoke a timeout exception in these cases. - - Assert.That(async () => await invalidProxyConsumer.GetPartitionIdsAsync(cancellationSource.Token), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyConsumer.GetEventHubPropertiesAsync(cancellationSource.Token), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyConsumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - } - } - } - /// /// Verifies that the is able to /// connect to the Event Hubs service and perform operations. @@ -2470,44 +2430,83 @@ public async Task ConsumerCanReadFromAllPartitionsStartingWithLatest() using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var sourceEvents = EventGenerator.CreateEvents(50).ToList(); - - await using (var consumer = new EventHubConsumerClient( + await using var consumer = new EventHubConsumerClient( EventHubConsumerClient.DefaultConsumerGroupName, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential)) - { - // Send a set of seed events, which should not be read. + EventHubsTestEnvironment.Instance.Credential); - var partitions = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).ToArray(); - await SendEventsToAllPartitionsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), partitions, cancellationSource.Token); + // Send a set of seed events to the partition, which should not be read. - // Begin reading though no events have been published. This is necessary to open the connection and - // ensure that the consumer is watching the partition. + var partitions = await consumer.GetPartitionIdsAsync(cancellationSource.Token); + await SendEventsToAllPartitionsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), partitions, cancellationSource.Token); - var readTask = ReadEventsFromAllPartitionsAsync(consumer, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token, startFromEarliest: false); + // Begin reading in the background, though no events should be read until the next publish. This is necessary to open the connection and + // ensure that the receiver is watching the partition. - // Give the consumer a moment to ensure that it is established and then send events for it to read. + var eventsRead = 0; - await Task.Delay(1500); - await SendEventsToAllPartitionsAsync(scope.EventHubName, sourceEvents, partitions, cancellationSource.Token); + var readTask = Task.Run(async () => + { + await Task.Yield(); - // Read the events and validate the resulting state. + try + { + await foreach (var item in consumer.ReadEventsAsync(startReadingAtEarliestEvent: false, cancellationToken: cancellationSource.Token)) + { + // If more than one event was read, no need to keep going. - var readState = await readTask; - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - Assert.That(readState.Events.Count, Is.EqualTo(sourceEvents.Count), "Only the source events should have been read."); + if (++eventsRead > 1) + { + break; + } + } + } + catch (TaskCanceledException) + { + // Expected + } + }); - foreach (var sourceEvent in sourceEvents) + // Give the receiver a moment to ensure that it is established and then send events for it to read. + + var sendTask = Task.Run(async () => + { + try { - var sourceId = sourceEvent.MessageId; - Assert.That(readState.Events.TryGetValue(sourceId, out var readEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed."); - Assert.That(sourceEvent.IsEquivalentTo(readEvent.Data), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event."); + while (!cancellationSource.IsCancellationRequested) + { + await Task.Delay(150); + await SendEventsToAllPartitionsAsync(scope.EventHubName, EventGenerator.CreateEvents(5), partitions, cancellationSource.Token); + } + } + catch (TaskCanceledException) + { + // Expected + } + }); + + while ((eventsRead < 1) && (!cancellationSource.IsCancellationRequested)) + { + try + { + await Task.Delay(250, cancellationSource.Token); + } + catch (TaskCanceledException) + { + // Expected } } + // Await reading of the events and validate that we were able to read at least one event. + + Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + Assert.That(eventsRead, Is.GreaterThanOrEqualTo(1), "At least one event should have been read."); + cancellationSource.Cancel(); + + await readTask; + await sendTask; } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs index fe44aeacab83..3dbf2c2d0fe0 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs @@ -11,6 +11,7 @@ using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Diagnostics; using Azure.Messaging.EventHubs.Primitives; +using Azure.Messaging.EventHubs.Processor; using Moq; using Moq.Protected; using NUnit.Framework; @@ -1151,6 +1152,10 @@ public async Task CreatePartitionProcessorProcessingTaskLogsExceptions() await Task.WhenAny(completionSources, Task.Delay(Timeout.Infinite, cancellationSource.Token)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + // Each consumer failure/recycle will emit a log. Because the test doesn't have insight into the recycle threshold for the + // processor, the assertion can't be precise about the number of times this will be called. Make sure there's at least one + // log written. + mockLogger .Verify(log => log.EventProcessorPartitionProcessingError( partition.PartitionId, @@ -1158,7 +1163,7 @@ public async Task CreatePartitionProcessorProcessingTaskLogsExceptions() mockProcessor.Object.EventHubName, mockProcessor.Object.ConsumerGroup, expectedException.Message), - Times.Once); + Times.AtLeastOnce()); cancellationSource.Cancel(); } @@ -1396,24 +1401,39 @@ public async Task CreatePartitionProcessorProcessingTaskSurfacesDeveloperCodeExc /// /// [Test] - public async Task CreatePartitionProcessorProcessingTaskHonorsTheRetryPolicy() + public async Task CreatePartitionProcessorProcessingTaskResetsTheCheckpointForLegacyFormatFailures() { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - var expectedException = new EventHubsException(true, "frank", "BOOM!", EventHubsException.FailureReason.GeneralError); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset("12"); - var retryOptions = new EventHubsRetryOptions { MaximumRetries = 2, MaximumDelay = TimeSpan.FromMilliseconds(15) }; - var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; + var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; + var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions, DefaultStartingPosition = EventPosition.FromSequenceNumber(65) }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); var mockConsumer = new Mock(); + var badMockConsumer = new Mock(); var mockProcessor = new Mock>(5, "consumerGroup", "namespace", "eventHub", Mock.Of(), options) { CallBase = true }; + var legacyCheckpoint = new EventProcessorCheckpoint + { + FullyQualifiedNamespace = mockProcessor.Object.FullyQualifiedNamespace, + EventHubName = mockProcessor.Object.EventHubName, + ConsumerGroup = mockProcessor.Object.ConsumerGroup, + PartitionId = partition.PartitionId, + StartingPosition = EventPosition.FromOffset("123"), + ClientIdentifier = "legacy", + LastModified = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero) + }; + mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) - .Throws(expectedException); + .Callback(() => completionSource.TrySetResult(true)) + .ReturnsAsync(EmptyBatch); + + badMockConsumer + .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Throws(new FormatException("legacy", new InvalidCastException("legacy inner"))); mockProcessor .Setup(processor => processor.CreateConnection()) @@ -1421,30 +1441,148 @@ public async Task CreatePartitionProcessorProcessingTaskHonorsTheRetryPolicy() mockProcessor .SetupSequence(processor => processor.CreateConsumer(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), mockConnection, It.IsAny(), It.IsAny())) - .Returns(mockConsumer.Object) - .Returns(() => - { - completionSource.TrySetResult(true); - return Mock.Of(); - }); + .Returns(badMockConsumer.Object) + .Returns(mockConsumer.Object); mockProcessor - .Setup(processor => processor.ProcessEventBatchAsync(partition, It.IsAny>(), It.IsAny(), cancellationSource.Token)) - .Returns(Task.CompletedTask); + .Protected() + .Setup("UpdateCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); - var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(partition, cancellationSource, position); + mockProcessor + .Protected() + .SetupSequence>("GetCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(legacyCheckpoint)) + .Returns(Task.FromResult(default(EventProcessorCheckpoint))); + + var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(partition, cancellationSource); await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + cancellationSource.Cancel(); + + // The checkpoint should have been reset to an empty state. + + mockProcessor + .Protected() + .Verify("UpdateCheckpointAsync", + Times.Once(), + [partition.PartitionId, new CheckpointPosition(), ItExpr.IsAny()]); + + // The initial consumer should use the checkpoint starting position. + + mockProcessor + .Verify(processor => processor.CreateConsumer( + mockProcessor.Object.ConsumerGroup, + partition.PartitionId, + It.IsAny(), + legacyCheckpoint.StartingPosition, + mockConnection, + It.IsAny(), + It.IsAny()), + Times.Once); + + // The second consumer should use the default starting position because there + // is no valid checkpoint. + + mockProcessor + .Verify(processor => processor.CreateConsumer( + mockProcessor.Object.ConsumerGroup, + partition.PartitionId, + It.IsAny(), + options.DefaultStartingPosition, + mockConnection, + It.IsAny(), + It.IsAny()), + Times.Once); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreatePartitionProcessorProcessingTaskLogsLegacyFormatFailures() + { + using var cancellationSource = new CancellationTokenSource(); + cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + + var partition = new EventProcessorPartition { PartitionId = "99" }; + var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; + var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions, DefaultStartingPosition = EventPosition.FromSequenceNumber(65) }; + var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var mockLogger = new Mock(); + var mockConnection = Mock.Of(); + var mockConsumer = new Mock(); + var badMockConsumer = new Mock(); + var mockProcessor = new Mock>(5, "consumerGroup", "namespace", "eventHub", Mock.Of(), options) { CallBase = true }; + + var legacyCheckpoint = new EventProcessorCheckpoint + { + FullyQualifiedNamespace = mockProcessor.Object.FullyQualifiedNamespace, + EventHubName = mockProcessor.Object.EventHubName, + ConsumerGroup = mockProcessor.Object.ConsumerGroup, + PartitionId = partition.PartitionId, + StartingPosition = EventPosition.FromOffset("123"), + ClientIdentifier = "legacy", + LastModified = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero) + }; mockConsumer - .Verify(consumer => consumer.ReceiveAsync( - It.IsAny(), - It.IsAny(), - It.IsAny()), - Times.Exactly(retryOptions.MaximumRetries + 1)); + .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Callback(() => completionSource.TrySetResult(true)) + .ReturnsAsync(EmptyBatch); + + badMockConsumer + .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Throws(new FormatException("legacy", new InvalidCastException("legacy inner"))); + + mockProcessor.Object.Logger = mockLogger.Object; + + mockProcessor + .Setup(processor => processor.CreateConnection()) + .Returns(mockConnection); + + mockProcessor + .SetupSequence(processor => processor.CreateConsumer(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), mockConnection, It.IsAny(), It.IsAny())) + .Returns(badMockConsumer.Object) + .Returns(mockConsumer.Object); + + mockProcessor + .Protected() + .Setup("UpdateCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + mockProcessor + .Protected() + .SetupSequence>("GetCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(legacyCheckpoint)) + .Returns(Task.FromResult(default(EventProcessorCheckpoint))); + + var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(partition, cancellationSource); + await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); + Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); cancellationSource.Cancel(); + + mockLogger + .Verify(log => log.EventProcessorPartitionLegacyCheckpointFormat( + partition.PartitionId, + mockProcessor.Object.Identifier, + mockProcessor.Object.EventHubName, + mockProcessor.Object.ConsumerGroup), + Times.Once); } /// @@ -1453,19 +1591,33 @@ public async Task CreatePartitionProcessorProcessingTaskHonorsTheRetryPolicy() /// /// [Test] - public async Task CreatePartitionProcessorProcessingTaskReplacesTheConsumerOnFailure() + public async Task CreatePartitionProcessorProcessingTaskInvokesTheErrorHandlerForLegacyFormatFailures() { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + var expectedException = new FormatException("legacy", new InvalidCastException("legacy inner")); + var partition = new EventProcessorPartition { PartitionId = "99" }; var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; - var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; + var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions, DefaultStartingPosition = EventPosition.FromSequenceNumber(65) }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var mockLogger = new Mock(); var mockConnection = Mock.Of(); var mockConsumer = new Mock(); var badMockConsumer = new Mock(); var mockProcessor = new Mock>(5, "consumerGroup", "namespace", "eventHub", Mock.Of(), options) { CallBase = true }; + var legacyCheckpoint = new EventProcessorCheckpoint + { + FullyQualifiedNamespace = mockProcessor.Object.FullyQualifiedNamespace, + EventHubName = mockProcessor.Object.EventHubName, + ConsumerGroup = mockProcessor.Object.ConsumerGroup, + PartitionId = partition.PartitionId, + StartingPosition = EventPosition.FromOffset("123"), + ClientIdentifier = "legacy", + LastModified = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero) + }; + mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) .Callback(() => completionSource.TrySetResult(true)) @@ -1473,7 +1625,9 @@ public async Task CreatePartitionProcessorProcessingTaskReplacesTheConsumerOnFai badMockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) - .Throws(new DllNotFoundException()); + .Throws(expectedException); + + mockProcessor.Object.Logger = mockLogger.Object; mockProcessor .Setup(processor => processor.CreateConnection()) @@ -1484,22 +1638,101 @@ public async Task CreatePartitionProcessorProcessingTaskReplacesTheConsumerOnFai .Returns(badMockConsumer.Object) .Returns(mockConsumer.Object); - var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(new EventProcessorPartition(), cancellationSource, EventPosition.Earliest); + mockProcessor + .Protected() + .Setup("UpdateCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + mockProcessor + .Protected() + .SetupSequence>("GetCheckpointAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(legacyCheckpoint)) + .Returns(Task.FromResult(default(EventProcessorCheckpoint))); + + var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(partition, cancellationSource); await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); cancellationSource.Cancel(); + // Allow for a small delay because error processing is a background task, just to give it time to trigger. + + await Task.Delay(250); + mockProcessor - .Verify(processor => processor.CreateConsumer( - It.IsAny(), - It.IsAny(), - It.IsAny(), - It.IsAny(), - mockConnection, - It.IsAny(), - It.IsAny()), - Times.AtLeast(2)); + .Protected() + .Verify("OnProcessingErrorAsync", Times.Once(), + ItExpr.Is(ex => + ex.IsTransient == false + && ex.Message.Contains(expectedException.Message) + && ex.InnerException == expectedException.InnerException), + partition, + Resources.OperationReadEvents, + ItExpr.IsAny()); + + cancellationSource.Cancel(); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreatePartitionProcessorProcessingTaskHonorsTheRetryPolicy() + { + using var cancellationSource = new CancellationTokenSource(); + cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); + + var expectedException = new EventHubsException(true, "frank", "BOOM!", EventHubsException.FailureReason.GeneralError); + var partition = new EventProcessorPartition { PartitionId = "99" }; + var position = EventPosition.FromOffset("12"); + var retryOptions = new EventHubsRetryOptions { MaximumRetries = 2, MaximumDelay = TimeSpan.FromMilliseconds(15) }; + var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; + var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var mockConnection = Mock.Of(); + var mockConsumer = new Mock(); + var mockProcessor = new Mock>(5, "consumerGroup", "namespace", "eventHub", Mock.Of(), options) { CallBase = true }; + + mockConsumer + .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Throws(expectedException); + + mockProcessor + .Setup(processor => processor.CreateConnection()) + .Returns(mockConnection); + + mockProcessor + .SetupSequence(processor => processor.CreateConsumer(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), mockConnection, It.IsAny(), It.IsAny())) + .Returns(mockConsumer.Object) + .Returns(() => + { + completionSource.TrySetResult(true); + return Mock.Of(); + }); + + mockProcessor + .Setup(processor => processor.ProcessEventBatchAsync(partition, It.IsAny>(), It.IsAny(), cancellationSource.Token)) + .Returns(Task.CompletedTask); + + var partitionProcessor = mockProcessor.Object.CreatePartitionProcessor(partition, cancellationSource, position); + + await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); + Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + + mockConsumer + .Verify(consumer => consumer.ReceiveAsync( + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Exactly(retryOptions.MaximumRetries + 1)); + + cancellationSource.Cancel(); } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs index 3a5665f9b4b8..92a88aff62ea 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs @@ -5,8 +5,6 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; -using System.Net; -using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; using Azure.Core.Amqp; @@ -579,7 +577,6 @@ public async Task ReceiverCanReadFromLatest() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - var sourceEvents = EventGenerator.CreateEvents(200).ToList(); await using (var receiver = new PartitionReceiver( EventHubConsumerClient.DefaultConsumerGroupName, @@ -593,31 +590,76 @@ public async Task ReceiverCanReadFromLatest() await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(50), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); - // Begin reading though no events have been published. This is necessary to open the connection and + // Begin reading in the background, though no events should be read until the next publish. This is necessary to open the connection and // ensure that the receiver is watching the partition. - var readTask = ReadEventsAsync(receiver, sourceEvents.Select(evt => evt.MessageId), cancellationSource.Token); + var eventsRead = 0; - // Give the receiver a moment to ensure that it is established and then send events for it to read. + var readTask = Task.Run(async () => + { + await Task.Yield(); - await Task.Delay(250); - await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + try + { + while ((!cancellationSource.Token.IsCancellationRequested) && (eventsRead <= 1)) + { + var batch = await receiver.ReceiveBatchAsync(10, TimeSpan.FromMilliseconds(250), cancellationSource.Token); + eventsRead += batch.Count(); - // Await reading of the events and validate the resulting state. + // Avoid a tight loop if nothing was read. - var readState = await readTask; - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - Assert.That(readState.Events.Count, Is.EqualTo(sourceEvents.Count), "Only the source events should have been read."); + if (eventsRead <= 1) + { + await Task.Delay(50); + } + } + } + catch (TaskCanceledException) + { + // Expected + } + }); - foreach (var sourceEvent in sourceEvents) + // Give the receiver a moment to ensure that it is established and then send events for it to read. + + var sendTask = Task.Run(async () => { - var sourceId = sourceEvent.MessageId; - Assert.That(readState.Events.TryGetValue(sourceId, out var readEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed."); - Assert.That(sourceEvent.IsEquivalentTo(readEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event."); + try + { + while (!cancellationSource.IsCancellationRequested) + { + await Task.Delay(150); + await SendEventsAsync(scope.EventHubName, EventGenerator.CreateEvents(5), new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); + } + } + catch (TaskCanceledException) + { + // Expected + } + }); + + while ((eventsRead < 1) && (!cancellationSource.IsCancellationRequested)) + { + try + { + await Task.Delay(250, cancellationSource.Token); + } + catch (TaskCanceledException) + { + // Expected + } } - } - cancellationSource.Cancel(); + // Await reading of the events and validate that we were able to read at least one event. + + Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); + Assert.That(eventsRead, Is.GreaterThanOrEqualTo(1), "At least one event should have been read."); + + cancellationSource.Cancel(); + + await readTask; + await sendTask; + } } } @@ -952,47 +994,6 @@ public async Task ReceiverCannotReadFromInvalidConsumerGroup() } } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service and perform operations. - /// - /// - [Test] - public async Task ReceiverCannotReadWithInvalidProxy() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - using var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - - var clientOptions = new PartitionReceiverOptions(); - clientOptions.RetryOptions.MaximumRetries = 0; - clientOptions.RetryOptions.MaximumDelay = TimeSpan.FromMilliseconds(5); - clientOptions.RetryOptions.TryTimeout = TimeSpan.FromSeconds(45); - clientOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); - clientOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - - var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - - await using (var invalidProxyReceiver = new PartitionReceiver( - EventHubConsumerClient.DefaultConsumerGroupName, - partition, - EventPosition.Earliest, - EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, - scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential, - clientOptions)) - { - // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and - // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to - // invoke a timeout exception in these cases. - - Assert.That(async () => await ReadNothingAsync(invalidProxyReceiver, cancellationSource.Token, iterationCount: 25), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - } - } - } - /// /// Verifies that the is able to /// connect to the Event Hubs service and perform operations. @@ -2476,47 +2477,6 @@ public async Task ReceiverCannotRetrievePartitionPropertiesWhenConnectionIsClose } } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service and perform operations. - /// - /// - [Test] - public async Task ReceiverCannotRetrieveMetadataWithInvalidProxy() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - using var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - - var partition = (await QueryPartitionsAsync(scope.EventHubName, cancellationSource.Token)).First(); - - var invalidProxyOptions = new PartitionReceiverOptions(); - invalidProxyOptions.RetryOptions.MaximumRetries = 0; - invalidProxyOptions.RetryOptions.MaximumDelay = TimeSpan.FromMilliseconds(5); - invalidProxyOptions.RetryOptions.TryTimeout = TimeSpan.FromSeconds(45); - invalidProxyOptions.ConnectionOptions.Proxy = new WebProxy("http://1.2.3.4:9999"); - invalidProxyOptions.ConnectionOptions.TransportType = EventHubsTransportType.AmqpWebSockets; - - await using (var receiver = new PartitionReceiver( - EventHubConsumerClient.DefaultConsumerGroupName, - partition, - EventPosition.Earliest, - EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, - scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential, - invalidProxyOptions)) - { - // The sockets implementation in .NET Core on some platforms, such as Linux, does not trigger a specific socket exception and - // will, instead, hang indefinitely. The try timeout is intentionally set to a value smaller than the cancellation token to - // invoke a timeout exception in these cases. - - Assert.That(async () => await receiver.GetPartitionPropertiesAsync(cancellationSource.Token), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); - } - } - } - /// /// Reads the list of partition identifiers for an Event Hub instance. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs index e78b5f44c0ce..5d905ab05c9b 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs @@ -1666,36 +1666,6 @@ public async Task ProducerCannotRetrievePartitionPropertiesWhenPartitionIdIsInva Assert.That(async () => await producer.GetPartitionPropertiesAsync(invalidPartition), Throws.TypeOf()); } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service. - /// - /// - [Test] - public async Task ProducerCannotRetrieveMetadataWhenProxyIsInvalid() - { - var invalidProxyOptions = new EventHubBufferedProducerClientOptions - { - RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }, - - ConnectionOptions = new EventHubConnectionOptions - { - Proxy = new WebProxy("http://1.2.3.4:9999"), - TransportType = EventHubsTransportType.AmqpWebSockets - } - }; - - await using var scope = await EventHubScope.CreateAsync(1); - await using var producer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential); - await using var invalidProxyProducer = new EventHubBufferedProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, invalidProxyOptions); - - var partition = (await producer.GetPartitionIdsAsync()).First(); - - Assert.That(async () => await invalidProxyProducer.GetPartitionIdsAsync(), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyProducer.GetEventHubPropertiesAsync(), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyProducer.GetPartitionPropertiesAsync(partition), Throws.InstanceOf().Or.InstanceOf()); - } - /// /// Polls the count of buffered events for a producer until it has been updated to /// 0 or the maximum number of iterations has been reached. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs index bc78073b0d42..4d6941b83041 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs @@ -6062,7 +6062,7 @@ public async Task BackgroundPublishingTaskLogsErrors() /// /// [Test] - public async Task DrainAndPublishPartitionEventsPublishshesOneBatch() + public async Task DrainAndPublishPartitionEventsPublishesOneBatch() { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -6130,7 +6130,7 @@ public async Task DrainAndPublishPartitionEventsPublishshesOneBatch() /// /// [Test] - public async Task DrainAndPublishPartitionEventsPublishshesMultipleBatches() + public async Task DrainAndPublishPartitionEventsPublishesMultipleBatches() { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); @@ -6259,7 +6259,7 @@ public async Task DrainAndPublishPartitionEventsClearsPartitionState() /// /// [Test] - public async Task DrainAndPublishPartitionEventsIvokesTheHandlerWhenPublishingFails() + public async Task DrainAndPublishPartitionEventsInvokesTheHandlerWhenPublishingFails() { using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs index 70d643635bd1..5acfe17292d8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs @@ -1180,38 +1180,6 @@ public async Task ProducerSendsEventsWithTheSamePartitionHashKeyToTheSamePartiti } } - /// - /// Verifies that the is able to - /// connect to the Event Hubs service and perform operations. - /// - /// - [Test] - public async Task ProducerCannotSendWhenProxyIsInvalid() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - var producerOptions = new EventHubProducerClientOptions - { - RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }, - - ConnectionOptions = new EventHubConnectionOptions - { - Proxy = new WebProxy("http://1.2.3.4:9999"), - TransportType = EventHubsTransportType.AmqpWebSockets - } - }; - - await using (var invalidProxyProducer = new EventHubProducerClient( - EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, - scope.EventHubName, - EventHubsTestEnvironment.Instance.Credential, - producerOptions)) - { - Assert.That(async () => await invalidProxyProducer.SendAsync(new[] { new EventData(new byte[1]) }), Throws.InstanceOf().Or.InstanceOf()); - } - } - } - /// /// Verifies that the is able to /// connect to the Event Hubs service and perform operations. @@ -1451,38 +1419,5 @@ public async Task ProducerCannotRetrievePartitionPropertiesWhenPartitionIdIsInva } } } - - /// - /// Verifies that the is able to - /// connect to the Event Hubs service. - /// - /// - [Test] - public async Task ProducerCannotRetrieveMetadataWhenProxyIsInvalid() - { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) - { - var invalidProxyOptions = new EventHubProducerClientOptions - { - RetryOptions = new EventHubsRetryOptions { TryTimeout = TimeSpan.FromMinutes(2) }, - - ConnectionOptions = new EventHubConnectionOptions - { - Proxy = new WebProxy("http://1.2.3.4:9999"), - TransportType = EventHubsTransportType.AmqpWebSockets - } - }; - - await using (var producer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential)) - await using (var invalidProxyProducer = new EventHubProducerClient(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, scope.EventHubName, EventHubsTestEnvironment.Instance.Credential, invalidProxyOptions)) - { - var partition = (await producer.GetPartitionIdsAsync()).First(); - - Assert.That(async () => await invalidProxyProducer.GetPartitionIdsAsync(), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyProducer.GetEventHubPropertiesAsync(), Throws.InstanceOf().Or.InstanceOf()); - Assert.That(async () => await invalidProxyProducer.GetPartitionPropertiesAsync(partition), Throws.InstanceOf().Or.InstanceOf()); - } - } - } } } diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/README.md b/sdk/eventhub/Microsoft.Azure.EventHubs/README.md old mode 100755 new mode 100644 index 47653aa640b2..69c5545aeb56 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/README.md +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/README.md @@ -2,18 +2,18 @@ > Please note, a newer package [Azure.Messaging.EventHubs](https://www.nuget.org/packages/Azure.Messaging.EventHubs) for [Azure Event Hubs](https://azure.microsoft.com/services/event-hubs/) is available as of February 2020. While this package will continue to receive critical bug fixes, we strongly encourage you to upgrade. Read the [migration guide](https://aka.ms/azsdk/net/migrate/eh) for more details. -Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them into multiple applications. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform and store it by using any real-time analytics provider or with batching/storage adapters. +Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them into multiple applications. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform and store it by using any real-time analytics provider or with batching/storage adapters. -The Azure Events Hubs client library for .NET allows for both sending and receiving of events. Most common scenarios call for an application to act as either an event publisher or an event consumer, but rarely both. +The Azure Events Hubs client library for .NET allows for both sending and receiving of events. Most common scenarios call for an application to act as either an event publisher or an event consumer, but rarely both. -An **event publisher** is a source of telemetry data, diagnostics information, usage logs, or other log data, as -part of an embedded device solution, a mobile device application, a game title running on a console or other device, -some client or server based business solution, or a web site. +An **event publisher** is a source of telemetry data, diagnostics information, usage logs, or other log data, as +part of an embedded device solution, a mobile device application, a game title running on a console or other device, +some client or server based business solution, or a web site. -An **event consumer** picks up such information from the Event Hub and processes it. Processing may involve aggregation, complex +An **event consumer** picks up such information from the Event Hub and processes it. Processing may involve aggregation, complex computation and filtering. Processing may also involve distribution or storage of the information in a raw or transformed fashion. -Event Hub consumers are often robust and high-scale platform infrastructure parts with built-in analytics capabilities, like Azure -Stream Analytics, Apache Spark, or Apache Storm. +Event Hub consumers are often robust and high-scale platform infrastructure parts with built-in analytics capabilities, like Azure +Stream Analytics, Apache Spark, or Apache Storm. This directory contains the open source subset of the .NET SDK. For documentation of the complete Azure SDK, please see the [Microsoft Azure .NET Developer Center](https://azure.microsoft.com/develop/net/). @@ -65,9 +65,9 @@ Tests in the Event Hubs client library are split into two categories: - **Unit tests** have no special considerations; these are self-contained and execute locally without any reliance on external resources. Unit tests are considered the default test type in the Event Hubs client library and, thus, have no explicit category trait attached to them. -- **Integration tests** have dependencies on live Azure resources and require setting up your development environment prior to running. Known in the Azure SDK project commonly as "Live" tests, these tests are decorated with a category trait of "LiveTest". +- **Integration tests** have dependencies on live Azure resources and require setting up your development environment prior to running. Known in the Azure SDK project commonly as "Live" tests, these tests are decorated with a category trait of "LiveTest". -The required Azure resources are defined in the [test resources ARM template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/test-resources.json). In addition to these resources, a Azure Active Directory service principal is needed. The recommended approach is to use the Azure SDK [Test Resources](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/TestResources/README.md) tooling. +The required Azure resources are defined in the [test resources ARM template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/test-resources.json). In addition to these resources, a Azure Active Directory service principal is needed. The recommended approach is to use the Azure SDK [Test Resources](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/TestResources/README.md) tooling. The following PowerShell commands will make use of `New-TestResources.ps1` to create the Event Hubs test resources, including the Azure Active Directory service principal. The script uses the `BaseName` as a prefix when naming the service principal and other resources. The full set of options for `New-TestResources.ps1` can be found in the [New-TestResources.ps1 documentation](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/TestResources/New-TestResources.ps1.md). @@ -84,19 +84,19 @@ Connect-AzAccount -Subscription '<< AZURE SUBSCRIPTION ID >>' The Live tests read information from the following environment variables: -`EVENTHUB_RESOURCE_GROUP` +`EVENTHUB_RESOURCE_GROUP` The name of the Azure resource group that contains the Event Hubs namespace - -`EVENTHUB_SUBSCRIPTION_ID` + +`EVENTHUB_SUBSCRIPTION_ID` The identifier (GUID) of the Azure subscription to which the service principal belongs - -`EVENTHUB_TENANT_ID` + +`EVENTHUB_TENANT_ID` The identifier (GUID) of the Azure Active Directory tenant that contains the service principal -`EVENTHUB_CLIENT_ID` +`EVENTHUB_CLIENT_ID` The identifier (GUID) of the Azure Active Directory application that is associated with the service principal - -`EVENTHUB_CLIENT_SECRET` + +`EVENTHUB_CLIENT_SECRET` The client secret (password) of the Azure Active Directory application that is associated with the service principal ## Development history @@ -109,7 +109,7 @@ The Azure Event Hubs client library uses [the semantic versioning scheme.](https ## Target frameworks -For information about the target frameworks of the Azure Event Hubs client library, please refer to the [Target Frameworks](https://github.com/azure/azure-sdk-for-net#target-frameworks) of the Microsoft Azure SDK for .NET. +For information about the target frameworks of the Azure Event Hubs client library, please refer to the [Target Frameworks](https://github.com/azure/azure-sdk-for-net#target-frameworks) of the Microsoft Azure SDK for .NET. ## Contributing @@ -120,5 +120,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope - [Azure Event Hubs General Documentation](https://learn.microsoft.com/azure/event-hubs/) - [Azure Event Hubs REST API Reference](https://learn.microsoft.com/rest/api/eventhub/) - [Azure Event Hubs SDK for .NET Documentation](https://learn.microsoft.com/dotnet/api/overview/azure/event-hubs?view=azure-dotnet) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FMicrosoft.Azure.EventHubs%2FREADME.png) diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md index e214eb81954f..fd72101825e8 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md @@ -218,8 +218,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.EventHubs%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.EventHubs/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/ diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj index 539e414cb53f..c8b0729739ef 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj @@ -12,9 +12,8 @@ - - - + + diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/CHANGELOG.md b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/CHANGELOG.md index 96bce8e5f435..10d405061cde 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/CHANGELOG.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.5.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.4.0 (2025-02-11) + +### Other Changes + +- Updated dependencies to ensure they are up-to-date with the latest targets and trimming from built-in dependencies. + ## 1.3.2 (2024-08-16) ### Other Changes diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md index 4dad0a2be28f..03b5f624456f 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md @@ -82,8 +82,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fextensions%2FAzure.Extensions.AspNetCore.Configuration.Secrets%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets/ diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src/Azure.Extensions.AspNetCore.Configuration.Secrets.csproj b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src/Azure.Extensions.AspNetCore.Configuration.Secrets.csproj index 74544a995da7..36db7de9c910 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src/Azure.Extensions.AspNetCore.Configuration.Secrets.csproj +++ b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src/Azure.Extensions.AspNetCore.Configuration.Secrets.csproj @@ -4,9 +4,9 @@ Azure Key Vault configuration provider implementation for Microsoft.Extensions.Configuration. $(RequiredTargetFrameworks) $(PackageTags);azure;keyvault - 1.4.0-beta.1 + 1.5.0-beta.1 - 1.3.2 + 1.4.0 $(NoWarn);AZC0102 true diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/CHANGELOG.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/CHANGELOG.md index b64eaa1247a3..d8ea9cb1f451 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/CHANGELOG.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.5.0-beta.1 (Unreleased) +## 1.6.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.5.0 (2025-02-11) + +### Other Changes + +- Updated dependencies to ensure they are up-to-date with the latest targets and trimming from built-in dependencies. + ## 1.4.0 (2024-11-26) ### Other Changes diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md index 329e9995db07..5726cd4b0b06 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md @@ -91,8 +91,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fextensions%2FAzure.Extensions.AspNetCore.DataProtection.Blobs%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/ diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src/Azure.Extensions.AspNetCore.DataProtection.Blobs.csproj b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src/Azure.Extensions.AspNetCore.DataProtection.Blobs.csproj index 04f63bcf4418..e68d412ec6e2 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src/Azure.Extensions.AspNetCore.DataProtection.Blobs.csproj +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src/Azure.Extensions.AspNetCore.DataProtection.Blobs.csproj @@ -4,9 +4,9 @@ $(RequiredTargetFrameworks) Microsoft Azure Blob storage support as key store (https://docs.microsoft.com/aspnet/core/security/data-protection/implementation/key-storage-providers). aspnetcore;dataprotection;azure;blob;key store - 1.5.0-beta.1 + 1.6.0-beta.1 - 1.4.0 + 1.5.0 true $(NoWarn);AZC0102 diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/CHANGELOG.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/CHANGELOG.md index 41635b388be6..ad620ae68b9f 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/CHANGELOG.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.5.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.4.0 (2025-02-11) + +### Other Changes + +- Updated dependencies to ensure they are up-to-date with the latest targets and trimming from built-in dependencies. + ## 1.3.0 (2024-11-26) ### Other Changes diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md index 1d08b03ecae5..e81e89c6c32d 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md @@ -76,8 +76,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fextensions%2FAzure.AspNetCore.Extensions.DataProtection.Keys%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/ diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src/Azure.Extensions.AspNetCore.DataProtection.Keys.csproj b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src/Azure.Extensions.AspNetCore.DataProtection.Keys.csproj index 65015abb47b8..906718ff8298 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src/Azure.Extensions.AspNetCore.DataProtection.Keys.csproj +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src/Azure.Extensions.AspNetCore.DataProtection.Keys.csproj @@ -3,9 +3,9 @@ Microsoft Azure Key Vault key encryption support. aspnetcore;dataprotection;azure;keyvault - 1.4.0-beta.1 + 1.5.0-beta.1 - 1.3.0 + 1.4.0 true $(NoWarn);AZC0102 diff --git a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md index 22a2d2182878..6012112d2467 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md +++ b/sdk/extensions/Microsoft.Extensions.Azure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.10.0-beta.1 (Unreleased) +## 1.11.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,11 @@ ### Other Changes +## 1.10.0 (2025-02-11) + +### Other Changes +- Updated dependencies to ensure they are up-to-date with the latest targets and trimming from built-in dependencies. + ## 1.9.0 (2024-11-26) ### Other Changes diff --git a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj index 020c1f201108..6eb2edc27e73 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj +++ b/sdk/extensions/Microsoft.Extensions.Azure/src/Microsoft.Extensions.Azure.csproj @@ -4,9 +4,9 @@ $(RequiredTargetFrameworks) Azure Client SDK integration with Microsoft.Extensions libraries Azure Client SDK integration Microsoft.Extensions - 1.10.0-beta.1 + 1.11.0-beta.1 - 1.9.0 + 1.10.0 Microsoft Azure Client Pipeline AspNetCore Extensions diff --git a/sdk/extensions/README.md b/sdk/extensions/README.md index 2aae761410b2..1aa1bb26b3f6 100644 --- a/sdk/extensions/README.md +++ b/sdk/extensions/README.md @@ -20,8 +20,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FREADME.png) - [configuration_secrets]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md [dataprotection_keys]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md index fcfa47ba4ed8..9f24a64074cc 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md @@ -843,9 +843,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fformrecognizer%2FAzure.AI.FormRecognizer%2FREADME.png) - - [formreco_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/src [formreco_docs]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/ diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/perf/Azure.AI.FormRecognizer.Perf/README.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/perf/Azure.AI.FormRecognizer.Perf/README.md index ee5b69e9f815..be1fa8a5588e 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/perf/Azure.AI.FormRecognizer.Perf/README.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/perf/Azure.AI.FormRecognizer.Perf/README.md @@ -5,8 +5,8 @@ The assets in this area comprise a set of performance tests for the [Azure Form ## Running performance tests Run the Form Recognizer client library performance tests by executing the command-line application using the `dotnet run` command or, in some environments, your operating system's executable support. The performance tests rely on the same set of environment variables used by the Form Recognizer client library's test suite. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -15,5 +15,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fformrecognizer%2FAzure.AI.FormRecognizer%2Fperf%2FAzure.AI.FormRecognizer.Perf%2FREADME.png) diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Customize/ArmHealthcareApisModelFactory.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Customize/ArmHealthcareApisModelFactory.cs index 22445ceab218..2a611055d4d0 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Customize/ArmHealthcareApisModelFactory.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Customize/ArmHealthcareApisModelFactory.cs @@ -14,26 +14,6 @@ namespace Azure.ResourceManager.HealthcareApis.Models /// Model factory for models. public static partial class ArmHealthcareApisModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The provisioning state. - /// Dicom Service authentication configuration. - /// Dicom Service Cors configuration. - /// The url of the Dicom Services. - /// The list of private endpoint connections that are set up for this resource. - /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. - /// Setting indicating whether the service has a managed identity associated with it. - /// An etag associated with the resource, used for optimistic concurrency when editing it. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static DicomServiceData DicomServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HealthcareApisProvisioningState? provisioningState, DicomServiceAuthenticationConfiguration authenticationConfiguration, DicomServiceCorsConfiguration corsConfiguration, Uri serviceUri, IEnumerable privateEndpointConnections, HealthcareApisPublicNetworkAccess? publicNetworkAccess, ManagedServiceIdentity identity, ETag? etag) - => DicomServiceData(id, name, resourceType, systemData, tags, location, provisioningState, authenticationConfiguration, corsConfiguration, serviceUri, privateEndpointConnections, publicNetworkAccess, null, null, identity, etag); - /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/ArmHealthcareApisModelFactory.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/ArmHealthcareApisModelFactory.cs index a606eb757a8f..642a376bcc43 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/ArmHealthcareApisModelFactory.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/ArmHealthcareApisModelFactory.cs @@ -344,6 +344,28 @@ public static FhirServiceData FhirServiceData(ResourceIdentifier id = null, stri serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state. + /// Dicom Service authentication configuration. + /// Dicom Service Cors configuration. + /// The url of the Dicom Services. + /// The list of private endpoint connections that are set up for this resource. + /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. + /// Setting indicating whether the service has a managed identity associated with it. + /// An etag associated with the resource, used for optimistic concurrency when editing it. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DicomServiceData DicomServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HealthcareApisProvisioningState? provisioningState, DicomServiceAuthenticationConfiguration authenticationConfiguration, DicomServiceCorsConfiguration corsConfiguration, Uri serviceUri, IEnumerable privateEndpointConnections, HealthcareApisPublicNetworkAccess? publicNetworkAccess, ManagedServiceIdentity identity, ETag? etag) + { + return DicomServiceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, provisioningState: provisioningState, authenticationConfiguration: authenticationConfiguration, corsConfiguration: corsConfiguration, serviceUri: serviceUri, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, eventState: default, keyEncryptionKeyUri: default, storageConfiguration: default, isDataPartitionsEnabled: default, identity: identity, etag: etag); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md index 959f91deac0e..79206a00f561 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md @@ -119,5 +119,3 @@ additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/healthdataaiservices/Azure.Health.Deidentification/README.png) diff --git a/sdk/identity/Azure.Identity.Broker/README.md b/sdk/identity/Azure.Identity.Broker/README.md index a62743bebdc4..9e3a5de5c2c7 100644 --- a/sdk/identity/Azure.Identity.Broker/README.md +++ b/sdk/identity/Azure.Identity.Broker/README.md @@ -165,5 +165,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [nuget]: https://www.nuget.org/ [identity_api_docs]: https://learn.microsoft.com/dotnet/api/azure.identity?view=azure-dotnet - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fidentity%2FAzure.Identity%2FREADME.png) diff --git a/sdk/identity/Azure.Identity/CHANGELOG.md b/sdk/identity/Azure.Identity/CHANGELOG.md index c857c96f9719..6068336c3dc1 100644 --- a/sdk/identity/Azure.Identity/CHANGELOG.md +++ b/sdk/identity/Azure.Identity/CHANGELOG.md @@ -1,9 +1,8 @@ # Release History -## 1.14.0-beta.1 (Unreleased) +## 1.14.0-beta.2 (Unreleased) ### Features Added -- Added a `Subscription` property to `AzureCliCredentialOptions` to allow specifying the Azure subscription ID or name to use when authenticating with the Azure CLI. ### Breaking Changes @@ -11,6 +10,17 @@ ### Other Changes +## 1.14.0-beta.1 (2025-02-11) + +### Features Added +- Added a `Subscription` property to `AzureCliCredentialOptions` to allow specifying the Azure subscription ID or name to use when authenticating with the Azure CLI. + +### Bugs Fixed +- Null or empty responses from IMDS probe attempts will now fall through to the next credential in the chain ([#47844](https://github.com/Azure/azure-sdk-for-net/issues/47844)) + +### Other Changes +- `AzurePowerShellCredential` no longer relies on APIs that are not available in Constrained Language Mode. + ## 1.13.2 (2025-01-14) ### Bugs Fixed diff --git a/sdk/identity/Azure.Identity/README.md b/sdk/identity/Azure.Identity/README.md index 7f9105dc0475..0b3d06e900a8 100644 --- a/sdk/identity/Azure.Identity/README.md +++ b/sdk/identity/Azure.Identity/README.md @@ -432,5 +432,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [ref_VisualStudioCodeCredential]: https://learn.microsoft.com/dotnet/api/azure.identity.visualstudiocodecredential?view=azure-dotnet [ref_WorkloadIdentityCredential]: https://learn.microsoft.com/dotnet/api/azure.identity.workloadidentitycredential?view=azure-dotnet [cae]: https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fidentity%2FAzure.Identity%2FREADME.png) diff --git a/sdk/identity/Azure.Identity/integration/Integration.Identity.Common/Integration.Identity.Common.csproj b/sdk/identity/Azure.Identity/integration/Integration.Identity.Common/Integration.Identity.Common.csproj index 3dc20577717f..986318b00a80 100644 --- a/sdk/identity/Azure.Identity/integration/Integration.Identity.Common/Integration.Identity.Common.csproj +++ b/sdk/identity/Azure.Identity/integration/Integration.Identity.Common/Integration.Identity.Common.csproj @@ -6,7 +6,7 @@ enable - + diff --git a/sdk/identity/Azure.Identity/integration/Integration.Identity.Container/Integration.Identity.Container.csproj b/sdk/identity/Azure.Identity/integration/Integration.Identity.Container/Integration.Identity.Container.csproj index e8ffb0f551b6..56369fc401ac 100644 --- a/sdk/identity/Azure.Identity/integration/Integration.Identity.Container/Integration.Identity.Container.csproj +++ b/sdk/identity/Azure.Identity/integration/Integration.Identity.Container/Integration.Identity.Container.csproj @@ -2,7 +2,7 @@ Exe - net461;net6.0 + net461;net6.0;net8.0 diff --git a/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Function1.cs b/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Function1.cs index a28f57ccbde1..de75fcfd9d83 100644 --- a/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Function1.cs +++ b/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Function1.cs @@ -23,6 +23,7 @@ public static async Task Run( try { ManagedIdentityTests.AuthToStorage(); + await Task.Yield(); return new OkObjectResult("Successfully acquired a token from ManagedIdentityCredential"); } catch (Exception ex) diff --git a/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Integration.Identity.Func.csproj b/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Integration.Identity.Func.csproj index 822d40d898bc..d8744febfe84 100644 --- a/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Integration.Identity.Func.csproj +++ b/sdk/identity/Azure.Identity/integration/Integration.Identity.Func/Integration.Identity.Func.csproj @@ -4,7 +4,7 @@ v4 - + diff --git a/sdk/identity/Azure.Identity/integration/WebApp/Controllers/TestController.cs b/sdk/identity/Azure.Identity/integration/WebApp/Controllers/TestController.cs index 470bee3938de..7f66dcf4b47a 100644 --- a/sdk/identity/Azure.Identity/integration/WebApp/Controllers/TestController.cs +++ b/sdk/identity/Azure.Identity/integration/WebApp/Controllers/TestController.cs @@ -2,7 +2,6 @@ using System.Linq; using Azure.Core; using Azure.Identity; -using Azure.Storage.Blobs; using Microsoft.AspNetCore.Mvc; using Integration.Identity.Common; diff --git a/sdk/identity/Azure.Identity/integration/WebApp/Integration.Identity.WebApp.csproj b/sdk/identity/Azure.Identity/integration/WebApp/Integration.Identity.WebApp.csproj index 9a7894b5d4ba..888eb244c385 100644 --- a/sdk/identity/Azure.Identity/integration/WebApp/Integration.Identity.WebApp.csproj +++ b/sdk/identity/Azure.Identity/integration/WebApp/Integration.Identity.WebApp.csproj @@ -6,9 +6,6 @@ enable - - - diff --git a/sdk/identity/Azure.Identity/src/Azure.Identity.csproj b/sdk/identity/Azure.Identity/src/Azure.Identity.csproj index 5a9a9b78f6e1..e08b33c701ee 100644 --- a/sdk/identity/Azure.Identity/src/Azure.Identity.csproj +++ b/sdk/identity/Azure.Identity/src/Azure.Identity.csproj @@ -2,7 +2,7 @@ This is the implementation of the Azure SDK Client Library for Azure Identity Microsoft Azure.Identity Component - 1.14.0-beta.1 + 1.14.0-beta.2 1.13.2 Microsoft Azure Identity;$(PackageCommonTags) diff --git a/sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredential.cs index 6a0946acb9bd..0e6330aede9f 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredential.cs @@ -110,7 +110,8 @@ internal AuthorizationCodeCredential(string tenantId, string clientId, string cl /// /// Obtains a token from Microsoft Entra ID, using the specified authorization code to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime and - /// refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -124,7 +125,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Obtains a token from Microsoft Entra ID, using the specified authorization code to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime and - /// refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/AzureApplicationCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/AzureApplicationCredential.cs index 5803e52d213c..657965f626a4 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/AzureApplicationCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/AzureApplicationCredential.cs @@ -46,7 +46,8 @@ internal AzureApplicationCredential(AzureApplicationCredentialOptions options, E /// /// Sequentially calls on all the specified sources, returning the first successfully obtained /// . Acquired tokens are cached by the credential instance. Token lifetime and refreshing is handled - /// automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -58,7 +59,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Sequentially calls on all the specified sources, returning the first successfully obtained /// . Acquired tokens are cached by the credential instance. Token lifetime and refreshing is handled - /// automatically. Where possible,reuse credential instances to optimize cache effectiveness. + /// automatically. Where possible,reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredential.cs index 6e12ac980230..7ff8d318a2ba 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredential.cs @@ -274,7 +274,7 @@ private void GetFileNameAndArguments(string resource, string tenantId, out strin }} else {{ $customToken | Add-Member -MemberType NoteProperty -Name Token -Value $token.Token }} -$customToken | Add-Member -MemberType NoteProperty -Name ExpiresOn -Value $token.ExpiresOn.ToUnixTimeSeconds() +$customToken | Add-Member -MemberType NoteProperty -Name ExpiresOn -Value $token.ExpiresOn.UtcDateTime.Ticks $x = $customToken | ConvertTo-Xml return $x.Objects.FirstChild.OuterXml @@ -314,7 +314,7 @@ private static AccessToken DeserializeOutput(string output) break; case "ExpiresOn": - expiresOn = DateTimeOffset.FromUnixTimeSeconds(long.Parse(e.Value)); + expiresOn = new DateTimeOffset(long.Parse(e.Value), TimeSpan.Zero); break; } diff --git a/sdk/identity/Azure.Identity/src/Credentials/ChainedTokenCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/ChainedTokenCredential.cs index 9b33a701ccf5..db7e9602b58a 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/ChainedTokenCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/ChainedTokenCredential.cs @@ -71,8 +71,8 @@ public ChainedTokenCredential(params TokenCredential[] sources) /// /// Sequentially calls on all the specified sources, returning the first successfully obtained /// . Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to - /// optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -84,8 +84,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Sequentially calls on all the specified sources, returning the first successfully obtained /// . Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to - /// optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredential.cs index e2e50781e89d..ec16ac9f52a9 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredential.cs @@ -175,7 +175,8 @@ internal ClientCertificateCredential( /// /// Obtains a token from Microsoft Entra ID, using the specified X509 certificate to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime - /// and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -201,7 +202,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Obtains a token from Microsoft Entra ID, using the specified X509 certificate to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime - /// and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredential.cs index e48302d07dc5..e9e1a5f62b8e 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredential.cs @@ -106,7 +106,8 @@ internal ClientSecretCredential(string tenantId, string clientId, string clientS /// /// Obtains a token from Microsoft Entra ID, using the specified client secret to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime - /// and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -132,7 +133,8 @@ public override async ValueTask GetTokenAsync(TokenRequestContext r /// /// Obtains a token from Microsoft Entra ID, using the specified client secret to authenticate. Acquired tokens are /// cached by the credential instance. Token lifetime - /// and refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredential.cs index de6dec861732..49ecfbc6134b 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredential.cs @@ -103,7 +103,7 @@ internal DefaultAzureCredential(DefaultAzureCredentialFactory factory) /// /// Sequentially calls on all the included credentials, returning the first successfully /// obtained . Acquired tokens are cached - /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// @@ -121,7 +121,7 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Sequentially calls on all the included credentials, returning the first successfully /// obtained . Acquired tokens are cached - /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// diff --git a/sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredential.cs index 3151da62448d..63bffd6ef80d 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredential.cs @@ -160,8 +160,8 @@ public virtual async Task AuthenticateAsync(TokenRequestCo /// /// Obtains a token for a user account, authenticating them through the device code authentication flow. /// Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse - /// credential instances to optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse + /// credential instances to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -175,8 +175,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Obtains a token for a user account, authenticating them through the device code authentication flow. /// Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse - /// credential instances to optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse + /// credential instances to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredential.cs index f055792c8d09..652a6838b0ce 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredential.cs @@ -129,7 +129,7 @@ internal EnvironmentCredential(CredentialPipeline pipeline, TokenCredential cred /// Obtains a token from Microsoft Entra ID, using the client details specified in the environment variables /// AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET or AZURE_USERNAME and AZURE_PASSWORD to authenticate. /// Acquired tokens are cached by the credential - /// instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// @@ -149,7 +149,7 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// Obtains a token from Microsoft Entra ID, using the client details specified in the environment variables /// AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET or AZURE_USERNAME and AZURE_PASSWORD to authenticate. /// Acquired tokens are cached by the credential - /// instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// diff --git a/sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredential.cs index a9617292e621..740d06f1b0ad 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredential.cs @@ -151,8 +151,8 @@ public virtual async Task AuthenticateAsync(TokenRequestCo /// /// Silently obtains an for a user account if the user has already authenticated. Otherwise, the default browser is launched /// to authenticate the user. Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to - /// optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -166,8 +166,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Silently obtains an for a user account if the user has already authenticated. Otherwise, the default browser is launched /// to authenticate the user. Acquired tokens are cached by the - /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to - /// optimize cache effectiveness. + /// credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/ManagedIdentityCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/ManagedIdentityCredential.cs index 404196a8cd29..9209a05d9311 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/ManagedIdentityCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/ManagedIdentityCredential.cs @@ -110,8 +110,8 @@ internal ManagedIdentityCredential(ManagedIdentityClient client) /// /// Obtains an from the Managed Identity service, if available. Acquired tokens are /// cached by the credential instance. Token - /// lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize - /// cache effectiveness. + /// lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -125,8 +125,8 @@ public override async ValueTask GetTokenAsync(TokenRequestContext r /// /// Obtains an from the Managed Identity service, if available. Acquired tokens are /// cached by the credential instance. Token - /// lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize - /// cache effectiveness. + /// lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredential.cs index ca02c4c3faea..95282159e3ca 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredential.cs @@ -212,7 +212,7 @@ internal OnBehalfOfCredential( /// /// Authenticates with Microsoft Entra ID and returns an access token if successful. Acquired tokens are /// cached by the credential instance. - /// Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// The details of the authentication request. @@ -225,7 +225,7 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Authenticates with Microsoft Entra ID and returns an access token if successful. Acquired tokens are /// cached by the credential instance. - /// Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances /// to optimize cache effectiveness. /// /// The details of the authentication request. diff --git a/sdk/identity/Azure.Identity/src/Credentials/SharedTokenCacheCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/SharedTokenCacheCredential.cs index b1713212017c..b4a724eea70a 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/SharedTokenCacheCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/SharedTokenCacheCredential.cs @@ -90,8 +90,8 @@ internal SharedTokenCacheCredential(string tenantId, string username, TokenCrede /// /// Silently obtains an for a user account if the user has already authenticated to another Microsoft application /// participating in SSO through a shared MSAL cache. Acquired tokens are cached - /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize - /// cache effectiveness. + /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime @@ -105,8 +105,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Silently obtains an for a user account if the user has already authenticated to another Microsoft application /// participating in SSO through a shared MSAL cache. Acquired tokens are cached - /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances to optimize - /// cache effectiveness. + /// by the credential instance. Token lifetime and refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime diff --git a/sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredential.cs b/sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredential.cs index 4ca9d4c081dc..0020fac8cac8 100644 --- a/sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredential.cs +++ b/sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredential.cs @@ -164,7 +164,8 @@ public virtual async Task AuthenticateAsync(TokenRequestCo /// /// Obtains a token for a user account, authenticating them using the provided username and password. Acquired tokens are /// cached by the credential instance. Token lifetime and - /// refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. @@ -178,7 +179,8 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell /// /// Obtains a token for a user account, authenticating them using the provided username and password. Acquired tokens are /// cached by the credential instance. Token lifetime and - /// refreshing is handled automatically. Where possible, reuse credential instances to optimize cache effectiveness. + /// refreshing is handled automatically. Where possible, reuse credential instances + /// to optimize cache effectiveness. /// /// The details of the authentication request. /// A controlling the request lifetime. diff --git a/sdk/identity/Azure.Identity/src/ManagedIdentitySource.cs b/sdk/identity/Azure.Identity/src/ManagedIdentitySource.cs index b86d4de60d0e..b525b6db4a7d 100644 --- a/sdk/identity/Azure.Identity/src/ManagedIdentitySource.cs +++ b/sdk/identity/Azure.Identity/src/ManagedIdentitySource.cs @@ -87,6 +87,7 @@ protected virtual async ValueTask HandleResponseAsync( if (response.IsError) { string content = string.Empty; + try { content = response.Content.ToString(); @@ -94,9 +95,9 @@ protected virtual async ValueTask HandleResponseAsync( ? await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false) : JsonDocument.Parse(response.ContentStream); } - catch (JsonException) + catch (Exception) { - // If the response is not json, it is not the IMDS and it should be treated as CredentialUnavailable + // If the response is not json or the Content was null, it is not the IMDS and it should be treated as CredentialUnavailable throw new CredentialUnavailableException(UnexpectedResponse, new Exception(content)); } } diff --git a/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs b/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs index 17d1e22cf0fd..4084aab83d37 100644 --- a/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs +++ b/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs @@ -75,7 +75,7 @@ public static (string Token, DateTimeOffset ExpiresOn, string Json) CreateTokenF { var expiresOn = DateTimeOffset.FromUnixTimeSeconds(DateTimeOffset.UtcNow.Add(expiresOffset).ToUnixTimeSeconds()); var token = TokenGenerator.GenerateToken(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), expiresOn.UtcDateTime); - var xml = @$"{token}{expiresOn.ToUnixTimeSeconds()}"; + var xml = @$"{token}{expiresOn.UtcDateTime.Ticks}"; return (token, expiresOn, xml); } diff --git a/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs b/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs index 94afae6b3576..f25cccb577a7 100644 --- a/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs +++ b/sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs @@ -386,6 +386,7 @@ public void VerifyImdsRequestFailurePopulatesExceptionMessage() [TestCase("connecting to 169.254.169.254:80: connecting to 169.254.169.254:80: dial tcp 169.254.169.254:80: connectex: A socket operation was attempted to an unreachable network")] [TestCase("connecting to 169.254.169.254:80: connecting to 169.254.169.254:80: dial tcp 169.254.169.254:80: connectex: A socket operation was attempted to an unreachable foo")] [TestCase("Some html")] + [TestCase(null)] public void VerifyImdsRequestFailureForDockerDesktopThrowsCUE(string error) { using var environment = new TestEnvVar(new() { { "MSI_ENDPOINT", null }, { "MSI_SECRET", null }, { "IDENTITY_ENDPOINT", null }, { "IDENTITY_HEADER", null }, { "AZURE_POD_IDENTITY_AUTHORITY_HOST", null } }); @@ -401,7 +402,10 @@ public void VerifyImdsRequestFailureForDockerDesktopThrowsCUE(string error) new ManagedIdentityClientOptions() { Pipeline = pipeline, ManagedIdentityId = ManagedIdentityId.FromUserAssignedClientId("mock-client-id"), IsForceRefreshEnabled = true, Options = options }))); var ex = Assert.ThrowsAsync(async () => await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default))); - Assert.That(ex.InnerException.Message, Does.Contain(expectedMessage)); + if (expectedMessage != null) + { + Assert.That(ex.InnerException.Message, Does.Contain(expectedMessage)); + } } [NonParallelizable] @@ -1190,7 +1194,10 @@ private MockResponse CreateErrorMockResponse(int responseCode, string message) private static MockResponse CreateInvalidJsonResponse(int status, string message = "invalid json") { var response = new MockResponse(status); - response.SetContent(message); + if (message != null) + { + response.SetContent(message); + } return response; } diff --git a/sdk/identity/Azure.Identity/tests/MultiTenantLiveTests.cs b/sdk/identity/Azure.Identity/tests/MultiTenantLiveTests.cs index 8655b57e604a..23e9bf3bcd60 100644 --- a/sdk/identity/Azure.Identity/tests/MultiTenantLiveTests.cs +++ b/sdk/identity/Azure.Identity/tests/MultiTenantLiveTests.cs @@ -19,6 +19,7 @@ public MultiTenantLiveTests(bool isAsync) : base(isAsync) private IdentityTestClient _client; [RecordedTest] + [PlaybackOnly("Requires ephemeral tenant")] public async Task CallGraphWithClientSecret() { var tenantId = TestEnvironment.MultiTenantAppTenantId; diff --git a/sdk/identity/test-resources-post.ps1 b/sdk/identity/test-resources-post.ps1 index e7bb5f88a5d1..11ac1219b810 100644 --- a/sdk/identity/test-resources-post.ps1 +++ b/sdk/identity/test-resources-post.ps1 @@ -28,7 +28,7 @@ az functionapp deployment source config-zip -g $DeploymentOutputs['IDENTITY_RESO # clean up Remove-Item -Force -Recurse "$workingFolder/Pub" -$containerImage = 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore_keyring:3080193' +$containerImage = 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore_keyring:4484670' $MIClientId = $DeploymentOutputs['IDENTITY_USER_DEFINED_IDENTITY_CLIENT_ID'] $MIName = $DeploymentOutputs['IDENTITY_USER_DEFINED_IDENTITY_NAME'] $SaAccountName = 'workload-identity-sa' diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/Azure.ResourceManager.IotOperations.sln b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Azure.ResourceManager.IotOperations.sln new file mode 100644 index 000000000000..8450f8da2f0f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Azure.ResourceManager.IotOperations.sln @@ -0,0 +1,36 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35431.28 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.IotOperations", "src\Azure.ResourceManager.IotOperations.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.IotOperations.Tests", "tests\Azure.ResourceManager.IotOperations.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.IotOperations.Samples", "samples\Azure.ResourceManager.IotOperations.Samples.csproj", "{2F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + {2F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/CHANGELOG.md b/sdk/iotoperations/Azure.ResourceManager.IotOperations/CHANGELOG.md new file mode 100644 index 000000000000..d0d2a0d41c03 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/CHANGELOG.md @@ -0,0 +1,29 @@ +# Release History + +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0 (2024-11-01) + +This release is the first stable release of the IotOperations Management client library. + +### Features Added + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/Directory.Build.props b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/README.md b/sdk/iotoperations/Azure.ResourceManager.IotOperations/README.md new file mode 100644 index 000000000000..382794dbc9b1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/README.md @@ -0,0 +1,65 @@ +# Microsoft Azure IoT Operations management client library for .NET + + +Azure IoT Operations is a unified data plane for the edge. It's a collection of modular, scalable, and highly available data services that run on Azure Arc-enabled edge Kubernetes clusters such as AKS Edge Essentials. It enables data capture from various different systems and integrates with data modeling applications such as Microsoft Fabric to help organizations deploy the industrial metaverse. + +## Getting started + +### Install the package + +Install the Microsoft Azure IoT Operations management library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.ResourceManager.IotOperations +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs new file mode 100644 index 000000000000..69da539c4a18 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs @@ -0,0 +1,2057 @@ +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthenticationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerAuthenticationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string authenticationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string authenticationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerAuthenticationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthenticationData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthenticationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerAuthenticationResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerAuthorizationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string authorizationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string authorizationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerAuthorizationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthorizationData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerAuthorizationResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string brokerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string brokerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerListenerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string listenerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string listenerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerListenerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerListenerData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerListenerResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsBrokerAuthentication(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAuthenticationAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationCollection GetIotOperationsBrokerAuthentications() { throw null; } + public virtual Azure.Response GetIotOperationsBrokerAuthorization(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAuthorizationAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationCollection GetIotOperationsBrokerAuthorizations() { throw null; } + public virtual Azure.Response GetIotOperationsBrokerListener(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerListenerAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerCollection GetIotOperationsBrokerListeners() { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowName, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowName, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowEndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowEndpointName, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowEndpointName, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowEndpointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowEndpointData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowEndpointResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowProfileName, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowProfileName, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowProfileData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProfileData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowProfileResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsDataflow(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowCollection GetIotOperationsDataflows() { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class IotOperationsExtensions + { + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerResource GetIotOperationsBrokerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowResource GetIotOperationsDataflowResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetIotOperationsInstance(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetIotOperationsInstanceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceResource GetIotOperationsInstanceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceCollection GetIotOperationsInstances(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetIotOperationsInstances(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetIotOperationsInstancesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsInstanceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsInstanceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string instanceName, Azure.ResourceManager.IotOperations.IotOperationsInstanceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string instanceName, Azure.ResourceManager.IotOperations.IotOperationsInstanceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsInstanceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstanceData(Azure.Core.AzureLocation location, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsInstanceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsInstanceResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsBroker(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerCollection GetIotOperationsBrokers() { throw null; } + public virtual Azure.Response GetIotOperationsDataflowEndpoint(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowEndpointAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointCollection GetIotOperationsDataflowEndpoints() { throw null; } + public virtual Azure.Response GetIotOperationsDataflowProfile(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowProfileAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileCollection GetIotOperationsDataflowProfiles() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.IotOperations.Mocking +{ + public partial class MockableIotOperationsArmClient : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsArmClient() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerResource GetIotOperationsBrokerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowResource GetIotOperationsDataflowResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceResource GetIotOperationsInstanceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableIotOperationsResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsResourceGroupResource() { } + public virtual Azure.Response GetIotOperationsInstance(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsInstanceAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceCollection GetIotOperationsInstances() { throw null; } + } + public partial class MockableIotOperationsSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsSubscriptionResource() { } + public virtual Azure.Pageable GetIotOperationsInstances(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetIotOperationsInstancesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.IotOperations.Models +{ + public static partial class ArmIotOperationsModelFactory + { + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData IotOperationsBrokerAuthenticationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties IotOperationsBrokerAuthenticationProperties(System.Collections.Generic.IEnumerable authenticationMethods = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData IotOperationsBrokerAuthorizationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties IotOperationsBrokerAuthorizationProperties(Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig authorizationPolicies = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerData IotOperationsBrokerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData IotOperationsBrokerListenerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties IotOperationsBrokerListenerProperties(string serviceName = null, System.Collections.Generic.IEnumerable ports = null, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType? serviceType = default(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties IotOperationsBrokerProperties(Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings advanced = null, Azure.ResourceManager.IotOperations.Models.BrokerCardinality cardinality = null, Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics diagnostics = null, Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer diskBackedMessageBuffer = null, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? generateResourceLimitsCpu = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile? memoryProfile = default(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowData IotOperationsDataflowData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData IotOperationsDataflowEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties IotOperationsDataflowEndpointProperties(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType endpointType = default(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType), Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer dataExplorerSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage dataLakeStorageSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake fabricOneLakeSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka kafkaSettings = null, string localStoragePersistentVolumeClaimRef = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt mqttSettings = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData IotOperationsDataflowProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties IotOperationsDataflowProfileProperties(Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics diagnostics = null, int? instanceCount = default(int?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties IotOperationsDataflowProperties(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? mode = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), System.Collections.Generic.IEnumerable operations = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceData IotOperationsInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BlockerListenerServiceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BlockerListenerServiceType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType ClusterIP { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType LoadBalancer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType NodePort { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType left, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType left, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerAdvancedSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAdvancedSettings() { } + public Azure.ResourceManager.IotOperations.Models.BrokerClientConfig Clients { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? EncryptInternalTraffic { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig InternalCerts { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerAuthenticationMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerAuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod Custom { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod ServiceAccountToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod X509 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod left, Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod left, Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerAuthenticatorMethodCustom : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodCustom(System.Uri endpoint) { } + public string CaCertConfigMap { get { throw null; } set { } } + public System.Uri Endpoint { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Headers { get { throw null; } } + public string X509SecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethods : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethods(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod method) { } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom CustomSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod Method { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceAccountTokenAudiences { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 X509Settings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethods System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethods System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethodX509 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodX509() { } + public System.Collections.Generic.IDictionary AuthorizationAttributes { get { throw null; } } + public string TrustedClientCaCert { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethodX509Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodX509Attributes(System.Collections.Generic.IDictionary attributes, string subject) { } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public string Subject { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthorizationConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthorizationConfig() { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Cache { get { throw null; } set { } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthorizationRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthorizationRule(System.Collections.Generic.IEnumerable brokerResources, Azure.ResourceManager.IotOperations.Models.PrincipalConfig principals) { } + public System.Collections.Generic.IList BrokerResources { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.PrincipalConfig Principals { get { throw null; } set { } } + public System.Collections.Generic.IList StateStoreResources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerBackendChain : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerBackendChain(int partitions, int redundancyFactor) { } + public int Partitions { get { throw null; } set { } } + public int RedundancyFactor { get { throw null; } set { } } + public int? Workers { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerBackendChain System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerBackendChain System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerCardinality : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerCardinality(Azure.ResourceManager.IotOperations.Models.BrokerBackendChain backendChain, Azure.ResourceManager.IotOperations.Models.BrokerFrontend frontend) { } + public Azure.ResourceManager.IotOperations.Models.BrokerBackendChain BackendChain { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerFrontend Frontend { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerCardinality System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerCardinality System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerClientConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerClientConfig() { } + public int? MaxKeepAliveSeconds { get { throw null; } set { } } + public int? MaxMessageExpirySeconds { get { throw null; } set { } } + public int? MaxPacketSizeBytes { get { throw null; } set { } } + public int? MaxReceiveMaximum { get { throw null; } set { } } + public int? MaxSessionExpirySeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit SubscriberQueueLimit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerClientConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerClientConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnostics() { } + public string LogsLevel { get { throw null; } set { } } + public int? MetricsPrometheusPort { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck SelfCheck { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces Traces { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnosticSelfCheck : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnosticSelfCheck() { } + public int? IntervalSeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public int? TimeoutSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnosticTraces : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnosticTraces() { } + public int? CacheSizeMegabytes { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing SelfTracing { get { throw null; } set { } } + public int? SpanChannelCapacity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerFrontend : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerFrontend(int replicas) { } + public int Replicas { get { throw null; } set { } } + public int? Workers { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerFrontend System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerFrontend System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerListenerPort : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerListenerPort(int port) { } + public string AuthenticationRef { get { throw null; } set { } } + public string AuthorizationRef { get { throw null; } set { } } + public int? NodePort { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerProtocolType? Protocol { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerListenerPort System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerListenerPort System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerMemoryProfile : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerMemoryProfile(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile High { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Low { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Medium { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Tiny { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile left, Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile left, Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerOperatorValue : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerOperatorValue(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue DoesNotExist { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue Exists { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue In { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue NotIn { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue left, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue left, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerProtocolType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerProtocolType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerProtocolType Mqtt { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerProtocolType WebSockets { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType left, Azure.ResourceManager.IotOperations.Models.BrokerProtocolType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerProtocolType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType left, Azure.ResourceManager.IotOperations.Models.BrokerProtocolType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerResourceDefinitionMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerResourceDefinitionMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Connect { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Publish { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Subscribe { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerResourceRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerResourceRule(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod method) { } + public System.Collections.Generic.IList ClientIds { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Method { get { throw null; } set { } } + public System.Collections.Generic.IList Topics { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerResourceRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerResourceRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerCertConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerCertConfig(string duration, string renewBefore, Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey privateKey) { } + public string Duration { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey PrivateKey { get { throw null; } set { } } + public string RenewBefore { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerCertificateSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerCertificateSpec(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef issuerRef) { } + public string Duration { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef IssuerRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey PrivateKey { get { throw null; } set { } } + public string RenewBefore { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SanForCert San { get { throw null; } set { } } + public string SecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CertManagerIssuerKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CertManagerIssuerKind(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind ClusterIssuer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind Issuer { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind left, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind left, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CertManagerIssuerRef : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerIssuerRef(string group, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind kind, string name) { } + public string Group { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerPrivateKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerPrivateKey(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm algorithm, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy rotationPolicy) { } + public Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Algorithm { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy RotationPolicy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudEventAttributeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudEventAttributeType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType CreateOrRemap { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType Propagate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType left, Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType left, Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataExplorerAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataExplorerAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowBuiltInTransformationDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationDataset(string key, System.Collections.Generic.IEnumerable inputs) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public string Key { get { throw null; } set { } } + public string SchemaRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationFilter(System.Collections.Generic.IEnumerable inputs, string expression) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.DataflowFilterType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationMap(System.Collections.Generic.IEnumerable inputs, string output) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public string Output { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowMappingType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationSettings() { } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public System.Collections.Generic.IList Filter { get { throw null; } } + public System.Collections.Generic.IList Map { get { throw null; } } + public string SchemaRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat? SerializationFormat { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowDestinationOperationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowDestinationOperationSettings(string endpointRef, string dataDestination) { } + public string DataDestination { get { throw null; } set { } } + public string EndpointRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointAuthenticationSasl : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointAuthenticationSasl(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType saslType, string secretRef) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType SaslType { get { throw null; } set { } } + public string SecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointAuthenticationSaslType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointAuthenticationSaslType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType Plain { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType ScramSha256 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType ScramSha512 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string tenantId) { } + public string ClientId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataExplorer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataExplorer(Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication authentication, string database, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Database { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataExplorerAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataExplorerAuthentication(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataLakeStorage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataLakeStorage(Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication authentication, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataLakeStorageAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataLakeStorageAuthentication(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod method) { } + public string AccessTokenSecretRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLake : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLake(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication authentication, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames names, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType oneLakePathType, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames Names { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType OneLakePathType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLakeAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLakeAuthentication(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLakeNames : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName) { } + public string LakehouseName { get { throw null; } set { } } + public string WorkspaceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointFabricPathType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointFabricPathType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType Files { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType Tables { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointKafka : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafka(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication authentication, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching Batching { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType? CloudEventAttributes { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression? Compression { get { throw null; } set { } } + public string ConsumerGroupId { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? CopyMqttProperties { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck? KafkaAcks { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy? PartitionStrategy { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaAck : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaAck(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck All { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck One { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck Zero { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointKafkaAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafkaAuthentication(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Method { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl SaslSettings { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + public string X509CertificateSecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointKafkaBatching : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafkaBatching() { } + public int? LatencyMs { get { throw null; } set { } } + public int? MaxBytes { get { throw null; } set { } } + public int? MaxMessages { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaCompression : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaCompression(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Gzip { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Lz4 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression None { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Snappy { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaPartitionStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaPartitionStrategy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Default { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Property { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Static { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Topic { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointMqtt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointMqtt(Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication authentication) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication Authentication { get { throw null; } set { } } + public string ClientIdPrefix { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType? CloudEventAttributes { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public int? KeepAliveSeconds { get { throw null; } set { } } + public int? MaxInflightMessages { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerProtocolType? Protocol { get { throw null; } set { } } + public int? Qos { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.MqttRetainType? Retain { get { throw null; } set { } } + public int? SessionExpirySeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointMqttAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointMqttAuthentication(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.MqttAuthMethod Method { get { throw null; } set { } } + public string ServiceAccountTokenAudience { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + public string X509CertificateSecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType DataExplorer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType DataLakeStorage { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType FabricOneLake { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType Kafka { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType LocalStorage { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType Mqtt { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowFilterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowFilterType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowFilterType Filter { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowFilterType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowFilterType left, Azure.ResourceManager.IotOperations.Models.DataflowFilterType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowFilterType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowFilterType left, Azure.ResourceManager.IotOperations.Models.DataflowFilterType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowMappingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowMappingType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType BuiltInFunction { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType Compute { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType NewProperties { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType PassThrough { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType Rename { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowMappingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowMappingType left, Azure.ResourceManager.IotOperations.Models.DataflowMappingType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowMappingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowMappingType left, Azure.ResourceManager.IotOperations.Models.DataflowMappingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowOperationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowOperationProperties(Azure.ResourceManager.IotOperations.Models.DataflowOperationType operationType) { } + public Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings BuiltInTransformationSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings DestinationSettings { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowOperationType OperationType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings SourceSettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowOperationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowOperationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowOperationType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType BuiltInTransformation { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType Destination { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType Source { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowOperationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowOperationType left, Azure.ResourceManager.IotOperations.Models.DataflowOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowOperationType left, Azure.ResourceManager.IotOperations.Models.DataflowOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowProfileDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowProfileDiagnostics() { } + public string LogsLevel { get { throw null; } set { } } + public int? MetricsPrometheusPort { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowSourceOperationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowSourceOperationSettings(string endpointRef, System.Collections.Generic.IEnumerable dataSources) { } + public string AssetRef { get { throw null; } set { } } + public System.Collections.Generic.IList DataSources { get { throw null; } } + public string EndpointRef { get { throw null; } set { } } + public string SchemaRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat? SerializationFormat { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowSourceSerializationFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowSourceSerializationFormat(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat Json { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat left, Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat left, Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataLakeStorageAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataLakeStorageAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod AccessToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiagnosticSelfTracing : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiagnosticSelfTracing() { } + public int? IntervalSeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiskBackedMessageBuffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskBackedMessageBuffer(string maxSize) { } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec EphemeralVolumeClaimSpec { get { throw null; } set { } } + public string MaxSize { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec PersistentVolumeClaimSpec { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FabricOneLakeAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FabricOneLakeAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsBatchingConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBatchingConfig() { } + public int? LatencySeconds { get { throw null; } set { } } + public int? MaxMessages { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthenticationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthenticationProperties(System.Collections.Generic.IEnumerable authenticationMethods) { } + public System.Collections.Generic.IList AuthenticationMethods { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthorizationProperties(Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig authorizationPolicies) { } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig AuthorizationPolicies { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerListenerProperties(System.Collections.Generic.IEnumerable ports) { } + public System.Collections.Generic.IList Ports { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceName { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType? ServiceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerProperties() { } + public Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings Advanced { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerCardinality Cardinality { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics Diagnostics { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer DiskBackedMessageBuffer { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? GenerateResourceLimitsCpu { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile? MemoryProfile { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowEndpointProperties(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType endpointType) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer DataExplorerSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage DataLakeStorageSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointType EndpointType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake FabricOneLakeSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka KafkaSettings { get { throw null; } set { } } + public string LocalStoragePersistentVolumeClaimRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt MqttSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProfileProperties() { } + public Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics Diagnostics { get { throw null; } set { } } + public int? InstanceCount { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProperties(System.Collections.Generic.IEnumerable operations) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IList Operations { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsExtendedLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsExtendedLocation(string name, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType type) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsExtendedLocationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsExtendedLocationType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType CustomLocation { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType left, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType left, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsInstancePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstancePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsInstanceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstanceProperties(Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef schemaRegistryRef) { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier SchemaRegistryRefResourceId { get { throw null; } set { } } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsOperationalMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsOperationalMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode Disabled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode left, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode left, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState left, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState left, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsTlsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsTlsProperties() { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public string TrustedCaCertificateConfigMapRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KafkaAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KafkaAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Sasl { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod X509Certificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod left, Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod left, Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class KubernetesReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KubernetesReference(string kind, string name) { } + public string ApiGroup { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Namespace { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.KubernetesReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.KubernetesReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ListenerPortTlsCertMethod : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListenerPortTlsCertMethod(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode mode) { } + public Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec CertManagerCertificateSpec { get { throw null; } set { } } + public string ManualSecretRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LocalKubernetesReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocalKubernetesReference(string kind, string name) { } + public string ApiGroup { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MqttAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MqttAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod ServiceAccountToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod X509Certificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod left, Azure.ResourceManager.IotOperations.Models.MqttAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.MqttAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod left, Azure.ResourceManager.IotOperations.Models.MqttAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MqttRetainType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MqttRetainType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.MqttRetainType Keep { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttRetainType Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.MqttRetainType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.MqttRetainType left, Azure.ResourceManager.IotOperations.Models.MqttRetainType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.MqttRetainType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.MqttRetainType left, Azure.ResourceManager.IotOperations.Models.MqttRetainType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PrincipalConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrincipalConfig() { } + public System.Collections.Generic.IList> Attributes { get { throw null; } } + public System.Collections.Generic.IList ClientIds { get { throw null; } } + public System.Collections.Generic.IList Usernames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.PrincipalConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.PrincipalConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateKeyAlgorithm : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateKeyAlgorithm(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec256 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec384 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec521 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ed25519 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa2048 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa4096 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa8192 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm left, Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm left, Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateKeyRotationPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateKeyRotationPolicy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy Always { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy left, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy left, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SanForCert : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SanForCert(System.Collections.Generic.IEnumerable dns, System.Collections.Generic.IEnumerable ip) { } + public System.Collections.Generic.IList Dns { get { throw null; } } + public System.Collections.Generic.IList IP { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SanForCert System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SanForCert System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SchemaRegistryRef : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SchemaRegistryRef(Azure.Core.ResourceIdentifier resourceId) { } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StateStoreResourceDefinitionMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StateStoreResourceDefinitionMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Read { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod ReadWrite { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Write { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StateStoreResourceKeyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StateStoreResourceKeyType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType Binary { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType Pattern { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType String { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StateStoreResourceRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StateStoreResourceRule(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType keyType, System.Collections.Generic.IEnumerable keys, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod method) { } + public System.Collections.Generic.IList Keys { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType KeyType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Method { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.StateStoreResourceRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.StateStoreResourceRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SubscriberMessageDropStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SubscriberMessageDropStrategy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy DropOldest { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy None { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy left, Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy left, Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubscriberQueueLimit : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubscriberQueueLimit() { } + public long? Length { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy? Strategy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TlsCertMethodMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TlsCertMethodMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Automatic { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode left, Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode left, Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TransformationSerializationFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TransformationSerializationFormat(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Delta { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Json { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Parquet { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat left, Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat left, Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VolumeClaimResourceRequirements : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimResourceRequirements() { } + public System.Collections.Generic.IDictionary Limits { get { throw null; } } + public System.Collections.Generic.IDictionary Requests { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpec() { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference DataSource { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.KubernetesReference DataSourceRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements Resources { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector Selector { get { throw null; } set { } } + public string StorageClassName { get { throw null; } set { } } + public string VolumeMode { get { throw null; } set { } } + public string VolumeName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpecSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpecSelector() { } + public System.Collections.Generic.IList MatchExpressions { get { throw null; } } + public System.Collections.Generic.IDictionary MatchLabels { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpecSelectorMatchExpressions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpecSelectorMatchExpressions(string key, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue @operator) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue Operator { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelectorMatchExpressions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelectorMatchExpressions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs new file mode 100644 index 000000000000..69da539c4a18 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs @@ -0,0 +1,2057 @@ +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthenticationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerAuthenticationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string authenticationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string authenticationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerAuthenticationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthenticationData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthenticationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerAuthenticationResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerAuthorizationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string authorizationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string authorizationName, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerAuthorizationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthorizationData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerAuthorizationResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string brokerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string brokerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsBrokerListenerCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string listenerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string listenerName, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsBrokerListenerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerListenerData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerListenerResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsBrokerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsBrokerResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsBrokerAuthentication(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAuthenticationAsync(string authenticationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationCollection GetIotOperationsBrokerAuthentications() { throw null; } + public virtual Azure.Response GetIotOperationsBrokerAuthorization(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAuthorizationAsync(string authorizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationCollection GetIotOperationsBrokerAuthorizations() { throw null; } + public virtual Azure.Response GetIotOperationsBrokerListener(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerListenerAsync(string listenerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerCollection GetIotOperationsBrokerListeners() { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsBrokerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsBrokerData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowName, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowName, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowEndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowEndpointName, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowEndpointName, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowEndpointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowEndpointData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowEndpointResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsDataflowProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dataflowProfileName, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dataflowProfileName, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsDataflowProfileData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProfileData(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowProfileResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsDataflow(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowAsync(string dataflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowCollection GetIotOperationsDataflows() { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsDataflowResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsDataflowResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsDataflowData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.IotOperations.IotOperationsDataflowData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class IotOperationsExtensions + { + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerResource GetIotOperationsBrokerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowResource GetIotOperationsDataflowResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetIotOperationsInstance(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetIotOperationsInstanceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceResource GetIotOperationsInstanceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceCollection GetIotOperationsInstances(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetIotOperationsInstances(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetIotOperationsInstancesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IotOperationsInstanceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IotOperationsInstanceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string instanceName, Azure.ResourceManager.IotOperations.IotOperationsInstanceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string instanceName, Azure.ResourceManager.IotOperations.IotOperationsInstanceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class IotOperationsInstanceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstanceData(Azure.Core.AzureLocation location, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation ExtendedLocation { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsInstanceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IotOperationsInstanceResource() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIotOperationsBroker(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsBrokerAsync(string brokerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerCollection GetIotOperationsBrokers() { throw null; } + public virtual Azure.Response GetIotOperationsDataflowEndpoint(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowEndpointAsync(string dataflowEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointCollection GetIotOperationsDataflowEndpoints() { throw null; } + public virtual Azure.Response GetIotOperationsDataflowProfile(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsDataflowProfileAsync(string dataflowProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileCollection GetIotOperationsDataflowProfiles() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.IotOperationsInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.IotOperations.Mocking +{ + public partial class MockableIotOperationsArmClient : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsArmClient() { } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsBrokerResource GetIotOperationsBrokerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsDataflowResource GetIotOperationsDataflowResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceResource GetIotOperationsInstanceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableIotOperationsResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsResourceGroupResource() { } + public virtual Azure.Response GetIotOperationsInstance(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIotOperationsInstanceAsync(string instanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.IotOperations.IotOperationsInstanceCollection GetIotOperationsInstances() { throw null; } + } + public partial class MockableIotOperationsSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableIotOperationsSubscriptionResource() { } + public virtual Azure.Pageable GetIotOperationsInstances(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetIotOperationsInstancesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.IotOperations.Models +{ + public static partial class ArmIotOperationsModelFactory + { + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthenticationData IotOperationsBrokerAuthenticationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties IotOperationsBrokerAuthenticationProperties(System.Collections.Generic.IEnumerable authenticationMethods = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerAuthorizationData IotOperationsBrokerAuthorizationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties IotOperationsBrokerAuthorizationProperties(Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig authorizationPolicies = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerData IotOperationsBrokerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsBrokerListenerData IotOperationsBrokerListenerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties IotOperationsBrokerListenerProperties(string serviceName = null, System.Collections.Generic.IEnumerable ports = null, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType? serviceType = default(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties IotOperationsBrokerProperties(Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings advanced = null, Azure.ResourceManager.IotOperations.Models.BrokerCardinality cardinality = null, Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics diagnostics = null, Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer diskBackedMessageBuffer = null, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? generateResourceLimitsCpu = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile? memoryProfile = default(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowData IotOperationsDataflowData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowEndpointData IotOperationsDataflowEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties IotOperationsDataflowEndpointProperties(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType endpointType = default(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType), Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer dataExplorerSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage dataLakeStorageSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake fabricOneLakeSettings = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka kafkaSettings = null, string localStoragePersistentVolumeClaimRef = null, Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt mqttSettings = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsDataflowProfileData IotOperationsDataflowProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties IotOperationsDataflowProfileProperties(Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics diagnostics = null, int? instanceCount = default(int?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties IotOperationsDataflowProperties(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? mode = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), System.Collections.Generic.IEnumerable operations = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } + public static Azure.ResourceManager.IotOperations.IotOperationsInstanceData IotOperationsInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BlockerListenerServiceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BlockerListenerServiceType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType ClusterIP { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType LoadBalancer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType NodePort { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType left, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType left, Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerAdvancedSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAdvancedSettings() { } + public Azure.ResourceManager.IotOperations.Models.BrokerClientConfig Clients { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? EncryptInternalTraffic { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig InternalCerts { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerAuthenticationMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerAuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod Custom { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod ServiceAccountToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod X509 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod left, Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod left, Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerAuthenticatorMethodCustom : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodCustom(System.Uri endpoint) { } + public string CaCertConfigMap { get { throw null; } set { } } + public System.Uri Endpoint { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Headers { get { throw null; } } + public string X509SecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethods : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethods(Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod method) { } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodCustom CustomSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticationMethod Method { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceAccountTokenAudiences { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 X509Settings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethods System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethods System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethodX509 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodX509() { } + public System.Collections.Generic.IDictionary AuthorizationAttributes { get { throw null; } } + public string TrustedClientCaCert { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509 System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthenticatorMethodX509Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthenticatorMethodX509Attributes(System.Collections.Generic.IDictionary attributes, string subject) { } + public System.Collections.Generic.IDictionary Attributes { get { throw null; } } + public string Subject { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthenticatorMethodX509Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthorizationConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthorizationConfig() { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Cache { get { throw null; } set { } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerAuthorizationRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerAuthorizationRule(System.Collections.Generic.IEnumerable brokerResources, Azure.ResourceManager.IotOperations.Models.PrincipalConfig principals) { } + public System.Collections.Generic.IList BrokerResources { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.PrincipalConfig Principals { get { throw null; } set { } } + public System.Collections.Generic.IList StateStoreResources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerBackendChain : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerBackendChain(int partitions, int redundancyFactor) { } + public int Partitions { get { throw null; } set { } } + public int RedundancyFactor { get { throw null; } set { } } + public int? Workers { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerBackendChain System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerBackendChain System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerCardinality : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerCardinality(Azure.ResourceManager.IotOperations.Models.BrokerBackendChain backendChain, Azure.ResourceManager.IotOperations.Models.BrokerFrontend frontend) { } + public Azure.ResourceManager.IotOperations.Models.BrokerBackendChain BackendChain { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerFrontend Frontend { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerCardinality System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerCardinality System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerClientConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerClientConfig() { } + public int? MaxKeepAliveSeconds { get { throw null; } set { } } + public int? MaxMessageExpirySeconds { get { throw null; } set { } } + public int? MaxPacketSizeBytes { get { throw null; } set { } } + public int? MaxReceiveMaximum { get { throw null; } set { } } + public int? MaxSessionExpirySeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit SubscriberQueueLimit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerClientConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerClientConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnostics() { } + public string LogsLevel { get { throw null; } set { } } + public int? MetricsPrometheusPort { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck SelfCheck { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces Traces { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnosticSelfCheck : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnosticSelfCheck() { } + public int? IntervalSeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public int? TimeoutSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticSelfCheck System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerDiagnosticTraces : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerDiagnosticTraces() { } + public int? CacheSizeMegabytes { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing SelfTracing { get { throw null; } set { } } + public int? SpanChannelCapacity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerDiagnosticTraces System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerFrontend : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerFrontend(int replicas) { } + public int Replicas { get { throw null; } set { } } + public int? Workers { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerFrontend System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerFrontend System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BrokerListenerPort : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerListenerPort(int port) { } + public string AuthenticationRef { get { throw null; } set { } } + public string AuthorizationRef { get { throw null; } set { } } + public int? NodePort { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerProtocolType? Protocol { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerListenerPort System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerListenerPort System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerMemoryProfile : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerMemoryProfile(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile High { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Low { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Medium { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile Tiny { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile left, Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile left, Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerOperatorValue : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerOperatorValue(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue DoesNotExist { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue Exists { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue In { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue NotIn { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue left, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue left, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerProtocolType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerProtocolType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerProtocolType Mqtt { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerProtocolType WebSockets { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType left, Azure.ResourceManager.IotOperations.Models.BrokerProtocolType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerProtocolType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerProtocolType left, Azure.ResourceManager.IotOperations.Models.BrokerProtocolType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrokerResourceDefinitionMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrokerResourceDefinitionMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Connect { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Publish { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Subscribe { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class BrokerResourceRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BrokerResourceRule(Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod method) { } + public System.Collections.Generic.IList ClientIds { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.BrokerResourceDefinitionMethod Method { get { throw null; } set { } } + public System.Collections.Generic.IList Topics { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerResourceRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.BrokerResourceRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerCertConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerCertConfig(string duration, string renewBefore, Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey privateKey) { } + public string Duration { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey PrivateKey { get { throw null; } set { } } + public string RenewBefore { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerCertificateSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerCertificateSpec(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef issuerRef) { } + public string Duration { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef IssuerRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey PrivateKey { get { throw null; } set { } } + public string RenewBefore { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SanForCert San { get { throw null; } set { } } + public string SecretName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CertManagerIssuerKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CertManagerIssuerKind(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind ClusterIssuer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind Issuer { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind left, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind left, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CertManagerIssuerRef : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerIssuerRef(string group, Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind kind, string name) { } + public string Group { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CertManagerIssuerKind Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerIssuerRef System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CertManagerPrivateKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CertManagerPrivateKey(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm algorithm, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy rotationPolicy) { } + public Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Algorithm { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy RotationPolicy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.CertManagerPrivateKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudEventAttributeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudEventAttributeType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType CreateOrRemap { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType Propagate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType left, Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType left, Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataExplorerAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataExplorerAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowBuiltInTransformationDataset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationDataset(string key, System.Collections.Generic.IEnumerable inputs) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public string Key { get { throw null; } set { } } + public string SchemaRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationDataset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationDataset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationFilter(System.Collections.Generic.IEnumerable inputs, string expression) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.DataflowFilterType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationMap(System.Collections.Generic.IEnumerable inputs, string output) { } + public string Description { get { throw null; } set { } } + public string Expression { get { throw null; } set { } } + public System.Collections.Generic.IList Inputs { get { throw null; } } + public string Output { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowMappingType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowBuiltInTransformationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowBuiltInTransformationSettings() { } + public System.Collections.Generic.IList Datasets { get { throw null; } } + public System.Collections.Generic.IList Filter { get { throw null; } } + public System.Collections.Generic.IList Map { get { throw null; } } + public string SchemaRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat? SerializationFormat { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowDestinationOperationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowDestinationOperationSettings(string endpointRef, string dataDestination) { } + public string DataDestination { get { throw null; } set { } } + public string EndpointRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointAuthenticationSasl : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointAuthenticationSasl(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType saslType, string secretRef) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType SaslType { get { throw null; } set { } } + public string SecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointAuthenticationSaslType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointAuthenticationSaslType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType Plain { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType ScramSha256 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType ScramSha512 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSaslType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string tenantId) { } + public string ClientId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataExplorer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataExplorer(Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication authentication, string database, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Database { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataExplorerAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataExplorerAuthentication(Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.DataExplorerAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorerAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataLakeStorage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataLakeStorage(Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication authentication, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointDataLakeStorageAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointDataLakeStorageAuthentication(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod method) { } + public string AccessTokenSecretRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorageAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLake : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLake(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication authentication, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames names, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType oneLakePathType, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig Batching { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames Names { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType OneLakePathType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLakeAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLakeAuthentication(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod Method { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointFabricOneLakeNames : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName) { } + public string LakehouseName { get { throw null; } set { } } + public string WorkspaceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLakeNames System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointFabricPathType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointFabricPathType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType Files { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType Tables { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricPathType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointKafka : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafka(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication authentication, string host) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication Authentication { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching Batching { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType? CloudEventAttributes { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression? Compression { get { throw null; } set { } } + public string ConsumerGroupId { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? CopyMqttProperties { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck? KafkaAcks { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy? PartitionStrategy { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaAck : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaAck(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck All { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck One { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck Zero { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAck right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointKafkaAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafkaAuthentication(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Method { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationSasl SaslSettings { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + public string X509CertificateSecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointKafkaBatching : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointKafkaBatching() { } + public int? LatencyMs { get { throw null; } set { } } + public int? MaxBytes { get { throw null; } set { } } + public int? MaxMessages { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaBatching System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaCompression : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaCompression(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Gzip { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Lz4 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression None { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression Snappy { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaCompression right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointKafkaPartitionStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointKafkaPartitionStrategy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Default { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Property { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Static { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy Topic { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafkaPartitionStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowEndpointMqtt : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointMqtt(Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication authentication) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication Authentication { get { throw null; } set { } } + public string ClientIdPrefix { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.CloudEventAttributeType? CloudEventAttributes { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public int? KeepAliveSeconds { get { throw null; } set { } } + public int? MaxInflightMessages { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerProtocolType? Protocol { get { throw null; } set { } } + public int? Qos { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.MqttRetainType? Retain { get { throw null; } set { } } + public int? SessionExpirySeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties Tls { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowEndpointMqttAuthentication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowEndpointMqttAuthentication(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod method) { } + public Azure.ResourceManager.IotOperations.Models.MqttAuthMethod Method { get { throw null; } set { } } + public string ServiceAccountTokenAudience { get { throw null; } set { } } + public string SystemAssignedManagedIdentityAudience { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get { throw null; } set { } } + public string X509CertificateSecretRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqttAuthentication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowEndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowEndpointType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType DataExplorer { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType DataLakeStorage { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType FabricOneLake { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType Kafka { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType LocalStorage { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowEndpointType Mqtt { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowEndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType left, Azure.ResourceManager.IotOperations.Models.DataflowEndpointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowFilterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowFilterType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowFilterType Filter { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowFilterType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowFilterType left, Azure.ResourceManager.IotOperations.Models.DataflowFilterType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowFilterType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowFilterType left, Azure.ResourceManager.IotOperations.Models.DataflowFilterType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowMappingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowMappingType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType BuiltInFunction { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType Compute { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType NewProperties { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType PassThrough { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowMappingType Rename { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowMappingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowMappingType left, Azure.ResourceManager.IotOperations.Models.DataflowMappingType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowMappingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowMappingType left, Azure.ResourceManager.IotOperations.Models.DataflowMappingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowOperationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowOperationProperties(Azure.ResourceManager.IotOperations.Models.DataflowOperationType operationType) { } + public Azure.ResourceManager.IotOperations.Models.DataflowBuiltInTransformationSettings BuiltInTransformationSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowDestinationOperationSettings DestinationSettings { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowOperationType OperationType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings SourceSettings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowOperationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowOperationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowOperationType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType BuiltInTransformation { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType Destination { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataflowOperationType Source { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowOperationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowOperationType left, Azure.ResourceManager.IotOperations.Models.DataflowOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowOperationType left, Azure.ResourceManager.IotOperations.Models.DataflowOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataflowProfileDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowProfileDiagnostics() { } + public string LogsLevel { get { throw null; } set { } } + public int? MetricsPrometheusPort { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataflowSourceOperationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataflowSourceOperationSettings(string endpointRef, System.Collections.Generic.IEnumerable dataSources) { } + public string AssetRef { get { throw null; } set { } } + public System.Collections.Generic.IList DataSources { get { throw null; } } + public string EndpointRef { get { throw null; } set { } } + public string SchemaRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat? SerializationFormat { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DataflowSourceOperationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataflowSourceSerializationFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataflowSourceSerializationFormat(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat Json { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat left, Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat left, Azure.ResourceManager.IotOperations.Models.DataflowSourceSerializationFormat right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataLakeStorageAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataLakeStorageAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod AccessToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod left, Azure.ResourceManager.IotOperations.Models.DataLakeStorageAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiagnosticSelfTracing : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiagnosticSelfTracing() { } + public int? IntervalSeconds { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiagnosticSelfTracing System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiskBackedMessageBuffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskBackedMessageBuffer(string maxSize) { } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec EphemeralVolumeClaimSpec { get { throw null; } set { } } + public string MaxSize { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec PersistentVolumeClaimSpec { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FabricOneLakeAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FabricOneLakeAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsBatchingConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBatchingConfig() { } + public int? LatencySeconds { get { throw null; } set { } } + public int? MaxMessages { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBatchingConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthenticationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthenticationProperties(System.Collections.Generic.IEnumerable authenticationMethods) { } + public System.Collections.Generic.IList AuthenticationMethods { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthenticationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerAuthorizationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerAuthorizationProperties(Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig authorizationPolicies) { } + public Azure.ResourceManager.IotOperations.Models.BrokerAuthorizationConfig AuthorizationPolicies { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerAuthorizationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerListenerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerListenerProperties(System.Collections.Generic.IEnumerable ports) { } + public System.Collections.Generic.IList Ports { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceName { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BlockerListenerServiceType? ServiceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerListenerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsBrokerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsBrokerProperties() { } + public Azure.ResourceManager.IotOperations.Models.BrokerAdvancedSettings Advanced { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerCardinality Cardinality { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerDiagnostics Diagnostics { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DiskBackedMessageBuffer DiskBackedMessageBuffer { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? GenerateResourceLimitsCpu { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerMemoryProfile? MemoryProfile { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsBrokerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowEndpointProperties(Azure.ResourceManager.IotOperations.Models.DataflowEndpointType endpointType) { } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataExplorer DataExplorerSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointDataLakeStorage DataLakeStorageSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointType EndpointType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointFabricOneLake FabricOneLakeSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointKafka KafkaSettings { get { throw null; } set { } } + public string LocalStoragePersistentVolumeClaimRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.DataflowEndpointMqtt MqttSettings { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProfileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProfileProperties() { } + public Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics Diagnostics { get { throw null; } set { } } + public int? InstanceCount { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsDataflowProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsDataflowProperties(System.Collections.Generic.IEnumerable operations) { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IList Operations { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsExtendedLocation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsExtendedLocation(string name, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType type) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsExtendedLocationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsExtendedLocationType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType CustomLocation { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType left, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType left, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsInstancePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstancePatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstancePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IotOperationsInstanceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsInstanceProperties(Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef schemaRegistryRef) { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier SchemaRegistryRefResourceId { get { throw null; } set { } } + public string Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsOperationalMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsOperationalMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode Disabled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode left, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode left, Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IotOperationsProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IotOperationsProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState left, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState left, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IotOperationsTlsProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IotOperationsTlsProperties() { } + public Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? Mode { get { throw null; } set { } } + public string TrustedCaCertificateConfigMapRef { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.IotOperationsTlsProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KafkaAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KafkaAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod Sasl { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod X509Certificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod left, Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod left, Azure.ResourceManager.IotOperations.Models.KafkaAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + public partial class KubernetesReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KubernetesReference(string kind, string name) { } + public string ApiGroup { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Namespace { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.KubernetesReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.KubernetesReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ListenerPortTlsCertMethod : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListenerPortTlsCertMethod(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode mode) { } + public Azure.ResourceManager.IotOperations.Models.CertManagerCertificateSpec CertManagerCertificateSpec { get { throw null; } set { } } + public string ManualSecretRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.ListenerPortTlsCertMethod System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LocalKubernetesReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocalKubernetesReference(string kind, string name) { } + public string ApiGroup { get { throw null; } set { } } + public string Kind { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MqttAuthMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MqttAuthMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod Anonymous { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod ServiceAccountToken { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod SystemAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod UserAssignedManagedIdentity { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttAuthMethod X509Certificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod left, Azure.ResourceManager.IotOperations.Models.MqttAuthMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.MqttAuthMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.MqttAuthMethod left, Azure.ResourceManager.IotOperations.Models.MqttAuthMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MqttRetainType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MqttRetainType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.MqttRetainType Keep { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.MqttRetainType Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.MqttRetainType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.MqttRetainType left, Azure.ResourceManager.IotOperations.Models.MqttRetainType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.MqttRetainType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.MqttRetainType left, Azure.ResourceManager.IotOperations.Models.MqttRetainType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PrincipalConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PrincipalConfig() { } + public System.Collections.Generic.IList> Attributes { get { throw null; } } + public System.Collections.Generic.IList ClientIds { get { throw null; } } + public System.Collections.Generic.IList Usernames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.PrincipalConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.PrincipalConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateKeyAlgorithm : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateKeyAlgorithm(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec256 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec384 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ec521 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Ed25519 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa2048 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa4096 { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm Rsa8192 { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm left, Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm left, Azure.ResourceManager.IotOperations.Models.PrivateKeyAlgorithm right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateKeyRotationPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateKeyRotationPolicy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy Always { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy left, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy left, Azure.ResourceManager.IotOperations.Models.PrivateKeyRotationPolicy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SanForCert : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SanForCert(System.Collections.Generic.IEnumerable dns, System.Collections.Generic.IEnumerable ip) { } + public System.Collections.Generic.IList Dns { get { throw null; } } + public System.Collections.Generic.IList IP { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SanForCert System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SanForCert System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SchemaRegistryRef : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SchemaRegistryRef(Azure.Core.ResourceIdentifier resourceId) { } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StateStoreResourceDefinitionMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StateStoreResourceDefinitionMethod(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Read { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod ReadWrite { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Write { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StateStoreResourceKeyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StateStoreResourceKeyType(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType Binary { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType Pattern { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType String { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType left, Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StateStoreResourceRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StateStoreResourceRule(Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType keyType, System.Collections.Generic.IEnumerable keys, Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod method) { } + public System.Collections.Generic.IList Keys { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.StateStoreResourceKeyType KeyType { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.StateStoreResourceDefinitionMethod Method { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.StateStoreResourceRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.StateStoreResourceRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SubscriberMessageDropStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SubscriberMessageDropStrategy(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy DropOldest { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy None { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy left, Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy left, Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubscriberQueueLimit : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubscriberQueueLimit() { } + public long? Length { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.SubscriberMessageDropStrategy? Strategy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.SubscriberQueueLimit System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TlsCertMethodMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TlsCertMethodMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Automatic { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode left, Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode left, Azure.ResourceManager.IotOperations.Models.TlsCertMethodMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TransformationSerializationFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TransformationSerializationFormat(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Delta { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Json { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat Parquet { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat left, Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat left, Azure.ResourceManager.IotOperations.Models.TransformationSerializationFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VolumeClaimResourceRequirements : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimResourceRequirements() { } + public System.Collections.Generic.IDictionary Limits { get { throw null; } } + public System.Collections.Generic.IDictionary Requests { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpec : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpec() { } + public System.Collections.Generic.IList AccessModes { get { throw null; } } + public Azure.ResourceManager.IotOperations.Models.LocalKubernetesReference DataSource { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.KubernetesReference DataSourceRef { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimResourceRequirements Resources { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector Selector { get { throw null; } set { } } + public string StorageClassName { get { throw null; } set { } } + public string VolumeMode { get { throw null; } set { } } + public string VolumeName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpecSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpecSelector() { } + public System.Collections.Generic.IList MatchExpressions { get { throw null; } } + public System.Collections.Generic.IDictionary MatchLabels { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VolumeClaimSpecSelectorMatchExpressions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VolumeClaimSpecSelectorMatchExpressions(string key, Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue @operator) { } + public string Key { get { throw null; } set { } } + public Azure.ResourceManager.IotOperations.Models.BrokerOperatorValue Operator { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelectorMatchExpressions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.VolumeClaimSpecSelectorMatchExpressions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/assets.json b/sdk/iotoperations/Azure.ResourceManager.IotOperations/assets.json new file mode 100644 index 000000000000..3dba4ca93266 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/iotoperations/Azure.ResourceManager.IotOperations", + "Tag": "net/iotoperations/Azure.ResourceManager.IotOperations_4887017c2b" +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Azure.ResourceManager.IotOperations.Samples.csproj b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Azure.ResourceManager.IotOperations.Samples.csproj new file mode 100644 index 000000000000..e763780a9578 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Azure.ResourceManager.IotOperations.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs new file mode 100644 index 000000000000..9f121cef1865 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerAuthenticationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation + string authenticationName = "resource-name123"; + IotOperationsBrokerAuthenticationData data = new IotOperationsBrokerAuthenticationData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.ServiceAccountToken) +{ +ServiceAccountTokenAudiences = {"aio-internal"}, +}, +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.X509) +{ +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["root"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["organization"] = "contoso" +}, "CN = Contoso Root CA Cert, OU = Engineering, C = US"), +["intermediate"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["city"] = "seattle", +["foo"] = "bar" +}, "CN = Contoso Intermediate CA"), +["smart-fan"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["building"] = "17" +}, "CN = smart-fan") +}, +TrustedClientCaCert = "my-ca", +}, +} + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authenticationName, data); + IotOperationsBrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation + string authenticationName = "resource-name123"; + IotOperationsBrokerAuthenticationData data = new IotOperationsBrokerAuthenticationData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.Custom) +{ +CustomSettings = new BrokerAuthenticatorMethodCustom(new Uri("https://www.example.com")) +{ +X509SecretRef = "secret-name", +CaCertConfigMap = "pdecudefqyolvncbus", +Headers = +{ +["key8518"] = "bwityjy" +}, +}, +ServiceAccountTokenAudiences = {"jqyhyqatuydg"}, +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["key3384"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["key186"] = "ucpajramsz" +}, "jpgwctfeixitptfgfnqhua") +}, +TrustedClientCaCert = "vlctsqddl", +}, +} + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authenticationName, data); + IotOperationsBrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation + string authenticationName = "resource-name123"; + IotOperationsBrokerAuthenticationResource result = await collection.GetAsync(authenticationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerAuthenticationListByResourceGroup() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsBrokerAuthenticationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation + string authenticationName = "resource-name123"; + bool result = await collection.ExistsAsync(authenticationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerAuthenticationResource + IotOperationsBrokerAuthenticationCollection collection = iotOperationsBroker.GetIotOperationsBrokerAuthentications(); + + // invoke the operation + string authenticationName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(authenticationName); + IotOperationsBrokerAuthenticationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs new file mode 100644 index 000000000000..6058e48bf430 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerAuthenticationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerAuthenticationResource created on azure + // for more information of creating IotOperationsBrokerAuthenticationResource, please refer to the document of IotOperationsBrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerAuthenticationResourceId = IotOperationsBrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + IotOperationsBrokerAuthenticationResource iotOperationsBrokerAuthentication = client.GetIotOperationsBrokerAuthenticationResource(iotOperationsBrokerAuthenticationResourceId); + + // invoke the operation + IotOperationsBrokerAuthenticationResource result = await iotOperationsBrokerAuthentication.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerAuthenticationDelete() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerAuthenticationResource created on azure + // for more information of creating IotOperationsBrokerAuthenticationResource, please refer to the document of IotOperationsBrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerAuthenticationResourceId = IotOperationsBrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + IotOperationsBrokerAuthenticationResource iotOperationsBrokerAuthentication = client.GetIotOperationsBrokerAuthenticationResource(iotOperationsBrokerAuthenticationResourceId); + + // invoke the operation + await iotOperationsBrokerAuthentication.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerAuthenticationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerAuthenticationResource created on azure + // for more information of creating IotOperationsBrokerAuthenticationResource, please refer to the document of IotOperationsBrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerAuthenticationResourceId = IotOperationsBrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + IotOperationsBrokerAuthenticationResource iotOperationsBrokerAuthentication = client.GetIotOperationsBrokerAuthenticationResource(iotOperationsBrokerAuthenticationResourceId); + + // invoke the operation + IotOperationsBrokerAuthenticationData data = new IotOperationsBrokerAuthenticationData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.ServiceAccountToken) +{ +ServiceAccountTokenAudiences = {"aio-internal"}, +}, +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.X509) +{ +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["root"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["organization"] = "contoso" +}, "CN = Contoso Root CA Cert, OU = Engineering, C = US"), +["intermediate"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["city"] = "seattle", +["foo"] = "bar" +}, "CN = Contoso Intermediate CA"), +["smart-fan"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["building"] = "17" +}, "CN = smart-fan") +}, +TrustedClientCaCert = "my-ca", +}, +} + }), + }; + ArmOperation lro = await iotOperationsBrokerAuthentication.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerAuthenticationCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerAuthenticationResource created on azure + // for more information of creating IotOperationsBrokerAuthenticationResource, please refer to the document of IotOperationsBrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerAuthenticationResourceId = IotOperationsBrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + IotOperationsBrokerAuthenticationResource iotOperationsBrokerAuthentication = client.GetIotOperationsBrokerAuthenticationResource(iotOperationsBrokerAuthenticationResourceId); + + // invoke the operation + IotOperationsBrokerAuthenticationData data = new IotOperationsBrokerAuthenticationData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.Custom) +{ +CustomSettings = new BrokerAuthenticatorMethodCustom(new Uri("https://www.example.com")) +{ +X509SecretRef = "secret-name", +CaCertConfigMap = "pdecudefqyolvncbus", +Headers = +{ +["key8518"] = "bwityjy" +}, +}, +ServiceAccountTokenAudiences = {"jqyhyqatuydg"}, +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["key3384"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["key186"] = "ucpajramsz" +}, "jpgwctfeixitptfgfnqhua") +}, +TrustedClientCaCert = "vlctsqddl", +}, +} + }), + }; + ArmOperation lro = await iotOperationsBrokerAuthentication.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerAuthenticationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs new file mode 100644 index 000000000000..2162fc3a56a4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Cardinality = new BrokerCardinality(new BrokerBackendChain(2, 2) + { + Workers = 2, + }, new BrokerFrontend(2) + { + Workers = 2, + }), + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("50M"), + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Medium, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Advanced = new BrokerAdvancedSettings + { + Clients = new BrokerClientConfig + { + MaxSessionExpirySeconds = 3859, + MaxMessageExpirySeconds = 3263, + MaxPacketSizeBytes = 3029, + SubscriberQueueLimit = new SubscriberQueueLimit + { + Length = 6L, + Strategy = SubscriberMessageDropStrategy.None, + }, + MaxReceiveMaximum = 2365, + MaxKeepAliveSeconds = 3744, + }, + EncryptInternalTraffic = IotOperationsOperationalMode.Enabled, + InternalCerts = new CertManagerCertConfig("bchrc", "xkafmpgjfifkwwrhkswtopdnne", new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always)), + }, + Cardinality = new BrokerCardinality(new BrokerBackendChain(11, 5) + { + Workers = 15, + }, new BrokerFrontend(2) + { + Workers = 6, + }), + Diagnostics = new BrokerDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + SelfCheck = new BrokerDiagnosticSelfCheck + { + Mode = IotOperationsOperationalMode.Enabled, + IntervalSeconds = 158, + TimeoutSeconds = 14, + }, + Traces = new BrokerDiagnosticTraces + { + Mode = IotOperationsOperationalMode.Enabled, + CacheSizeMegabytes = 28, + SelfTracing = new DiagnosticSelfTracing + { + Mode = IotOperationsOperationalMode.Enabled, + IntervalSeconds = 22, + }, + SpanChannelCapacity = 1000, + }, + }, + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("500M") + { + EphemeralVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", BrokerOperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + PersistentVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", BrokerOperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + }, + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Cardinality = new BrokerCardinality(new BrokerBackendChain(2, 2) + { + Workers = 2, + }, new BrokerFrontend(2) + { + Workers = 2, + }), + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Low, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + IotOperationsBrokerResource result = await collection.GetAsync(brokerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerListByResourceGroup() + { + // Generated from example definition: 2024-11-01/Broker_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsBrokerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + bool result = await collection.ExistsAsync(brokerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsBrokerResource + IotOperationsBrokerCollection collection = iotOperationsInstance.GetIotOperationsBrokers(); + + // invoke the operation + string brokerName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(brokerName); + IotOperationsBrokerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs new file mode 100644 index 000000000000..2b711a83140c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerListenerCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(8080) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +}, +new BrokerListenerPort(8443) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "example-issuer")), +}, +}, +new BrokerListenerPort(1883) +{ +AuthenticationRef = "example-authentication", +}, +new BrokerListenerPort(8883) +{ +AuthenticationRef = "example-authentication", +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Manual) +{ +ManualSecretRef = "example-secret", +}, +} + }) + { + ServiceType = BlockerListenerServiceType.LoadBalancer, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(1268) +{ +AuthenticationRef = "tjvdroaqqy", +AuthorizationRef = "inxhvxnwswyrvt", +NodePort = 7281, +Protocol = BrokerProtocolType.Mqtt, +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "ocwoqpgucvjrsuudtjhb")) +{ +Duration = "qmpeffoksron", +SecretName = "oagi", +RenewBefore = "hutno", +PrivateKey = new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always), +San = new SanForCert(new string[]{"xhvmhrrhgfsapocjeebqtnzarlj"}, new string[]{"zbgugfzcgsmegevzktsnibyuyp"}), +}, +ManualSecretRef = "secret-name", +}, +} + }) + { + ServiceName = "tpfiszlapdpxktx", + ServiceType = BlockerListenerServiceType.ClusterIP, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(1883) + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + IotOperationsBrokerListenerResource result = await collection.GetAsync(listenerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerListenerListByResourceGroup() + { + // Generated from example definition: 2024-11-01/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsBrokerListenerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + bool result = await collection.ExistsAsync(listenerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // get the collection of this IotOperationsBrokerListenerResource + IotOperationsBrokerListenerCollection collection = iotOperationsBroker.GetIotOperationsBrokerListeners(); + + // invoke the operation + string listenerName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(listenerName); + IotOperationsBrokerListenerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs new file mode 100644 index 000000000000..cba233d24ac7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerListenerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerListenerResource created on azure + // for more information of creating IotOperationsBrokerListenerResource, please refer to the document of IotOperationsBrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerListenerResourceId = IotOperationsBrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + IotOperationsBrokerListenerResource iotOperationsBrokerListener = client.GetIotOperationsBrokerListenerResource(iotOperationsBrokerListenerResourceId); + + // invoke the operation + IotOperationsBrokerListenerResource result = await iotOperationsBrokerListener.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerListenerDelete() + { + // Generated from example definition: 2024-11-01/BrokerListener_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerListenerResource created on azure + // for more information of creating IotOperationsBrokerListenerResource, please refer to the document of IotOperationsBrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerListenerResourceId = IotOperationsBrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + IotOperationsBrokerListenerResource iotOperationsBrokerListener = client.GetIotOperationsBrokerListenerResource(iotOperationsBrokerListenerResourceId); + + // invoke the operation + await iotOperationsBrokerListener.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerListenerResource created on azure + // for more information of creating IotOperationsBrokerListenerResource, please refer to the document of IotOperationsBrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerListenerResourceId = IotOperationsBrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + IotOperationsBrokerListenerResource iotOperationsBrokerListener = client.GetIotOperationsBrokerListenerResource(iotOperationsBrokerListenerResourceId); + + // invoke the operation + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(8080) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +}, +new BrokerListenerPort(8443) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "example-issuer")), +}, +}, +new BrokerListenerPort(1883) +{ +AuthenticationRef = "example-authentication", +}, +new BrokerListenerPort(8883) +{ +AuthenticationRef = "example-authentication", +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Manual) +{ +ManualSecretRef = "example-secret", +}, +} + }) + { + ServiceType = BlockerListenerServiceType.LoadBalancer, + }, + }; + ArmOperation lro = await iotOperationsBrokerListener.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerListenerResource created on azure + // for more information of creating IotOperationsBrokerListenerResource, please refer to the document of IotOperationsBrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerListenerResourceId = IotOperationsBrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + IotOperationsBrokerListenerResource iotOperationsBrokerListener = client.GetIotOperationsBrokerListenerResource(iotOperationsBrokerListenerResourceId); + + // invoke the operation + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(1268) +{ +AuthenticationRef = "tjvdroaqqy", +AuthorizationRef = "inxhvxnwswyrvt", +NodePort = 7281, +Protocol = BrokerProtocolType.Mqtt, +Tls = new ListenerPortTlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "ocwoqpgucvjrsuudtjhb")) +{ +Duration = "qmpeffoksron", +SecretName = "oagi", +RenewBefore = "hutno", +PrivateKey = new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always), +San = new SanForCert(new string[]{"xhvmhrrhgfsapocjeebqtnzarlj"}, new string[]{"zbgugfzcgsmegevzktsnibyuyp"}), +}, +ManualSecretRef = "secret-name", +}, +} + }) + { + ServiceName = "tpfiszlapdpxktx", + ServiceType = BlockerListenerServiceType.ClusterIP, + }, + }; + ArmOperation lro = await iotOperationsBrokerListener.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerListenerResource created on azure + // for more information of creating IotOperationsBrokerListenerResource, please refer to the document of IotOperationsBrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerListenerResourceId = IotOperationsBrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + IotOperationsBrokerListenerResource iotOperationsBrokerListener = client.GetIotOperationsBrokerListenerResource(iotOperationsBrokerListenerResourceId); + + // invoke the operation + IotOperationsBrokerListenerData data = new IotOperationsBrokerListenerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerListenerProperties(new BrokerListenerPort[] + { +new BrokerListenerPort(1883) + }), + }; + ArmOperation lro = await iotOperationsBrokerListener.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerListenerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs new file mode 100644 index 000000000000..47157e7c8f23 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsBrokerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + IotOperationsBrokerResource result = await iotOperationsBroker.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerDelete() + { + // Generated from example definition: 2024-11-01/Broker_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + await iotOperationsBroker.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Cardinality = new BrokerCardinality(new BrokerBackendChain(2, 2) + { + Workers = 2, + }, new BrokerFrontend(2) + { + Workers = 2, + }), + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("50M"), + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Medium, + }, + }; + ArmOperation lro = await iotOperationsBroker.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Advanced = new BrokerAdvancedSettings + { + Clients = new BrokerClientConfig + { + MaxSessionExpirySeconds = 3859, + MaxMessageExpirySeconds = 3263, + MaxPacketSizeBytes = 3029, + SubscriberQueueLimit = new SubscriberQueueLimit + { + Length = 6L, + Strategy = SubscriberMessageDropStrategy.None, + }, + MaxReceiveMaximum = 2365, + MaxKeepAliveSeconds = 3744, + }, + EncryptInternalTraffic = IotOperationsOperationalMode.Enabled, + InternalCerts = new CertManagerCertConfig("bchrc", "xkafmpgjfifkwwrhkswtopdnne", new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always)), + }, + Cardinality = new BrokerCardinality(new BrokerBackendChain(11, 5) + { + Workers = 15, + }, new BrokerFrontend(2) + { + Workers = 6, + }), + Diagnostics = new BrokerDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + SelfCheck = new BrokerDiagnosticSelfCheck + { + Mode = IotOperationsOperationalMode.Enabled, + IntervalSeconds = 158, + TimeoutSeconds = 14, + }, + Traces = new BrokerDiagnosticTraces + { + Mode = IotOperationsOperationalMode.Enabled, + CacheSizeMegabytes = 28, + SelfTracing = new DiagnosticSelfTracing + { + Mode = IotOperationsOperationalMode.Enabled, + IntervalSeconds = 22, + }, + SpanChannelCapacity = 1000, + }, + }, + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("500M") + { + EphemeralVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", BrokerOperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + PersistentVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", BrokerOperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + }, + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await iotOperationsBroker.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await iotOperationsBroker.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsBrokerResource created on azure + // for more information of creating IotOperationsBrokerResource, please refer to the document of IotOperationsBrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier iotOperationsBrokerResourceId = IotOperationsBrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + IotOperationsBrokerResource iotOperationsBroker = client.GetIotOperationsBrokerResource(iotOperationsBrokerResourceId); + + // invoke the operation + IotOperationsBrokerData data = new IotOperationsBrokerData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsBrokerProperties + { + Cardinality = new BrokerCardinality(new BrokerBackendChain(2, 2) + { + Workers = 2, + }, new BrokerFrontend(2) + { + Workers = 2, + }), + GenerateResourceLimitsCpu = IotOperationsOperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Low, + }, + }; + ArmOperation lro = await iotOperationsBroker.UpdateAsync(WaitUntil.Completed, data); + IotOperationsBrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsBrokerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs new file mode 100644 index 000000000000..728994d656b3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexContextualization() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "aio-to-adx-contexualized"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Datasets = {new DataflowBuiltInTransformationDataset("quality", new string[]{"$source.country", "$context.country"}) +{ +Expression = "$1 == $2", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"$context(quality).*"}, "enriched.*")}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("adx-endpoint", "mytable"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexEventHub() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "aio-to-event-hub-transformed"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000")}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "AvgTemp.Value") +{ +Expression = "($1+$2)/2", +}, new DataflowBuiltInTransformationMap(Array.Empty(), "dataflow-processed") +{ +Expression = "true", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.SourceTimestamp"}, "") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\""}, "pressure") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.Value"}, "temperatureF.Value") +{ +Expression = "cToF($1)", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\".Value"}, "\"Scale Tag 10\".Value") +{ +Expression = "scale ($1,0,10,0,100)", +}}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-hub-endpoint", "myuniqueeventhub"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateFilterToTopic() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "mqtt-filter-to-topic"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000") +{ +Type = DataflowFilterType.Filter, +Description = "filter-datapoint", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*") +{ +Type = DataflowMappingType.PassThrough, +}}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("aio-builtin-broker-endpoint", "data/filtered/thermostat"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "resource-name123"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "knnafvkwoeakm", +SourceSettings = new DataflowSourceOperationSettings("iixotodhvhkkfcfyrkoveslqig", new string[]{"chkkpymxhp"}) +{ +AssetRef = "zayyykwmckaocywdkohmu", +SerializationFormat = DataflowSourceSerializationFormat.Json, +SchemaRef = "pknmdzqll", +}, +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Delta, +SchemaRef = "mcdc", +Datasets = {new DataflowBuiltInTransformationDataset("qsfqcgxaxnhfumrsdsokwyv", new string[]{"mosffpsslifkq"}) +{ +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +SchemaRef = "n", +Expression = "aatbwomvflemsxialv", +}}, +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"sxmjkbntgb"}, "n") +{ +Type = DataflowFilterType.Filter, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"xsbxuk"}, "nvgtmkfl") +{ +Type = DataflowMappingType.NewProperties, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +Expression = "txoiltogsarwkzalsphvlmt", +}}, +}, +DestinationSettings = new DataflowDestinationOperationSettings("kybkchnzimerguekuvqlqiqdvvrt", "cbrh"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleEventGrid() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "aio-to-event-grid"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"thermostats/+/telemetry/temperature/#"}), +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-grid-endpoint", "factory/telemetry"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleFabric() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "aio-to-fabric"; + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Parquet, +SchemaRef = "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0", +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("fabric-endpoint", "telemetryTable"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "resource-name123"; + IotOperationsDataflowResource result = await collection.GetAsync(dataflowName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowListByProfileResource() + { + // Generated from example definition: 2024-11-01/Dataflow_ListByProfileResource_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsDataflowResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // get the collection of this IotOperationsDataflowResource + IotOperationsDataflowCollection collection = iotOperationsDataflowProfile.GetIotOperationsDataflows(); + + // invoke the operation + string dataflowName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowName); + IotOperationsDataflowResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs new file mode 100644 index 000000000000..fee6e655a60b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs @@ -0,0 +1,756 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowEndpointCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADLSv2() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "adlsv2-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataLakeStorage) + { + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.AccessToken) + { + AccessTokenSecretRef = "my-secret", + }, "example.blob.core.windows.net"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADX() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "adx-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity), "example-database", "example.westeurope.kusto.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateAIO() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "aio-builtin-broker-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(default) + { + ServiceAccountTokenAudience = "aio-internal", + }) + { + Host = "aio-broker:18883", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "aio-ca-trust-bundle-test-only", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventGrid() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "event-grid-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity)) + { + Host = "example.westeurope-1.ts.eventgrid.azure.net:8883", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventHub() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "event-hub-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity), "example.servicebus.windows.net:9093") + { + ConsumerGroupId = "aiodataflows", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateFabric() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "fabric-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.FabricOneLake) + { + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity), new DataflowEndpointFabricOneLakeNames("example-lakehouse", "example-workspace"), DataflowEndpointFabricPathType.Tables, "onelake.dfs.fabric.microsoft.com"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateKafka() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "generic-kafka-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.Sasl) + { + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "my-secret"), + }, "example.kafka.local:9093") + { + ConsumerGroupId = "dataflows", + Batching = new DataflowEndpointKafkaBatching + { + Mode = IotOperationsOperationalMode.Enabled, + LatencyMs = 5, + MaxBytes = 1000000, + MaxMessages = 100000, + }, + CopyMqttProperties = IotOperationsOperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.Gzip, + KafkaAcks = DataflowEndpointKafkaAck.All, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "ca-certificates", + }, + CloudEventAttributes = CloudEventAttributeType.Propagate, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateLocalStorage() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "local-storage-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.LocalStorage) + { + LocalStoragePersistentVolumeClaimRef = "example-pvc", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateMQTT() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "generic-mqtt-broker-endpoint"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.X509Certificate) + { + X509CertificateSecretRef = "example-secret", + }) + { + ClientIdPrefix = "factory-gateway", + Host = "example.broker.local:1883", + Protocol = BrokerProtocolType.WebSockets, + KeepAliveSeconds = 60, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 100, + Qos = 1, + SessionExpirySeconds = 3600, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Disabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, "yqcdpjsifm", "..kusto.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.SystemAssignedManagedIdentity) + { + AccessTokenSecretRef = "sevriyphcvnlrnfudqzejecwa", + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, ".blob.core.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, new DataflowEndpointFabricOneLakeNames("wpeathi", "nwgmitkbljztgms"), DataflowEndpointFabricPathType.Files, "https://.fabric.microsoft.com") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "visyxoztqnylvbyokhtmpdkwes"), + X509CertificateSecretRef = "afwizrystfslkfqd", + }, "pwcqfiqclcgneolpewnyavoulbip") + { + ConsumerGroupId = "ukkzcjiyenhxokat", + Batching = new DataflowEndpointKafkaBatching + { + Mode = IotOperationsOperationalMode.Enabled, + LatencyMs = 3679, + MaxBytes = 8887, + MaxMessages = 2174, + }, + CopyMqttProperties = IotOperationsOperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.None, + KafkaAcks = DataflowEndpointKafkaAck.Zero, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + LocalStoragePersistentVolumeClaimRef = "jjwqwvd", + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + ServiceAccountTokenAudience = "ejbklrbxgjaqleoycgpje", + X509CertificateSecretRef = "afwizrystfslkfqd", + }) + { + ClientIdPrefix = "kkljsdxdirfhwxtkavldekeqhv", + Host = "nyhnxqnbspstctl", + Protocol = BrokerProtocolType.Mqtt, + KeepAliveSeconds = 0, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 0, + Qos = 1, + SessionExpirySeconds = 0, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + IotOperationsDataflowEndpointResource result = await collection.GetAsync(dataflowEndpointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowEndpointListByResourceGroup() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsDataflowEndpointResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowEndpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowEndpointResource + IotOperationsDataflowEndpointCollection collection = iotOperationsInstance.GetIotOperationsDataflowEndpoints(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowEndpointName); + IotOperationsDataflowEndpointResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs new file mode 100644 index 000000000000..28a4166b63eb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowEndpointResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointResource result = await iotOperationsDataflowEndpoint.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowEndpointDelete() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + await iotOperationsDataflowEndpoint.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateADLSv2() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "adlsv2-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataLakeStorage) + { + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.AccessToken) + { + AccessTokenSecretRef = "my-secret", + }, "example.blob.core.windows.net"), + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateADX() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "adx-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity), "example-database", "example.westeurope.kusto.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateAIO() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "aio-builtin-broker-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(default) + { + ServiceAccountTokenAudience = "aio-internal", + }) + { + Host = "aio-broker:18883", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "aio-ca-trust-bundle-test-only", + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateEventGrid() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "event-grid-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity)) + { + Host = "example.westeurope-1.ts.eventgrid.azure.net:8883", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateEventHub() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "event-hub-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity), "example.servicebus.windows.net:9093") + { + ConsumerGroupId = "aiodataflows", + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateFabric() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "fabric-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.FabricOneLake) + { + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity), new DataflowEndpointFabricOneLakeNames("example-lakehouse", "example-workspace"), DataflowEndpointFabricPathType.Tables, "onelake.dfs.fabric.microsoft.com"), + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateKafka() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "generic-kafka-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.Sasl) + { + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "my-secret"), + }, "example.kafka.local:9093") + { + ConsumerGroupId = "dataflows", + Batching = new DataflowEndpointKafkaBatching + { + Mode = IotOperationsOperationalMode.Enabled, + LatencyMs = 5, + MaxBytes = 1000000, + MaxMessages = 100000, + }, + CopyMqttProperties = IotOperationsOperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.Gzip, + KafkaAcks = DataflowEndpointKafkaAck.All, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "ca-certificates", + }, + CloudEventAttributes = CloudEventAttributeType.Propagate, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateLocalStorage() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "local-storage-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.LocalStorage) + { + LocalStoragePersistentVolumeClaimRef = "example-pvc", + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateMQTT() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "generic-mqtt-broker-endpoint"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.X509Certificate) + { + X509CertificateSecretRef = "example-secret", + }) + { + ClientIdPrefix = "factory-gateway", + Host = "example.broker.local:1883", + Protocol = BrokerProtocolType.WebSockets, + KeepAliveSeconds = 60, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 100, + Qos = 1, + SessionExpirySeconds = 3600, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Disabled, + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowEndpointResource created on azure + // for more information of creating IotOperationsDataflowEndpointResource, please refer to the document of IotOperationsDataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowEndpointResourceId = IotOperationsDataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + IotOperationsDataflowEndpointResource iotOperationsDataflowEndpoint = client.GetIotOperationsDataflowEndpointResource(iotOperationsDataflowEndpointResourceId); + + // invoke the operation + IotOperationsDataflowEndpointData data = new IotOperationsDataflowEndpointData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowEndpointProperties(DataflowEndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, "yqcdpjsifm", "..kusto.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.SystemAssignedManagedIdentity) + { + AccessTokenSecretRef = "sevriyphcvnlrnfudqzejecwa", + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, ".blob.core.windows.net") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, new DataflowEndpointFabricOneLakeNames("wpeathi", "nwgmitkbljztgms"), DataflowEndpointFabricPathType.Files, "https://.fabric.microsoft.com") + { + Batching = new IotOperationsBatchingConfig + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "visyxoztqnylvbyokhtmpdkwes"), + X509CertificateSecretRef = "afwizrystfslkfqd", + }, "pwcqfiqclcgneolpewnyavoulbip") + { + ConsumerGroupId = "ukkzcjiyenhxokat", + Batching = new DataflowEndpointKafkaBatching + { + Mode = IotOperationsOperationalMode.Enabled, + LatencyMs = 3679, + MaxBytes = 8887, + MaxMessages = 2174, + }, + CopyMqttProperties = IotOperationsOperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.None, + KafkaAcks = DataflowEndpointKafkaAck.Zero, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + LocalStoragePersistentVolumeClaimRef = "jjwqwvd", + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + ServiceAccountTokenAudience = "ejbklrbxgjaqleoycgpje", + X509CertificateSecretRef = "afwizrystfslkfqd", + }) + { + ClientIdPrefix = "kkljsdxdirfhwxtkavldekeqhv", + Host = "nyhnxqnbspstctl", + Protocol = BrokerProtocolType.Mqtt, + KeepAliveSeconds = 0, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 0, + Qos = 1, + SessionExpirySeconds = 0, + Tls = new IotOperationsTlsProperties + { + Mode = IotOperationsOperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + }, + }; + ArmOperation lro = await iotOperationsDataflowEndpoint.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs new file mode 100644 index 000000000000..ab1001d1c18b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowProfileCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + Diagnostics = new DataflowProfileDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + }, + InstanceCount = 14, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "aio-dataflowprofile"; + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + InstanceCount = 1, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMulti() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "aio-dataflowprofile"; + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + InstanceCount = 3, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + IotOperationsDataflowProfileResource result = await collection.GetAsync(dataflowProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowProfileListByResourceGroup() + { + // Generated from example definition: 2024-11-01/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsDataflowProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // get the collection of this IotOperationsDataflowProfileResource + IotOperationsDataflowProfileCollection collection = iotOperationsInstance.GetIotOperationsDataflowProfiles(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowProfileName); + IotOperationsDataflowProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs new file mode 100644 index 000000000000..7f685cfb02cd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowProfileResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // invoke the operation + IotOperationsDataflowProfileResource result = await iotOperationsDataflowProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowProfileDelete() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // invoke the operation + await iotOperationsDataflowProfile.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // invoke the operation + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + Diagnostics = new DataflowProfileDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + }, + InstanceCount = 14, + }, + }; + ArmOperation lro = await iotOperationsDataflowProfile.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "aio-dataflowprofile"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // invoke the operation + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + InstanceCount = 1, + }, + }; + ArmOperation lro = await iotOperationsDataflowProfile.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdateMulti() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowProfileResource created on azure + // for more information of creating IotOperationsDataflowProfileResource, please refer to the document of IotOperationsDataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "aio-dataflowprofile"; + ResourceIdentifier iotOperationsDataflowProfileResourceId = IotOperationsDataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + IotOperationsDataflowProfileResource iotOperationsDataflowProfile = client.GetIotOperationsDataflowProfileResource(iotOperationsDataflowProfileResourceId); + + // invoke the operation + IotOperationsDataflowProfileData data = new IotOperationsDataflowProfileData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProfileProperties + { + InstanceCount = 3, + }, + }; + ArmOperation lro = await iotOperationsDataflowProfile.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs new file mode 100644 index 000000000000..399b936a023e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsDataflowResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowResource result = await iotOperationsDataflow.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowDelete() + { + // Generated from example definition: 2024-11-01/Dataflow_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + await iotOperationsDataflow.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateComplexContextualization() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-adx-contexualized"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Datasets = {new DataflowBuiltInTransformationDataset("quality", new string[]{"$source.country", "$context.country"}) +{ +Expression = "$1 == $2", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"$context(quality).*"}, "enriched.*")}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("adx-endpoint", "mytable"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateComplexEventHub() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-event-hub-transformed"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000")}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "AvgTemp.Value") +{ +Expression = "($1+$2)/2", +}, new DataflowBuiltInTransformationMap(Array.Empty(), "dataflow-processed") +{ +Expression = "true", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.SourceTimestamp"}, "") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\""}, "pressure") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.Value"}, "temperatureF.Value") +{ +Expression = "cToF($1)", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\".Value"}, "\"Scale Tag 10\".Value") +{ +Expression = "scale ($1,0,10,0,100)", +}}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-hub-endpoint", "myuniqueeventhub"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateFilterToTopic() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "mqtt-filter-to-topic"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000") +{ +Type = DataflowFilterType.Filter, +Description = "filter-datapoint", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*") +{ +Type = DataflowMappingType.PassThrough, +}}, +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("aio-builtin-broker-endpoint", "data/filtered/thermostat"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "knnafvkwoeakm", +SourceSettings = new DataflowSourceOperationSettings("iixotodhvhkkfcfyrkoveslqig", new string[]{"chkkpymxhp"}) +{ +AssetRef = "zayyykwmckaocywdkohmu", +SerializationFormat = DataflowSourceSerializationFormat.Json, +SchemaRef = "pknmdzqll", +}, +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Delta, +SchemaRef = "mcdc", +Datasets = {new DataflowBuiltInTransformationDataset("qsfqcgxaxnhfumrsdsokwyv", new string[]{"mosffpsslifkq"}) +{ +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +SchemaRef = "n", +Expression = "aatbwomvflemsxialv", +}}, +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"sxmjkbntgb"}, "n") +{ +Type = DataflowFilterType.Filter, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"xsbxuk"}, "nvgtmkfl") +{ +Type = DataflowMappingType.NewProperties, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +Expression = "txoiltogsarwkzalsphvlmt", +}}, +}, +DestinationSettings = new DataflowDestinationOperationSettings("kybkchnzimerguekuvqlqiqdvvrt", "cbrh"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateSimpleEventGrid() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-event-grid"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"thermostats/+/telemetry/temperature/#"}), +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-grid-endpoint", "factory/telemetry"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateSimpleFabric() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsDataflowResource created on azure + // for more information of creating IotOperationsDataflowResource, please refer to the document of IotOperationsDataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-fabric"; + ResourceIdentifier iotOperationsDataflowResourceId = IotOperationsDataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + IotOperationsDataflowResource iotOperationsDataflow = client.GetIotOperationsDataflowResource(iotOperationsDataflowResourceId); + + // invoke the operation + IotOperationsDataflowData data = new IotOperationsDataflowData(new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsDataflowProperties(new DataflowOperationProperties[] + { +new DataflowOperationProperties(DataflowOperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowOperationProperties(DataflowOperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Parquet, +SchemaRef = "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0", +}, +}, +new DataflowOperationProperties(DataflowOperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("fabric-endpoint", "telemetryTable"), +} + }) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + ArmOperation lro = await iotOperationsDataflow.UpdateAsync(WaitUntil.Completed, data); + IotOperationsDataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsDataflowData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs new file mode 100644 index 000000000000..8ccae2220ee2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_InstanceCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Instance_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IotOperationsInstanceResource + IotOperationsInstanceCollection collection = resourceGroupResource.GetIotOperationsInstances(); + + // invoke the operation + string instanceName = "aio-instance"; + IotOperationsInstanceData data = new IotOperationsInstanceData(new AzureLocation("xvewadyhycrjpu"), new IotOperationsExtendedLocation("qmbrfwcpwwhggszhrdjv", IotOperationsExtendedLocationType.CustomLocation)) + { + Properties = new IotOperationsInstanceProperties(new SchemaRegistryRef(new ResourceIdentifier("/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123"))) + { + Description = "kpqtgocs", + }, + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = { }, + }, + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, instanceName, data); + IotOperationsInstanceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IotOperationsInstanceResource + IotOperationsInstanceCollection collection = resourceGroupResource.GetIotOperationsInstances(); + + // invoke the operation + string instanceName = "aio-instance"; + IotOperationsInstanceResource result = await collection.GetAsync(instanceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_InstanceListByResourceGroup() + { + // Generated from example definition: 2024-11-01/Instance_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IotOperationsInstanceResource + IotOperationsInstanceCollection collection = resourceGroupResource.GetIotOperationsInstances(); + + // invoke the operation and iterate over the result + await foreach (IotOperationsInstanceResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IotOperationsInstanceResource + IotOperationsInstanceCollection collection = resourceGroupResource.GetIotOperationsInstances(); + + // invoke the operation + string instanceName = "aio-instance"; + bool result = await collection.ExistsAsync(instanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IotOperationsInstanceResource + IotOperationsInstanceCollection collection = resourceGroupResource.GetIotOperationsInstances(); + + // invoke the operation + string instanceName = "aio-instance"; + NullableResponse response = await collection.GetIfExistsAsync(instanceName); + IotOperationsInstanceResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs new file mode 100644 index 000000000000..00889943d261 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_IotOperationsInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // invoke the operation + IotOperationsInstanceResource result = await iotOperationsInstance.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_InstanceDelete() + { + // Generated from example definition: 2024-11-01/Instance_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // invoke the operation + await iotOperationsInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_InstanceUpdate() + { + // Generated from example definition: 2024-11-01/Instance_Update_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IotOperationsInstanceResource created on azure + // for more information of creating IotOperationsInstanceResource, please refer to the document of IotOperationsInstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier iotOperationsInstanceResourceId = IotOperationsInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + IotOperationsInstanceResource iotOperationsInstance = client.GetIotOperationsInstanceResource(iotOperationsInstanceResourceId); + + // invoke the operation + IotOperationsInstancePatch patch = new IotOperationsInstancePatch + { + Tags = { }, + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = { }, + }, + }; + IotOperationsInstanceResource result = await iotOperationsInstance.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..07082aafb691 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIotOperationsInstances_InstanceListBySubscription() + { + // Generated from example definition: 2024-11-01/Instance_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (IotOperationsInstanceResource item in subscriptionResource.GetIotOperationsInstancesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IotOperationsInstanceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Azure.ResourceManager.IotOperations.csproj b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Azure.ResourceManager.IotOperations.csproj new file mode 100644 index 000000000000..dc6cc6a311f8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Azure.ResourceManager.IotOperations.csproj @@ -0,0 +1,12 @@ + + + This is the Azure.ResourceManager.IotOperations client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.ResourceManager.IotOperations for Azure Data Plane + 1.1.0-beta.1 + + 1.0.0 + Azure.ResourceManager.IotOperations + $(RequiredTargetFrameworks) + true + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Customization/Models/BrokerAuthenticatorCustomAuth.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Customization/Models/BrokerAuthenticatorCustomAuth.cs new file mode 100644 index 000000000000..5991e786dd3d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Customization/Models/BrokerAuthenticatorCustomAuth.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Custom Authentication properties. + internal partial class BrokerAuthenticatorCustomAuth + { + /// Initializes a new instance of . + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + /// is null. + public BrokerAuthenticatorCustomAuth(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + X509 = new X509ManualCertificate(secretRef); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs new file mode 100644 index 000000000000..16ac4f7e2324 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Model factory for models. + public static partial class ArmIotOperationsModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsDataflowEndpointData IotOperationsDataflowEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsDataflowEndpointProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsDataflowEndpointData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Endpoint Type. + /// Azure Data Explorer endpoint. + /// Azure Data Lake endpoint. + /// Microsoft Fabric endpoint. + /// Kafka endpoint. + /// Local persistent volume endpoint. + /// Broker endpoint. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsDataflowEndpointProperties IotOperationsDataflowEndpointProperties(DataflowEndpointType endpointType = default, DataflowEndpointDataExplorer dataExplorerSettings = null, DataflowEndpointDataLakeStorage dataLakeStorageSettings = null, DataflowEndpointFabricOneLake fabricOneLakeSettings = null, DataflowEndpointKafka kafkaSettings = null, string localStoragePersistentVolumeClaimRef = null, DataflowEndpointMqtt mqttSettings = null, IotOperationsProvisioningState? provisioningState = null) + { + return new IotOperationsDataflowEndpointProperties( + endpointType, + dataExplorerSettings, + dataLakeStorageSettings, + fabricOneLakeSettings, + kafkaSettings, + localStoragePersistentVolumeClaimRef != null ? new DataflowEndpointLocalStorage(localStoragePersistentVolumeClaimRef, serializedAdditionalRawData: null) : null, + mqttSettings, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsDataflowData IotOperationsDataflowData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsDataflowProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsDataflowData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mode for Dataflow. Optional; defaults to Enabled. + /// List of operations including source and destination references as well as transformation. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsDataflowProperties IotOperationsDataflowProperties(IotOperationsOperationalMode? mode = null, IEnumerable operations = null, IotOperationsProvisioningState? provisioningState = null) + { + operations ??= new List(); + + return new IotOperationsDataflowProperties(mode, operations?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsDataflowProfileData IotOperationsDataflowProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsDataflowProfileProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsDataflowProfileData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Spec defines the desired identities of NBC diagnostics settings. + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsDataflowProfileProperties IotOperationsDataflowProfileProperties(DataflowProfileDiagnostics diagnostics = null, int? instanceCount = null, IotOperationsProvisioningState? provisioningState = null) + { + return new IotOperationsDataflowProfileProperties(diagnostics, instanceCount, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsBrokerAuthorizationData IotOperationsBrokerAuthorizationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsBrokerAuthorizationProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsBrokerAuthorizationData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsBrokerAuthorizationProperties IotOperationsBrokerAuthorizationProperties(BrokerAuthorizationConfig authorizationPolicies = null, IotOperationsProvisioningState? provisioningState = null) + { + return new IotOperationsBrokerAuthorizationProperties(authorizationPolicies, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsBrokerAuthenticationData IotOperationsBrokerAuthenticationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsBrokerAuthenticationProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsBrokerAuthenticationData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsBrokerAuthenticationProperties IotOperationsBrokerAuthenticationProperties(IEnumerable authenticationMethods = null, IotOperationsProvisioningState? provisioningState = null) + { + authenticationMethods ??= new List(); + + return new IotOperationsBrokerAuthenticationProperties(authenticationMethods?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsBrokerListenerData IotOperationsBrokerListenerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsBrokerListenerProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsBrokerListenerData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Kubernetes Service name of this listener. + /// Ports on which this listener accepts client connections. + /// Kubernetes Service type of this listener. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsBrokerListenerProperties IotOperationsBrokerListenerProperties(string serviceName = null, IEnumerable ports = null, BlockerListenerServiceType? serviceType = null, IotOperationsProvisioningState? provisioningState = null) + { + ports ??= new List(); + + return new IotOperationsBrokerListenerProperties(serviceName, ports?.ToList(), serviceType, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static IotOperationsBrokerData IotOperationsBrokerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IotOperationsBrokerProperties properties = null, IotOperationsExtendedLocation extendedLocation = null) + { + return new IotOperationsBrokerData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Advanced settings of Broker. + /// The cardinality details of the broker. + /// Spec defines the desired identities of Broker diagnostics settings. + /// Settings of Disk Backed Message Buffer. + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + /// Memory profile of Broker. + /// The status of the last operation. + /// A new instance for mocking. + public static IotOperationsBrokerProperties IotOperationsBrokerProperties(BrokerAdvancedSettings advanced = null, BrokerCardinality cardinality = null, BrokerDiagnostics diagnostics = null, DiskBackedMessageBuffer diskBackedMessageBuffer = null, IotOperationsOperationalMode? generateResourceLimitsCpu = null, BrokerMemoryProfile? memoryProfile = null, IotOperationsProvisioningState? provisioningState = null) + { + return new IotOperationsBrokerProperties( + advanced, + cardinality, + diagnostics, + diskBackedMessageBuffer, + generateResourceLimitsCpu != null ? new GenerateResourceLimits(generateResourceLimitsCpu, serializedAdditionalRawData: null) : null, + memoryProfile, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static IotOperationsInstanceData IotOperationsInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IotOperationsInstanceProperties properties = null, IotOperationsExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new IotOperationsInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Detailed description of the Instance. + /// The status of the last operation. + /// The Azure IoT Operations version. + /// The reference to the Schema Registry for this AIO Instance. + /// A new instance for mocking. + public static IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, IotOperationsProvisioningState? provisioningState = null, string version = null, ResourceIdentifier schemaRegistryRefResourceId = null) + { + return new IotOperationsInstanceProperties(description, provisioningState, version, schemaRegistryRefResourceId != null ? new SchemaRegistryRef(schemaRegistryRefResourceId, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs new file mode 100644 index 000000000000..76652d258092 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IotOperations +{ + /// A class to add extension methods to Azure.ResourceManager.IotOperations. + public static partial class IotOperationsExtensions + { + private static MockableIotOperationsArmClient GetMockableIotOperationsArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableIotOperationsArmClient(client0)); + } + + private static MockableIotOperationsResourceGroupResource GetMockableIotOperationsResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableIotOperationsResourceGroupResource(client, resource.Id)); + } + + private static MockableIotOperationsSubscriptionResource GetMockableIotOperationsSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableIotOperationsSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsInstanceResource GetIotOperationsInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsInstanceResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsBrokerResource GetIotOperationsBrokerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsBrokerResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsBrokerListenerResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsBrokerAuthenticationResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsBrokerAuthorizationResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsDataflowProfileResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsDataflowResource GetIotOperationsDataflowResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsDataflowResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIotOperationsArmClient(client).GetIotOperationsDataflowEndpointResource(id); + } + + /// + /// Gets a collection of IotOperationsInstanceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of IotOperationsInstanceResources and their operations over a IotOperationsInstanceResource. + public static IotOperationsInstanceCollection GetIotOperationsInstances(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableIotOperationsResourceGroupResource(resourceGroupResource).GetIotOperationsInstances(); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetIotOperationsInstanceAsync(this ResourceGroupResource resourceGroupResource, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableIotOperationsResourceGroupResource(resourceGroupResource).GetIotOperationsInstanceAsync(instanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetIotOperationsInstance(this ResourceGroupResource resourceGroupResource, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableIotOperationsResourceGroupResource(resourceGroupResource).GetIotOperationsInstance(instanceName, cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetIotOperationsInstancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableIotOperationsSubscriptionResource(subscriptionResource).GetIotOperationsInstancesAsync(cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetIotOperationsInstances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableIotOperationsSubscriptionResource(subscriptionResource).GetIotOperationsInstances(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsArmClient.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsArmClient.cs new file mode 100644 index 000000000000..2c16a64d1b88 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsArmClient.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableIotOperationsArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableIotOperationsArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIotOperationsArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableIotOperationsArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsInstanceResource GetIotOperationsInstanceResource(ResourceIdentifier id) + { + IotOperationsInstanceResource.ValidateResourceId(id); + return new IotOperationsInstanceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsBrokerResource GetIotOperationsBrokerResource(ResourceIdentifier id) + { + IotOperationsBrokerResource.ValidateResourceId(id); + return new IotOperationsBrokerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsBrokerListenerResource GetIotOperationsBrokerListenerResource(ResourceIdentifier id) + { + IotOperationsBrokerListenerResource.ValidateResourceId(id); + return new IotOperationsBrokerListenerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsBrokerAuthenticationResource GetIotOperationsBrokerAuthenticationResource(ResourceIdentifier id) + { + IotOperationsBrokerAuthenticationResource.ValidateResourceId(id); + return new IotOperationsBrokerAuthenticationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsBrokerAuthorizationResource GetIotOperationsBrokerAuthorizationResource(ResourceIdentifier id) + { + IotOperationsBrokerAuthorizationResource.ValidateResourceId(id); + return new IotOperationsBrokerAuthorizationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsDataflowProfileResource GetIotOperationsDataflowProfileResource(ResourceIdentifier id) + { + IotOperationsDataflowProfileResource.ValidateResourceId(id); + return new IotOperationsDataflowProfileResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsDataflowResource GetIotOperationsDataflowResource(ResourceIdentifier id) + { + IotOperationsDataflowResource.ValidateResourceId(id); + return new IotOperationsDataflowResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotOperationsDataflowEndpointResource GetIotOperationsDataflowEndpointResource(ResourceIdentifier id) + { + IotOperationsDataflowEndpointResource.ValidateResourceId(id); + return new IotOperationsDataflowEndpointResource(Client, id); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs new file mode 100644 index 000000000000..c61784d10f4a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableIotOperationsResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableIotOperationsResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIotOperationsResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of IotOperationsInstanceResources in the ResourceGroupResource. + /// An object representing collection of IotOperationsInstanceResources and their operations over a IotOperationsInstanceResource. + public virtual IotOperationsInstanceCollection GetIotOperationsInstances() + { + return GetCachedClient(client => new IotOperationsInstanceCollection(client, Id)); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsInstanceAsync(string instanceName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsInstances().GetAsync(instanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsInstance(string instanceName, CancellationToken cancellationToken = default) + { + return GetIotOperationsInstances().Get(instanceName, cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs new file mode 100644 index 000000000000..af819a8e6e37 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableIotOperationsSubscriptionResource : ArmResource + { + private ClientDiagnostics _iotOperationsInstanceInstanceClientDiagnostics; + private InstanceRestOperations _iotOperationsInstanceInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableIotOperationsSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIotOperationsSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics IotOperationsInstanceInstanceClientDiagnostics => _iotOperationsInstanceInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsInstanceResource.ResourceType.Namespace, Diagnostics); + private InstanceRestOperations IotOperationsInstanceInstanceRestClient => _iotOperationsInstanceInstanceRestClient ??= new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(IotOperationsInstanceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetIotOperationsInstancesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => IotOperationsInstanceInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotOperationsInstanceInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsInstanceResource(Client, IotOperationsInstanceData.DeserializeIotOperationsInstanceData(e)), IotOperationsInstanceInstanceClientDiagnostics, Pipeline, "MockableIotOperationsSubscriptionResource.GetIotOperationsInstances", "value", "nextLink", cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetIotOperationsInstances(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => IotOperationsInstanceInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotOperationsInstanceInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsInstanceResource(Client, IotOperationsInstanceData.DeserializeIotOperationsInstanceData(e)), IotOperationsInstanceInstanceClientDiagnostics, Pipeline, "MockableIotOperationsSubscriptionResource.GetIotOperationsInstances", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Argument.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..910e7c7cf2cf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..d0904eba20d1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingList.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e869474a76c6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..37eae5bc0372 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Optional.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..7622a33bd66a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..a9df9dbd846c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs new file mode 100644 index 000000000000..2a905732e2dd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsBrokerAuthentications method from an instance of . + /// + public partial class IotOperationsBrokerAuthenticationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics; + private readonly BrokerAuthenticationRestOperations _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerAuthenticationCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsBrokerAuthenticationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsBrokerAuthenticationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsBrokerAuthenticationResource.ResourceType, out string iotOperationsBrokerAuthenticationBrokerAuthenticationApiVersion); + _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerAuthenticationBrokerAuthenticationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsBrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsBrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string authenticationName, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthenticationOperationSource(Client), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string authenticationName, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthenticationOperationSource(Client), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerAuthenticationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerAuthenticationResource(Client, IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(e)), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, "IotOperationsBrokerAuthenticationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerAuthenticationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerAuthenticationResource(Client, IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(e)), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, "IotOperationsBrokerAuthenticationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.Serialization.cs new file mode 100644 index 000000000000..8a1754aefa74 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthenticationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsBrokerAuthenticationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerAuthenticationData(document.RootElement, options); + } + + internal static IotOperationsBrokerAuthenticationData DeserializeIotOperationsBrokerAuthenticationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsBrokerAuthenticationProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsBrokerAuthenticationProperties.DeserializeIotOperationsBrokerAuthenticationProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerAuthenticationData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerAuthenticationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerAuthenticationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.cs new file mode 100644 index 000000000000..5a03c6da9162 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsBrokerAuthentication data model. + /// Instance broker authentication resource + /// + public partial class IotOperationsBrokerAuthenticationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsBrokerAuthenticationData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerAuthenticationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsBrokerAuthenticationProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerAuthenticationData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsBrokerAuthenticationProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.Serialization.cs new file mode 100644 index 000000000000..79a4be181b38 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthenticationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsBrokerAuthenticationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsBrokerAuthenticationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs new file mode 100644 index 000000000000..2cb2a50a0086 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsBrokerAuthentication along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsBrokerAuthenticationResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsBrokerAuthentication method. + /// + public partial class IotOperationsBrokerAuthenticationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The authenticationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics; + private readonly BrokerAuthenticationRestOperations _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient; + private readonly IotOperationsBrokerAuthenticationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authentications"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerAuthenticationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsBrokerAuthenticationResource(ArmClient client, IotOperationsBrokerAuthenticationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsBrokerAuthenticationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsBrokerAuthenticationBrokerAuthenticationApiVersion); + _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerAuthenticationBrokerAuthenticationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsBrokerAuthenticationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthenticationOperationSource(Client), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics.CreateScope("IotOperationsBrokerAuthenticationResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthenticationOperationSource(Client), _iotOperationsBrokerAuthenticationBrokerAuthenticationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthenticationBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs new file mode 100644 index 000000000000..93e0d25c6b5f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsBrokerAuthorizations method from an instance of . + /// + public partial class IotOperationsBrokerAuthorizationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics; + private readonly BrokerAuthorizationRestOperations _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerAuthorizationCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsBrokerAuthorizationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsBrokerAuthorizationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsBrokerAuthorizationResource.ResourceType, out string iotOperationsBrokerAuthorizationBrokerAuthorizationApiVersion); + _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerAuthorizationBrokerAuthorizationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsBrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsBrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string authorizationName, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthorizationOperationSource(Client), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string authorizationName, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthorizationOperationSource(Client), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerAuthorizationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerAuthorizationResource(Client, IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(e)), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, "IotOperationsBrokerAuthorizationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerAuthorizationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerAuthorizationResource(Client, IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(e)), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, "IotOperationsBrokerAuthorizationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.Serialization.cs new file mode 100644 index 000000000000..4a57b7baa2ac --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthorizationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsBrokerAuthorizationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerAuthorizationData(document.RootElement, options); + } + + internal static IotOperationsBrokerAuthorizationData DeserializeIotOperationsBrokerAuthorizationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsBrokerAuthorizationProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsBrokerAuthorizationProperties.DeserializeIotOperationsBrokerAuthorizationProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerAuthorizationData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerAuthorizationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerAuthorizationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.cs new file mode 100644 index 000000000000..fdd9187c31d9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsBrokerAuthorization data model. + /// Instance broker authorizations resource + /// + public partial class IotOperationsBrokerAuthorizationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsBrokerAuthorizationData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerAuthorizationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsBrokerAuthorizationProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerAuthorizationData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsBrokerAuthorizationProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.Serialization.cs new file mode 100644 index 000000000000..0190e21e4771 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerAuthorizationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsBrokerAuthorizationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsBrokerAuthorizationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs new file mode 100644 index 000000000000..54adbeb12365 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsBrokerAuthorization along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsBrokerAuthorizationResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsBrokerAuthorization method. + /// + public partial class IotOperationsBrokerAuthorizationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The authorizationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics; + private readonly BrokerAuthorizationRestOperations _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient; + private readonly IotOperationsBrokerAuthorizationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authorizations"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerAuthorizationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsBrokerAuthorizationResource(ArmClient client, IotOperationsBrokerAuthorizationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsBrokerAuthorizationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsBrokerAuthorizationBrokerAuthorizationApiVersion); + _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerAuthorizationBrokerAuthorizationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsBrokerAuthorizationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthorizationOperationSource(Client), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics.CreateScope("IotOperationsBrokerAuthorizationResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerAuthorizationOperationSource(Client), _iotOperationsBrokerAuthorizationBrokerAuthorizationClientDiagnostics, Pipeline, _iotOperationsBrokerAuthorizationBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs new file mode 100644 index 000000000000..5331bfff92f5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsBrokers method from an instance of . + /// + public partial class IotOperationsBrokerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsBrokerBrokerClientDiagnostics; + private readonly BrokerRestOperations _iotOperationsBrokerBrokerRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsBrokerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsBrokerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsBrokerResource.ResourceType, out string iotOperationsBrokerBrokerApiVersion); + _iotOperationsBrokerBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerBrokerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string brokerName, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerOperationSource(Client), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string brokerName, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerOperationSource(Client), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers + /// + /// + /// Operation Id + /// BrokerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerResource(Client, IotOperationsBrokerData.DeserializeIotOperationsBrokerData(e)), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, "IotOperationsBrokerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers + /// + /// + /// Operation Id + /// BrokerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerResource(Client, IotOperationsBrokerData.DeserializeIotOperationsBrokerData(e)), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, "IotOperationsBrokerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.Serialization.cs new file mode 100644 index 000000000000..a6ce0b6dfcac --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsBrokerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerData(document.RootElement, options); + } + + internal static IotOperationsBrokerData DeserializeIotOperationsBrokerData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsBrokerProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsBrokerProperties.DeserializeIotOperationsBrokerProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.cs new file mode 100644 index 000000000000..8aecda74c08b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsBroker data model. + /// Instance broker resource + /// + public partial class IotOperationsBrokerData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsBrokerData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsBrokerProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsBrokerProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs new file mode 100644 index 000000000000..c68e6df73e83 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsBrokerListeners method from an instance of . + /// + public partial class IotOperationsBrokerListenerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsBrokerListenerBrokerListenerClientDiagnostics; + private readonly BrokerListenerRestOperations _iotOperationsBrokerListenerBrokerListenerRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerListenerCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsBrokerListenerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerListenerBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsBrokerListenerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsBrokerListenerResource.ResourceType, out string iotOperationsBrokerListenerBrokerListenerApiVersion); + _iotOperationsBrokerListenerBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerListenerBrokerListenerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsBrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsBrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string listenerName, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerListenerOperationSource(Client), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string listenerName, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerListenerOperationSource(Client), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerListenerResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners + /// + /// + /// Operation Id + /// BrokerListenerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerListenerBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerListenerBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerListenerResource(Client, IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(e)), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, "IotOperationsBrokerListenerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerListenerResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners + /// + /// + /// Operation Id + /// BrokerListenerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsBrokerListenerBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsBrokerListenerBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsBrokerListenerResource(Client, IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(e)), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, "IotOperationsBrokerListenerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.Serialization.cs new file mode 100644 index 000000000000..dff373ab2cdf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerListenerData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsBrokerListenerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerListenerData(document.RootElement, options); + } + + internal static IotOperationsBrokerListenerData DeserializeIotOperationsBrokerListenerData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsBrokerListenerProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsBrokerListenerProperties.DeserializeIotOperationsBrokerListenerProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerListenerData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerListenerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerListenerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.cs new file mode 100644 index 000000000000..a04649ae93bb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsBrokerListener data model. + /// Instance broker resource + /// + public partial class IotOperationsBrokerListenerData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsBrokerListenerData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerListenerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsBrokerListenerProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerListenerData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsBrokerListenerProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.Serialization.cs new file mode 100644 index 000000000000..7c173670a609 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerListenerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsBrokerListenerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsBrokerListenerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs new file mode 100644 index 000000000000..4f9676032a2c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsBrokerListener along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsBrokerListenerResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsBrokerListener method. + /// + public partial class IotOperationsBrokerListenerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The listenerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsBrokerListenerBrokerListenerClientDiagnostics; + private readonly BrokerListenerRestOperations _iotOperationsBrokerListenerBrokerListenerRestClient; + private readonly IotOperationsBrokerListenerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/listeners"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerListenerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsBrokerListenerResource(ArmClient client, IotOperationsBrokerListenerData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsBrokerListenerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerListenerBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsBrokerListenerBrokerListenerApiVersion); + _iotOperationsBrokerListenerBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerListenerBrokerListenerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsBrokerListenerData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerListenerBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerListenerOperationSource(Client), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerListenerBrokerListenerClientDiagnostics.CreateScope("IotOperationsBrokerListenerResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsBrokerListenerBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerListenerOperationSource(Client), _iotOperationsBrokerListenerBrokerListenerClientDiagnostics, Pipeline, _iotOperationsBrokerListenerBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.Serialization.cs new file mode 100644 index 000000000000..62d3be809ff3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsBrokerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsBrokerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsBrokerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs new file mode 100644 index 000000000000..21c066d6a4fd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs @@ -0,0 +1,554 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsBroker along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsBrokerResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsBroker method. + /// + public partial class IotOperationsBrokerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsBrokerBrokerClientDiagnostics; + private readonly BrokerRestOperations _iotOperationsBrokerBrokerRestClient; + private readonly IotOperationsBrokerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsBrokerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsBrokerResource(ArmClient client, IotOperationsBrokerData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsBrokerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsBrokerBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsBrokerBrokerApiVersion); + _iotOperationsBrokerBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsBrokerBrokerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsBrokerData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of IotOperationsBrokerListenerResources in the IotOperationsBroker. + /// An object representing collection of IotOperationsBrokerListenerResources and their operations over a IotOperationsBrokerListenerResource. + public virtual IotOperationsBrokerListenerCollection GetIotOperationsBrokerListeners() + { + return GetCachedClient(client => new IotOperationsBrokerListenerCollection(client, Id)); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsBrokerListenerAsync(string listenerName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsBrokerListeners().GetAsync(listenerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsBrokerListener(string listenerName, CancellationToken cancellationToken = default) + { + return GetIotOperationsBrokerListeners().Get(listenerName, cancellationToken); + } + + /// Gets a collection of IotOperationsBrokerAuthenticationResources in the IotOperationsBroker. + /// An object representing collection of IotOperationsBrokerAuthenticationResources and their operations over a IotOperationsBrokerAuthenticationResource. + public virtual IotOperationsBrokerAuthenticationCollection GetIotOperationsBrokerAuthentications() + { + return GetCachedClient(client => new IotOperationsBrokerAuthenticationCollection(client, Id)); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsBrokerAuthenticationAsync(string authenticationName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsBrokerAuthentications().GetAsync(authenticationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsBrokerAuthentication(string authenticationName, CancellationToken cancellationToken = default) + { + return GetIotOperationsBrokerAuthentications().Get(authenticationName, cancellationToken); + } + + /// Gets a collection of IotOperationsBrokerAuthorizationResources in the IotOperationsBroker. + /// An object representing collection of IotOperationsBrokerAuthorizationResources and their operations over a IotOperationsBrokerAuthorizationResource. + public virtual IotOperationsBrokerAuthorizationCollection GetIotOperationsBrokerAuthorizations() + { + return GetCachedClient(client => new IotOperationsBrokerAuthorizationCollection(client, Id)); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsBrokerAuthorizationAsync(string authorizationName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsBrokerAuthorizations().GetAsync(authorizationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsBrokerAuthorization(string authorizationName, CancellationToken cancellationToken = default) + { + return GetIotOperationsBrokerAuthorizations().Get(authorizationName, cancellationToken); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsBrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsBrokerBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerOperationSource(Client), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsBrokerBrokerClientDiagnostics.CreateScope("IotOperationsBrokerResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsBrokerBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsBrokerOperationSource(Client), _iotOperationsBrokerBrokerClientDiagnostics, Pipeline, _iotOperationsBrokerBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs new file mode 100644 index 000000000000..ea521ae9658e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsDataflows method from an instance of . + /// + public partial class IotOperationsDataflowCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsDataflowDataflowClientDiagnostics; + private readonly DataflowRestOperations _iotOperationsDataflowDataflowRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsDataflowCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowDataflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsDataflowResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsDataflowResource.ResourceType, out string iotOperationsDataflowDataflowApiVersion); + _iotOperationsDataflowDataflowRestClient = new DataflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowDataflowApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsDataflowProfileResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsDataflowProfileResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowName, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowOperationSource(Client), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowName, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowOperationSource(Client), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowResource resources by DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows + /// + /// + /// Operation Id + /// DataflowResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowDataflowRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowDataflowRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowResource(Client, IotOperationsDataflowData.DeserializeIotOperationsDataflowData(e)), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, "IotOperationsDataflowCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowResource resources by DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows + /// + /// + /// Operation Id + /// DataflowResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowDataflowRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowDataflowRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowResource(Client, IotOperationsDataflowData.DeserializeIotOperationsDataflowData(e)), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, "IotOperationsDataflowCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.Serialization.cs new file mode 100644 index 000000000000..3f49118f12b8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsDataflowData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowData(document.RootElement, options); + } + + internal static IotOperationsDataflowData DeserializeIotOperationsDataflowData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsDataflowProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsDataflowProperties.DeserializeIotOperationsDataflowProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.cs new file mode 100644 index 000000000000..abd28844e817 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsDataflow data model. + /// Instance dataflowProfile dataflow resource + /// + public partial class IotOperationsDataflowData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsDataflowData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsDataflowProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsDataflowData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsDataflowProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs new file mode 100644 index 000000000000..79d1d438bc3f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsDataflowEndpoints method from an instance of . + /// + public partial class IotOperationsDataflowEndpointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics; + private readonly DataflowEndpointRestOperations _iotOperationsDataflowEndpointDataflowEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowEndpointCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsDataflowEndpointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsDataflowEndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsDataflowEndpointResource.ResourceType, out string iotOperationsDataflowEndpointDataflowEndpointApiVersion); + _iotOperationsDataflowEndpointDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowEndpointDataflowEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowEndpointName, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowEndpointOperationSource(Client), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowEndpointName, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowEndpointOperationSource(Client), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowEndpointResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints + /// + /// + /// Operation Id + /// DataflowEndpointResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowEndpointResource(Client, IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(e)), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, "IotOperationsDataflowEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowEndpointResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints + /// + /// + /// Operation Id + /// DataflowEndpointResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowEndpointResource(Client, IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(e)), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, "IotOperationsDataflowEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.Serialization.cs new file mode 100644 index 000000000000..cd3778eba676 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowEndpointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsDataflowEndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowEndpointData(document.RootElement, options); + } + + internal static IotOperationsDataflowEndpointData DeserializeIotOperationsDataflowEndpointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsDataflowEndpointProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsDataflowEndpointProperties.DeserializeIotOperationsDataflowEndpointProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowEndpointData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowEndpointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.cs new file mode 100644 index 000000000000..172ce3cefd8a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsDataflowEndpoint data model. + /// Instance dataflowEndpoint resource + /// + public partial class IotOperationsDataflowEndpointData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsDataflowEndpointData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsDataflowEndpointProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsDataflowEndpointData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsDataflowEndpointProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.Serialization.cs new file mode 100644 index 000000000000..134a9923576c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowEndpointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsDataflowEndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsDataflowEndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs new file mode 100644 index 000000000000..ec4dc201e2ef --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsDataflowEndpoint along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsDataflowEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsDataflowEndpoint method. + /// + public partial class IotOperationsDataflowEndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The dataflowEndpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics; + private readonly DataflowEndpointRestOperations _iotOperationsDataflowEndpointDataflowEndpointRestClient; + private readonly IotOperationsDataflowEndpointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowEndpoints"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowEndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsDataflowEndpointResource(ArmClient client, IotOperationsDataflowEndpointData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsDataflowEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsDataflowEndpointDataflowEndpointApiVersion); + _iotOperationsDataflowEndpointDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowEndpointDataflowEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsDataflowEndpointData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowEndpointOperationSource(Client), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics.CreateScope("IotOperationsDataflowEndpointResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowEndpointOperationSource(Client), _iotOperationsDataflowEndpointDataflowEndpointClientDiagnostics, Pipeline, _iotOperationsDataflowEndpointDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs new file mode 100644 index 000000000000..1fe882d17472 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsDataflowProfiles method from an instance of . + /// + public partial class IotOperationsDataflowProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsDataflowProfileDataflowProfileClientDiagnostics; + private readonly DataflowProfileRestOperations _iotOperationsDataflowProfileDataflowProfileRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowProfileCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsDataflowProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowProfileDataflowProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsDataflowProfileResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsDataflowProfileResource.ResourceType, out string iotOperationsDataflowProfileDataflowProfileApiVersion); + _iotOperationsDataflowProfileDataflowProfileRestClient = new DataflowProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowProfileDataflowProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IotOperationsInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotOperationsInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowProfileName, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowProfileOperationSource(Client), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowProfileName, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowProfileOperationSource(Client), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowProfileResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles + /// + /// + /// Operation Id + /// DataflowProfileResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowProfileDataflowProfileRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowProfileDataflowProfileRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowProfileResource(Client, IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(e)), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, "IotOperationsDataflowProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowProfileResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles + /// + /// + /// Operation Id + /// DataflowProfileResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsDataflowProfileDataflowProfileRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsDataflowProfileDataflowProfileRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsDataflowProfileResource(Client, IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(e)), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, "IotOperationsDataflowProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.Serialization.cs new file mode 100644 index 000000000000..1fc72c2b82f6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowProfileData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + IotOperationsDataflowProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowProfileData(document.RootElement, options); + } + + internal static IotOperationsDataflowProfileData DeserializeIotOperationsDataflowProfileData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsDataflowProfileProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsDataflowProfileProperties.DeserializeIotOperationsDataflowProfileProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowProfileData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowProfileData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.cs new file mode 100644 index 000000000000..48f5678689d8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsDataflowProfile data model. + /// Instance dataflowProfile resource + /// + public partial class IotOperationsDataflowProfileData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public IotOperationsDataflowProfileData(IotOperationsExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotOperationsDataflowProfileProperties properties, IotOperationsExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsDataflowProfileData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsDataflowProfileProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.Serialization.cs new file mode 100644 index 000000000000..250a017a1b7e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsDataflowProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsDataflowProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs new file mode 100644 index 000000000000..291abc4283b7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsDataflowProfile along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsDataflowProfileResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsDataflowProfile method. + /// + public partial class IotOperationsDataflowProfileResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The dataflowProfileName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsDataflowProfileDataflowProfileClientDiagnostics; + private readonly DataflowProfileRestOperations _iotOperationsDataflowProfileDataflowProfileRestClient; + private readonly IotOperationsDataflowProfileData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowProfiles"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowProfileResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsDataflowProfileResource(ArmClient client, IotOperationsDataflowProfileData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsDataflowProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowProfileDataflowProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsDataflowProfileDataflowProfileApiVersion); + _iotOperationsDataflowProfileDataflowProfileRestClient = new DataflowProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowProfileDataflowProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsDataflowProfileData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of IotOperationsDataflowResources in the IotOperationsDataflowProfile. + /// An object representing collection of IotOperationsDataflowResources and their operations over a IotOperationsDataflowResource. + public virtual IotOperationsDataflowCollection GetIotOperationsDataflows() + { + return GetCachedClient(client => new IotOperationsDataflowCollection(client, Id)); + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsDataflowAsync(string dataflowName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsDataflows().GetAsync(dataflowName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsDataflow(string dataflowName, CancellationToken cancellationToken = default) + { + return GetIotOperationsDataflows().Get(dataflowName, cancellationToken); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowProfileDataflowProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowProfileOperationSource(Client), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowProfileDataflowProfileClientDiagnostics.CreateScope("IotOperationsDataflowProfileResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsDataflowProfileDataflowProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowProfileOperationSource(Client), _iotOperationsDataflowProfileDataflowProfileClientDiagnostics, Pipeline, _iotOperationsDataflowProfileDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.Serialization.cs new file mode 100644 index 000000000000..9aba6ab29bc6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsDataflowResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsDataflowData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsDataflowData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs new file mode 100644 index 000000000000..779f4114c9f1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsDataflow along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsDataflowResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsDataflow method. + /// + public partial class IotOperationsDataflowResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The dataflowProfileName. + /// The dataflowName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsDataflowDataflowClientDiagnostics; + private readonly DataflowRestOperations _iotOperationsDataflowDataflowRestClient; + private readonly IotOperationsDataflowData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowProfiles/dataflows"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsDataflowResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsDataflowResource(ArmClient client, IotOperationsDataflowData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsDataflowResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsDataflowDataflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsDataflowDataflowApiVersion); + _iotOperationsDataflowDataflowRestClient = new DataflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsDataflowDataflowApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsDataflowData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsDataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsDataflowDataflowRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowOperationSource(Client), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsDataflowDataflowClientDiagnostics.CreateScope("IotOperationsDataflowResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsDataflowDataflowRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsDataflowOperationSource(Client), _iotOperationsDataflowDataflowClientDiagnostics, Pipeline, _iotOperationsDataflowDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs new file mode 100644 index 000000000000..31af78f0ebba --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIotOperationsInstances method from an instance of . + /// + public partial class IotOperationsInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _iotOperationsInstanceInstanceClientDiagnostics; + private readonly InstanceRestOperations _iotOperationsInstanceInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsInstanceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal IotOperationsInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsInstanceInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", IotOperationsInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IotOperationsInstanceResource.ResourceType, out string iotOperationsInstanceInstanceApiVersion); + _iotOperationsInstanceInstanceRestClient = new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsInstanceInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string instanceName, IotOperationsInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(new IotOperationsInstanceOperationSource(Client), _iotOperationsInstanceInstanceClientDiagnostics, Pipeline, _iotOperationsInstanceInstanceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string instanceName, IotOperationsInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data, cancellationToken); + var operation = new IotOperationsArmOperation(new IotOperationsInstanceOperationSource(Client), _iotOperationsInstanceInstanceClientDiagnostics, Pipeline, _iotOperationsInstanceInstanceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.Get"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List InstanceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsInstanceInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsInstanceInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotOperationsInstanceResource(Client, IotOperationsInstanceData.DeserializeIotOperationsInstanceData(e)), _iotOperationsInstanceInstanceClientDiagnostics, Pipeline, "IotOperationsInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List InstanceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _iotOperationsInstanceInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotOperationsInstanceInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotOperationsInstanceResource(Client, IotOperationsInstanceData.DeserializeIotOperationsInstanceData(e)), _iotOperationsInstanceInstanceClientDiagnostics, Pipeline, "IotOperationsInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.Serialization.cs new file mode 100644 index 000000000000..542579816b41 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsInstanceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + IotOperationsInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsInstanceData(document.RootElement, options); + } + + internal static IotOperationsInstanceData DeserializeIotOperationsInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsInstanceProperties properties = default; + IotOperationsExtendedLocation extendedLocation = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = IotOperationsInstanceProperties.DeserializeIotOperationsInstanceProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = IotOperationsExtendedLocation.DeserializeIotOperationsExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsInstanceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsInstanceData)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.cs new file mode 100644 index 000000000000..0404cfc0c24f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A class representing the IotOperationsInstance data model. + /// A Instance resource is a logical container for a set of child resources. + /// + public partial class IotOperationsInstanceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + /// Edge location of the resource. + /// is null. + public IotOperationsInstanceData(AzureLocation location, IotOperationsExtendedLocation extendedLocation) : base(location) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IotOperationsInstanceProperties properties, IotOperationsExtendedLocation extendedLocation, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsInstanceData() + { + } + + /// The resource-specific properties for this resource. + public IotOperationsInstanceProperties Properties { get; set; } + /// Edge location of the resource. + public IotOperationsExtendedLocation ExtendedLocation { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.Serialization.cs new file mode 100644 index 000000000000..8ee31f10212f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IotOperations +{ + public partial class IotOperationsInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IotOperationsInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IotOperationsInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs new file mode 100644 index 000000000000..eb00248a5e78 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs @@ -0,0 +1,906 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IotOperations +{ + /// + /// A Class representing an IotOperationsInstance along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIotOperationsInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetIotOperationsInstance method. + /// + public partial class IotOperationsInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _iotOperationsInstanceInstanceClientDiagnostics; + private readonly InstanceRestOperations _iotOperationsInstanceInstanceRestClient; + private readonly IotOperationsInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances"; + + /// Initializes a new instance of the class for mocking. + protected IotOperationsInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IotOperationsInstanceResource(ArmClient client, IotOperationsInstanceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal IotOperationsInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _iotOperationsInstanceInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IotOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string iotOperationsInstanceInstanceApiVersion); + _iotOperationsInstanceInstanceRestClient = new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotOperationsInstanceInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual IotOperationsInstanceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of IotOperationsBrokerResources in the IotOperationsInstance. + /// An object representing collection of IotOperationsBrokerResources and their operations over a IotOperationsBrokerResource. + public virtual IotOperationsBrokerCollection GetIotOperationsBrokers() + { + return GetCachedClient(client => new IotOperationsBrokerCollection(client, Id)); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsBrokerAsync(string brokerName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsBrokers().GetAsync(brokerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsBroker(string brokerName, CancellationToken cancellationToken = default) + { + return GetIotOperationsBrokers().Get(brokerName, cancellationToken); + } + + /// Gets a collection of IotOperationsDataflowProfileResources in the IotOperationsInstance. + /// An object representing collection of IotOperationsDataflowProfileResources and their operations over a IotOperationsDataflowProfileResource. + public virtual IotOperationsDataflowProfileCollection GetIotOperationsDataflowProfiles() + { + return GetCachedClient(client => new IotOperationsDataflowProfileCollection(client, Id)); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsDataflowProfileAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsDataflowProfiles().GetAsync(dataflowProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsDataflowProfile(string dataflowProfileName, CancellationToken cancellationToken = default) + { + return GetIotOperationsDataflowProfiles().Get(dataflowProfileName, cancellationToken); + } + + /// Gets a collection of IotOperationsDataflowEndpointResources in the IotOperationsInstance. + /// An object representing collection of IotOperationsDataflowEndpointResources and their operations over a IotOperationsDataflowEndpointResource. + public virtual IotOperationsDataflowEndpointCollection GetIotOperationsDataflowEndpoints() + { + return GetCachedClient(client => new IotOperationsDataflowEndpointCollection(client, Id)); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotOperationsDataflowEndpointAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + return await GetIotOperationsDataflowEndpoints().GetAsync(dataflowEndpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotOperationsDataflowEndpoint(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + return GetIotOperationsDataflowEndpoints().Get(dataflowEndpointName, cancellationToken); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Get"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Get"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IotOperationsArmOperation(_iotOperationsInstanceInstanceClientDiagnostics, Pipeline, _iotOperationsInstanceInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Delete"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new IotOperationsArmOperation(_iotOperationsInstanceInstanceClientDiagnostics, Pipeline, _iotOperationsInstanceInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Update + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(IotOperationsInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Update"); + scope.Start(); + try + { + var response = await _iotOperationsInstanceInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Update + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(IotOperationsInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.Update"); + scope.Start(); + try + { + var response = _iotOperationsInstanceInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new IotOperationsInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new IotOperationsInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new IotOperationsInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new IotOperationsInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new IotOperationsInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _iotOperationsInstanceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new IotOperationsInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _iotOperationsInstanceInstanceClientDiagnostics.CreateScope("IotOperationsInstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _iotOperationsInstanceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IotOperationsInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new IotOperationsInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperation.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperation.cs new file mode 100644 index 000000000000..76eb16afee48 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ +#pragma warning disable SA1649 // File name should match first type name + internal class IotOperationsArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of IotOperationsArmOperation for mocking. + protected IotOperationsArmOperation() + { + } + + internal IotOperationsArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal IotOperationsArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "IotOperationsArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperationOfT.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperationOfT.cs new file mode 100644 index 000000000000..ecfddb26d159 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ +#pragma warning disable SA1649 // File name should match first type name + internal class IotOperationsArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of IotOperationsArmOperation for mocking. + protected IotOperationsArmOperation() + { + } + + internal IotOperationsArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal IotOperationsArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "IotOperationsArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthenticationOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthenticationOperationSource.cs new file mode 100644 index 000000000000..c14ba0d92158 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthenticationOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsBrokerAuthenticationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsBrokerAuthenticationOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsBrokerAuthenticationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(document.RootElement); + return new IotOperationsBrokerAuthenticationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(document.RootElement); + return new IotOperationsBrokerAuthenticationResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthorizationOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthorizationOperationSource.cs new file mode 100644 index 000000000000..1902b4f8d295 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerAuthorizationOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsBrokerAuthorizationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsBrokerAuthorizationOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsBrokerAuthorizationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(document.RootElement); + return new IotOperationsBrokerAuthorizationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(document.RootElement); + return new IotOperationsBrokerAuthorizationResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerListenerOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerListenerOperationSource.cs new file mode 100644 index 000000000000..a9816e0d9ad5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerListenerOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsBrokerListenerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsBrokerListenerOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsBrokerListenerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(document.RootElement); + return new IotOperationsBrokerListenerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(document.RootElement); + return new IotOperationsBrokerListenerResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerOperationSource.cs new file mode 100644 index 000000000000..ee053d696ac5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsBrokerOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsBrokerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsBrokerOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsBrokerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsBrokerData.DeserializeIotOperationsBrokerData(document.RootElement); + return new IotOperationsBrokerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsBrokerData.DeserializeIotOperationsBrokerData(document.RootElement); + return new IotOperationsBrokerResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowEndpointOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowEndpointOperationSource.cs new file mode 100644 index 000000000000..3ce58ca9a9cd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowEndpointOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsDataflowEndpointOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsDataflowEndpointOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsDataflowEndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(document.RootElement); + return new IotOperationsDataflowEndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(document.RootElement); + return new IotOperationsDataflowEndpointResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowOperationSource.cs new file mode 100644 index 000000000000..237f20f0ef1c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsDataflowOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsDataflowOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsDataflowResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsDataflowData.DeserializeIotOperationsDataflowData(document.RootElement); + return new IotOperationsDataflowResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsDataflowData.DeserializeIotOperationsDataflowData(document.RootElement); + return new IotOperationsDataflowResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowProfileOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowProfileOperationSource.cs new file mode 100644 index 000000000000..1b49a4d68e5e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsDataflowProfileOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsDataflowProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsDataflowProfileOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsDataflowProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(document.RootElement); + return new IotOperationsDataflowProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(document.RootElement); + return new IotOperationsDataflowProfileResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsInstanceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsInstanceOperationSource.cs new file mode 100644 index 000000000000..62418aa7bcdb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/LongRunningOperation/IotOperationsInstanceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations +{ + internal class IotOperationsInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IotOperationsInstanceOperationSource(ArmClient client) + { + _client = client; + } + + IotOperationsInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return new IotOperationsInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return new IotOperationsInstanceResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BlockerListenerServiceType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BlockerListenerServiceType.cs new file mode 100644 index 000000000000..d94787a6930c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BlockerListenerServiceType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kubernetes Service Types supported by Listener. + public readonly partial struct BlockerListenerServiceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BlockerListenerServiceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ClusterIPValue = "ClusterIp"; + private const string LoadBalancerValue = "LoadBalancer"; + private const string NodePortValue = "NodePort"; + + /// Cluster IP Service. + public static BlockerListenerServiceType ClusterIP { get; } = new BlockerListenerServiceType(ClusterIPValue); + /// Load Balancer Service. + public static BlockerListenerServiceType LoadBalancer { get; } = new BlockerListenerServiceType(LoadBalancerValue); + /// Node Port Service. + public static BlockerListenerServiceType NodePort { get; } = new BlockerListenerServiceType(NodePortValue); + /// Determines if two values are the same. + public static bool operator ==(BlockerListenerServiceType left, BlockerListenerServiceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BlockerListenerServiceType left, BlockerListenerServiceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BlockerListenerServiceType(string value) => new BlockerListenerServiceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlockerListenerServiceType other && Equals(other); + /// + public bool Equals(BlockerListenerServiceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.Serialization.cs new file mode 100644 index 000000000000..c09de310ee2d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAdvancedSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAdvancedSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Clients)) + { + writer.WritePropertyName("clients"u8); + writer.WriteObjectValue(Clients, options); + } + if (Optional.IsDefined(EncryptInternalTraffic)) + { + writer.WritePropertyName("encryptInternalTraffic"u8); + writer.WriteStringValue(EncryptInternalTraffic.Value.ToString()); + } + if (Optional.IsDefined(InternalCerts)) + { + writer.WritePropertyName("internalCerts"u8); + writer.WriteObjectValue(InternalCerts, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAdvancedSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAdvancedSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAdvancedSettings(document.RootElement, options); + } + + internal static BrokerAdvancedSettings DeserializeBrokerAdvancedSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerClientConfig clients = default; + IotOperationsOperationalMode? encryptInternalTraffic = default; + CertManagerCertConfig internalCerts = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clients"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clients = BrokerClientConfig.DeserializeBrokerClientConfig(property.Value, options); + continue; + } + if (property.NameEquals("encryptInternalTraffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptInternalTraffic = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("internalCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internalCerts = CertManagerCertConfig.DeserializeCertManagerCertConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAdvancedSettings(clients, encryptInternalTraffic, internalCerts, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAdvancedSettings)} does not support writing '{options.Format}' format."); + } + } + + BrokerAdvancedSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAdvancedSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAdvancedSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.cs new file mode 100644 index 000000000000..35a5069ce688 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAdvancedSettings.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Advanced Settings. + public partial class BrokerAdvancedSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerAdvancedSettings() + { + } + + /// Initializes a new instance of . + /// Configurations related to All Clients. + /// The setting to enable or disable encryption of internal Traffic. + /// Certificate rotation and private key configuration. + /// Keeps track of any properties unknown to the library. + internal BrokerAdvancedSettings(BrokerClientConfig clients, IotOperationsOperationalMode? encryptInternalTraffic, CertManagerCertConfig internalCerts, IDictionary serializedAdditionalRawData) + { + Clients = clients; + EncryptInternalTraffic = encryptInternalTraffic; + InternalCerts = internalCerts; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Configurations related to All Clients. + public BrokerClientConfig Clients { get; set; } + /// The setting to enable or disable encryption of internal Traffic. + public IotOperationsOperationalMode? EncryptInternalTraffic { get; set; } + /// Certificate rotation and private key configuration. + public CertManagerCertConfig InternalCerts { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationMethod.cs new file mode 100644 index 000000000000..f4c44714395d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Authentication Mode. + public readonly partial struct BrokerAuthenticationMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerAuthenticationMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomValue = "Custom"; + private const string ServiceAccountTokenValue = "ServiceAccountToken"; + private const string X509Value = "X509"; + + /// Custom authentication configuration. + public static BrokerAuthenticationMethod Custom { get; } = new BrokerAuthenticationMethod(CustomValue); + /// ServiceAccountToken authentication configuration. + public static BrokerAuthenticationMethod ServiceAccountToken { get; } = new BrokerAuthenticationMethod(ServiceAccountTokenValue); + /// X.509 authentication configuration. + public static BrokerAuthenticationMethod X509 { get; } = new BrokerAuthenticationMethod(X509Value); + /// Determines if two values are the same. + public static bool operator ==(BrokerAuthenticationMethod left, BrokerAuthenticationMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerAuthenticationMethod left, BrokerAuthenticationMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerAuthenticationMethod(string value) => new BrokerAuthenticationMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerAuthenticationMethod other && Equals(other); + /// + public bool Equals(BrokerAuthenticationMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs new file mode 100644 index 000000000000..dc43d1d261c6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerAuthenticationResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticationResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticationResourceListResult(document.RootElement, options); + } + + internal static BrokerAuthenticationResourceListResult DeserializeBrokerAuthenticationResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticationResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticationResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticationResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs new file mode 100644 index 000000000000..490f6de6423e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a BrokerAuthenticationResource list operation. + internal partial class BrokerAuthenticationResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BrokerAuthenticationResource items on this page. + /// is null. + internal BrokerAuthenticationResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerAuthenticationResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticationResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticationResourceListResult() + { + } + + /// The BrokerAuthenticationResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs new file mode 100644 index 000000000000..8aff2d3d95d3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerAuthenticatorCustomAuth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("x509"u8); + writer.WriteObjectValue(X509, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorCustomAuth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorCustomAuth(document.RootElement, options); + } + + internal static BrokerAuthenticatorCustomAuth DeserializeBrokerAuthenticatorCustomAuth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + X509ManualCertificate x509 = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("x509"u8)) + { + x509 = X509ManualCertificate.DeserializeX509ManualCertificate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorCustomAuth(x509, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorCustomAuth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorCustomAuth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs new file mode 100644 index 000000000000..566f55bde393 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Custom Authentication properties. + internal partial class BrokerAuthenticatorCustomAuth + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// X509 Custom Auth type details. + /// is null. + public BrokerAuthenticatorCustomAuth(X509ManualCertificate x509) + { + Argument.AssertNotNull(x509, nameof(x509)); + + X509 = x509; + } + + /// Initializes a new instance of . + /// X509 Custom Auth type details. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorCustomAuth(X509ManualCertificate x509, IDictionary serializedAdditionalRawData) + { + X509 = x509; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorCustomAuth() + { + } + + /// X509 Custom Auth type details. + internal X509ManualCertificate X509 { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string X509SecretRef + { + get => X509 is null ? default : X509.SecretRef; + set => X509 = new X509ManualCertificate(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs new file mode 100644 index 000000000000..045f8bec5398 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthenticatorMethodCustom : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Auth)) + { + writer.WritePropertyName("auth"u8); + writer.WriteObjectValue(Auth, options); + } + if (Optional.IsDefined(CaCertConfigMap)) + { + writer.WritePropertyName("caCertConfigMap"u8); + writer.WriteStringValue(CaCertConfigMap); + } + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodCustom IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodCustom(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodCustom DeserializeBrokerAuthenticatorMethodCustom(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthenticatorCustomAuth auth = default; + string caCertConfigMap = default; + Uri endpoint = default; + IDictionary headers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("auth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auth = BrokerAuthenticatorCustomAuth.DeserializeBrokerAuthenticatorCustomAuth(property.Value, options); + continue; + } + if (property.NameEquals("caCertConfigMap"u8)) + { + caCertConfigMap = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoint"u8)) + { + endpoint = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodCustom(auth, caCertConfigMap, endpoint, headers ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodCustom IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodCustom(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs new file mode 100644 index 000000000000..7f83250cb593 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Custom method for BrokerAuthentication. + public partial class BrokerAuthenticatorMethodCustom + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + /// is null. + public BrokerAuthenticatorMethodCustom(Uri endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + Headers = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Optional authentication needed for authenticating with the custom authentication server. + /// Optional CA certificate for validating the custom authentication server's certificate. + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + /// Additional HTTP headers to pass to the custom authentication server. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodCustom(BrokerAuthenticatorCustomAuth auth, string caCertConfigMap, Uri endpoint, IDictionary headers, IDictionary serializedAdditionalRawData) + { + Auth = auth; + CaCertConfigMap = caCertConfigMap; + Endpoint = endpoint; + Headers = headers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodCustom() + { + } + + /// Optional authentication needed for authenticating with the custom authentication server. + internal BrokerAuthenticatorCustomAuth Auth { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string X509SecretRef + { + get => Auth is null ? default : Auth.X509SecretRef; + set => Auth = new BrokerAuthenticatorCustomAuth(value); + } + + /// Optional CA certificate for validating the custom authentication server's certificate. + public string CaCertConfigMap { get; set; } + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + public Uri Endpoint { get; set; } + /// Additional HTTP headers to pass to the custom authentication server. + public IDictionary Headers { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs new file mode 100644 index 000000000000..9ddfcd18fb79 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerAuthenticatorMethodSat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("audiences"u8); + writer.WriteStartArray(); + foreach (var item in Audiences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodSat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodSat(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodSat DeserializeBrokerAuthenticatorMethodSat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList audiences = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audiences"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + audiences = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodSat(audiences, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodSat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodSat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs new file mode 100644 index 000000000000..d6445de8f25b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Service Account Token for BrokerAuthentication. + internal partial class BrokerAuthenticatorMethodSat + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of allowed audience. + /// is null. + public BrokerAuthenticatorMethodSat(IEnumerable audiences) + { + Argument.AssertNotNull(audiences, nameof(audiences)); + + Audiences = audiences.ToList(); + } + + /// Initializes a new instance of . + /// List of allowed audience. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodSat(IList audiences, IDictionary serializedAdditionalRawData) + { + Audiences = audiences; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodSat() + { + } + + /// List of allowed audience. + public IList Audiences { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs new file mode 100644 index 000000000000..8eb30c57f945 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthenticatorMethodX509 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AuthorizationAttributes)) + { + writer.WritePropertyName("authorizationAttributes"u8); + writer.WriteStartObject(); + foreach (var item in AuthorizationAttributes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(TrustedClientCaCert)) + { + writer.WritePropertyName("trustedClientCaCert"u8); + writer.WriteStringValue(TrustedClientCaCert); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodX509 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodX509(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodX509 DeserializeBrokerAuthenticatorMethodX509(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary authorizationAttributes = default; + string trustedClientCaCert = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authorizationAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, BrokerAuthenticatorMethodX509Attributes.DeserializeBrokerAuthenticatorMethodX509Attributes(property0.Value, options)); + } + authorizationAttributes = dictionary; + continue; + } + if (property.NameEquals("trustedClientCaCert"u8)) + { + trustedClientCaCert = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodX509(authorizationAttributes ?? new ChangeTrackingDictionary(), trustedClientCaCert, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodX509 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodX509(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs new file mode 100644 index 000000000000..5157f1ffb56d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// X509 for BrokerAuthentication. + public partial class BrokerAuthenticatorMethodX509 + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerAuthenticatorMethodX509() + { + AuthorizationAttributes = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// X509 authorization attributes properties. + /// Name of the trusted client ca cert resource. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodX509(IDictionary authorizationAttributes, string trustedClientCaCert, IDictionary serializedAdditionalRawData) + { + AuthorizationAttributes = authorizationAttributes; + TrustedClientCaCert = trustedClientCaCert; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// X509 authorization attributes properties. + public IDictionary AuthorizationAttributes { get; } + /// Name of the trusted client ca cert resource. + public string TrustedClientCaCert { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs new file mode 100644 index 000000000000..673865431e91 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthenticatorMethodX509Attributes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("attributes"u8); + writer.WriteStartObject(); + foreach (var item in Attributes) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + writer.WritePropertyName("subject"u8); + writer.WriteStringValue(Subject); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodX509Attributes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodX509Attributes(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodX509Attributes DeserializeBrokerAuthenticatorMethodX509Attributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary attributes = default; + string subject = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + attributes = dictionary; + continue; + } + if (property.NameEquals("subject"u8)) + { + subject = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodX509Attributes(attributes, subject, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodX509Attributes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodX509Attributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs new file mode 100644 index 000000000000..8a10d92bf426 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// BrokerAuthenticatorMethodX509Attributes properties. + public partial class BrokerAuthenticatorMethodX509Attributes + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Attributes object. + /// Subject of the X509 attribute. + /// or is null. + public BrokerAuthenticatorMethodX509Attributes(IDictionary attributes, string subject) + { + Argument.AssertNotNull(attributes, nameof(attributes)); + Argument.AssertNotNull(subject, nameof(subject)); + + Attributes = attributes; + Subject = subject; + } + + /// Initializes a new instance of . + /// Attributes object. + /// Subject of the X509 attribute. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodX509Attributes(IDictionary attributes, string subject, IDictionary serializedAdditionalRawData) + { + Attributes = attributes; + Subject = subject; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodX509Attributes() + { + } + + /// Attributes object. + public IDictionary Attributes { get; } + /// Subject of the X509 attribute. + public string Subject { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs new file mode 100644 index 000000000000..e2a8de2ac8a6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthenticatorMethods : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(CustomSettings)) + { + writer.WritePropertyName("customSettings"u8); + writer.WriteObjectValue(CustomSettings, options); + } + if (Optional.IsDefined(ServiceAccountTokenSettings)) + { + writer.WritePropertyName("serviceAccountTokenSettings"u8); + writer.WriteObjectValue(ServiceAccountTokenSettings, options); + } + if (Optional.IsDefined(X509Settings)) + { + writer.WritePropertyName("x509Settings"u8); + writer.WriteObjectValue(X509Settings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethods IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethods(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethods DeserializeBrokerAuthenticatorMethods(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthenticationMethod method = default; + BrokerAuthenticatorMethodCustom customSettings = default; + BrokerAuthenticatorMethodSat serviceAccountTokenSettings = default; + BrokerAuthenticatorMethodX509 x509Settings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new BrokerAuthenticationMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("customSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customSettings = BrokerAuthenticatorMethodCustom.DeserializeBrokerAuthenticatorMethodCustom(property.Value, options); + continue; + } + if (property.NameEquals("serviceAccountTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceAccountTokenSettings = BrokerAuthenticatorMethodSat.DeserializeBrokerAuthenticatorMethodSat(property.Value, options); + continue; + } + if (property.NameEquals("x509Settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509Settings = BrokerAuthenticatorMethodX509.DeserializeBrokerAuthenticatorMethodX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethods(method, customSettings, serviceAccountTokenSettings, x509Settings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethods IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethods(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs new file mode 100644 index 000000000000..da2e4179d2d8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Set of broker authentication policies. Only one method is supported for each entry. + public partial class BrokerAuthenticatorMethods + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Custom authentication configuration. + public BrokerAuthenticatorMethods(BrokerAuthenticationMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Custom authentication configuration. + /// Custom authentication configuration. + /// ServiceAccountToken authentication configuration. + /// X.509 authentication configuration. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethods(BrokerAuthenticationMethod method, BrokerAuthenticatorMethodCustom customSettings, BrokerAuthenticatorMethodSat serviceAccountTokenSettings, BrokerAuthenticatorMethodX509 x509Settings, IDictionary serializedAdditionalRawData) + { + Method = method; + CustomSettings = customSettings; + ServiceAccountTokenSettings = serviceAccountTokenSettings; + X509Settings = x509Settings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethods() + { + } + + /// Custom authentication configuration. + public BrokerAuthenticationMethod Method { get; set; } + /// Custom authentication configuration. + public BrokerAuthenticatorMethodCustom CustomSettings { get; set; } + /// ServiceAccountToken authentication configuration. + internal BrokerAuthenticatorMethodSat ServiceAccountTokenSettings { get; set; } + /// List of allowed audience. + public IList ServiceAccountTokenAudiences + { + get => ServiceAccountTokenSettings is null ? default : ServiceAccountTokenSettings.Audiences; + set => ServiceAccountTokenSettings = new BrokerAuthenticatorMethodSat(value); + } + + /// X.509 authentication configuration. + public BrokerAuthenticatorMethodX509 X509Settings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.Serialization.cs new file mode 100644 index 000000000000..80f23b170635 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthorizationConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Cache)) + { + writer.WritePropertyName("cache"u8); + writer.WriteStringValue(Cache.Value.ToString()); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthorizationConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationConfig(document.RootElement, options); + } + + internal static BrokerAuthorizationConfig DeserializeBrokerAuthorizationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? cache = default; + IList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cache = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerAuthorizationRule.DeserializeBrokerAuthorizationRule(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationConfig(cache, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationConfig)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.cs new file mode 100644 index 000000000000..eb18fe4d4b4f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationConfig.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker AuthorizationConfig properties. + public partial class BrokerAuthorizationConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerAuthorizationConfig() + { + Rules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Enable caching of the authorization rules. + /// The authorization rules to follow. If no rule is set, but Authorization Resource is used that would mean DenyAll. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationConfig(IotOperationsOperationalMode? cache, IList rules, IDictionary serializedAdditionalRawData) + { + Cache = cache; + Rules = rules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enable caching of the authorization rules. + public IotOperationsOperationalMode? Cache { get; set; } + /// The authorization rules to follow. If no rule is set, but Authorization Resource is used that would mean DenyAll. + public IList Rules { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs new file mode 100644 index 000000000000..d3ffbb498f30 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerAuthorizationResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthorizationResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationResourceListResult(document.RootElement, options); + } + + internal static BrokerAuthorizationResourceListResult DeserializeBrokerAuthorizationResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs new file mode 100644 index 000000000000..dd5e8858db80 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a BrokerAuthorizationResource list operation. + internal partial class BrokerAuthorizationResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BrokerAuthorizationResource items on this page. + /// is null. + internal BrokerAuthorizationResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerAuthorizationResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthorizationResourceListResult() + { + } + + /// The BrokerAuthorizationResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.Serialization.cs new file mode 100644 index 000000000000..f6c2fac89086 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerAuthorizationRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("brokerResources"u8); + writer.WriteStartArray(); + foreach (var item in BrokerResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("principals"u8); + writer.WriteObjectValue(Principals, options); + if (Optional.IsCollectionDefined(StateStoreResources)) + { + writer.WritePropertyName("stateStoreResources"u8); + writer.WriteStartArray(); + foreach (var item in StateStoreResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthorizationRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationRule(document.RootElement, options); + } + + internal static BrokerAuthorizationRule DeserializeBrokerAuthorizationRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList brokerResources = default; + PrincipalConfig principals = default; + IList stateStoreResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("brokerResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerResourceRule.DeserializeBrokerResourceRule(item, options)); + } + brokerResources = array; + continue; + } + if (property.NameEquals("principals"u8)) + { + principals = PrincipalConfig.DeserializePrincipalConfig(property.Value, options); + continue; + } + if (property.NameEquals("stateStoreResources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StateStoreResourceRule.DeserializeStateStoreResourceRule(item, options)); + } + stateStoreResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationRule(brokerResources, principals, stateStoreResources ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationRule)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.cs new file mode 100644 index 000000000000..9fb432abb78a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerAuthorizationRule.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// AuthorizationConfig Rule Properties. + public partial class BrokerAuthorizationRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Give access to Broker methods and topics. + /// Give access to clients based on the following properties. + /// or is null. + public BrokerAuthorizationRule(IEnumerable brokerResources, PrincipalConfig principals) + { + Argument.AssertNotNull(brokerResources, nameof(brokerResources)); + Argument.AssertNotNull(principals, nameof(principals)); + + BrokerResources = brokerResources.ToList(); + Principals = principals; + StateStoreResources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Give access to Broker methods and topics. + /// Give access to clients based on the following properties. + /// Give access to state store resources. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationRule(IList brokerResources, PrincipalConfig principals, IList stateStoreResources, IDictionary serializedAdditionalRawData) + { + BrokerResources = brokerResources; + Principals = principals; + StateStoreResources = stateStoreResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthorizationRule() + { + } + + /// Give access to Broker methods and topics. + public IList BrokerResources { get; } + /// Give access to clients based on the following properties. + public PrincipalConfig Principals { get; set; } + /// Give access to state store resources. + public IList StateStoreResources { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.Serialization.cs new file mode 100644 index 000000000000..48c08606cced --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerBackendChain : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerBackendChain)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("partitions"u8); + writer.WriteNumberValue(Partitions); + writer.WritePropertyName("redundancyFactor"u8); + writer.WriteNumberValue(RedundancyFactor); + if (Optional.IsDefined(Workers)) + { + writer.WritePropertyName("workers"u8); + writer.WriteNumberValue(Workers.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerBackendChain IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerBackendChain)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerBackendChain(document.RootElement, options); + } + + internal static BrokerBackendChain DeserializeBrokerBackendChain(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int partitions = default; + int redundancyFactor = default; + int? workers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("partitions"u8)) + { + partitions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("redundancyFactor"u8)) + { + redundancyFactor = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workers = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerBackendChain(partitions, redundancyFactor, workers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerBackendChain)} does not support writing '{options.Format}' format."); + } + } + + BrokerBackendChain IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerBackendChain(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerBackendChain)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.cs new file mode 100644 index 000000000000..baaf6d24062d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerBackendChain.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Desired properties of the backend instances of the broker. + public partial class BrokerBackendChain + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The desired number of physical backend partitions. + /// The desired numbers of backend replicas (pods) in a physical partition. + public BrokerBackendChain(int partitions, int redundancyFactor) + { + Partitions = partitions; + RedundancyFactor = redundancyFactor; + } + + /// Initializes a new instance of . + /// The desired number of physical backend partitions. + /// The desired numbers of backend replicas (pods) in a physical partition. + /// Number of logical backend workers per replica (pod). + /// Keeps track of any properties unknown to the library. + internal BrokerBackendChain(int partitions, int redundancyFactor, int? workers, IDictionary serializedAdditionalRawData) + { + Partitions = partitions; + RedundancyFactor = redundancyFactor; + Workers = workers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerBackendChain() + { + } + + /// The desired number of physical backend partitions. + public int Partitions { get; set; } + /// The desired numbers of backend replicas (pods) in a physical partition. + public int RedundancyFactor { get; set; } + /// Number of logical backend workers per replica (pod). + public int? Workers { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.Serialization.cs new file mode 100644 index 000000000000..52f5c57d001b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerCardinality : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerCardinality)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("backendChain"u8); + writer.WriteObjectValue(BackendChain, options); + writer.WritePropertyName("frontend"u8); + writer.WriteObjectValue(Frontend, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerCardinality IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerCardinality)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerCardinality(document.RootElement, options); + } + + internal static BrokerCardinality DeserializeBrokerCardinality(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerBackendChain backendChain = default; + BrokerFrontend frontend = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("backendChain"u8)) + { + backendChain = BrokerBackendChain.DeserializeBrokerBackendChain(property.Value, options); + continue; + } + if (property.NameEquals("frontend"u8)) + { + frontend = BrokerFrontend.DeserializeBrokerFrontend(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerCardinality(backendChain, frontend, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerCardinality)} does not support writing '{options.Format}' format."); + } + } + + BrokerCardinality IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerCardinality(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerCardinality)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.cs new file mode 100644 index 000000000000..b23711cf287a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerCardinality.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Cardinality properties. + public partial class BrokerCardinality + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The backend broker desired properties. + /// The frontend desired properties. + /// or is null. + public BrokerCardinality(BrokerBackendChain backendChain, BrokerFrontend frontend) + { + Argument.AssertNotNull(backendChain, nameof(backendChain)); + Argument.AssertNotNull(frontend, nameof(frontend)); + + BackendChain = backendChain; + Frontend = frontend; + } + + /// Initializes a new instance of . + /// The backend broker desired properties. + /// The frontend desired properties. + /// Keeps track of any properties unknown to the library. + internal BrokerCardinality(BrokerBackendChain backendChain, BrokerFrontend frontend, IDictionary serializedAdditionalRawData) + { + BackendChain = backendChain; + Frontend = frontend; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerCardinality() + { + } + + /// The backend broker desired properties. + public BrokerBackendChain BackendChain { get; set; } + /// The frontend desired properties. + public BrokerFrontend Frontend { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.Serialization.cs new file mode 100644 index 000000000000..de259286c1e0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerClientConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerClientConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxSessionExpirySeconds)) + { + writer.WritePropertyName("maxSessionExpirySeconds"u8); + writer.WriteNumberValue(MaxSessionExpirySeconds.Value); + } + if (Optional.IsDefined(MaxMessageExpirySeconds)) + { + writer.WritePropertyName("maxMessageExpirySeconds"u8); + writer.WriteNumberValue(MaxMessageExpirySeconds.Value); + } + if (Optional.IsDefined(MaxPacketSizeBytes)) + { + writer.WritePropertyName("maxPacketSizeBytes"u8); + writer.WriteNumberValue(MaxPacketSizeBytes.Value); + } + if (Optional.IsDefined(SubscriberQueueLimit)) + { + writer.WritePropertyName("subscriberQueueLimit"u8); + writer.WriteObjectValue(SubscriberQueueLimit, options); + } + if (Optional.IsDefined(MaxReceiveMaximum)) + { + writer.WritePropertyName("maxReceiveMaximum"u8); + writer.WriteNumberValue(MaxReceiveMaximum.Value); + } + if (Optional.IsDefined(MaxKeepAliveSeconds)) + { + writer.WritePropertyName("maxKeepAliveSeconds"u8); + writer.WriteNumberValue(MaxKeepAliveSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerClientConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerClientConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerClientConfig(document.RootElement, options); + } + + internal static BrokerClientConfig DeserializeBrokerClientConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxSessionExpirySeconds = default; + int? maxMessageExpirySeconds = default; + int? maxPacketSizeBytes = default; + SubscriberQueueLimit subscriberQueueLimit = default; + int? maxReceiveMaximum = default; + int? maxKeepAliveSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxSessionExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxSessionExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessageExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessageExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxPacketSizeBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxPacketSizeBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("subscriberQueueLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriberQueueLimit = SubscriberQueueLimit.DeserializeSubscriberQueueLimit(property.Value, options); + continue; + } + if (property.NameEquals("maxReceiveMaximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxReceiveMaximum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxKeepAliveSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxKeepAliveSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerClientConfig( + maxSessionExpirySeconds, + maxMessageExpirySeconds, + maxPacketSizeBytes, + subscriberQueueLimit, + maxReceiveMaximum, + maxKeepAliveSeconds, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerClientConfig)} does not support writing '{options.Format}' format."); + } + } + + BrokerClientConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerClientConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerClientConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.cs new file mode 100644 index 000000000000..065b32ebb626 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerClientConfig.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The settings of Client Config. + public partial class BrokerClientConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerClientConfig() + { + } + + /// Initializes a new instance of . + /// Upper bound of Session Expiry Interval, in seconds. + /// Upper bound of Message Expiry Interval, in seconds. + /// Max message size for a packet in Bytes. + /// The limit on the number of queued messages for a subscriber. + /// Upper bound of Receive Maximum that a client can request in the CONNECT packet. + /// Upper bound of a client's Keep Alive, in seconds. + /// Keeps track of any properties unknown to the library. + internal BrokerClientConfig(int? maxSessionExpirySeconds, int? maxMessageExpirySeconds, int? maxPacketSizeBytes, SubscriberQueueLimit subscriberQueueLimit, int? maxReceiveMaximum, int? maxKeepAliveSeconds, IDictionary serializedAdditionalRawData) + { + MaxSessionExpirySeconds = maxSessionExpirySeconds; + MaxMessageExpirySeconds = maxMessageExpirySeconds; + MaxPacketSizeBytes = maxPacketSizeBytes; + SubscriberQueueLimit = subscriberQueueLimit; + MaxReceiveMaximum = maxReceiveMaximum; + MaxKeepAliveSeconds = maxKeepAliveSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Upper bound of Session Expiry Interval, in seconds. + public int? MaxSessionExpirySeconds { get; set; } + /// Upper bound of Message Expiry Interval, in seconds. + public int? MaxMessageExpirySeconds { get; set; } + /// Max message size for a packet in Bytes. + public int? MaxPacketSizeBytes { get; set; } + /// The limit on the number of queued messages for a subscriber. + public SubscriberQueueLimit SubscriberQueueLimit { get; set; } + /// Upper bound of Receive Maximum that a client can request in the CONNECT packet. + public int? MaxReceiveMaximum { get; set; } + /// Upper bound of a client's Keep Alive, in seconds. + public int? MaxKeepAliveSeconds { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.Serialization.cs similarity index 55% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.Serialization.cs index 09f5be9b774c..997161e50418 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UserAuthenticationUpdate.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - public partial class UserAuthenticationUpdate : IUtf8JsonSerializable, IJsonModel + public partial class BrokerDiagnosticSelfCheck : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UserAuthenticationUpdate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BrokerDiagnosticSelfCheck)} does not support writing '{format}' format."); } if (Optional.IsDefined(Mode)) @@ -39,15 +39,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("mode"u8); writer.WriteStringValue(Mode.Value.ToString()); } - if (Optional.IsDefined(UsernamePasswordCredentials)) + if (Optional.IsDefined(IntervalSeconds)) { - writer.WritePropertyName("usernamePasswordCredentials"u8); - writer.WriteObjectValue(UsernamePasswordCredentials, options); + writer.WritePropertyName("intervalSeconds"u8); + writer.WriteNumberValue(IntervalSeconds.Value); } - if (Optional.IsDefined(X509Credentials)) + if (Optional.IsDefined(TimeoutSeconds)) { - writer.WritePropertyName("x509Credentials"u8); - writer.WriteObjectValue(X509Credentials, options); + writer.WritePropertyName("timeoutSeconds"u8); + writer.WriteNumberValue(TimeoutSeconds.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserAuthenticationUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BrokerDiagnosticSelfCheck IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UserAuthenticationUpdate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BrokerDiagnosticSelfCheck)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUserAuthenticationUpdate(document.RootElement, options); + return DeserializeBrokerDiagnosticSelfCheck(document.RootElement, options); } - internal static UserAuthenticationUpdate DeserializeUserAuthenticationUpdate(JsonElement element, ModelReaderWriterOptions options = null) + internal static BrokerDiagnosticSelfCheck DeserializeBrokerDiagnosticSelfCheck(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,9 +86,9 @@ internal static UserAuthenticationUpdate DeserializeUserAuthenticationUpdate(Jso { return null; } - UserAuthenticationMode? mode = default; - UsernamePasswordCredentialsUpdate usernamePasswordCredentials = default; - X509CredentialsUpdate x509Credentials = default; + IotOperationsOperationalMode? mode = default; + int? intervalSeconds = default; + int? timeoutSeconds = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -99,25 +99,25 @@ internal static UserAuthenticationUpdate DeserializeUserAuthenticationUpdate(Jso { continue; } - mode = new UserAuthenticationMode(property.Value.GetString()); + mode = new IotOperationsOperationalMode(property.Value.GetString()); continue; } - if (property.NameEquals("usernamePasswordCredentials"u8)) + if (property.NameEquals("intervalSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - usernamePasswordCredentials = UsernamePasswordCredentialsUpdate.DeserializeUsernamePasswordCredentialsUpdate(property.Value, options); + intervalSeconds = property.Value.GetInt32(); continue; } - if (property.NameEquals("x509Credentials"u8)) + if (property.NameEquals("timeoutSeconds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - x509Credentials = X509CredentialsUpdate.DeserializeX509CredentialsUpdate(property.Value, options); + timeoutSeconds = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -126,38 +126,38 @@ internal static UserAuthenticationUpdate DeserializeUserAuthenticationUpdate(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new UserAuthenticationUpdate(mode, usernamePasswordCredentials, x509Credentials, serializedAdditionalRawData); + return new BrokerDiagnosticSelfCheck(mode, intervalSeconds, timeoutSeconds, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UserAuthenticationUpdate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerDiagnosticSelfCheck)} does not support writing '{options.Format}' format."); } } - UserAuthenticationUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BrokerDiagnosticSelfCheck IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUserAuthenticationUpdate(document.RootElement, options); + return DeserializeBrokerDiagnosticSelfCheck(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UserAuthenticationUpdate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerDiagnosticSelfCheck)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.cs new file mode 100644 index 000000000000..32c48926e084 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticSelfCheck.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Diagnostic Self check properties. + public partial class BrokerDiagnosticSelfCheck + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerDiagnosticSelfCheck() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable self check. + /// The self check interval. + /// The timeout for self check. + /// Keeps track of any properties unknown to the library. + internal BrokerDiagnosticSelfCheck(IotOperationsOperationalMode? mode, int? intervalSeconds, int? timeoutSeconds, IDictionary serializedAdditionalRawData) + { + Mode = mode; + IntervalSeconds = intervalSeconds; + TimeoutSeconds = timeoutSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable self check. + public IotOperationsOperationalMode? Mode { get; set; } + /// The self check interval. + public int? IntervalSeconds { get; set; } + /// The timeout for self check. + public int? TimeoutSeconds { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.Serialization.cs new file mode 100644 index 000000000000..1001dbff7d70 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerDiagnosticTraces : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnosticTraces)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(CacheSizeMegabytes)) + { + writer.WritePropertyName("cacheSizeMegabytes"u8); + writer.WriteNumberValue(CacheSizeMegabytes.Value); + } + if (Optional.IsDefined(SelfTracing)) + { + writer.WritePropertyName("selfTracing"u8); + writer.WriteObjectValue(SelfTracing, options); + } + if (Optional.IsDefined(SpanChannelCapacity)) + { + writer.WritePropertyName("spanChannelCapacity"u8); + writer.WriteNumberValue(SpanChannelCapacity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerDiagnosticTraces IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnosticTraces)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerDiagnosticTraces(document.RootElement, options); + } + + internal static BrokerDiagnosticTraces DeserializeBrokerDiagnosticTraces(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? mode = default; + int? cacheSizeMegabytes = default; + DiagnosticSelfTracing selfTracing = default; + int? spanChannelCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("cacheSizeMegabytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cacheSizeMegabytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("selfTracing"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfTracing = DiagnosticSelfTracing.DeserializeDiagnosticSelfTracing(property.Value, options); + continue; + } + if (property.NameEquals("spanChannelCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spanChannelCapacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerDiagnosticTraces(mode, cacheSizeMegabytes, selfTracing, spanChannelCapacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerDiagnosticTraces)} does not support writing '{options.Format}' format."); + } + } + + BrokerDiagnosticTraces IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerDiagnosticTraces(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerDiagnosticTraces)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.cs new file mode 100644 index 000000000000..4b25b5f3d110 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnosticTraces.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Diagnostic Trace properties. + public partial class BrokerDiagnosticTraces + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerDiagnosticTraces() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable traces. + /// The cache size in megabytes. + /// The self tracing properties. + /// The span channel capacity. + /// Keeps track of any properties unknown to the library. + internal BrokerDiagnosticTraces(IotOperationsOperationalMode? mode, int? cacheSizeMegabytes, DiagnosticSelfTracing selfTracing, int? spanChannelCapacity, IDictionary serializedAdditionalRawData) + { + Mode = mode; + CacheSizeMegabytes = cacheSizeMegabytes; + SelfTracing = selfTracing; + SpanChannelCapacity = spanChannelCapacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable traces. + public IotOperationsOperationalMode? Mode { get; set; } + /// The cache size in megabytes. + public int? CacheSizeMegabytes { get; set; } + /// The self tracing properties. + public DiagnosticSelfTracing SelfTracing { get; set; } + /// The span channel capacity. + public int? SpanChannelCapacity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs new file mode 100644 index 000000000000..f472d08fa804 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Logs)) + { + writer.WritePropertyName("logs"u8); + writer.WriteObjectValue(Logs, options); + } + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + if (Optional.IsDefined(SelfCheck)) + { + writer.WritePropertyName("selfCheck"u8); + writer.WriteObjectValue(SelfCheck, options); + } + if (Optional.IsDefined(Traces)) + { + writer.WritePropertyName("traces"u8); + writer.WriteObjectValue(Traces, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerDiagnostics(document.RootElement, options); + } + + internal static BrokerDiagnostics DeserializeBrokerDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiagnosticsLogs logs = default; + IotOperationsMetrics metrics = default; + BrokerDiagnosticSelfCheck selfCheck = default; + BrokerDiagnosticTraces traces = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logs = DiagnosticsLogs.DeserializeDiagnosticsLogs(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = IotOperationsMetrics.DeserializeIotOperationsMetrics(property.Value, options); + continue; + } + if (property.NameEquals("selfCheck"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfCheck = BrokerDiagnosticSelfCheck.DeserializeBrokerDiagnosticSelfCheck(property.Value, options); + continue; + } + if (property.NameEquals("traces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + traces = BrokerDiagnosticTraces.DeserializeBrokerDiagnosticTraces(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerDiagnostics(logs, metrics, selfCheck, traces, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + BrokerDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.cs new file mode 100644 index 000000000000..8469121b8947 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerDiagnostics.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Diagnostic Setting properties. + public partial class BrokerDiagnostics + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BrokerDiagnostics() + { + } + + /// Initializes a new instance of . + /// Diagnostic log settings for the resource. + /// The metrics settings for the resource. + /// The self check properties. + /// The trace properties. + /// Keeps track of any properties unknown to the library. + internal BrokerDiagnostics(DiagnosticsLogs logs, IotOperationsMetrics metrics, BrokerDiagnosticSelfCheck selfCheck, BrokerDiagnosticTraces traces, IDictionary serializedAdditionalRawData) + { + Logs = logs; + Metrics = metrics; + SelfCheck = selfCheck; + Traces = traces; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Diagnostic log settings for the resource. + internal DiagnosticsLogs Logs { get; set; } + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string LogsLevel + { + get => Logs is null ? default : Logs.Level; + set + { + if (Logs is null) + Logs = new DiagnosticsLogs(); + Logs.Level = value; + } + } + + /// The metrics settings for the resource. + internal IotOperationsMetrics Metrics { get; set; } + /// The prometheus port to expose the metrics. + public int? MetricsPrometheusPort + { + get => Metrics is null ? default : Metrics.PrometheusPort; + set + { + if (Metrics is null) + Metrics = new IotOperationsMetrics(); + Metrics.PrometheusPort = value; + } + } + + /// The self check properties. + public BrokerDiagnosticSelfCheck SelfCheck { get; set; } + /// The trace properties. + public BrokerDiagnosticTraces Traces { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.Serialization.cs similarity index 57% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.Serialization.cs index 351e3dc20a15..49bc68ac8872 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/OwnCertificate.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - public partial class OwnCertificate : IUtf8JsonSerializable, IJsonModel + public partial class BrokerFrontend : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,26 +28,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OwnCertificate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BrokerFrontend)} does not support writing '{format}' format."); } - if (Optional.IsDefined(CertThumbprint)) + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas); + if (Optional.IsDefined(Workers)) { - writer.WritePropertyName("certThumbprint"u8); - writer.WriteStringValue(CertThumbprint); - } - if (Optional.IsDefined(CertSecretReference)) - { - writer.WritePropertyName("certSecretReference"u8); - writer.WriteStringValue(CertSecretReference); - } - if (Optional.IsDefined(CertPasswordReference)) - { - writer.WritePropertyName("certPasswordReference"u8); - writer.WriteStringValue(CertPasswordReference); + writer.WritePropertyName("workers"u8); + writer.WriteNumberValue(Workers.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OwnCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BrokerFrontend IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OwnCertificate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BrokerFrontend)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOwnCertificate(document.RootElement, options); + return DeserializeBrokerFrontend(document.RootElement, options); } - internal static OwnCertificate DeserializeOwnCertificate(JsonElement element, ModelReaderWriterOptions options = null) + internal static BrokerFrontend DeserializeBrokerFrontend(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,26 +78,24 @@ internal static OwnCertificate DeserializeOwnCertificate(JsonElement element, Mo { return null; } - string certThumbprint = default; - string certSecretReference = default; - string certPasswordReference = default; + int replicas = default; + int? workers = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("certThumbprint"u8)) + if (property.NameEquals("replicas"u8)) { - certThumbprint = property.Value.GetString(); + replicas = property.Value.GetInt32(); continue; } - if (property.NameEquals("certSecretReference"u8)) + if (property.NameEquals("workers"u8)) { - certSecretReference = property.Value.GetString(); - continue; - } - if (property.NameEquals("certPasswordReference"u8)) - { - certPasswordReference = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workers = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -114,38 +104,38 @@ internal static OwnCertificate DeserializeOwnCertificate(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new OwnCertificate(certThumbprint, certSecretReference, certPasswordReference, serializedAdditionalRawData); + return new BrokerFrontend(replicas, workers, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OwnCertificate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerFrontend)} does not support writing '{options.Format}' format."); } } - OwnCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BrokerFrontend IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOwnCertificate(document.RootElement, options); + return DeserializeBrokerFrontend(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OwnCertificate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerFrontend)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.cs new file mode 100644 index 000000000000..621e78510745 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerFrontend.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The desired properties of the frontend instances of the Broker. + public partial class BrokerFrontend + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The desired number of frontend instances (pods). + public BrokerFrontend(int replicas) + { + Replicas = replicas; + } + + /// Initializes a new instance of . + /// The desired number of frontend instances (pods). + /// Number of logical frontend workers per instance (pod). + /// Keeps track of any properties unknown to the library. + internal BrokerFrontend(int replicas, int? workers, IDictionary serializedAdditionalRawData) + { + Replicas = replicas; + Workers = workers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerFrontend() + { + } + + /// The desired number of frontend instances (pods). + public int Replicas { get; set; } + /// Number of logical frontend workers per instance (pod). + public int? Workers { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.Serialization.cs new file mode 100644 index 000000000000..97b276efe40b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerListenerPort : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerPort)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AuthenticationRef)) + { + writer.WritePropertyName("authenticationRef"u8); + writer.WriteStringValue(AuthenticationRef); + } + if (Optional.IsDefined(AuthorizationRef)) + { + writer.WritePropertyName("authorizationRef"u8); + writer.WriteStringValue(AuthorizationRef); + } + if (Optional.IsDefined(NodePort)) + { + writer.WritePropertyName("nodePort"u8); + writer.WriteNumberValue(NodePort.Value); + } + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerListenerPort IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerPort)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerListenerPort(document.RootElement, options); + } + + internal static BrokerListenerPort DeserializeBrokerListenerPort(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string authenticationRef = default; + string authorizationRef = default; + int? nodePort = default; + int port = default; + BrokerProtocolType? protocol = default; + ListenerPortTlsCertMethod tls = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationRef"u8)) + { + authenticationRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("authorizationRef"u8)) + { + authorizationRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodePort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodePort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new BrokerProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = ListenerPortTlsCertMethod.DeserializeListenerPortTlsCertMethod(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerListenerPort( + authenticationRef, + authorizationRef, + nodePort, + port, + protocol, + tls, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerListenerPort)} does not support writing '{options.Format}' format."); + } + } + + BrokerListenerPort IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerListenerPort(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerListenerPort)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.cs new file mode 100644 index 000000000000..5c4eace07a9c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerPort.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Defines a TCP port on which a `BrokerListener` listens. + public partial class BrokerListenerPort + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// TCP port for accepting client connections. + public BrokerListenerPort(int port) + { + Port = port; + } + + /// Initializes a new instance of . + /// Reference to client authentication settings. Omit to disable authentication. + /// Reference to client authorization settings. Omit to disable authorization. + /// Kubernetes node port. Only relevant when this port is associated with a `NodePort` listener. + /// TCP port for accepting client connections. + /// Protocol to use for client connections. + /// TLS server certificate settings for this port. Omit to disable TLS. + /// Keeps track of any properties unknown to the library. + internal BrokerListenerPort(string authenticationRef, string authorizationRef, int? nodePort, int port, BrokerProtocolType? protocol, ListenerPortTlsCertMethod tls, IDictionary serializedAdditionalRawData) + { + AuthenticationRef = authenticationRef; + AuthorizationRef = authorizationRef; + NodePort = nodePort; + Port = port; + Protocol = protocol; + Tls = tls; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerListenerPort() + { + } + + /// Reference to client authentication settings. Omit to disable authentication. + public string AuthenticationRef { get; set; } + /// Reference to client authorization settings. Omit to disable authorization. + public string AuthorizationRef { get; set; } + /// Kubernetes node port. Only relevant when this port is associated with a `NodePort` listener. + public int? NodePort { get; set; } + /// TCP port for accepting client connections. + public int Port { get; set; } + /// Protocol to use for client connections. + public BrokerProtocolType? Protocol { get; set; } + /// TLS server certificate settings for this port. Omit to disable TLS. + public ListenerPortTlsCertMethod Tls { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..f490959735c4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerListenerResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerListenerResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerListenerResourceListResult(document.RootElement, options); + } + + internal static BrokerListenerResourceListResult DeserializeBrokerListenerResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerListenerResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerListenerResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerListenerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.cs new file mode 100644 index 000000000000..cfabff3b0ef6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerListenerResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a BrokerListenerResource list operation. + internal partial class BrokerListenerResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BrokerListenerResource items on this page. + /// is null. + internal BrokerListenerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerListenerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerListenerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerListenerResourceListResult() + { + } + + /// The BrokerListenerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerMemoryProfile.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerMemoryProfile.cs new file mode 100644 index 000000000000..79d58c27d43f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerMemoryProfile.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The memory profile settings of the Broker. + public readonly partial struct BrokerMemoryProfile : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerMemoryProfile(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TinyValue = "Tiny"; + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Tiny memory profile. + public static BrokerMemoryProfile Tiny { get; } = new BrokerMemoryProfile(TinyValue); + /// Low memory profile. + public static BrokerMemoryProfile Low { get; } = new BrokerMemoryProfile(LowValue); + /// Medium memory profile. + public static BrokerMemoryProfile Medium { get; } = new BrokerMemoryProfile(MediumValue); + /// High memory profile. + public static BrokerMemoryProfile High { get; } = new BrokerMemoryProfile(HighValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerMemoryProfile left, BrokerMemoryProfile right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerMemoryProfile left, BrokerMemoryProfile right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerMemoryProfile(string value) => new BrokerMemoryProfile(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerMemoryProfile other && Equals(other); + /// + public bool Equals(BrokerMemoryProfile other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerOperatorValue.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerOperatorValue.cs new file mode 100644 index 000000000000..4ecabff851b8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerOperatorValue.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Valid operators are In, NotIn, Exists and DoesNotExist. + public readonly partial struct BrokerOperatorValue : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerOperatorValue(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InValue = "In"; + private const string NotInValue = "NotIn"; + private const string ExistsValue = "Exists"; + private const string DoesNotExistValue = "DoesNotExist"; + + /// In operator. + public static BrokerOperatorValue In { get; } = new BrokerOperatorValue(InValue); + /// NotIn operator. + public static BrokerOperatorValue NotIn { get; } = new BrokerOperatorValue(NotInValue); + /// Exists operator. + public static BrokerOperatorValue Exists { get; } = new BrokerOperatorValue(ExistsValue); + /// DoesNotExist operator. + public static BrokerOperatorValue DoesNotExist { get; } = new BrokerOperatorValue(DoesNotExistValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerOperatorValue left, BrokerOperatorValue right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerOperatorValue left, BrokerOperatorValue right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerOperatorValue(string value) => new BrokerOperatorValue(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerOperatorValue other && Equals(other); + /// + public bool Equals(BrokerOperatorValue other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerProtocolType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerProtocolType.cs new file mode 100644 index 000000000000..d120021ddd81 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerProtocolType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Protocol types. + public readonly partial struct BrokerProtocolType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerProtocolType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MqttValue = "Mqtt"; + private const string WebSocketsValue = "WebSockets"; + + /// protocol broker. + public static BrokerProtocolType Mqtt { get; } = new BrokerProtocolType(MqttValue); + /// protocol websocket. + public static BrokerProtocolType WebSockets { get; } = new BrokerProtocolType(WebSocketsValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerProtocolType left, BrokerProtocolType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerProtocolType left, BrokerProtocolType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerProtocolType(string value) => new BrokerProtocolType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerProtocolType other && Equals(other); + /// + public bool Equals(BrokerProtocolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs new file mode 100644 index 000000000000..3178f23a44bb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// BrokerResourceDefinitionMethods methods allowed. + public readonly partial struct BrokerResourceDefinitionMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerResourceDefinitionMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConnectValue = "Connect"; + private const string PublishValue = "Publish"; + private const string SubscribeValue = "Subscribe"; + + /// Allowed Connecting to Broker. + public static BrokerResourceDefinitionMethod Connect { get; } = new BrokerResourceDefinitionMethod(ConnectValue); + /// Allowed Publishing to Broker. + public static BrokerResourceDefinitionMethod Publish { get; } = new BrokerResourceDefinitionMethod(PublishValue); + /// Allowed Subscribing to Broker. + public static BrokerResourceDefinitionMethod Subscribe { get; } = new BrokerResourceDefinitionMethod(SubscribeValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerResourceDefinitionMethod left, BrokerResourceDefinitionMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerResourceDefinitionMethod left, BrokerResourceDefinitionMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerResourceDefinitionMethod(string value) => new BrokerResourceDefinitionMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerResourceDefinitionMethod other && Equals(other); + /// + public bool Equals(BrokerResourceDefinitionMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..1268dc5ec9d6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class BrokerResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerResourceListResult(document.RootElement, options); + } + + internal static BrokerResourceListResult DeserializeBrokerResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsBrokerData.DeserializeIotOperationsBrokerData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.cs new file mode 100644 index 000000000000..8b9c8a284ae9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a BrokerResource list operation. + internal partial class BrokerResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BrokerResource items on this page. + /// is null. + internal BrokerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerResourceListResult() + { + } + + /// The BrokerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs new file mode 100644 index 000000000000..e7bb48790629 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class BrokerResourceRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsCollectionDefined(ClientIds)) + { + writer.WritePropertyName("clientIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Topics)) + { + writer.WritePropertyName("topics"u8); + writer.WriteStartArray(); + foreach (var item in Topics) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerResourceRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerResourceRule(document.RootElement, options); + } + + internal static BrokerResourceRule DeserializeBrokerResourceRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerResourceDefinitionMethod method = default; + IList clientIds = default; + IList topics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new BrokerResourceDefinitionMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + clientIds = array; + continue; + } + if (property.NameEquals("topics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + topics = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerResourceRule(method, clientIds ?? new ChangeTrackingList(), topics ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support writing '{options.Format}' format."); + } + } + + BrokerResourceRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerResourceRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.cs new file mode 100644 index 000000000000..6bb64d25fa89 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/BrokerResourceRule.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Resource Rule properties. This defines the objects that represent the actions or topics, such as - method.Connect, method.Publish, etc. + public partial class BrokerResourceRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + public BrokerResourceRule(BrokerResourceDefinitionMethod method) + { + Method = method; + ClientIds = new ChangeTrackingList(); + Topics = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. This subfield may be set if the method is Connect. + /// A list of topics or topic patterns that match the topics that the clients can publish or subscribe to. This subfield is required if the method is Publish or Subscribe. + /// Keeps track of any properties unknown to the library. + internal BrokerResourceRule(BrokerResourceDefinitionMethod method, IList clientIds, IList topics, IDictionary serializedAdditionalRawData) + { + Method = method; + ClientIds = clientIds; + Topics = topics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerResourceRule() + { + } + + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + public BrokerResourceDefinitionMethod Method { get; set; } + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. This subfield may be set if the method is Connect. + public IList ClientIds { get; } + /// A list of topics or topic patterns that match the topics that the clients can publish or subscribe to. This subfield is required if the method is Publish or Subscribe. + public IList Topics { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs new file mode 100644 index 000000000000..7154d0604387 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class CertManagerCertConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration); + writer.WritePropertyName("renewBefore"u8); + writer.WriteStringValue(RenewBefore); + writer.WritePropertyName("privateKey"u8); + writer.WriteObjectValue(PrivateKey, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerCertConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerCertConfig(document.RootElement, options); + } + + internal static CertManagerCertConfig DeserializeCertManagerCertConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string duration = default; + string renewBefore = default; + CertManagerPrivateKey privateKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("renewBefore"u8)) + { + renewBefore = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + privateKey = CertManagerPrivateKey.DeserializeCertManagerPrivateKey(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerCertConfig(duration, renewBefore, privateKey, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support writing '{options.Format}' format."); + } + } + + CertManagerCertConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerCertConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.cs new file mode 100644 index 000000000000..0fce36ef4b68 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertConfig.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Cert Manager Cert properties. + public partial class CertManagerCertConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Configuration of certificate private key. + /// , or is null. + public CertManagerCertConfig(string duration, string renewBefore, CertManagerPrivateKey privateKey) + { + Argument.AssertNotNull(duration, nameof(duration)); + Argument.AssertNotNull(renewBefore, nameof(renewBefore)); + Argument.AssertNotNull(privateKey, nameof(privateKey)); + + Duration = duration; + RenewBefore = renewBefore; + PrivateKey = privateKey; + } + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Configuration of certificate private key. + /// Keeps track of any properties unknown to the library. + internal CertManagerCertConfig(string duration, string renewBefore, CertManagerPrivateKey privateKey, IDictionary serializedAdditionalRawData) + { + Duration = duration; + RenewBefore = renewBefore; + PrivateKey = privateKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerCertConfig() + { + } + + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string Duration { get; set; } + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string RenewBefore { get; set; } + /// Configuration of certificate private key. + public CertManagerPrivateKey PrivateKey { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs new file mode 100644 index 000000000000..ea8be1a2ee0c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class CertManagerCertificateSpec : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration); + } + if (Optional.IsDefined(SecretName)) + { + writer.WritePropertyName("secretName"u8); + writer.WriteStringValue(SecretName); + } + if (Optional.IsDefined(RenewBefore)) + { + writer.WritePropertyName("renewBefore"u8); + writer.WriteStringValue(RenewBefore); + } + writer.WritePropertyName("issuerRef"u8); + writer.WriteObjectValue(IssuerRef, options); + if (Optional.IsDefined(PrivateKey)) + { + writer.WritePropertyName("privateKey"u8); + writer.WriteObjectValue(PrivateKey, options); + } + if (Optional.IsDefined(San)) + { + writer.WritePropertyName("san"u8); + writer.WriteObjectValue(San, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerCertificateSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerCertificateSpec(document.RootElement, options); + } + + internal static CertManagerCertificateSpec DeserializeCertManagerCertificateSpec(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string duration = default; + string secretName = default; + string renewBefore = default; + CertManagerIssuerRef issuerRef = default; + CertManagerPrivateKey privateKey = default; + SanForCert san = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretName"u8)) + { + secretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("renewBefore"u8)) + { + renewBefore = property.Value.GetString(); + continue; + } + if (property.NameEquals("issuerRef"u8)) + { + issuerRef = CertManagerIssuerRef.DeserializeCertManagerIssuerRef(property.Value, options); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateKey = CertManagerPrivateKey.DeserializeCertManagerPrivateKey(property.Value, options); + continue; + } + if (property.NameEquals("san"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + san = SanForCert.DeserializeSanForCert(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerCertificateSpec( + duration, + secretName, + renewBefore, + issuerRef, + privateKey, + san, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support writing '{options.Format}' format."); + } + } + + CertManagerCertificateSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerCertificateSpec(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.cs new file mode 100644 index 000000000000..72e6e3d2ee80 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerCertificateSpec.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Automatic TLS server certificate management with cert-manager. + public partial class CertManagerCertificateSpec + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// cert-manager issuerRef. + /// is null. + public CertManagerCertificateSpec(CertManagerIssuerRef issuerRef) + { + Argument.AssertNotNull(issuerRef, nameof(issuerRef)); + + IssuerRef = issuerRef; + } + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Secret for storing server certificate. Any existing data will be overwritten. This is a reference to the secret through an identifying name, not the secret itself. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// cert-manager issuerRef. + /// Type of certificate private key. + /// Additional Subject Alternative Names (SANs) to include in the certificate. + /// Keeps track of any properties unknown to the library. + internal CertManagerCertificateSpec(string duration, string secretName, string renewBefore, CertManagerIssuerRef issuerRef, CertManagerPrivateKey privateKey, SanForCert san, IDictionary serializedAdditionalRawData) + { + Duration = duration; + SecretName = secretName; + RenewBefore = renewBefore; + IssuerRef = issuerRef; + PrivateKey = privateKey; + San = san; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerCertificateSpec() + { + } + + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string Duration { get; set; } + /// Secret for storing server certificate. Any existing data will be overwritten. This is a reference to the secret through an identifying name, not the secret itself. + public string SecretName { get; set; } + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string RenewBefore { get; set; } + /// cert-manager issuerRef. + public CertManagerIssuerRef IssuerRef { get; set; } + /// Type of certificate private key. + public CertManagerPrivateKey PrivateKey { get; set; } + /// Additional Subject Alternative Names (SANs) to include in the certificate. + public SanForCert San { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerKind.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerKind.cs new file mode 100644 index 000000000000..324d892c4d4f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// CertManagerIssuerKind properties. + public readonly partial struct CertManagerIssuerKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CertManagerIssuerKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IssuerValue = "Issuer"; + private const string ClusterIssuerValue = "ClusterIssuer"; + + /// Issuer kind. + public static CertManagerIssuerKind Issuer { get; } = new CertManagerIssuerKind(IssuerValue); + /// ClusterIssuer kind. + public static CertManagerIssuerKind ClusterIssuer { get; } = new CertManagerIssuerKind(ClusterIssuerValue); + /// Determines if two values are the same. + public static bool operator ==(CertManagerIssuerKind left, CertManagerIssuerKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CertManagerIssuerKind left, CertManagerIssuerKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CertManagerIssuerKind(string value) => new CertManagerIssuerKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CertManagerIssuerKind other && Equals(other); + /// + public bool Equals(CertManagerIssuerKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs new file mode 100644 index 000000000000..3beebfc81754 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class CertManagerIssuerRef : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerIssuerRef IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerIssuerRef(document.RootElement, options); + } + + internal static CertManagerIssuerRef DeserializeCertManagerIssuerRef(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string group = default; + CertManagerIssuerKind kind = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("group"u8)) + { + group = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CertManagerIssuerKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerIssuerRef(group, kind, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support writing '{options.Format}' format."); + } + } + + CertManagerIssuerRef IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerIssuerRef(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.cs new file mode 100644 index 000000000000..a4bebbc9067a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerIssuerRef.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Cert-Manager issuerRef properties. + public partial class CertManagerIssuerRef + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// group of issuer. + /// kind of issuer (Issuer or ClusterIssuer). + /// name of issuer. + /// or is null. + public CertManagerIssuerRef(string group, CertManagerIssuerKind kind, string name) + { + Argument.AssertNotNull(group, nameof(group)); + Argument.AssertNotNull(name, nameof(name)); + + Group = group; + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// group of issuer. + /// kind of issuer (Issuer or ClusterIssuer). + /// name of issuer. + /// Keeps track of any properties unknown to the library. + internal CertManagerIssuerRef(string group, CertManagerIssuerKind kind, string name, IDictionary serializedAdditionalRawData) + { + Group = group; + Kind = kind; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerIssuerRef() + { + } + + /// group of issuer. + public string Group { get; set; } + /// kind of issuer (Issuer or ClusterIssuer). + public CertManagerIssuerKind Kind { get; set; } + /// name of issuer. + public string Name { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs new file mode 100644 index 000000000000..e6dfd3deeca9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class CertManagerPrivateKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("algorithm"u8); + writer.WriteStringValue(Algorithm.ToString()); + writer.WritePropertyName("rotationPolicy"u8); + writer.WriteStringValue(RotationPolicy.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerPrivateKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerPrivateKey(document.RootElement, options); + } + + internal static CertManagerPrivateKey DeserializeCertManagerPrivateKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PrivateKeyAlgorithm algorithm = default; + PrivateKeyRotationPolicy rotationPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("algorithm"u8)) + { + algorithm = new PrivateKeyAlgorithm(property.Value.GetString()); + continue; + } + if (property.NameEquals("rotationPolicy"u8)) + { + rotationPolicy = new PrivateKeyRotationPolicy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerPrivateKey(algorithm, rotationPolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support writing '{options.Format}' format."); + } + } + + CertManagerPrivateKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerPrivateKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.cs new file mode 100644 index 000000000000..8b47bdaa6136 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CertManagerPrivateKey.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Cert Manager private key properties. + public partial class CertManagerPrivateKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// algorithm for private key. + /// cert-manager private key rotationPolicy. + public CertManagerPrivateKey(PrivateKeyAlgorithm algorithm, PrivateKeyRotationPolicy rotationPolicy) + { + Algorithm = algorithm; + RotationPolicy = rotationPolicy; + } + + /// Initializes a new instance of . + /// algorithm for private key. + /// cert-manager private key rotationPolicy. + /// Keeps track of any properties unknown to the library. + internal CertManagerPrivateKey(PrivateKeyAlgorithm algorithm, PrivateKeyRotationPolicy rotationPolicy, IDictionary serializedAdditionalRawData) + { + Algorithm = algorithm; + RotationPolicy = rotationPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerPrivateKey() + { + } + + /// algorithm for private key. + public PrivateKeyAlgorithm Algorithm { get; set; } + /// cert-manager private key rotationPolicy. + public PrivateKeyRotationPolicy RotationPolicy { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CloudEventAttributeType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CloudEventAttributeType.cs new file mode 100644 index 000000000000..36316dd74dd7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/CloudEventAttributeType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// How to map events to the cloud. + public readonly partial struct CloudEventAttributeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudEventAttributeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PropagateValue = "Propagate"; + private const string CreateOrRemapValue = "CreateOrRemap"; + + /// Propagate type. + public static CloudEventAttributeType Propagate { get; } = new CloudEventAttributeType(PropagateValue); + /// CreateOrRemap type. + public static CloudEventAttributeType CreateOrRemap { get; } = new CloudEventAttributeType(CreateOrRemapValue); + /// Determines if two values are the same. + public static bool operator ==(CloudEventAttributeType left, CloudEventAttributeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudEventAttributeType left, CloudEventAttributeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudEventAttributeType(string value) => new CloudEventAttributeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudEventAttributeType other && Equals(other); + /// + public bool Equals(CloudEventAttributeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataExplorerAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataExplorerAuthMethod.cs new file mode 100644 index 000000000000..d494a04ab05c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataExplorerAuthMethod.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Data Explorer Authentication Method properties. + public readonly partial struct DataExplorerAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataExplorerAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + + /// SystemAssignedManagedIdentity type. + public static DataExplorerAuthMethod SystemAssignedManagedIdentity { get; } = new DataExplorerAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static DataExplorerAuthMethod UserAssignedManagedIdentity { get; } = new DataExplorerAuthMethod(UserAssignedManagedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(DataExplorerAuthMethod left, DataExplorerAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataExplorerAuthMethod left, DataExplorerAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataExplorerAuthMethod(string value) => new DataExplorerAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataExplorerAuthMethod other && Equals(other); + /// + public bool Equals(DataExplorerAuthMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs new file mode 100644 index 000000000000..70b1b1583ca6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Data Lake Storage Authentication Method properties. + public readonly partial struct DataLakeStorageAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataLakeStorageAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string AccessTokenValue = "AccessToken"; + + /// SystemAssignedManagedIdentity type. + public static DataLakeStorageAuthMethod SystemAssignedManagedIdentity { get; } = new DataLakeStorageAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static DataLakeStorageAuthMethod UserAssignedManagedIdentity { get; } = new DataLakeStorageAuthMethod(UserAssignedManagedIdentityValue); + /// AccessToken Option. + public static DataLakeStorageAuthMethod AccessToken { get; } = new DataLakeStorageAuthMethod(AccessTokenValue); + /// Determines if two values are the same. + public static bool operator ==(DataLakeStorageAuthMethod left, DataLakeStorageAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataLakeStorageAuthMethod left, DataLakeStorageAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataLakeStorageAuthMethod(string value) => new DataLakeStorageAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataLakeStorageAuthMethod other && Equals(other); + /// + public bool Equals(DataLakeStorageAuthMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs new file mode 100644 index 000000000000..fa2391f34c40 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowBuiltInTransformationDataset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationDataset(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationDataset DeserializeDataflowBuiltInTransformationDataset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string description = default; + string schemaRef = default; + IList inputs = default; + string expression = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationDataset( + key, + description, + schemaRef, + inputs, + expression, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationDataset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs new file mode 100644 index 000000000000..7ad875930df3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow BuiltIn Transformation dataset properties. + public partial class DataflowBuiltInTransformationDataset + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The key of the dataset. + /// List of fields for enriching from the Broker State Store. + /// or is null. + public DataflowBuiltInTransformationDataset(string key, IEnumerable inputs) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(inputs, nameof(inputs)); + + Key = key; + Inputs = inputs.ToList(); + } + + /// Initializes a new instance of . + /// The key of the dataset. + /// A user provided optional description of the dataset. + /// The reference to the schema that describes the dataset. Allowed: JSON Schema/draft-7. + /// List of fields for enriching from the Broker State Store. + /// Condition to enrich data from Broker State Store. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationDataset(string key, string description, string schemaRef, IList inputs, string expression, IDictionary serializedAdditionalRawData) + { + Key = key; + Description = description; + SchemaRef = schemaRef; + Inputs = inputs; + Expression = expression; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationDataset() + { + } + + /// The key of the dataset. + public string Key { get; set; } + /// A user provided optional description of the dataset. + public string Description { get; set; } + /// The reference to the schema that describes the dataset. Allowed: JSON Schema/draft-7. + public string SchemaRef { get; set; } + /// List of fields for enriching from the Broker State Store. + public IList Inputs { get; } + /// Condition to enrich data from Broker State Store. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + public string Expression { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs new file mode 100644 index 000000000000..c289c2bec612 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowBuiltInTransformationFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationFilter(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationFilter DeserializeDataflowBuiltInTransformationFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowFilterType? type = default; + string description = default; + IList inputs = default; + string expression = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new DataflowFilterType(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationFilter(type, description, inputs, expression, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs new file mode 100644 index 000000000000..72ea32123f36 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow BuiltIn Transformation filter properties. + public partial class DataflowBuiltInTransformationFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of fields for filtering in JSON path expression. + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// or is null. + public DataflowBuiltInTransformationFilter(IEnumerable inputs, string expression) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(expression, nameof(expression)); + + Inputs = inputs.ToList(); + Expression = expression; + } + + /// Initializes a new instance of . + /// The type of dataflow operation. + /// A user provided optional description of the filter. + /// List of fields for filtering in JSON path expression. + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationFilter(DataflowFilterType? type, string description, IList inputs, string expression, IDictionary serializedAdditionalRawData) + { + Type = type; + Description = description; + Inputs = inputs; + Expression = expression; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationFilter() + { + } + + /// The type of dataflow operation. + public DataflowFilterType? Type { get; set; } + /// A user provided optional description of the filter. + public string Description { get; set; } + /// List of fields for filtering in JSON path expression. + public IList Inputs { get; } + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + public string Expression { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs new file mode 100644 index 000000000000..b2fc5983b576 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowBuiltInTransformationMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + writer.WritePropertyName("output"u8); + writer.WriteStringValue(Output); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationMap IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationMap(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationMap DeserializeDataflowBuiltInTransformationMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowMappingType? type = default; + string description = default; + IList inputs = default; + string expression = default; + string output = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new DataflowMappingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (property.NameEquals("output"u8)) + { + output = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationMap( + type, + description, + inputs, + expression, + output, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs new file mode 100644 index 000000000000..35b97d6282bb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow BuiltIn Transformation map properties. + public partial class DataflowBuiltInTransformationMap + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of fields for mapping in JSON path expression. + /// Where and how the input fields to be organized in the output record. + /// or is null. + public DataflowBuiltInTransformationMap(IEnumerable inputs, string output) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(output, nameof(output)); + + Inputs = inputs.ToList(); + Output = output; + } + + /// Initializes a new instance of . + /// Type of transformation. + /// A user provided optional description of the mapping function. + /// List of fields for mapping in JSON path expression. + /// Modify the inputs field(s) to the final output field. Example: $1 * 2.2 (Assuming inputs section $1 is provided). + /// Where and how the input fields to be organized in the output record. + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationMap(DataflowMappingType? type, string description, IList inputs, string expression, string output, IDictionary serializedAdditionalRawData) + { + Type = type; + Description = description; + Inputs = inputs; + Expression = expression; + Output = output; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationMap() + { + } + + /// Type of transformation. + public DataflowMappingType? Type { get; set; } + /// A user provided optional description of the mapping function. + public string Description { get; set; } + /// List of fields for mapping in JSON path expression. + public IList Inputs { get; } + /// Modify the inputs field(s) to the final output field. Example: $1 * 2.2 (Assuming inputs section $1 is provided). + public string Expression { get; set; } + /// Where and how the input fields to be organized in the output record. + public string Output { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs new file mode 100644 index 000000000000..f2df3200ed1e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowBuiltInTransformationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SerializationFormat)) + { + writer.WritePropertyName("serializationFormat"u8); + writer.WriteStringValue(SerializationFormat.Value.ToString()); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteStartArray(); + foreach (var item in Filter) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Map)) + { + writer.WritePropertyName("map"u8); + writer.WriteStartArray(); + foreach (var item in Map) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationSettings(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationSettings DeserializeDataflowBuiltInTransformationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TransformationSerializationFormat? serializationFormat = default; + string schemaRef = default; + IList datasets = default; + IList filter = default; + IList map = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serializationFormat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serializationFormat = new TransformationSerializationFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationDataset.DeserializeDataflowBuiltInTransformationDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("filter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationFilter.DeserializeDataflowBuiltInTransformationFilter(item, options)); + } + filter = array; + continue; + } + if (property.NameEquals("map"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationMap.DeserializeDataflowBuiltInTransformationMap(item, options)); + } + map = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationSettings( + serializationFormat, + schemaRef, + datasets ?? new ChangeTrackingList(), + filter ?? new ChangeTrackingList(), + map ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs new file mode 100644 index 000000000000..052a855c7a14 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow BuiltIn Transformation properties. + public partial class DataflowBuiltInTransformationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataflowBuiltInTransformationSettings() + { + Datasets = new ChangeTrackingList(); + Filter = new ChangeTrackingList(); + Map = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Serialization format. Optional; defaults to JSON. Allowed value JSON Schema/draft-7, Parquet. Default: Json. + /// Reference to the schema that describes the output of the transformation. + /// Enrich data from Broker State Store. Dataset references a key in Broker State Store. + /// Filters input record or datapoints based on condition. + /// Maps input to output message. + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationSettings(TransformationSerializationFormat? serializationFormat, string schemaRef, IList datasets, IList filter, IList map, IDictionary serializedAdditionalRawData) + { + SerializationFormat = serializationFormat; + SchemaRef = schemaRef; + Datasets = datasets; + Filter = filter; + Map = map; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Serialization format. Optional; defaults to JSON. Allowed value JSON Schema/draft-7, Parquet. Default: Json. + public TransformationSerializationFormat? SerializationFormat { get; set; } + /// Reference to the schema that describes the output of the transformation. + public string SchemaRef { get; set; } + /// Enrich data from Broker State Store. Dataset references a key in Broker State Store. + public IList Datasets { get; } + /// Filters input record or datapoints based on condition. + public IList Filter { get; } + /// Maps input to output message. + public IList Map { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs new file mode 100644 index 000000000000..0a51f54dda4d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowDestinationOperationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointRef"u8); + writer.WriteStringValue(EndpointRef); + writer.WritePropertyName("dataDestination"u8); + writer.WriteStringValue(DataDestination); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowDestinationOperationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowDestinationOperationSettings(document.RootElement, options); + } + + internal static DataflowDestinationOperationSettings DeserializeDataflowDestinationOperationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpointRef = default; + string dataDestination = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointRef"u8)) + { + endpointRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataDestination"u8)) + { + dataDestination = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowDestinationOperationSettings(endpointRef, dataDestination, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowDestinationOperationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowDestinationOperationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs new file mode 100644 index 000000000000..4ffa39c18f3c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow Destination Operation properties. + public partial class DataflowDestinationOperationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + /// or is null. + public DataflowDestinationOperationSettings(string endpointRef, string dataDestination) + { + Argument.AssertNotNull(endpointRef, nameof(endpointRef)); + Argument.AssertNotNull(dataDestination, nameof(dataDestination)); + + EndpointRef = endpointRef; + DataDestination = dataDestination; + } + + /// Initializes a new instance of . + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + /// Keeps track of any properties unknown to the library. + internal DataflowDestinationOperationSettings(string endpointRef, string dataDestination, IDictionary serializedAdditionalRawData) + { + EndpointRef = endpointRef; + DataDestination = dataDestination; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowDestinationOperationSettings() + { + } + + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + public string EndpointRef { get; set; } + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + public string DataDestination { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs new file mode 100644 index 000000000000..40804729a433 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + internal partial class ElasticOpenAIIntegrationStatusProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== + internal partial class DataflowEndpointAuthenticationAccessToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticOpenAIIntegrationStatusProperties)} does not support writing '{format}' format."); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support writing '{format}' format."); +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + } + + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + ElasticOpenAIIntegrationStatusProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticOpenAIIntegrationStatusProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticOpenAIIntegrationStatusProperties(document.RootElement, options); + } + + internal static ElasticOpenAIIntegrationStatusProperties DeserializeElasticOpenAIIntegrationStatusProperties(JsonElement element, ModelReaderWriterOptions options = null) +======== + DataflowEndpointAuthenticationAccessToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationAccessToken(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationAccessToken DeserializeDataflowEndpointAuthenticationAccessToken(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + return new ElasticOpenAIIntegrationStatusProperties(status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new DataflowEndpointAuthenticationAccessToken(secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + throw new FormatException($"The model {nameof(ElasticOpenAIIntegrationStatusProperties)} does not support writing '{options.Format}' format."); + } + } + + ElasticOpenAIIntegrationStatusProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationAccessToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticOpenAIIntegrationStatusProperties.Serialization.cs + return DeserializeElasticOpenAIIntegrationStatusProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticOpenAIIntegrationStatusProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeDataflowEndpointAuthenticationAccessToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs new file mode 100644 index 000000000000..6aefe1c51b9d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication Access Token properties. + internal partial class DataflowEndpointAuthenticationAccessToken + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Token secret name. + /// is null. + public DataflowEndpointAuthenticationAccessToken(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Token secret name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationAccessToken(string secretRef, IDictionary serializedAdditionalRawData) + { + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationAccessToken() + { + } + + /// Token secret name. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs new file mode 100644 index 000000000000..071e24f8068b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointAuthenticationSasl : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("saslType"u8); + writer.WriteStringValue(SaslType.ToString()); + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationSasl IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationSasl(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationSasl DeserializeDataflowEndpointAuthenticationSasl(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointAuthenticationSaslType saslType = default; + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("saslType"u8)) + { + saslType = new DataflowEndpointAuthenticationSaslType(property.Value.GetString()); + continue; + } + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationSasl(saslType, secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationSasl IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationSasl(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs new file mode 100644 index 000000000000..432947949348 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication Sasl properties. + public partial class DataflowEndpointAuthenticationSasl + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + /// Token secret name. + /// is null. + public DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType saslType, string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SaslType = saslType; + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + /// Token secret name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType saslType, string secretRef, IDictionary serializedAdditionalRawData) + { + SaslType = saslType; + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationSasl() + { + } + + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + public DataflowEndpointAuthenticationSaslType SaslType { get; set; } + /// Token secret name. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs new file mode 100644 index 000000000000..2085fb5bb40b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication Sasl Type properties. + public readonly partial struct DataflowEndpointAuthenticationSaslType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointAuthenticationSaslType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PlainValue = "Plain"; + private const string ScramSha256Value = "ScramSha256"; + private const string ScramSha512Value = "ScramSha512"; + + /// PLAIN Type. + public static DataflowEndpointAuthenticationSaslType Plain { get; } = new DataflowEndpointAuthenticationSaslType(PlainValue); + /// SCRAM_SHA_256 Type. + public static DataflowEndpointAuthenticationSaslType ScramSha256 { get; } = new DataflowEndpointAuthenticationSaslType(ScramSha256Value); + /// SCRAM_SHA_512 Type. + public static DataflowEndpointAuthenticationSaslType ScramSha512 { get; } = new DataflowEndpointAuthenticationSaslType(ScramSha512Value); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointAuthenticationSaslType left, DataflowEndpointAuthenticationSaslType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointAuthenticationSaslType left, DataflowEndpointAuthenticationSaslType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointAuthenticationSaslType(string value) => new DataflowEndpointAuthenticationSaslType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointAuthenticationSaslType other && Equals(other); + /// + public bool Equals(DataflowEndpointAuthenticationSaslType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs new file mode 100644 index 000000000000..b71fe15b7867 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowEndpointAuthenticationServiceAccountToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationServiceAccountToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationServiceAccountToken(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationServiceAccountToken DeserializeDataflowEndpointAuthenticationServiceAccountToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string audience = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationServiceAccountToken(audience, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationServiceAccountToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationServiceAccountToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs new file mode 100644 index 000000000000..4beb7de61619 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Service Account Token for BrokerAuthentication. + internal partial class DataflowEndpointAuthenticationServiceAccountToken + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + /// is null. + public DataflowEndpointAuthenticationServiceAccountToken(string audience) + { + Argument.AssertNotNull(audience, nameof(audience)); + + Audience = audience; + } + + /// Initializes a new instance of . + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationServiceAccountToken(string audience, IDictionary serializedAdditionalRawData) + { + Audience = audience; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationServiceAccountToken() + { + } + + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + public string Audience { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..64c0684a49f0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowEndpointAuthenticationSystemAssignedManagedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Audience)) + { + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationSystemAssignedManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationSystemAssignedManagedIdentity DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string audience = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(audience, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationSystemAssignedManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs new file mode 100644 index 000000000000..363687e7efbd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication SystemAssignedManagedIdentity properties. + internal partial class DataflowEndpointAuthenticationSystemAssignedManagedIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataflowEndpointAuthenticationSystemAssignedManagedIdentity() + { + } + + /// Initializes a new instance of . + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity(string audience, IDictionary serializedAdditionalRawData) + { + Audience = audience; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string Audience { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..fca2d5be8d2d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationUserAssignedManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationUserAssignedManagedIdentity DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientId = default; + string scope = default; + string tenantId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("scope"u8)) + { + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationUserAssignedManagedIdentity(clientId, scope, tenantId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationUserAssignedManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs new file mode 100644 index 000000000000..6ed43fc2cab8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication UserAssignedManagedIdentity properties. + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Client ID for the user-assigned managed identity. + /// Tenant ID. + /// or is null. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string tenantId) + { + Argument.AssertNotNull(clientId, nameof(clientId)); + Argument.AssertNotNull(tenantId, nameof(tenantId)); + + ClientId = clientId; + TenantId = tenantId; + } + + /// Initializes a new instance of . + /// Client ID for the user-assigned managed identity. + /// Resource identifier (application ID URI) of the resource, affixed with the .default suffix. + /// Tenant ID. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string scope, string tenantId, IDictionary serializedAdditionalRawData) + { + ClientId = clientId; + Scope = scope; + TenantId = tenantId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationUserAssignedManagedIdentity() + { + } + + /// Client ID for the user-assigned managed identity. + public string ClientId { get; set; } + /// Resource identifier (application ID URI) of the resource, affixed with the .default suffix. + public string Scope { get; set; } + /// Tenant ID. + public string TenantId { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs new file mode 100644 index 000000000000..192e6ffd985b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowEndpointAuthenticationX509 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationX509 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationX509(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationX509 DeserializeDataflowEndpointAuthenticationX509(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationX509(secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationX509 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationX509(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs new file mode 100644 index 000000000000..3006690008ca --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Authentication X509 properties. + internal partial class DataflowEndpointAuthenticationX509 + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Secret reference of the X.509 certificate. + /// is null. + public DataflowEndpointAuthenticationX509(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Secret reference of the X.509 certificate. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationX509(string secretRef, IDictionary serializedAdditionalRawData) + { + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationX509() + { + } + + /// Secret reference of the X.509 certificate. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs new file mode 100644 index 000000000000..98fb0d03e87e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointDataExplorer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("database"u8); + writer.WriteStringValue(Database); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataExplorer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataExplorer(document.RootElement, options); + } + + internal static DataflowEndpointDataExplorer DeserializeDataflowEndpointDataExplorer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointDataExplorerAuthentication authentication = default; + string database = default; + string host = default; + IotOperationsBatchingConfig batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointDataExplorerAuthentication.DeserializeDataflowEndpointDataExplorerAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("database"u8)) + { + database = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = IotOperationsBatchingConfig.DeserializeIotOperationsBatchingConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataExplorer(authentication, database, host, batching, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataExplorer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataExplorer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs new file mode 100644 index 000000000000..fc8ea2a23c5b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Azure Data Explorer endpoint properties. + public partial class DataflowEndpointDataExplorer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Database name. + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + /// , or is null. + public DataflowEndpointDataExplorer(DataflowEndpointDataExplorerAuthentication authentication, string database, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(database, nameof(database)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Database = database; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Database name. + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + /// Azure Data Explorer endpoint batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataExplorer(DataflowEndpointDataExplorerAuthentication authentication, string database, string host, IotOperationsBatchingConfig batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Database = database; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataExplorer() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointDataExplorerAuthentication Authentication { get; set; } + /// Database name. + public string Database { get; set; } + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + public string Host { get; set; } + /// Azure Data Explorer endpoint batching configuration. + public IotOperationsBatchingConfig Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs new file mode 100644 index 000000000000..7d848f1a9750 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointDataExplorerAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataExplorerAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataExplorerAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointDataExplorerAuthentication DeserializeDataflowEndpointDataExplorerAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataExplorerAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new DataExplorerAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataExplorerAuthentication(method, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataExplorerAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataExplorerAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs new file mode 100644 index 000000000000..31e06aad1f71 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Azure Data Explorer Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointDataExplorerAuthentication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataExplorerAuthentication() + { + } + + /// Mode of Authentication. + public DataExplorerAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs new file mode 100644 index 000000000000..7ac2fd20c31f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointDataLakeStorage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataLakeStorage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataLakeStorage(document.RootElement, options); + } + + internal static DataflowEndpointDataLakeStorage DeserializeDataflowEndpointDataLakeStorage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointDataLakeStorageAuthentication authentication = default; + string host = default; + IotOperationsBatchingConfig batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointDataLakeStorageAuthentication.DeserializeDataflowEndpointDataLakeStorageAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = IotOperationsBatchingConfig.DeserializeIotOperationsBatchingConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataLakeStorage(authentication, host, batching, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataLakeStorage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataLakeStorage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs new file mode 100644 index 000000000000..431a60bbbdf5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Azure Data Lake endpoint properties. + public partial class DataflowEndpointDataLakeStorage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + /// or is null. + public DataflowEndpointDataLakeStorage(DataflowEndpointDataLakeStorageAuthentication authentication, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + /// Azure Data Lake endpoint batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataLakeStorage(DataflowEndpointDataLakeStorageAuthentication authentication, string host, IotOperationsBatchingConfig batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataLakeStorage() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointDataLakeStorageAuthentication Authentication { get; set; } + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + public string Host { get; set; } + /// Azure Data Lake endpoint batching configuration. + public IotOperationsBatchingConfig Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs new file mode 100644 index 000000000000..f7efc9e33f95 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointDataLakeStorageAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(AccessTokenSettings)) + { + writer.WritePropertyName("accessTokenSettings"u8); + writer.WriteObjectValue(AccessTokenSettings, options); + } + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataLakeStorageAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataLakeStorageAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointDataLakeStorageAuthentication DeserializeDataflowEndpointDataLakeStorageAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataLakeStorageAuthMethod method = default; + DataflowEndpointAuthenticationAccessToken accessTokenSettings = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new DataLakeStorageAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("accessTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessTokenSettings = DataflowEndpointAuthenticationAccessToken.DeserializeDataflowEndpointAuthenticationAccessToken(property.Value, options); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataLakeStorageAuthentication(method, accessTokenSettings, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataLakeStorageAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataLakeStorageAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs new file mode 100644 index 000000000000..4866f138eb74 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Azure Data Lake endpoint Authentication properties. NOTE Enum - Only one method is supported for one entry. + public partial class DataflowEndpointDataLakeStorageAuthentication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// SAS token authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod method, DataflowEndpointAuthenticationAccessToken accessTokenSettings, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + AccessTokenSettings = accessTokenSettings; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataLakeStorageAuthentication() + { + } + + /// Mode of Authentication. + public DataLakeStorageAuthMethod Method { get; set; } + /// SAS token authentication. + internal DataflowEndpointAuthenticationAccessToken AccessTokenSettings { get; set; } + /// Token secret name. + public string AccessTokenSecretRef + { + get => AccessTokenSettings is null ? default : AccessTokenSettings.SecretRef; + set => AccessTokenSettings = new DataflowEndpointAuthenticationAccessToken(value); + } + + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs new file mode 100644 index 000000000000..f1a4c40cc311 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointFabricOneLake : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("names"u8); + writer.WriteObjectValue(Names, options); + writer.WritePropertyName("oneLakePathType"u8); + writer.WriteStringValue(OneLakePathType.ToString()); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLake IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLake(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLake DeserializeDataflowEndpointFabricOneLake(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointFabricOneLakeAuthentication authentication = default; + DataflowEndpointFabricOneLakeNames names = default; + DataflowEndpointFabricPathType oneLakePathType = default; + string host = default; + IotOperationsBatchingConfig batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointFabricOneLakeAuthentication.DeserializeDataflowEndpointFabricOneLakeAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("names"u8)) + { + names = DataflowEndpointFabricOneLakeNames.DeserializeDataflowEndpointFabricOneLakeNames(property.Value, options); + continue; + } + if (property.NameEquals("oneLakePathType"u8)) + { + oneLakePathType = new DataflowEndpointFabricPathType(property.Value.GetString()); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = IotOperationsBatchingConfig.DeserializeIotOperationsBatchingConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLake( + authentication, + names, + oneLakePathType, + host, + batching, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLake IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLake(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs new file mode 100644 index 000000000000..1f8339ff226e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Microsoft Fabric endpoint properties. + public partial class DataflowEndpointFabricOneLake + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + /// Names of the workspace and lakehouse. + /// Type of location of the data in the workspace. Can be either tables or files. + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + /// , or is null. + public DataflowEndpointFabricOneLake(DataflowEndpointFabricOneLakeAuthentication authentication, DataflowEndpointFabricOneLakeNames names, DataflowEndpointFabricPathType oneLakePathType, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(names, nameof(names)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Names = names; + OneLakePathType = oneLakePathType; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + /// Names of the workspace and lakehouse. + /// Type of location of the data in the workspace. Can be either tables or files. + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + /// Batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLake(DataflowEndpointFabricOneLakeAuthentication authentication, DataflowEndpointFabricOneLakeNames names, DataflowEndpointFabricPathType oneLakePathType, string host, IotOperationsBatchingConfig batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Names = names; + OneLakePathType = oneLakePathType; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLake() + { + } + + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + public DataflowEndpointFabricOneLakeAuthentication Authentication { get; set; } + /// Names of the workspace and lakehouse. + public DataflowEndpointFabricOneLakeNames Names { get; set; } + /// Type of location of the data in the workspace. Can be either tables or files. + public DataflowEndpointFabricPathType OneLakePathType { get; set; } + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + public string Host { get; set; } + /// Batching configuration. + public IotOperationsBatchingConfig Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs new file mode 100644 index 000000000000..1e9d0123012d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointFabricOneLakeAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLakeAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLakeAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLakeAuthentication DeserializeDataflowEndpointFabricOneLakeAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FabricOneLakeAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new FabricOneLakeAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLakeAuthentication(method, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLakeAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLakeAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs new file mode 100644 index 000000000000..3fc4e605e9b5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Microsoft Fabric endpoint. Authentication properties. NOTE - Only one method is supported for one entry. + public partial class DataflowEndpointFabricOneLakeAuthentication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLakeAuthentication() + { + } + + /// Mode of Authentication. + public FabricOneLakeAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs new file mode 100644 index 000000000000..dccf62229bd1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointFabricOneLakeNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("lakehouseName"u8); + writer.WriteStringValue(LakehouseName); + writer.WritePropertyName("workspaceName"u8); + writer.WriteStringValue(WorkspaceName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLakeNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLakeNames(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLakeNames DeserializeDataflowEndpointFabricOneLakeNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lakehouseName = default; + string workspaceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lakehouseName"u8)) + { + lakehouseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("workspaceName"u8)) + { + workspaceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLakeNames(lakehouseName, workspaceName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLakeNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLakeNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs new file mode 100644 index 000000000000..6ffd0118b085 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Microsoft Fabric endpoint Names properties. + public partial class DataflowEndpointFabricOneLakeNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Lakehouse name. + /// Workspace name. + /// or is null. + public DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName) + { + Argument.AssertNotNull(lakehouseName, nameof(lakehouseName)); + Argument.AssertNotNull(workspaceName, nameof(workspaceName)); + + LakehouseName = lakehouseName; + WorkspaceName = workspaceName; + } + + /// Initializes a new instance of . + /// Lakehouse name. + /// Workspace name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName, IDictionary serializedAdditionalRawData) + { + LakehouseName = lakehouseName; + WorkspaceName = workspaceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLakeNames() + { + } + + /// Lakehouse name. + public string LakehouseName { get; set; } + /// Workspace name. + public string WorkspaceName { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs new file mode 100644 index 000000000000..996b7056b1c0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Fabric Path Type properties. + public readonly partial struct DataflowEndpointFabricPathType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointFabricPathType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FilesValue = "Files"; + private const string TablesValue = "Tables"; + + /// FILES Type. + public static DataflowEndpointFabricPathType Files { get; } = new DataflowEndpointFabricPathType(FilesValue); + /// TABLES Type. + public static DataflowEndpointFabricPathType Tables { get; } = new DataflowEndpointFabricPathType(TablesValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointFabricPathType left, DataflowEndpointFabricPathType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointFabricPathType left, DataflowEndpointFabricPathType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointFabricPathType(string value) => new DataflowEndpointFabricPathType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointFabricPathType other && Equals(other); + /// + public bool Equals(DataflowEndpointFabricPathType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs new file mode 100644 index 000000000000..0e0f55b6c75e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointKafka : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + if (Optional.IsDefined(ConsumerGroupId)) + { + writer.WritePropertyName("consumerGroupId"u8); + writer.WriteStringValue(ConsumerGroupId); + } + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (Optional.IsDefined(CopyMqttProperties)) + { + writer.WritePropertyName("copyMqttProperties"u8); + writer.WriteStringValue(CopyMqttProperties.Value.ToString()); + } + if (Optional.IsDefined(Compression)) + { + writer.WritePropertyName("compression"u8); + writer.WriteStringValue(Compression.Value.ToString()); + } + if (Optional.IsDefined(KafkaAcks)) + { + writer.WritePropertyName("kafkaAcks"u8); + writer.WriteStringValue(KafkaAcks.Value.ToString()); + } + if (Optional.IsDefined(PartitionStrategy)) + { + writer.WritePropertyName("partitionStrategy"u8); + writer.WriteStringValue(PartitionStrategy.Value.ToString()); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (Optional.IsDefined(CloudEventAttributes)) + { + writer.WritePropertyName("cloudEventAttributes"u8); + writer.WriteStringValue(CloudEventAttributes.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafka IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafka(document.RootElement, options); + } + + internal static DataflowEndpointKafka DeserializeDataflowEndpointKafka(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointKafkaAuthentication authentication = default; + string consumerGroupId = default; + string host = default; + DataflowEndpointKafkaBatching batching = default; + IotOperationsOperationalMode? copyMqttProperties = default; + DataflowEndpointKafkaCompression? compression = default; + DataflowEndpointKafkaAck? kafkaAcks = default; + DataflowEndpointKafkaPartitionStrategy? partitionStrategy = default; + IotOperationsTlsProperties tls = default; + CloudEventAttributeType? cloudEventAttributes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointKafkaAuthentication.DeserializeDataflowEndpointKafkaAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("consumerGroupId"u8)) + { + consumerGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = DataflowEndpointKafkaBatching.DeserializeDataflowEndpointKafkaBatching(property.Value, options); + continue; + } + if (property.NameEquals("copyMqttProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + copyMqttProperties = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("compression"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compression = new DataflowEndpointKafkaCompression(property.Value.GetString()); + continue; + } + if (property.NameEquals("kafkaAcks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kafkaAcks = new DataflowEndpointKafkaAck(property.Value.GetString()); + continue; + } + if (property.NameEquals("partitionStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + partitionStrategy = new DataflowEndpointKafkaPartitionStrategy(property.Value.GetString()); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = IotOperationsTlsProperties.DeserializeIotOperationsTlsProperties(property.Value, options); + continue; + } + if (property.NameEquals("cloudEventAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudEventAttributes = new CloudEventAttributeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafka( + authentication, + consumerGroupId, + host, + batching, + copyMqttProperties, + compression, + kafkaAcks, + partitionStrategy, + tls, + cloudEventAttributes, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafka IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafka(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.cs new file mode 100644 index 000000000000..5d026f50d602 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafka.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kafka endpoint properties. + public partial class DataflowEndpointKafka + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Kafka endpoint host. + /// or is null. + public DataflowEndpointKafka(DataflowEndpointKafkaAuthentication authentication, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Consumer group ID. + /// Kafka endpoint host. + /// Batching configuration. + /// Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source. + /// Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source. + /// Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source. + /// Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source. + /// TLS configuration. + /// Cloud event mapping config. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafka(DataflowEndpointKafkaAuthentication authentication, string consumerGroupId, string host, DataflowEndpointKafkaBatching batching, IotOperationsOperationalMode? copyMqttProperties, DataflowEndpointKafkaCompression? compression, DataflowEndpointKafkaAck? kafkaAcks, DataflowEndpointKafkaPartitionStrategy? partitionStrategy, IotOperationsTlsProperties tls, CloudEventAttributeType? cloudEventAttributes, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + ConsumerGroupId = consumerGroupId; + Host = host; + Batching = batching; + CopyMqttProperties = copyMqttProperties; + Compression = compression; + KafkaAcks = kafkaAcks; + PartitionStrategy = partitionStrategy; + Tls = tls; + CloudEventAttributes = cloudEventAttributes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointKafka() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointKafkaAuthentication Authentication { get; set; } + /// Consumer group ID. + public string ConsumerGroupId { get; set; } + /// Kafka endpoint host. + public string Host { get; set; } + /// Batching configuration. + public DataflowEndpointKafkaBatching Batching { get; set; } + /// Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source. + public IotOperationsOperationalMode? CopyMqttProperties { get; set; } + /// Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaCompression? Compression { get; set; } + /// Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaAck? KafkaAcks { get; set; } + /// Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaPartitionStrategy? PartitionStrategy { get; set; } + /// TLS configuration. + public IotOperationsTlsProperties Tls { get; set; } + /// Cloud event mapping config. + public CloudEventAttributeType? CloudEventAttributes { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs new file mode 100644 index 000000000000..0df576557ae1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Kafka Acks properties. + public readonly partial struct DataflowEndpointKafkaAck : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaAck(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ZeroValue = "Zero"; + private const string OneValue = "One"; + private const string AllValue = "All"; + + /// ZERO Option. + public static DataflowEndpointKafkaAck Zero { get; } = new DataflowEndpointKafkaAck(ZeroValue); + /// ONE Option. + public static DataflowEndpointKafkaAck One { get; } = new DataflowEndpointKafkaAck(OneValue); + /// ALL Option. + public static DataflowEndpointKafkaAck All { get; } = new DataflowEndpointKafkaAck(AllValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaAck left, DataflowEndpointKafkaAck right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaAck left, DataflowEndpointKafkaAck right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaAck(string value) => new DataflowEndpointKafkaAck(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaAck other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaAck other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs new file mode 100644 index 000000000000..ffb03b2233dc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointKafkaAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(SaslSettings)) + { + writer.WritePropertyName("saslSettings"u8); + writer.WriteObjectValue(SaslSettings, options); + } + if (Optional.IsDefined(X509CertificateSettings)) + { + writer.WritePropertyName("x509CertificateSettings"u8); + writer.WriteObjectValue(X509CertificateSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafkaAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafkaAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointKafkaAuthentication DeserializeDataflowEndpointKafkaAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KafkaAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationSasl saslSettings = default; + DataflowEndpointAuthenticationX509 x509CertificateSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new KafkaAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("saslSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + saslSettings = DataflowEndpointAuthenticationSasl.DeserializeDataflowEndpointAuthenticationSasl(property.Value, options); + continue; + } + if (property.NameEquals("x509CertificateSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509CertificateSettings = DataflowEndpointAuthenticationX509.DeserializeDataflowEndpointAuthenticationX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafkaAuthentication( + method, + systemAssignedManagedIdentitySettings, + userAssignedManagedIdentitySettings, + saslSettings, + x509CertificateSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafkaAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafkaAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs new file mode 100644 index 000000000000..a2432c7c1f11 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kafka endpoint Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointKafkaAuthentication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointKafkaAuthentication(KafkaAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// SASL authentication. + /// X.509 certificate authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafkaAuthentication(KafkaAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, DataflowEndpointAuthenticationSasl saslSettings, DataflowEndpointAuthenticationX509 x509CertificateSettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + SaslSettings = saslSettings; + X509CertificateSettings = x509CertificateSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointKafkaAuthentication() + { + } + + /// Mode of Authentication. + public KafkaAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + /// SASL authentication. + public DataflowEndpointAuthenticationSasl SaslSettings { get; set; } + /// X.509 certificate authentication. + internal DataflowEndpointAuthenticationX509 X509CertificateSettings { get; set; } + /// Secret reference of the X.509 certificate. + public string X509CertificateSecretRef + { + get => X509CertificateSettings is null ? default : X509CertificateSettings.SecretRef; + set => X509CertificateSettings = new DataflowEndpointAuthenticationX509(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs new file mode 100644 index 000000000000..f28171d30f02 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointKafkaBatching : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(LatencyMs)) + { + writer.WritePropertyName("latencyMs"u8); + writer.WriteNumberValue(LatencyMs.Value); + } + if (Optional.IsDefined(MaxBytes)) + { + writer.WritePropertyName("maxBytes"u8); + writer.WriteNumberValue(MaxBytes.Value); + } + if (Optional.IsDefined(MaxMessages)) + { + writer.WritePropertyName("maxMessages"u8); + writer.WriteNumberValue(MaxMessages.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafkaBatching IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafkaBatching(document.RootElement, options); + } + + internal static DataflowEndpointKafkaBatching DeserializeDataflowEndpointKafkaBatching(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? mode = default; + int? latencyMs = default; + int? maxBytes = default; + int? maxMessages = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("latencyMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latencyMs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessages = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafkaBatching(mode, latencyMs, maxBytes, maxMessages, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafkaBatching IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafkaBatching(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs new file mode 100644 index 000000000000..9a2266943cad --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kafka endpoint Batching properties. + public partial class DataflowEndpointKafkaBatching + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataflowEndpointKafkaBatching() + { + } + + /// Initializes a new instance of . + /// Mode for batching. + /// Batching latency in milliseconds. + /// Maximum number of bytes in a batch. + /// Maximum number of messages in a batch. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafkaBatching(IotOperationsOperationalMode? mode, int? latencyMs, int? maxBytes, int? maxMessages, IDictionary serializedAdditionalRawData) + { + Mode = mode; + LatencyMs = latencyMs; + MaxBytes = maxBytes; + MaxMessages = maxMessages; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mode for batching. + public IotOperationsOperationalMode? Mode { get; set; } + /// Batching latency in milliseconds. + public int? LatencyMs { get; set; } + /// Maximum number of bytes in a batch. + public int? MaxBytes { get; set; } + /// Maximum number of messages in a batch. + public int? MaxMessages { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs new file mode 100644 index 000000000000..a7721b764027 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kafka endpoint Compression properties. + public readonly partial struct DataflowEndpointKafkaCompression : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaCompression(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string GzipValue = "Gzip"; + private const string SnappyValue = "Snappy"; + private const string Lz4Value = "Lz4"; + + /// NONE Option. + public static DataflowEndpointKafkaCompression None { get; } = new DataflowEndpointKafkaCompression(NoneValue); + /// Gzip Option. + public static DataflowEndpointKafkaCompression Gzip { get; } = new DataflowEndpointKafkaCompression(GzipValue); + /// SNAPPY Option. + public static DataflowEndpointKafkaCompression Snappy { get; } = new DataflowEndpointKafkaCompression(SnappyValue); + /// LZ4 Option. + public static DataflowEndpointKafkaCompression Lz4 { get; } = new DataflowEndpointKafkaCompression(Lz4Value); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaCompression left, DataflowEndpointKafkaCompression right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaCompression left, DataflowEndpointKafkaCompression right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaCompression(string value) => new DataflowEndpointKafkaCompression(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaCompression other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaCompression other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs new file mode 100644 index 000000000000..4d47a8c150ba --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Kafka Partition Strategy properties. + public readonly partial struct DataflowEndpointKafkaPartitionStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaPartitionStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string StaticValue = "Static"; + private const string TopicValue = "Topic"; + private const string PropertyValue = "Property"; + + /// Default: Assigns messages to random partitions, using a round-robin algorithm. + public static DataflowEndpointKafkaPartitionStrategy Default { get; } = new DataflowEndpointKafkaPartitionStrategy(DefaultValue); + /// Static: Assigns messages to a fixed partition number that's derived from the instance ID of the dataflow. + public static DataflowEndpointKafkaPartitionStrategy Static { get; } = new DataflowEndpointKafkaPartitionStrategy(StaticValue); + /// TOPIC Option. + public static DataflowEndpointKafkaPartitionStrategy Topic { get; } = new DataflowEndpointKafkaPartitionStrategy(TopicValue); + /// PROPERTY Option. + public static DataflowEndpointKafkaPartitionStrategy Property { get; } = new DataflowEndpointKafkaPartitionStrategy(PropertyValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaPartitionStrategy left, DataflowEndpointKafkaPartitionStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaPartitionStrategy left, DataflowEndpointKafkaPartitionStrategy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaPartitionStrategy(string value) => new DataflowEndpointKafkaPartitionStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaPartitionStrategy other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaPartitionStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs new file mode 100644 index 000000000000..273b30367207 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs +namespace Azure.ResourceManager.Avs.Models +{ + internal partial class ElasticSanVolume : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowEndpointLocalStorage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticSanVolume)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targetId"u8); + writer.WriteStringValue(TargetId); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("persistentVolumeClaimRef"u8); + writer.WriteStringValue(PersistentVolumeClaimRef); +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + ElasticSanVolume IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticSanVolume)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticSanVolume(document.RootElement, options); + } + + internal static ElasticSanVolume DeserializeElasticSanVolume(JsonElement element, ModelReaderWriterOptions options = null) +======== + DataflowEndpointLocalStorage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointLocalStorage(document.RootElement, options); + } + + internal static DataflowEndpointLocalStorage DeserializeDataflowEndpointLocalStorage(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + ResourceIdentifier targetId = default; +======== + string persistentVolumeClaimRef = default; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + if (property.NameEquals("targetId"u8)) + { + targetId = new ResourceIdentifier(property.Value.GetString()); +======== + if (property.NameEquals("persistentVolumeClaimRef"u8)) + { + persistentVolumeClaimRef = property.Value.GetString(); +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + return new ElasticSanVolume(targetId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new DataflowEndpointLocalStorage(persistentVolumeClaimRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + throw new FormatException($"The model {nameof(ElasticSanVolume)} does not support writing '{options.Format}' format."); + } + } + + ElasticSanVolume IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointLocalStorage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/avs/Azure.ResourceManager.Avs/src/Generated/Models/ElasticSanVolume.Serialization.cs + return DeserializeElasticSanVolume(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticSanVolume)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeDataflowEndpointLocalStorage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs new file mode 100644 index 000000000000..0fe18edad6b1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Local persistent volume endpoint properties. + internal partial class DataflowEndpointLocalStorage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Persistent volume claim name. + /// is null. + public DataflowEndpointLocalStorage(string persistentVolumeClaimRef) + { + Argument.AssertNotNull(persistentVolumeClaimRef, nameof(persistentVolumeClaimRef)); + + PersistentVolumeClaimRef = persistentVolumeClaimRef; + } + + /// Initializes a new instance of . + /// Persistent volume claim name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointLocalStorage(string persistentVolumeClaimRef, IDictionary serializedAdditionalRawData) + { + PersistentVolumeClaimRef = persistentVolumeClaimRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointLocalStorage() + { + } + + /// Persistent volume claim name. + public string PersistentVolumeClaimRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs new file mode 100644 index 000000000000..65fc2094fd5e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointMqtt : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + if (Optional.IsDefined(ClientIdPrefix)) + { + writer.WritePropertyName("clientIdPrefix"u8); + writer.WriteStringValue(ClientIdPrefix); + } + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(KeepAliveSeconds)) + { + writer.WritePropertyName("keepAliveSeconds"u8); + writer.WriteNumberValue(KeepAliveSeconds.Value); + } + if (Optional.IsDefined(Retain)) + { + writer.WritePropertyName("retain"u8); + writer.WriteStringValue(Retain.Value.ToString()); + } + if (Optional.IsDefined(MaxInflightMessages)) + { + writer.WritePropertyName("maxInflightMessages"u8); + writer.WriteNumberValue(MaxInflightMessages.Value); + } + if (Optional.IsDefined(Qos)) + { + writer.WritePropertyName("qos"u8); + writer.WriteNumberValue(Qos.Value); + } + if (Optional.IsDefined(SessionExpirySeconds)) + { + writer.WritePropertyName("sessionExpirySeconds"u8); + writer.WriteNumberValue(SessionExpirySeconds.Value); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (Optional.IsDefined(CloudEventAttributes)) + { + writer.WritePropertyName("cloudEventAttributes"u8); + writer.WriteStringValue(CloudEventAttributes.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointMqtt IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointMqtt(document.RootElement, options); + } + + internal static DataflowEndpointMqtt DeserializeDataflowEndpointMqtt(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointMqttAuthentication authentication = default; + string clientIdPrefix = default; + string host = default; + BrokerProtocolType? protocol = default; + int? keepAliveSeconds = default; + MqttRetainType? retain = default; + int? maxInflightMessages = default; + int? qos = default; + int? sessionExpirySeconds = default; + IotOperationsTlsProperties tls = default; + CloudEventAttributeType? cloudEventAttributes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointMqttAuthentication.DeserializeDataflowEndpointMqttAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("clientIdPrefix"u8)) + { + clientIdPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new BrokerProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keepAliveSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepAliveSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retain = new MqttRetainType(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxInflightMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxInflightMessages = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("qos"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + qos = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sessionExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = IotOperationsTlsProperties.DeserializeIotOperationsTlsProperties(property.Value, options); + continue; + } + if (property.NameEquals("cloudEventAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudEventAttributes = new CloudEventAttributeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointMqtt( + authentication, + clientIdPrefix, + host, + protocol, + keepAliveSeconds, + retain, + maxInflightMessages, + qos, + sessionExpirySeconds, + tls, + cloudEventAttributes, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointMqtt IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointMqtt(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.cs new file mode 100644 index 000000000000..da476dfa14fc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqtt.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker endpoint properties. + public partial class DataflowEndpointMqtt + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + /// is null. + public DataflowEndpointMqtt(DataflowEndpointMqttAuthentication authentication) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + + Authentication = authentication; + } + + /// Initializes a new instance of . + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + /// Client ID prefix. Client ID generated by the dataflow is <prefix>-TBD. Optional; no prefix if omitted. + /// Host of the Broker in the form of <hostname>:<port>. Optional; connects to Broker if omitted. + /// Enable or disable websockets. + /// Broker KeepAlive for connection in seconds. + /// Whether or not to keep the retain setting. + /// The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack. + /// Qos for Broker connection. + /// Session expiry in seconds. + /// TLS configuration. + /// Cloud event mapping config. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointMqtt(DataflowEndpointMqttAuthentication authentication, string clientIdPrefix, string host, BrokerProtocolType? protocol, int? keepAliveSeconds, MqttRetainType? retain, int? maxInflightMessages, int? qos, int? sessionExpirySeconds, IotOperationsTlsProperties tls, CloudEventAttributeType? cloudEventAttributes, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + ClientIdPrefix = clientIdPrefix; + Host = host; + Protocol = protocol; + KeepAliveSeconds = keepAliveSeconds; + Retain = retain; + MaxInflightMessages = maxInflightMessages; + Qos = qos; + SessionExpirySeconds = sessionExpirySeconds; + Tls = tls; + CloudEventAttributes = cloudEventAttributes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointMqtt() + { + } + + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + public DataflowEndpointMqttAuthentication Authentication { get; set; } + /// Client ID prefix. Client ID generated by the dataflow is <prefix>-TBD. Optional; no prefix if omitted. + public string ClientIdPrefix { get; set; } + /// Host of the Broker in the form of <hostname>:<port>. Optional; connects to Broker if omitted. + public string Host { get; set; } + /// Enable or disable websockets. + public BrokerProtocolType? Protocol { get; set; } + /// Broker KeepAlive for connection in seconds. + public int? KeepAliveSeconds { get; set; } + /// Whether or not to keep the retain setting. + public MqttRetainType? Retain { get; set; } + /// The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack. + public int? MaxInflightMessages { get; set; } + /// Qos for Broker connection. + public int? Qos { get; set; } + /// Session expiry in seconds. + public int? SessionExpirySeconds { get; set; } + /// TLS configuration. + public IotOperationsTlsProperties Tls { get; set; } + /// Cloud event mapping config. + public CloudEventAttributeType? CloudEventAttributes { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs new file mode 100644 index 000000000000..da3152335866 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowEndpointMqttAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(ServiceAccountTokenSettings)) + { + writer.WritePropertyName("serviceAccountTokenSettings"u8); + writer.WriteObjectValue(ServiceAccountTokenSettings, options); + } + if (Optional.IsDefined(X509CertificateSettings)) + { + writer.WritePropertyName("x509CertificateSettings"u8); + writer.WriteObjectValue(X509CertificateSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointMqttAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointMqttAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointMqttAuthentication DeserializeDataflowEndpointMqttAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MqttAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationServiceAccountToken serviceAccountTokenSettings = default; + DataflowEndpointAuthenticationX509 x509CertificateSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new MqttAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("serviceAccountTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceAccountTokenSettings = DataflowEndpointAuthenticationServiceAccountToken.DeserializeDataflowEndpointAuthenticationServiceAccountToken(property.Value, options); + continue; + } + if (property.NameEquals("x509CertificateSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509CertificateSettings = DataflowEndpointAuthenticationX509.DeserializeDataflowEndpointAuthenticationX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointMqttAuthentication( + method, + systemAssignedManagedIdentitySettings, + userAssignedManagedIdentitySettings, + serviceAccountTokenSettings, + x509CertificateSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointMqttAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointMqttAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs new file mode 100644 index 000000000000..70e1168b1489 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Mqtt endpoint Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointMqttAuthentication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointMqttAuthentication(MqttAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Kubernetes service account token authentication. Default audience if not set is aio-internal. + /// X.509 certificate authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointMqttAuthentication(MqttAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, DataflowEndpointAuthenticationServiceAccountToken serviceAccountTokenSettings, DataflowEndpointAuthenticationX509 x509CertificateSettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + ServiceAccountTokenSettings = serviceAccountTokenSettings; + X509CertificateSettings = x509CertificateSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointMqttAuthentication() + { + } + + /// Mode of Authentication. + public MqttAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + /// Kubernetes service account token authentication. Default audience if not set is aio-internal. + internal DataflowEndpointAuthenticationServiceAccountToken ServiceAccountTokenSettings { get; set; } + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + public string ServiceAccountTokenAudience + { + get => ServiceAccountTokenSettings is null ? default : ServiceAccountTokenSettings.Audience; + set => ServiceAccountTokenSettings = new DataflowEndpointAuthenticationServiceAccountToken(value); + } + + /// X.509 certificate authentication. + internal DataflowEndpointAuthenticationX509 X509CertificateSettings { get; set; } + /// Secret reference of the X.509 certificate. + public string X509CertificateSecretRef + { + get => X509CertificateSettings is null ? default : X509CertificateSettings.SecretRef; + set => X509CertificateSettings = new DataflowEndpointAuthenticationX509(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs new file mode 100644 index 000000000000..4b46aaa59a0a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowEndpointResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointResourceListResult(document.RootElement, options); + } + + internal static DataflowEndpointResourceListResult DeserializeDataflowEndpointResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs new file mode 100644 index 000000000000..1f962deae25f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a DataflowEndpointResource list operation. + internal partial class DataflowEndpointResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The DataflowEndpointResource items on this page. + /// is null. + internal DataflowEndpointResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowEndpointResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointResourceListResult() + { + } + + /// The DataflowEndpointResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointType.cs new file mode 100644 index 000000000000..cf2f76bbb3ba --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowEndpointType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Type properties. + public readonly partial struct DataflowEndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DataExplorerValue = "DataExplorer"; + private const string DataLakeStorageValue = "DataLakeStorage"; + private const string FabricOneLakeValue = "FabricOneLake"; + private const string KafkaValue = "Kafka"; + private const string LocalStorageValue = "LocalStorage"; + private const string MqttValue = "Mqtt"; + + /// Azure Data Explorer Type. + public static DataflowEndpointType DataExplorer { get; } = new DataflowEndpointType(DataExplorerValue); + /// Azure Data Lake Type. + public static DataflowEndpointType DataLakeStorage { get; } = new DataflowEndpointType(DataLakeStorageValue); + /// Microsoft Fabric Type. + public static DataflowEndpointType FabricOneLake { get; } = new DataflowEndpointType(FabricOneLakeValue); + /// Kafka Type. + public static DataflowEndpointType Kafka { get; } = new DataflowEndpointType(KafkaValue); + /// Local Storage Type. + public static DataflowEndpointType LocalStorage { get; } = new DataflowEndpointType(LocalStorageValue); + /// Broker Type. + public static DataflowEndpointType Mqtt { get; } = new DataflowEndpointType(MqttValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointType left, DataflowEndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointType left, DataflowEndpointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointType(string value) => new DataflowEndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointType other && Equals(other); + /// + public bool Equals(DataflowEndpointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowFilterType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowFilterType.cs new file mode 100644 index 000000000000..3280bee9d192 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowFilterType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Filter Type properties. + public readonly partial struct DataflowFilterType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowFilterType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FilterValue = "Filter"; + + /// Filter type. + public static DataflowFilterType Filter { get; } = new DataflowFilterType(FilterValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowFilterType left, DataflowFilterType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowFilterType left, DataflowFilterType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowFilterType(string value) => new DataflowFilterType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowFilterType other && Equals(other); + /// + public bool Equals(DataflowFilterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowMappingType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowMappingType.cs new file mode 100644 index 000000000000..0028d8ac544f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowMappingType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow type mapping properties. + public readonly partial struct DataflowMappingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowMappingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NewPropertiesValue = "NewProperties"; + private const string RenameValue = "Rename"; + private const string ComputeValue = "Compute"; + private const string PassThroughValue = "PassThrough"; + private const string BuiltInFunctionValue = "BuiltInFunction"; + + /// New Properties type. + public static DataflowMappingType NewProperties { get; } = new DataflowMappingType(NewPropertiesValue); + /// Rename type. + public static DataflowMappingType Rename { get; } = new DataflowMappingType(RenameValue); + /// Compute type. + public static DataflowMappingType Compute { get; } = new DataflowMappingType(ComputeValue); + /// Pass-through type. + public static DataflowMappingType PassThrough { get; } = new DataflowMappingType(PassThroughValue); + /// Built in function type. + public static DataflowMappingType BuiltInFunction { get; } = new DataflowMappingType(BuiltInFunctionValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowMappingType left, DataflowMappingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowMappingType left, DataflowMappingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowMappingType(string value) => new DataflowMappingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowMappingType other && Equals(other); + /// + public bool Equals(DataflowMappingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.Serialization.cs new file mode 100644 index 000000000000..41bb4ebee869 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowOperationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowOperationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("operationType"u8); + writer.WriteStringValue(OperationType.ToString()); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(SourceSettings)) + { + writer.WritePropertyName("sourceSettings"u8); + writer.WriteObjectValue(SourceSettings, options); + } + if (Optional.IsDefined(BuiltInTransformationSettings)) + { + writer.WritePropertyName("builtInTransformationSettings"u8); + writer.WriteObjectValue(BuiltInTransformationSettings, options); + } + if (Optional.IsDefined(DestinationSettings)) + { + writer.WritePropertyName("destinationSettings"u8); + writer.WriteObjectValue(DestinationSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowOperationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowOperationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowOperationProperties(document.RootElement, options); + } + + internal static DataflowOperationProperties DeserializeDataflowOperationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowOperationType operationType = default; + string name = default; + DataflowSourceOperationSettings sourceSettings = default; + DataflowBuiltInTransformationSettings builtInTransformationSettings = default; + DataflowDestinationOperationSettings destinationSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operationType"u8)) + { + operationType = new DataflowOperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceSettings = DataflowSourceOperationSettings.DeserializeDataflowSourceOperationSettings(property.Value, options); + continue; + } + if (property.NameEquals("builtInTransformationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + builtInTransformationSettings = DataflowBuiltInTransformationSettings.DeserializeDataflowBuiltInTransformationSettings(property.Value, options); + continue; + } + if (property.NameEquals("destinationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationSettings = DataflowDestinationOperationSettings.DeserializeDataflowDestinationOperationSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowOperationProperties( + operationType, + name, + sourceSettings, + builtInTransformationSettings, + destinationSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowOperationProperties)} does not support writing '{options.Format}' format."); + } + } + + DataflowOperationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowOperationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowOperationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.cs new file mode 100644 index 000000000000..a8561b0ff640 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow Operation properties. NOTE - One only method is allowed to be used for one entry. + public partial class DataflowOperationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Type of operation. + public DataflowOperationProperties(DataflowOperationType operationType) + { + OperationType = operationType; + } + + /// Initializes a new instance of . + /// Type of operation. + /// Optional user provided name of the transformation. + /// Source configuration. + /// Built In Transformation configuration. + /// Destination configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowOperationProperties(DataflowOperationType operationType, string name, DataflowSourceOperationSettings sourceSettings, DataflowBuiltInTransformationSettings builtInTransformationSettings, DataflowDestinationOperationSettings destinationSettings, IDictionary serializedAdditionalRawData) + { + OperationType = operationType; + Name = name; + SourceSettings = sourceSettings; + BuiltInTransformationSettings = builtInTransformationSettings; + DestinationSettings = destinationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowOperationProperties() + { + } + + /// Type of operation. + public DataflowOperationType OperationType { get; set; } + /// Optional user provided name of the transformation. + public string Name { get; set; } + /// Source configuration. + public DataflowSourceOperationSettings SourceSettings { get; set; } + /// Built In Transformation configuration. + public DataflowBuiltInTransformationSettings BuiltInTransformationSettings { get; set; } + /// Destination configuration. + public DataflowDestinationOperationSettings DestinationSettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationType.cs new file mode 100644 index 000000000000..7662886a417d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowOperationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow Operation Type properties. + public readonly partial struct DataflowOperationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowOperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SourceValue = "Source"; + private const string DestinationValue = "Destination"; + private const string BuiltInTransformationValue = "BuiltInTransformation"; + + /// Dataflow Source Operation. + public static DataflowOperationType Source { get; } = new DataflowOperationType(SourceValue); + /// Dataflow Destination Operation. + public static DataflowOperationType Destination { get; } = new DataflowOperationType(DestinationValue); + /// Dataflow BuiltIn Transformation Operation. + public static DataflowOperationType BuiltInTransformation { get; } = new DataflowOperationType(BuiltInTransformationValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowOperationType left, DataflowOperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowOperationType left, DataflowOperationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowOperationType(string value) => new DataflowOperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowOperationType other && Equals(other); + /// + public bool Equals(DataflowOperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.Serialization.cs new file mode 100644 index 000000000000..e16f5bec26bd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowProfileDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileDiagnostics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Logs)) + { + writer.WritePropertyName("logs"u8); + writer.WriteObjectValue(Logs, options); + } + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowProfileDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowProfileDiagnostics(document.RootElement, options); + } + + internal static DataflowProfileDiagnostics DeserializeDataflowProfileDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiagnosticsLogs logs = default; + IotOperationsMetrics metrics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logs = DiagnosticsLogs.DeserializeDiagnosticsLogs(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = IotOperationsMetrics.DeserializeIotOperationsMetrics(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowProfileDiagnostics(logs, metrics, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowProfileDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + DataflowProfileDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowProfileDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowProfileDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.cs new file mode 100644 index 000000000000..1054dadc6d3b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileDiagnostics.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowProfile Diagnostics properties. + public partial class DataflowProfileDiagnostics + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataflowProfileDiagnostics() + { + } + + /// Initializes a new instance of . + /// Diagnostic log settings for the resource. + /// The metrics settings for the resource. + /// Keeps track of any properties unknown to the library. + internal DataflowProfileDiagnostics(DiagnosticsLogs logs, IotOperationsMetrics metrics, IDictionary serializedAdditionalRawData) + { + Logs = logs; + Metrics = metrics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Diagnostic log settings for the resource. + internal DiagnosticsLogs Logs { get; set; } + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string LogsLevel + { + get => Logs is null ? default : Logs.Level; + set + { + if (Logs is null) + Logs = new DiagnosticsLogs(); + Logs.Level = value; + } + } + + /// The metrics settings for the resource. + internal IotOperationsMetrics Metrics { get; set; } + /// The prometheus port to expose the metrics. + public int? MetricsPrometheusPort + { + get => Metrics is null ? default : Metrics.PrometheusPort; + set + { + if (Metrics is null) + Metrics = new IotOperationsMetrics(); + Metrics.PrometheusPort = value; + } + } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs similarity index 54% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs index e8623de9c6f2..cb98cf5c7085 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/UsernamePasswordCredentialsUpdate.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - public partial class UsernamePasswordCredentialsUpdate : IUtf8JsonSerializable, IJsonModel + internal partial class DataflowProfileResourceListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,21 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UsernamePasswordCredentialsUpdate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(UsernameReference)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("usernameReference"u8); - writer.WriteStringValue(UsernameReference); + writer.WriteObjectValue(item, options); } - if (Optional.IsDefined(PasswordReference)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - writer.WritePropertyName("passwordReference"u8); - writer.WriteStringValue(PasswordReference); + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UsernamePasswordCredentialsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataflowProfileResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UsernamePasswordCredentialsUpdate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUsernamePasswordCredentialsUpdate(document.RootElement, options); + return DeserializeDataflowProfileResourceListResult(document.RootElement, options); } - internal static UsernamePasswordCredentialsUpdate DeserializeUsernamePasswordCredentialsUpdate(JsonElement element, ModelReaderWriterOptions options = null) + internal static DataflowProfileResourceListResult DeserializeDataflowProfileResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,20 +83,29 @@ internal static UsernamePasswordCredentialsUpdate DeserializeUsernamePasswordCre { return null; } - string usernameReference = default; - string passwordReference = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("usernameReference"u8)) + if (property.NameEquals("value"u8)) { - usernameReference = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(item, options)); + } + value = array; continue; } - if (property.NameEquals("passwordReference"u8)) + if (property.NameEquals("nextLink"u8)) { - passwordReference = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -103,38 +114,38 @@ internal static UsernamePasswordCredentialsUpdate DeserializeUsernamePasswordCre } } serializedAdditionalRawData = rawDataDictionary; - return new UsernamePasswordCredentialsUpdate(usernameReference, passwordReference, serializedAdditionalRawData); + return new DataflowProfileResourceListResult(value, nextLink, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UsernamePasswordCredentialsUpdate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support writing '{options.Format}' format."); } } - UsernamePasswordCredentialsUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DataflowProfileResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUsernamePasswordCredentialsUpdate(document.RootElement, options); + return DeserializeDataflowProfileResourceListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UsernamePasswordCredentialsUpdate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.cs new file mode 100644 index 000000000000..7cd1f46d44cd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowProfileResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a DataflowProfileResource list operation. + internal partial class DataflowProfileResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The DataflowProfileResource items on this page. + /// is null. + internal DataflowProfileResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowProfileResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowProfileResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowProfileResourceListResult() + { + } + + /// The DataflowProfileResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs new file mode 100644 index 000000000000..baefa40cd68e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class DataflowResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowResourceListResult(document.RootElement, options); + } + + internal static DataflowResourceListResult DeserializeDataflowResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsDataflowData.DeserializeIotOperationsDataflowData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DataflowResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.cs new file mode 100644 index 000000000000..c354c4b17576 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a DataflowResource list operation. + internal partial class DataflowResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The DataflowResource items on this page. + /// is null. + internal DataflowResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowResourceListResult() + { + } + + /// The DataflowResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs new file mode 100644 index 000000000000..fc55b1cc404c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DataflowSourceOperationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointRef"u8); + writer.WriteStringValue(EndpointRef); + if (Optional.IsDefined(AssetRef)) + { + writer.WritePropertyName("assetRef"u8); + writer.WriteStringValue(AssetRef); + } + if (Optional.IsDefined(SerializationFormat)) + { + writer.WritePropertyName("serializationFormat"u8); + writer.WriteStringValue(SerializationFormat.Value.ToString()); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + writer.WritePropertyName("dataSources"u8); + writer.WriteStartArray(); + foreach (var item in DataSources) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowSourceOperationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowSourceOperationSettings(document.RootElement, options); + } + + internal static DataflowSourceOperationSettings DeserializeDataflowSourceOperationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpointRef = default; + string assetRef = default; + DataflowSourceSerializationFormat? serializationFormat = default; + string schemaRef = default; + IList dataSources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointRef"u8)) + { + endpointRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("assetRef"u8)) + { + assetRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("serializationFormat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serializationFormat = new DataflowSourceSerializationFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataSources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowSourceOperationSettings( + endpointRef, + assetRef, + serializationFormat, + schemaRef, + dataSources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowSourceOperationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowSourceOperationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.cs new file mode 100644 index 000000000000..62015b711671 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceOperationSettings.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow Source Operation properties. + public partial class DataflowSourceOperationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + /// or is null. + public DataflowSourceOperationSettings(string endpointRef, IEnumerable dataSources) + { + Argument.AssertNotNull(endpointRef, nameof(endpointRef)); + Argument.AssertNotNull(dataSources, nameof(dataSources)); + + EndpointRef = endpointRef; + DataSources = dataSources.ToList(); + } + + /// Initializes a new instance of . + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + /// Reference to the resource in Azure Device Registry where the data in the endpoint originates from. + /// Content is a JSON Schema. Allowed: JSON Schema/draft-7. + /// Schema CR reference. Data will be deserialized according to the schema, and dropped if it doesn't match. + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + /// Keeps track of any properties unknown to the library. + internal DataflowSourceOperationSettings(string endpointRef, string assetRef, DataflowSourceSerializationFormat? serializationFormat, string schemaRef, IList dataSources, IDictionary serializedAdditionalRawData) + { + EndpointRef = endpointRef; + AssetRef = assetRef; + SerializationFormat = serializationFormat; + SchemaRef = schemaRef; + DataSources = dataSources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowSourceOperationSettings() + { + } + + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + public string EndpointRef { get; set; } + /// Reference to the resource in Azure Device Registry where the data in the endpoint originates from. + public string AssetRef { get; set; } + /// Content is a JSON Schema. Allowed: JSON Schema/draft-7. + public DataflowSourceSerializationFormat? SerializationFormat { get; set; } + /// Schema CR reference. Data will be deserialized according to the schema, and dropped if it doesn't match. + public string SchemaRef { get; set; } + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + public IList DataSources { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceSerializationFormat.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceSerializationFormat.cs new file mode 100644 index 000000000000..24aa4ba2ba4c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DataflowSourceSerializationFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Serialization Format properties. + public readonly partial struct DataflowSourceSerializationFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowSourceSerializationFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string JsonValue = "Json"; + + /// JSON Format. + public static DataflowSourceSerializationFormat Json { get; } = new DataflowSourceSerializationFormat(JsonValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowSourceSerializationFormat left, DataflowSourceSerializationFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowSourceSerializationFormat left, DataflowSourceSerializationFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowSourceSerializationFormat(string value) => new DataflowSourceSerializationFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowSourceSerializationFormat other && Equals(other); + /// + public bool Equals(DataflowSourceSerializationFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.Serialization.cs new file mode 100644 index 000000000000..c4e5de6d1325 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DiagnosticSelfTracing : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiagnosticSelfTracing)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(IntervalSeconds)) + { + writer.WritePropertyName("intervalSeconds"u8); + writer.WriteNumberValue(IntervalSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiagnosticSelfTracing IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiagnosticSelfTracing)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiagnosticSelfTracing(document.RootElement, options); + } + + internal static DiagnosticSelfTracing DeserializeDiagnosticSelfTracing(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? mode = default; + int? intervalSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("intervalSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiagnosticSelfTracing(mode, intervalSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiagnosticSelfTracing)} does not support writing '{options.Format}' format."); + } + } + + DiagnosticSelfTracing IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiagnosticSelfTracing(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiagnosticSelfTracing)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.cs new file mode 100644 index 000000000000..f9affe6eaa19 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticSelfTracing.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Diagnostic Self tracing properties. + public partial class DiagnosticSelfTracing + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiagnosticSelfTracing() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable self tracing. + /// The self tracing interval. + /// Keeps track of any properties unknown to the library. + internal DiagnosticSelfTracing(IotOperationsOperationalMode? mode, int? intervalSeconds, IDictionary serializedAdditionalRawData) + { + Mode = mode; + IntervalSeconds = intervalSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable self tracing. + public IotOperationsOperationalMode? Mode { get; set; } + /// The self tracing interval. + public int? IntervalSeconds { get; set; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs similarity index 65% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs index 09bd44e51ca4..9ba39763c348 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - internal partial class X509Credentials : IUtf8JsonSerializable, IJsonModel + internal partial class DiagnosticsLogs : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,17 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(X509Credentials)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support writing '{format}' format."); } - writer.WritePropertyName("certificateReference"u8); - writer.WriteStringValue(CertificateReference); + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -53,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - X509Credentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DiagnosticsLogs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(X509Credentials)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeX509Credentials(document.RootElement, options); + return DeserializeDiagnosticsLogs(document.RootElement, options); } - internal static X509Credentials DeserializeX509Credentials(JsonElement element, ModelReaderWriterOptions options = null) + internal static DiagnosticsLogs DeserializeDiagnosticsLogs(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,14 +76,14 @@ internal static X509Credentials DeserializeX509Credentials(JsonElement element, { return null; } - string certificateReference = default; + string level = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("certificateReference"u8)) + if (property.NameEquals("level"u8)) { - certificateReference = property.Value.GetString(); + level = property.Value.GetString(); continue; } if (options.Format != "W") @@ -89,38 +92,38 @@ internal static X509Credentials DeserializeX509Credentials(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new X509Credentials(certificateReference, serializedAdditionalRawData); + return new DiagnosticsLogs(level, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(X509Credentials)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support writing '{options.Format}' format."); } } - X509Credentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DiagnosticsLogs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeX509Credentials(document.RootElement, options); + return DeserializeDiagnosticsLogs(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(X509Credentials)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.cs new file mode 100644 index 000000000000..c9c5df765600 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiagnosticsLogs.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Diagnostic Log properties. + internal partial class DiagnosticsLogs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiagnosticsLogs() + { + } + + /// Initializes a new instance of . + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + /// Keeps track of any properties unknown to the library. + internal DiagnosticsLogs(string level, IDictionary serializedAdditionalRawData) + { + Level = level; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string Level { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs new file mode 100644 index 000000000000..afef033cd307 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class DiskBackedMessageBuffer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("maxSize"u8); + writer.WriteStringValue(MaxSize); + if (Optional.IsDefined(EphemeralVolumeClaimSpec)) + { + writer.WritePropertyName("ephemeralVolumeClaimSpec"u8); + writer.WriteObjectValue(EphemeralVolumeClaimSpec, options); + } + if (Optional.IsDefined(PersistentVolumeClaimSpec)) + { + writer.WritePropertyName("persistentVolumeClaimSpec"u8); + writer.WriteObjectValue(PersistentVolumeClaimSpec, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskBackedMessageBuffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskBackedMessageBuffer(document.RootElement, options); + } + + internal static DiskBackedMessageBuffer DeserializeDiskBackedMessageBuffer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string maxSize = default; + VolumeClaimSpec ephemeralVolumeClaimSpec = default; + VolumeClaimSpec persistentVolumeClaimSpec = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxSize"u8)) + { + maxSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("ephemeralVolumeClaimSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ephemeralVolumeClaimSpec = VolumeClaimSpec.DeserializeVolumeClaimSpec(property.Value, options); + continue; + } + if (property.NameEquals("persistentVolumeClaimSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + persistentVolumeClaimSpec = VolumeClaimSpec.DeserializeVolumeClaimSpec(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskBackedMessageBuffer(maxSize, ephemeralVolumeClaimSpec, persistentVolumeClaimSpec, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support writing '{options.Format}' format."); + } + } + + DiskBackedMessageBuffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskBackedMessageBuffer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.cs new file mode 100644 index 000000000000..397e07f090bb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/DiskBackedMessageBuffer.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DiskBackedMessageBuffer properties. + public partial class DiskBackedMessageBuffer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + /// is null. + public DiskBackedMessageBuffer(string maxSize) + { + Argument.AssertNotNull(maxSize, nameof(maxSize)); + + MaxSize = maxSize; + } + + /// Initializes a new instance of . + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + /// Use the specified persistent volume claim template to mount a "generic ephemeral volume" for the message buffer. See <https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes> for details. + /// Use the specified persistent volume claim template to mount a persistent volume for the message buffer. + /// Keeps track of any properties unknown to the library. + internal DiskBackedMessageBuffer(string maxSize, VolumeClaimSpec ephemeralVolumeClaimSpec, VolumeClaimSpec persistentVolumeClaimSpec, IDictionary serializedAdditionalRawData) + { + MaxSize = maxSize; + EphemeralVolumeClaimSpec = ephemeralVolumeClaimSpec; + PersistentVolumeClaimSpec = persistentVolumeClaimSpec; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiskBackedMessageBuffer() + { + } + + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + public string MaxSize { get; set; } + /// Use the specified persistent volume claim template to mount a "generic ephemeral volume" for the message buffer. See <https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes> for details. + public VolumeClaimSpec EphemeralVolumeClaimSpec { get; set; } + /// Use the specified persistent volume claim template to mount a persistent volume for the message buffer. + public VolumeClaimSpec PersistentVolumeClaimSpec { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs new file mode 100644 index 000000000000..775238b10f53 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Fabric One Lake Authentication Method properties. + public readonly partial struct FabricOneLakeAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FabricOneLakeAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + + /// SystemAssignedManagedIdentity type. + public static FabricOneLakeAuthMethod SystemAssignedManagedIdentity { get; } = new FabricOneLakeAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static FabricOneLakeAuthMethod UserAssignedManagedIdentity { get; } = new FabricOneLakeAuthMethod(UserAssignedManagedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(FabricOneLakeAuthMethod left, FabricOneLakeAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FabricOneLakeAuthMethod left, FabricOneLakeAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FabricOneLakeAuthMethod(string value) => new FabricOneLakeAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FabricOneLakeAuthMethod other && Equals(other); + /// + public bool Equals(FabricOneLakeAuthMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs new file mode 100644 index 000000000000..dbf60920daa8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class GenerateResourceLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Cpu)) + { + writer.WritePropertyName("cpu"u8); + writer.WriteStringValue(Cpu.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GenerateResourceLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGenerateResourceLimits(document.RootElement, options); + } + + internal static GenerateResourceLimits DeserializeGenerateResourceLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? cpu = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cpu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpu = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GenerateResourceLimits(cpu, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support writing '{options.Format}' format."); + } + } + + GenerateResourceLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGenerateResourceLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.cs new file mode 100644 index 000000000000..429b203649e5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/GenerateResourceLimits.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// GenerateResourceLimits properties. + internal partial class GenerateResourceLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GenerateResourceLimits() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable cpu resource limits. + /// Keeps track of any properties unknown to the library. + internal GenerateResourceLimits(IotOperationsOperationalMode? cpu, IDictionary serializedAdditionalRawData) + { + Cpu = cpu; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable cpu resource limits. + public IotOperationsOperationalMode? Cpu { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs new file mode 100644 index 000000000000..cfbe5f5b78c4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class InstanceResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstanceResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceResourceListResult(document.RootElement, options); + } + + internal static InstanceResourceListResult DeserializeInstanceResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IotOperationsInstanceData.DeserializeIotOperationsInstanceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + InstanceResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstanceResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.cs new file mode 100644 index 000000000000..52f45bbdf23b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The response of a InstanceResource list operation. + internal partial class InstanceResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The InstanceResource items on this page. + /// is null. + internal InstanceResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InstanceResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InstanceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InstanceResourceListResult() + { + } + + /// The InstanceResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.Serialization.cs new file mode 100644 index 000000000000..c2cf840fdb22 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsBatchingConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBatchingConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LatencySeconds)) + { + writer.WritePropertyName("latencySeconds"u8); + writer.WriteNumberValue(LatencySeconds.Value); + } + if (Optional.IsDefined(MaxMessages)) + { + writer.WritePropertyName("maxMessages"u8); + writer.WriteNumberValue(MaxMessages.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsBatchingConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBatchingConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBatchingConfig(document.RootElement, options); + } + + internal static IotOperationsBatchingConfig DeserializeIotOperationsBatchingConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? latencySeconds = default; + int? maxMessages = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("latencySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latencySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessages = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBatchingConfig(latencySeconds, maxMessages, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBatchingConfig)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBatchingConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBatchingConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBatchingConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.cs new file mode 100644 index 000000000000..0b054a83564c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBatchingConfig.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Batching configuration. + public partial class IotOperationsBatchingConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsBatchingConfig() + { + } + + /// Initializes a new instance of . + /// Batching latency in seconds. + /// Maximum number of messages in a batch. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBatchingConfig(int? latencySeconds, int? maxMessages, IDictionary serializedAdditionalRawData) + { + LatencySeconds = latencySeconds; + MaxMessages = maxMessages; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Batching latency in seconds. + public int? LatencySeconds { get; set; } + /// Maximum number of messages in a batch. + public int? MaxMessages { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.Serialization.cs new file mode 100644 index 000000000000..3f26cfe783af --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsBrokerAuthenticationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authenticationMethods"u8); + writer.WriteStartArray(); + foreach (var item in AuthenticationMethods) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsBrokerAuthenticationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerAuthenticationProperties(document.RootElement, options); + } + + internal static IotOperationsBrokerAuthenticationProperties DeserializeIotOperationsBrokerAuthenticationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList authenticationMethods = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationMethods"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerAuthenticatorMethods.DeserializeBrokerAuthenticatorMethods(item, options)); + } + authenticationMethods = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerAuthenticationProperties(authenticationMethods, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerAuthenticationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerAuthenticationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthenticationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.cs new file mode 100644 index 000000000000..641ebc82bb8c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthenticationProperties.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// BrokerAuthentication Resource properties. + public partial class IotOperationsBrokerAuthenticationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// is null. + public IotOperationsBrokerAuthenticationProperties(IEnumerable authenticationMethods) + { + Argument.AssertNotNull(authenticationMethods, nameof(authenticationMethods)); + + AuthenticationMethods = authenticationMethods.ToList(); + } + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerAuthenticationProperties(IList authenticationMethods, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthenticationMethods = authenticationMethods; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerAuthenticationProperties() + { + } + + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + public IList AuthenticationMethods { get; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs new file mode 100644 index 000000000000..2cf3a7404c29 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs +namespace Azure.ResourceManager.Network.Models +{ + public partial class ExpressRouteFailoverCircuitResourceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsBrokerAuthorizationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExpressRouteFailoverCircuitResourceDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NrpResourceUri)) + { + writer.WritePropertyName("nrpResourceUri"u8); + writer.WriteStringValue(NrpResourceUri.AbsoluteUri); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ConnectionName)) + { + writer.WritePropertyName("connectionName"u8); + writer.WriteStringValue(ConnectionName); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authorizationPolicies"u8); + writer.WriteObjectValue(AuthorizationPolicies, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + ExpressRouteFailoverCircuitResourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExpressRouteFailoverCircuitResourceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExpressRouteFailoverCircuitResourceDetails(document.RootElement, options); + } + + internal static ExpressRouteFailoverCircuitResourceDetails DeserializeExpressRouteFailoverCircuitResourceDetails(JsonElement element, ModelReaderWriterOptions options = null) +======== + IotOperationsBrokerAuthorizationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerAuthorizationProperties(document.RootElement, options); + } + + internal static IotOperationsBrokerAuthorizationProperties DeserializeIotOperationsBrokerAuthorizationProperties(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + Uri nrpResourceUri = default; + string name = default; + string connectionName = default; +======== + BrokerAuthorizationConfig authorizationPolicies = default; + IotOperationsProvisioningState? provisioningState = default; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + if (property.NameEquals("nrpResourceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nrpResourceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionName"u8)) + { + connectionName = property.Value.GetString(); +======== + if (property.NameEquals("authorizationPolicies"u8)) + { + authorizationPolicies = BrokerAuthorizationConfig.DeserializeBrokerAuthorizationConfig(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + return new ExpressRouteFailoverCircuitResourceDetails(nrpResourceUri, name, connectionName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new IotOperationsBrokerAuthorizationProperties(authorizationPolicies, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + throw new FormatException($"The model {nameof(ExpressRouteFailoverCircuitResourceDetails)} does not support writing '{options.Format}' format."); + } + } + + ExpressRouteFailoverCircuitResourceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerAuthorizationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ExpressRouteFailoverCircuitResourceDetails.Serialization.cs + return DeserializeExpressRouteFailoverCircuitResourceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExpressRouteFailoverCircuitResourceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeIotOperationsBrokerAuthorizationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerAuthorizationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.Serialization.cs + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.cs new file mode 100644 index 000000000000..40ff0898b820 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerAuthorizationProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// BrokerAuthorization Resource properties. + public partial class IotOperationsBrokerAuthorizationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// is null. + public IotOperationsBrokerAuthorizationProperties(BrokerAuthorizationConfig authorizationPolicies) + { + Argument.AssertNotNull(authorizationPolicies, nameof(authorizationPolicies)); + + AuthorizationPolicies = authorizationPolicies; + } + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerAuthorizationProperties(BrokerAuthorizationConfig authorizationPolicies, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthorizationPolicies = authorizationPolicies; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerAuthorizationProperties() + { + } + + /// The list of authorization policies supported by the Authorization Resource. + public BrokerAuthorizationConfig AuthorizationPolicies { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.Serialization.cs new file mode 100644 index 000000000000..27b7965ee76e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsBrokerListenerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName); + } + writer.WritePropertyName("ports"u8); + writer.WriteStartArray(); + foreach (var item in Ports) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(ServiceType)) + { + writer.WritePropertyName("serviceType"u8); + writer.WriteStringValue(ServiceType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsBrokerListenerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerListenerProperties(document.RootElement, options); + } + + internal static IotOperationsBrokerListenerProperties DeserializeIotOperationsBrokerListenerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string serviceName = default; + IList ports = default; + BlockerListenerServiceType? serviceType = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceName"u8)) + { + serviceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("ports"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerListenerPort.DeserializeBrokerListenerPort(item, options)); + } + ports = array; + continue; + } + if (property.NameEquals("serviceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceType = new BlockerListenerServiceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerListenerProperties(serviceName, ports, serviceType, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerListenerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerListenerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerListenerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.cs new file mode 100644 index 000000000000..360cbbb3f744 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerListenerProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Defines a Broker listener. A listener is a collection of ports on which the broker accepts connections from clients. + public partial class IotOperationsBrokerListenerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Ports on which this listener accepts client connections. + /// is null. + public IotOperationsBrokerListenerProperties(IEnumerable ports) + { + Argument.AssertNotNull(ports, nameof(ports)); + + Ports = ports.ToList(); + } + + /// Initializes a new instance of . + /// Kubernetes Service name of this listener. + /// Ports on which this listener accepts client connections. + /// Kubernetes Service type of this listener. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerListenerProperties(string serviceName, IList ports, BlockerListenerServiceType? serviceType, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ServiceName = serviceName; + Ports = ports; + ServiceType = serviceType; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsBrokerListenerProperties() + { + } + + /// Kubernetes Service name of this listener. + public string ServiceName { get; set; } + /// Ports on which this listener accepts client connections. + public IList Ports { get; } + /// Kubernetes Service type of this listener. + public BlockerListenerServiceType? ServiceType { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.Serialization.cs new file mode 100644 index 000000000000..3b2c22f2cc17 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsBrokerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Advanced)) + { + writer.WritePropertyName("advanced"u8); + writer.WriteObjectValue(Advanced, options); + } + if (Optional.IsDefined(Cardinality)) + { + writer.WritePropertyName("cardinality"u8); + writer.WriteObjectValue(Cardinality, options); + } + if (Optional.IsDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteObjectValue(Diagnostics, options); + } + if (Optional.IsDefined(DiskBackedMessageBuffer)) + { + writer.WritePropertyName("diskBackedMessageBuffer"u8); + writer.WriteObjectValue(DiskBackedMessageBuffer, options); + } + if (Optional.IsDefined(GenerateResourceLimits)) + { + writer.WritePropertyName("generateResourceLimits"u8); + writer.WriteObjectValue(GenerateResourceLimits, options); + } + if (Optional.IsDefined(MemoryProfile)) + { + writer.WritePropertyName("memoryProfile"u8); + writer.WriteStringValue(MemoryProfile.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsBrokerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsBrokerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsBrokerProperties(document.RootElement, options); + } + + internal static IotOperationsBrokerProperties DeserializeIotOperationsBrokerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAdvancedSettings advanced = default; + BrokerCardinality cardinality = default; + BrokerDiagnostics diagnostics = default; + DiskBackedMessageBuffer diskBackedMessageBuffer = default; + GenerateResourceLimits generateResourceLimits = default; + BrokerMemoryProfile? memoryProfile = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("advanced"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + advanced = BrokerAdvancedSettings.DeserializeBrokerAdvancedSettings(property.Value, options); + continue; + } + if (property.NameEquals("cardinality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cardinality = BrokerCardinality.DeserializeBrokerCardinality(property.Value, options); + continue; + } + if (property.NameEquals("diagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnostics = BrokerDiagnostics.DeserializeBrokerDiagnostics(property.Value, options); + continue; + } + if (property.NameEquals("diskBackedMessageBuffer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBackedMessageBuffer = DiskBackedMessageBuffer.DeserializeDiskBackedMessageBuffer(property.Value, options); + continue; + } + if (property.NameEquals("generateResourceLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + generateResourceLimits = GenerateResourceLimits.DeserializeGenerateResourceLimits(property.Value, options); + continue; + } + if (property.NameEquals("memoryProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryProfile = new BrokerMemoryProfile(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsBrokerProperties( + advanced, + cardinality, + diagnostics, + diskBackedMessageBuffer, + generateResourceLimits, + memoryProfile, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsBrokerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsBrokerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsBrokerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.cs new file mode 100644 index 000000000000..895aa85c0e2a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsBrokerProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Resource properties. + public partial class IotOperationsBrokerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsBrokerProperties() + { + } + + /// Initializes a new instance of . + /// Advanced settings of Broker. + /// The cardinality details of the broker. + /// Spec defines the desired identities of Broker diagnostics settings. + /// Settings of Disk Backed Message Buffer. + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + /// Memory profile of Broker. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsBrokerProperties(BrokerAdvancedSettings advanced, BrokerCardinality cardinality, BrokerDiagnostics diagnostics, DiskBackedMessageBuffer diskBackedMessageBuffer, GenerateResourceLimits generateResourceLimits, BrokerMemoryProfile? memoryProfile, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Advanced = advanced; + Cardinality = cardinality; + Diagnostics = diagnostics; + DiskBackedMessageBuffer = diskBackedMessageBuffer; + GenerateResourceLimits = generateResourceLimits; + MemoryProfile = memoryProfile; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Advanced settings of Broker. + public BrokerAdvancedSettings Advanced { get; set; } + /// The cardinality details of the broker. + public BrokerCardinality Cardinality { get; set; } + /// Spec defines the desired identities of Broker diagnostics settings. + public BrokerDiagnostics Diagnostics { get; set; } + /// Settings of Disk Backed Message Buffer. + public DiskBackedMessageBuffer DiskBackedMessageBuffer { get; set; } + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + internal GenerateResourceLimits GenerateResourceLimits { get; set; } + /// The toggle to enable/disable cpu resource limits. + public IotOperationsOperationalMode? GenerateResourceLimitsCpu + { + get => GenerateResourceLimits is null ? default : GenerateResourceLimits.Cpu; + set + { + if (GenerateResourceLimits is null) + GenerateResourceLimits = new GenerateResourceLimits(); + GenerateResourceLimits.Cpu = value; + } + } + + /// Memory profile of Broker. + public BrokerMemoryProfile? MemoryProfile { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.Serialization.cs new file mode 100644 index 000000000000..c11fb03493a3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.Serialization.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsDataflowEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(DataExplorerSettings)) + { + writer.WritePropertyName("dataExplorerSettings"u8); + writer.WriteObjectValue(DataExplorerSettings, options); + } + if (Optional.IsDefined(DataLakeStorageSettings)) + { + writer.WritePropertyName("dataLakeStorageSettings"u8); + writer.WriteObjectValue(DataLakeStorageSettings, options); + } + if (Optional.IsDefined(FabricOneLakeSettings)) + { + writer.WritePropertyName("fabricOneLakeSettings"u8); + writer.WriteObjectValue(FabricOneLakeSettings, options); + } + if (Optional.IsDefined(KafkaSettings)) + { + writer.WritePropertyName("kafkaSettings"u8); + writer.WriteObjectValue(KafkaSettings, options); + } + if (Optional.IsDefined(LocalStorageSettings)) + { + writer.WritePropertyName("localStorageSettings"u8); + writer.WriteObjectValue(LocalStorageSettings, options); + } + if (Optional.IsDefined(MqttSettings)) + { + writer.WritePropertyName("mqttSettings"u8); + writer.WriteObjectValue(MqttSettings, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsDataflowEndpointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowEndpointProperties(document.RootElement, options); + } + + internal static IotOperationsDataflowEndpointProperties DeserializeIotOperationsDataflowEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointType endpointType = default; + DataflowEndpointDataExplorer dataExplorerSettings = default; + DataflowEndpointDataLakeStorage dataLakeStorageSettings = default; + DataflowEndpointFabricOneLake fabricOneLakeSettings = default; + DataflowEndpointKafka kafkaSettings = default; + DataflowEndpointLocalStorage localStorageSettings = default; + DataflowEndpointMqtt mqttSettings = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointType"u8)) + { + endpointType = new DataflowEndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataExplorerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataExplorerSettings = DataflowEndpointDataExplorer.DeserializeDataflowEndpointDataExplorer(property.Value, options); + continue; + } + if (property.NameEquals("dataLakeStorageSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataLakeStorageSettings = DataflowEndpointDataLakeStorage.DeserializeDataflowEndpointDataLakeStorage(property.Value, options); + continue; + } + if (property.NameEquals("fabricOneLakeSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricOneLakeSettings = DataflowEndpointFabricOneLake.DeserializeDataflowEndpointFabricOneLake(property.Value, options); + continue; + } + if (property.NameEquals("kafkaSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kafkaSettings = DataflowEndpointKafka.DeserializeDataflowEndpointKafka(property.Value, options); + continue; + } + if (property.NameEquals("localStorageSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStorageSettings = DataflowEndpointLocalStorage.DeserializeDataflowEndpointLocalStorage(property.Value, options); + continue; + } + if (property.NameEquals("mqttSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mqttSettings = DataflowEndpointMqtt.DeserializeDataflowEndpointMqtt(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowEndpointProperties( + endpointType, + dataExplorerSettings, + dataLakeStorageSettings, + fabricOneLakeSettings, + kafkaSettings, + localStorageSettings, + mqttSettings, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowEndpointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.cs new file mode 100644 index 000000000000..dec808ba0d3b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowEndpointProperties.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Resource properties. NOTE - Only one type of endpoint is supported for one Resource. + public partial class IotOperationsDataflowEndpointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Endpoint Type. + public IotOperationsDataflowEndpointProperties(DataflowEndpointType endpointType) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of . + /// Endpoint Type. + /// Azure Data Explorer endpoint. + /// Azure Data Lake endpoint. + /// Microsoft Fabric endpoint. + /// Kafka endpoint. + /// Local persistent volume endpoint. + /// Broker endpoint. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowEndpointProperties(DataflowEndpointType endpointType, DataflowEndpointDataExplorer dataExplorerSettings, DataflowEndpointDataLakeStorage dataLakeStorageSettings, DataflowEndpointFabricOneLake fabricOneLakeSettings, DataflowEndpointKafka kafkaSettings, DataflowEndpointLocalStorage localStorageSettings, DataflowEndpointMqtt mqttSettings, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + EndpointType = endpointType; + DataExplorerSettings = dataExplorerSettings; + DataLakeStorageSettings = dataLakeStorageSettings; + FabricOneLakeSettings = fabricOneLakeSettings; + KafkaSettings = kafkaSettings; + LocalStorageSettings = localStorageSettings; + MqttSettings = mqttSettings; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsDataflowEndpointProperties() + { + } + + /// Endpoint Type. + public DataflowEndpointType EndpointType { get; set; } + /// Azure Data Explorer endpoint. + public DataflowEndpointDataExplorer DataExplorerSettings { get; set; } + /// Azure Data Lake endpoint. + public DataflowEndpointDataLakeStorage DataLakeStorageSettings { get; set; } + /// Microsoft Fabric endpoint. + public DataflowEndpointFabricOneLake FabricOneLakeSettings { get; set; } + /// Kafka endpoint. + public DataflowEndpointKafka KafkaSettings { get; set; } + /// Local persistent volume endpoint. + internal DataflowEndpointLocalStorage LocalStorageSettings { get; set; } + /// Persistent volume claim name. + public string LocalStoragePersistentVolumeClaimRef + { + get => LocalStorageSettings is null ? default : LocalStorageSettings.PersistentVolumeClaimRef; + set => LocalStorageSettings = new DataflowEndpointLocalStorage(value); + } + + /// Broker endpoint. + public DataflowEndpointMqtt MqttSettings { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.Serialization.cs new file mode 100644 index 000000000000..d5ea7ed28597 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsDataflowProfileProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteObjectValue(Diagnostics, options); + } + if (Optional.IsDefined(InstanceCount)) + { + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsDataflowProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowProfileProperties(document.RootElement, options); + } + + internal static IotOperationsDataflowProfileProperties DeserializeIotOperationsDataflowProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowProfileDiagnostics diagnostics = default; + int? instanceCount = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnostics = DataflowProfileDiagnostics.DeserializeDataflowProfileDiagnostics(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowProfileProperties(diagnostics, instanceCount, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowProfileProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProfileProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.cs new file mode 100644 index 000000000000..d4fd5a06e559 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProfileProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowProfile Resource properties. + public partial class IotOperationsDataflowProfileProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsDataflowProfileProperties() + { + } + + /// Initializes a new instance of . + /// Spec defines the desired identities of NBC diagnostics settings. + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowProfileProperties(DataflowProfileDiagnostics diagnostics, int? instanceCount, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Diagnostics = diagnostics; + InstanceCount = instanceCount; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Spec defines the desired identities of NBC diagnostics settings. + public DataflowProfileDiagnostics Diagnostics { get; set; } + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + public int? InstanceCount { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.Serialization.cs new file mode 100644 index 000000000000..9ab53970edc4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsDataflowProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + writer.WritePropertyName("operations"u8); + writer.WriteStartArray(); + foreach (var item in Operations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsDataflowProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsDataflowProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsDataflowProperties(document.RootElement, options); + } + + internal static IotOperationsDataflowProperties DeserializeIotOperationsDataflowProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? mode = default; + IList operations = default; + IotOperationsProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("operations"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowOperationProperties.DeserializeDataflowOperationProperties(item, options)); + } + operations = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsDataflowProperties(mode, operations, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsDataflowProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsDataflowProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsDataflowProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.cs new file mode 100644 index 000000000000..194d29e2d527 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsDataflowProperties.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Dataflow Resource properties. + public partial class IotOperationsDataflowProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of operations including source and destination references as well as transformation. + /// is null. + public IotOperationsDataflowProperties(IEnumerable operations) + { + Argument.AssertNotNull(operations, nameof(operations)); + + Operations = operations.ToList(); + } + + /// Initializes a new instance of . + /// Mode for Dataflow. Optional; defaults to Enabled. + /// List of operations including source and destination references as well as transformation. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsDataflowProperties(IotOperationsOperationalMode? mode, IList operations, IotOperationsProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Mode = mode; + Operations = operations; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsDataflowProperties() + { + } + + /// Mode for Dataflow. Optional; defaults to Enabled. + public IotOperationsOperationalMode? Mode { get; set; } + /// List of operations including source and destination references as well as transformation. + public IList Operations { get; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.Serialization.cs new file mode 100644 index 000000000000..b2d1984db123 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsExtendedLocation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsExtendedLocation)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsExtendedLocation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsExtendedLocation(document.RootElement, options); + } + + internal static IotOperationsExtendedLocation DeserializeIotOperationsExtendedLocation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IotOperationsExtendedLocationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new IotOperationsExtendedLocationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsExtendedLocation(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsExtendedLocation)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsExtendedLocation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsExtendedLocation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsExtendedLocation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.cs new file mode 100644 index 000000000000..25458631a1b8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocation.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Extended location is an extension of Azure locations. They provide a way to use their Azure ARC enabled Kubernetes clusters as target locations for deploying Azure services instances. + public partial class IotOperationsExtendedLocation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the extended location. + /// Type of ExtendedLocation. + /// is null. + public IotOperationsExtendedLocation(string name, IotOperationsExtendedLocationType type) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Type = type; + } + + /// Initializes a new instance of . + /// The name of the extended location. + /// Type of ExtendedLocation. + /// Keeps track of any properties unknown to the library. + internal IotOperationsExtendedLocation(string name, IotOperationsExtendedLocationType type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsExtendedLocation() + { + } + + /// The name of the extended location. + public string Name { get; set; } + /// Type of ExtendedLocation. + public IotOperationsExtendedLocationType Type { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocationType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocationType.cs new file mode 100644 index 000000000000..bdd20c1e83e2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsExtendedLocationType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The enum defining type of ExtendedLocation accepted. + public readonly partial struct IotOperationsExtendedLocationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IotOperationsExtendedLocationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomLocationValue = "CustomLocation"; + + /// CustomLocation type. + public static IotOperationsExtendedLocationType CustomLocation { get; } = new IotOperationsExtendedLocationType(CustomLocationValue); + /// Determines if two values are the same. + public static bool operator ==(IotOperationsExtendedLocationType left, IotOperationsExtendedLocationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IotOperationsExtendedLocationType left, IotOperationsExtendedLocationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IotOperationsExtendedLocationType(string value) => new IotOperationsExtendedLocationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IotOperationsExtendedLocationType other && Equals(other); + /// + public bool Equals(IotOperationsExtendedLocationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.Serialization.cs new file mode 100644 index 000000000000..8dc58170b971 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstancePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsInstancePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsInstancePatch(document.RootElement, options); + } + + internal static IotOperationsInstancePatch DeserializeIotOperationsInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentity identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsInstancePatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.cs new file mode 100644 index 000000000000..bc054f2b694c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstancePatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The Instance update model. + public partial class IotOperationsInstancePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal IotOperationsInstancePatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs new file mode 100644 index 000000000000..e003faf6325a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsInstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstanceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + writer.WritePropertyName("schemaRegistryRef"u8); + writer.WriteObjectValue(SchemaRegistryRef, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsInstanceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsInstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsInstanceProperties(document.RootElement, options); + } + + internal static IotOperationsInstanceProperties DeserializeIotOperationsInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + IotOperationsProvisioningState? provisioningState = default; + string version = default; + SchemaRegistryRef schemaRegistryRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new IotOperationsProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaRegistryRef"u8)) + { + schemaRegistryRef = SchemaRegistryRef.DeserializeSchemaRegistryRef(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsInstanceProperties(description, provisioningState, version, schemaRegistryRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsInstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsInstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsInstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs new file mode 100644 index 000000000000..da45d642b4d5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The properties of the Instance resource. + public partial class IotOperationsInstanceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The reference to the Schema Registry for this AIO Instance. + /// is null. + public IotOperationsInstanceProperties(SchemaRegistryRef schemaRegistryRef) + { + Argument.AssertNotNull(schemaRegistryRef, nameof(schemaRegistryRef)); + + SchemaRegistryRef = schemaRegistryRef; + } + + /// Initializes a new instance of . + /// Detailed description of the Instance. + /// The status of the last operation. + /// The Azure IoT Operations version. + /// The reference to the Schema Registry for this AIO Instance. + /// Keeps track of any properties unknown to the library. + internal IotOperationsInstanceProperties(string description, IotOperationsProvisioningState? provisioningState, string version, SchemaRegistryRef schemaRegistryRef, IDictionary serializedAdditionalRawData) + { + Description = description; + ProvisioningState = provisioningState; + Version = version; + SchemaRegistryRef = schemaRegistryRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IotOperationsInstanceProperties() + { + } + + /// Detailed description of the Instance. + public string Description { get; set; } + /// The status of the last operation. + public IotOperationsProvisioningState? ProvisioningState { get; } + /// The Azure IoT Operations version. + public string Version { get; } + /// The reference to the Schema Registry for this AIO Instance. + internal SchemaRegistryRef SchemaRegistryRef { get; set; } + /// The resource ID of the Schema Registry. + public ResourceIdentifier SchemaRegistryRefResourceId + { + get => SchemaRegistryRef is null ? default : SchemaRegistryRef.ResourceId; + set => SchemaRegistryRef = new SchemaRegistryRef(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.Serialization.cs new file mode 100644 index 000000000000..570fa41b6ae6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + internal partial class IotOperationsMetrics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsMetrics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PrometheusPort)) + { + writer.WritePropertyName("prometheusPort"u8); + writer.WriteNumberValue(PrometheusPort.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsMetrics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsMetrics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsMetrics(document.RootElement, options); + } + + internal static IotOperationsMetrics DeserializeIotOperationsMetrics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? prometheusPort = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prometheusPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + prometheusPort = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsMetrics(prometheusPort, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsMetrics)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsMetrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsMetrics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsMetrics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.cs new file mode 100644 index 000000000000..a99b608c0e15 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsMetrics.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Diagnostic Metrics properties. + internal partial class IotOperationsMetrics + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsMetrics() + { + } + + /// Initializes a new instance of . + /// The prometheus port to expose the metrics. + /// Keeps track of any properties unknown to the library. + internal IotOperationsMetrics(int? prometheusPort, IDictionary serializedAdditionalRawData) + { + PrometheusPort = prometheusPort; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The prometheus port to expose the metrics. + public int? PrometheusPort { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsOperationalMode.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsOperationalMode.cs new file mode 100644 index 000000000000..191a20fabb9d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsOperationalMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Mode properties. + public readonly partial struct IotOperationsOperationalMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IotOperationsOperationalMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled is equivalent to True. + public static IotOperationsOperationalMode Enabled { get; } = new IotOperationsOperationalMode(EnabledValue); + /// Disabled is equivalent to False. + public static IotOperationsOperationalMode Disabled { get; } = new IotOperationsOperationalMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(IotOperationsOperationalMode left, IotOperationsOperationalMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IotOperationsOperationalMode left, IotOperationsOperationalMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IotOperationsOperationalMode(string value) => new IotOperationsOperationalMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IotOperationsOperationalMode other && Equals(other); + /// + public bool Equals(IotOperationsOperationalMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsProvisioningState.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsProvisioningState.cs new file mode 100644 index 000000000000..6dc37692d956 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The enum defining status of resource. + public readonly partial struct IotOperationsProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IotOperationsProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static IotOperationsProvisioningState Succeeded { get; } = new IotOperationsProvisioningState(SucceededValue); + /// Resource creation failed. + public static IotOperationsProvisioningState Failed { get; } = new IotOperationsProvisioningState(FailedValue); + /// Resource creation was canceled. + public static IotOperationsProvisioningState Canceled { get; } = new IotOperationsProvisioningState(CanceledValue); + /// Resource is getting provisioned. + public static IotOperationsProvisioningState Provisioning { get; } = new IotOperationsProvisioningState(ProvisioningValue); + /// Resource is Updating. + public static IotOperationsProvisioningState Updating { get; } = new IotOperationsProvisioningState(UpdatingValue); + /// Resource is Deleting. + public static IotOperationsProvisioningState Deleting { get; } = new IotOperationsProvisioningState(DeletingValue); + /// Resource has been Accepted. + public static IotOperationsProvisioningState Accepted { get; } = new IotOperationsProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(IotOperationsProvisioningState left, IotOperationsProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IotOperationsProvisioningState left, IotOperationsProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IotOperationsProvisioningState(string value) => new IotOperationsProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IotOperationsProvisioningState other && Equals(other); + /// + public bool Equals(IotOperationsProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.Serialization.cs new file mode 100644 index 000000000000..b3a0a05963ec --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class IotOperationsTlsProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsTlsProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(TrustedCaCertificateConfigMapRef)) + { + writer.WritePropertyName("trustedCaCertificateConfigMapRef"u8); + writer.WriteStringValue(TrustedCaCertificateConfigMapRef); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IotOperationsTlsProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IotOperationsTlsProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotOperationsTlsProperties(document.RootElement, options); + } + + internal static IotOperationsTlsProperties DeserializeIotOperationsTlsProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IotOperationsOperationalMode? mode = default; + string trustedCaCertificateConfigMapRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new IotOperationsOperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("trustedCaCertificateConfigMapRef"u8)) + { + trustedCaCertificateConfigMapRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IotOperationsTlsProperties(mode, trustedCaCertificateConfigMapRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IotOperationsTlsProperties)} does not support writing '{options.Format}' format."); + } + } + + IotOperationsTlsProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIotOperationsTlsProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IotOperationsTlsProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.cs new file mode 100644 index 000000000000..8e3a30e634f3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsTlsProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Tls properties. + public partial class IotOperationsTlsProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IotOperationsTlsProperties() + { + } + + /// Initializes a new instance of . + /// Mode for TLS. + /// Trusted CA certificate config map. + /// Keeps track of any properties unknown to the library. + internal IotOperationsTlsProperties(IotOperationsOperationalMode? mode, string trustedCaCertificateConfigMapRef, IDictionary serializedAdditionalRawData) + { + Mode = mode; + TrustedCaCertificateConfigMapRef = trustedCaCertificateConfigMapRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mode for TLS. + public IotOperationsOperationalMode? Mode { get; set; } + /// Trusted CA certificate config map. + public string TrustedCaCertificateConfigMapRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KafkaAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KafkaAuthMethod.cs new file mode 100644 index 000000000000..7176568103fc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KafkaAuthMethod.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Kafka Authentication Method properties. + public readonly partial struct KafkaAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KafkaAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string SaslValue = "Sasl"; + private const string X509CertificateValue = "X509Certificate"; + private const string AnonymousValue = "Anonymous"; + + /// SystemAssignedManagedIdentity type. + public static KafkaAuthMethod SystemAssignedManagedIdentity { get; } = new KafkaAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static KafkaAuthMethod UserAssignedManagedIdentity { get; } = new KafkaAuthMethod(UserAssignedManagedIdentityValue); + /// Sasl Option. + public static KafkaAuthMethod Sasl { get; } = new KafkaAuthMethod(SaslValue); + /// x509Certificate Option. + public static KafkaAuthMethod X509Certificate { get; } = new KafkaAuthMethod(X509CertificateValue); + /// Anonymous Option. + public static KafkaAuthMethod Anonymous { get; } = new KafkaAuthMethod(AnonymousValue); + /// Determines if two values are the same. + public static bool operator ==(KafkaAuthMethod left, KafkaAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KafkaAuthMethod left, KafkaAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KafkaAuthMethod(string value) => new KafkaAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KafkaAuthMethod other && Equals(other); + /// + public bool Equals(KafkaAuthMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.Serialization.cs new file mode 100644 index 000000000000..aa31b0279073 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class KubernetesReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KubernetesReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApiGroup)) + { + writer.WritePropertyName("apiGroup"u8); + writer.WriteStringValue(ApiGroup); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Namespace)) + { + writer.WritePropertyName("namespace"u8); + writer.WriteStringValue(Namespace); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KubernetesReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KubernetesReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKubernetesReference(document.RootElement, options); + } + + internal static KubernetesReference DeserializeKubernetesReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apiGroup = default; + string kind = default; + string name = default; + string @namespace = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apiGroup"u8)) + { + apiGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespace"u8)) + { + @namespace = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KubernetesReference(apiGroup, kind, name, @namespace, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KubernetesReference)} does not support writing '{options.Format}' format."); + } + } + + KubernetesReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKubernetesReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KubernetesReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.cs new file mode 100644 index 000000000000..0bb01b50cca0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/KubernetesReference.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kubernetes reference. + public partial class KubernetesReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// or is null. + public KubernetesReference(string kind, string name) + { + Argument.AssertNotNull(kind, nameof(kind)); + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// Namespace is the namespace of the resource being referenced. This field is required when the resource has a namespace. + /// Keeps track of any properties unknown to the library. + internal KubernetesReference(string apiGroup, string kind, string name, string @namespace, IDictionary serializedAdditionalRawData) + { + ApiGroup = apiGroup; + Kind = kind; + Name = name; + Namespace = @namespace; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KubernetesReference() + { + } + + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + public string ApiGroup { get; set; } + /// Kind is the type of resource being referenced. + public string Kind { get; set; } + /// Name is the name of resource being referenced. + public string Name { get; set; } + /// Namespace is the namespace of the resource being referenced. This field is required when the resource has a namespace. + public string Namespace { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.Serialization.cs new file mode 100644 index 000000000000..313afdde7f62 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class ListenerPortTlsCertMethod : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListenerPortTlsCertMethod)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.ToString()); + if (Optional.IsDefined(CertManagerCertificateSpec)) + { + writer.WritePropertyName("certManagerCertificateSpec"u8); + writer.WriteObjectValue(CertManagerCertificateSpec, options); + } + if (Optional.IsDefined(Manual)) + { + writer.WritePropertyName("manual"u8); + writer.WriteObjectValue(Manual, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListenerPortTlsCertMethod IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListenerPortTlsCertMethod)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListenerPortTlsCertMethod(document.RootElement, options); + } + + internal static ListenerPortTlsCertMethod DeserializeListenerPortTlsCertMethod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TlsCertMethodMode mode = default; + CertManagerCertificateSpec certManagerCertificateSpec = default; + X509ManualCertificate manual = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + mode = new TlsCertMethodMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("certManagerCertificateSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certManagerCertificateSpec = CertManagerCertificateSpec.DeserializeCertManagerCertificateSpec(property.Value, options); + continue; + } + if (property.NameEquals("manual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manual = X509ManualCertificate.DeserializeX509ManualCertificate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListenerPortTlsCertMethod(mode, certManagerCertificateSpec, manual, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListenerPortTlsCertMethod)} does not support writing '{options.Format}' format."); + } + } + + ListenerPortTlsCertMethod IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeListenerPortTlsCertMethod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListenerPortTlsCertMethod)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.cs new file mode 100644 index 000000000000..97152c786676 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/ListenerPortTlsCertMethod.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Collection of different TLS types, NOTE- Enum at a time only one of them needs to be supported. + public partial class ListenerPortTlsCertMethod + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Mode of TLS server certificate management. + public ListenerPortTlsCertMethod(TlsCertMethodMode mode) + { + Mode = mode; + } + + /// Initializes a new instance of . + /// Mode of TLS server certificate management. + /// Option 1 - Automatic TLS server certificate management with cert-manager. + /// Option 2 - Manual TLS server certificate management through a defined secret. + /// Keeps track of any properties unknown to the library. + internal ListenerPortTlsCertMethod(TlsCertMethodMode mode, CertManagerCertificateSpec certManagerCertificateSpec, X509ManualCertificate manual, IDictionary serializedAdditionalRawData) + { + Mode = mode; + CertManagerCertificateSpec = certManagerCertificateSpec; + Manual = manual; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListenerPortTlsCertMethod() + { + } + + /// Mode of TLS server certificate management. + public TlsCertMethodMode Mode { get; set; } + /// Option 1 - Automatic TLS server certificate management with cert-manager. + public CertManagerCertificateSpec CertManagerCertificateSpec { get; set; } + /// Option 2 - Manual TLS server certificate management through a defined secret. + internal X509ManualCertificate Manual { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string ManualSecretRef + { + get => Manual is null ? default : Manual.SecretRef; + set => Manual = new X509ManualCertificate(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs new file mode 100644 index 000000000000..b4359b4fd3be --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class LocalKubernetesReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApiGroup)) + { + writer.WritePropertyName("apiGroup"u8); + writer.WriteStringValue(ApiGroup); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LocalKubernetesReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocalKubernetesReference(document.RootElement, options); + } + + internal static LocalKubernetesReference DeserializeLocalKubernetesReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apiGroup = default; + string kind = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apiGroup"u8)) + { + apiGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LocalKubernetesReference(apiGroup, kind, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support writing '{options.Format}' format."); + } + } + + LocalKubernetesReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLocalKubernetesReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.cs new file mode 100644 index 000000000000..427f8b07e32f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/LocalKubernetesReference.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Kubernetes reference. + public partial class LocalKubernetesReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// or is null. + public LocalKubernetesReference(string kind, string name) + { + Argument.AssertNotNull(kind, nameof(kind)); + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// Keeps track of any properties unknown to the library. + internal LocalKubernetesReference(string apiGroup, string kind, string name, IDictionary serializedAdditionalRawData) + { + ApiGroup = apiGroup; + Kind = kind; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LocalKubernetesReference() + { + } + + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + public string ApiGroup { get; set; } + /// Kind is the type of resource being referenced. + public string Kind { get; set; } + /// Name is the name of resource being referenced. + public string Name { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttAuthMethod.cs new file mode 100644 index 000000000000..65784118d0ae --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttAuthMethod.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// DataflowEndpoint Mqtt Authentication Method properties. + public readonly partial struct MqttAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MqttAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string ServiceAccountTokenValue = "ServiceAccountToken"; + private const string X509CertificateValue = "X509Certificate"; + private const string AnonymousValue = "Anonymous"; + + /// SystemAssignedManagedIdentity type. + public static MqttAuthMethod SystemAssignedManagedIdentity { get; } = new MqttAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static MqttAuthMethod UserAssignedManagedIdentity { get; } = new MqttAuthMethod(UserAssignedManagedIdentityValue); + /// ServiceAccountToken Option. + public static MqttAuthMethod ServiceAccountToken { get; } = new MqttAuthMethod(ServiceAccountTokenValue); + /// x509Certificate Option. + public static MqttAuthMethod X509Certificate { get; } = new MqttAuthMethod(X509CertificateValue); + /// Anonymous Option. + public static MqttAuthMethod Anonymous { get; } = new MqttAuthMethod(AnonymousValue); + /// Determines if two values are the same. + public static bool operator ==(MqttAuthMethod left, MqttAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MqttAuthMethod left, MqttAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MqttAuthMethod(string value) => new MqttAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MqttAuthMethod other && Equals(other); + /// + public bool Equals(MqttAuthMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttRetainType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttRetainType.cs new file mode 100644 index 000000000000..8245f97a4190 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/MqttRetainType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Retain types. + public readonly partial struct MqttRetainType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MqttRetainType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeepValue = "Keep"; + private const string NeverValue = "Never"; + + /// Retain the messages. + public static MqttRetainType Keep { get; } = new MqttRetainType(KeepValue); + /// Never retain messages. + public static MqttRetainType Never { get; } = new MqttRetainType(NeverValue); + /// Determines if two values are the same. + public static bool operator ==(MqttRetainType left, MqttRetainType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MqttRetainType left, MqttRetainType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MqttRetainType(string value) => new MqttRetainType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MqttRetainType other && Equals(other); + /// + public bool Equals(MqttRetainType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.Serialization.cs new file mode 100644 index 000000000000..78062eb1e28c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.Serialization.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class PrincipalConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartObject(); + foreach (var item0 in item) + { + writer.WritePropertyName(item0.Key); + writer.WriteStringValue(item0.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ClientIds)) + { + writer.WritePropertyName("clientIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Usernames)) + { + writer.WritePropertyName("usernames"u8); + writer.WriteStartArray(); + foreach (var item in Usernames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrincipalConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrincipalConfig(document.RootElement, options); + } + + internal static PrincipalConfig DeserializePrincipalConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList> attributes = default; + IList clientIds = default; + IList usernames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in item.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + array.Add(dictionary); + } + } + attributes = array; + continue; + } + if (property.NameEquals("clientIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + clientIds = array; + continue; + } + if (property.NameEquals("usernames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + usernames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrincipalConfig(attributes ?? new ChangeTrackingList>(), clientIds ?? new ChangeTrackingList(), usernames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support writing '{options.Format}' format."); + } + } + + PrincipalConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrincipalConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.cs new file mode 100644 index 000000000000..c03ac9733c7f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrincipalConfig.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// PrincipalDefinition properties of Rule. + public partial class PrincipalConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PrincipalConfig() + { + Attributes = new ChangeTrackingList>(); + ClientIds = new ChangeTrackingList(); + Usernames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// A list of key-value pairs that match the attributes of the clients. The attributes are case-sensitive and must match the attributes provided by the clients during authentication. + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. + /// A list of usernames that match the clients. The usernames are case-sensitive and must match the usernames provided by the clients during authentication. + /// Keeps track of any properties unknown to the library. + internal PrincipalConfig(IList> attributes, IList clientIds, IList usernames, IDictionary serializedAdditionalRawData) + { + Attributes = attributes; + ClientIds = clientIds; + Usernames = usernames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A list of key-value pairs that match the attributes of the clients. The attributes are case-sensitive and must match the attributes provided by the clients during authentication. + public IList> Attributes { get; } + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. + public IList ClientIds { get; } + /// A list of usernames that match the clients. The usernames are case-sensitive and must match the usernames provided by the clients during authentication. + public IList Usernames { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyAlgorithm.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyAlgorithm.cs new file mode 100644 index 000000000000..f6e7c239c612 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyAlgorithm.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Private key algorithm types. + public readonly partial struct PrivateKeyAlgorithm : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateKeyAlgorithm(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Ec256Value = "Ec256"; + private const string Ec384Value = "Ec384"; + private const string Ec521Value = "Ec521"; + private const string Ed25519Value = "Ed25519"; + private const string Rsa2048Value = "Rsa2048"; + private const string Rsa4096Value = "Rsa4096"; + private const string Rsa8192Value = "Rsa8192"; + + /// Algorithm - ec256. + public static PrivateKeyAlgorithm Ec256 { get; } = new PrivateKeyAlgorithm(Ec256Value); + /// Algorithm - ec384. + public static PrivateKeyAlgorithm Ec384 { get; } = new PrivateKeyAlgorithm(Ec384Value); + /// Algorithm - ec521. + public static PrivateKeyAlgorithm Ec521 { get; } = new PrivateKeyAlgorithm(Ec521Value); + /// Algorithm - ed25519. + public static PrivateKeyAlgorithm Ed25519 { get; } = new PrivateKeyAlgorithm(Ed25519Value); + /// Algorithm - rsa2048. + public static PrivateKeyAlgorithm Rsa2048 { get; } = new PrivateKeyAlgorithm(Rsa2048Value); + /// Algorithm - rsa4096. + public static PrivateKeyAlgorithm Rsa4096 { get; } = new PrivateKeyAlgorithm(Rsa4096Value); + /// Algorithm - rsa8192. + public static PrivateKeyAlgorithm Rsa8192 { get; } = new PrivateKeyAlgorithm(Rsa8192Value); + /// Determines if two values are the same. + public static bool operator ==(PrivateKeyAlgorithm left, PrivateKeyAlgorithm right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateKeyAlgorithm left, PrivateKeyAlgorithm right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateKeyAlgorithm(string value) => new PrivateKeyAlgorithm(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateKeyAlgorithm other && Equals(other); + /// + public bool Equals(PrivateKeyAlgorithm other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs new file mode 100644 index 000000000000..3f599341a777 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Private key rotation policy. + public readonly partial struct PrivateKeyRotationPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateKeyRotationPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlwaysValue = "Always"; + private const string NeverValue = "Never"; + + /// Rotation Policy - Always. + public static PrivateKeyRotationPolicy Always { get; } = new PrivateKeyRotationPolicy(AlwaysValue); + /// Rotation Policy - Never. + public static PrivateKeyRotationPolicy Never { get; } = new PrivateKeyRotationPolicy(NeverValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateKeyRotationPolicy left, PrivateKeyRotationPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateKeyRotationPolicy left, PrivateKeyRotationPolicy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateKeyRotationPolicy(string value) => new PrivateKeyRotationPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateKeyRotationPolicy other && Equals(other); + /// + public bool Equals(PrivateKeyRotationPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.Serialization.cs new file mode 100644 index 000000000000..0e10760f6e3b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class SanForCert : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SanForCert)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dns"u8); + writer.WriteStartArray(); + foreach (var item in Dns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("ip"u8); + writer.WriteStartArray(); + foreach (var item in IP) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SanForCert IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SanForCert)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSanForCert(document.RootElement, options); + } + + internal static SanForCert DeserializeSanForCert(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dns = default; + IList ip = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dns"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dns = array; + continue; + } + if (property.NameEquals("ip"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ip = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SanForCert(dns, ip, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SanForCert)} does not support writing '{options.Format}' format."); + } + } + + SanForCert IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSanForCert(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SanForCert)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.cs new file mode 100644 index 000000000000..4fba0f7414de --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SanForCert.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Subject Alternative Names (SANs) for certificate. + public partial class SanForCert + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// DNS SANs. + /// IP address SANs. + /// or is null. + public SanForCert(IEnumerable dns, IEnumerable ip) + { + Argument.AssertNotNull(dns, nameof(dns)); + Argument.AssertNotNull(ip, nameof(ip)); + + Dns = dns.ToList(); + IP = ip.ToList(); + } + + /// Initializes a new instance of . + /// DNS SANs. + /// IP address SANs. + /// Keeps track of any properties unknown to the library. + internal SanForCert(IList dns, IList ip, IDictionary serializedAdditionalRawData) + { + Dns = dns; + IP = ip; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SanForCert() + { + } + + /// DNS SANs. + public IList Dns { get; } + /// IP address SANs. + public IList IP { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs new file mode 100644 index 000000000000..ed3d365dba62 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class SchemaRegistryRef : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SchemaRegistryRef IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSchemaRegistryRef(document.RootElement, options); + } + + internal static SchemaRegistryRef DeserializeSchemaRegistryRef(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SchemaRegistryRef(resourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support writing '{options.Format}' format."); + } + } + + SchemaRegistryRef IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSchemaRegistryRef(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.cs new file mode 100644 index 000000000000..0aecdae69564 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SchemaRegistryRef.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The reference to the Schema Registry for this AIO Instance. + public partial class SchemaRegistryRef + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource ID of the Schema Registry. + /// is null. + public SchemaRegistryRef(ResourceIdentifier resourceId) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ResourceId = resourceId; + } + + /// Initializes a new instance of . + /// The resource ID of the Schema Registry. + /// Keeps track of any properties unknown to the library. + internal SchemaRegistryRef(ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SchemaRegistryRef() + { + } + + /// The resource ID of the Schema Registry. + public ResourceIdentifier ResourceId { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs new file mode 100644 index 000000000000..b8c575ce8aa5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// StateStoreResourceDefinitionMethods methods allowed. + public readonly partial struct StateStoreResourceDefinitionMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StateStoreResourceDefinitionMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadValue = "Read"; + private const string WriteValue = "Write"; + private const string ReadWriteValue = "ReadWrite"; + + /// Get/KeyNotify from Store. + public static StateStoreResourceDefinitionMethod Read { get; } = new StateStoreResourceDefinitionMethod(ReadValue); + /// Set/Delete in Store. + public static StateStoreResourceDefinitionMethod Write { get; } = new StateStoreResourceDefinitionMethod(WriteValue); + /// Allowed all operations on Store - Get/KeyNotify/Set/Delete. + public static StateStoreResourceDefinitionMethod ReadWrite { get; } = new StateStoreResourceDefinitionMethod(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(StateStoreResourceDefinitionMethod left, StateStoreResourceDefinitionMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StateStoreResourceDefinitionMethod left, StateStoreResourceDefinitionMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StateStoreResourceDefinitionMethod(string value) => new StateStoreResourceDefinitionMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StateStoreResourceDefinitionMethod other && Equals(other); + /// + public bool Equals(StateStoreResourceDefinitionMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceKeyType.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceKeyType.cs new file mode 100644 index 000000000000..0c281767ca15 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceKeyType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// StateStoreResourceKeyTypes properties. + public readonly partial struct StateStoreResourceKeyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StateStoreResourceKeyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PatternValue = "Pattern"; + private const string StringValue = "String"; + private const string BinaryValue = "Binary"; + + /// Key type - pattern. + public static StateStoreResourceKeyType Pattern { get; } = new StateStoreResourceKeyType(PatternValue); + /// Key type - string. + public static StateStoreResourceKeyType String { get; } = new StateStoreResourceKeyType(StringValue); + /// Key type - binary. + public static StateStoreResourceKeyType Binary { get; } = new StateStoreResourceKeyType(BinaryValue); + /// Determines if two values are the same. + public static bool operator ==(StateStoreResourceKeyType left, StateStoreResourceKeyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StateStoreResourceKeyType left, StateStoreResourceKeyType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StateStoreResourceKeyType(string value) => new StateStoreResourceKeyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StateStoreResourceKeyType other && Equals(other); + /// + public bool Equals(StateStoreResourceKeyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs new file mode 100644 index 000000000000..50a435619abc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class StateStoreResourceRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyType"u8); + writer.WriteStringValue(KeyType.ToString()); + writer.WritePropertyName("keys"u8); + writer.WriteStartArray(); + foreach (var item in Keys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StateStoreResourceRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStateStoreResourceRule(document.RootElement, options); + } + + internal static StateStoreResourceRule DeserializeStateStoreResourceRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StateStoreResourceKeyType keyType = default; + IList keys = default; + StateStoreResourceDefinitionMethod method = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyType"u8)) + { + keyType = new StateStoreResourceKeyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keys"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keys = array; + continue; + } + if (property.NameEquals("method"u8)) + { + method = new StateStoreResourceDefinitionMethod(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StateStoreResourceRule(keyType, keys, method, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support writing '{options.Format}' format."); + } + } + + StateStoreResourceRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStateStoreResourceRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.cs new file mode 100644 index 000000000000..e142cfebcab0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/StateStoreResourceRule.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// State Store Resource Rule properties. + public partial class StateStoreResourceRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + /// Give access for `Read`, `Write` and `ReadWrite` access level. + /// is null. + public StateStoreResourceRule(StateStoreResourceKeyType keyType, IEnumerable keys, StateStoreResourceDefinitionMethod method) + { + Argument.AssertNotNull(keys, nameof(keys)); + + KeyType = keyType; + Keys = keys.ToList(); + Method = method; + } + + /// Initializes a new instance of . + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + /// Give access for `Read`, `Write` and `ReadWrite` access level. + /// Keeps track of any properties unknown to the library. + internal StateStoreResourceRule(StateStoreResourceKeyType keyType, IList keys, StateStoreResourceDefinitionMethod method, IDictionary serializedAdditionalRawData) + { + KeyType = keyType; + Keys = keys; + Method = method; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StateStoreResourceRule() + { + } + + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + public StateStoreResourceKeyType KeyType { get; set; } + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + public IList Keys { get; } + /// Give access for `Read`, `Write` and `ReadWrite` access level. + public StateStoreResourceDefinitionMethod Method { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs new file mode 100644 index 000000000000..b0d4e18801c4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The enum defining strategies for dropping messages from the subscriber queue. + public readonly partial struct SubscriberMessageDropStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SubscriberMessageDropStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string DropOldestValue = "DropOldest"; + + /// Messages are never dropped. + public static SubscriberMessageDropStrategy None { get; } = new SubscriberMessageDropStrategy(NoneValue); + /// The oldest message is dropped. + public static SubscriberMessageDropStrategy DropOldest { get; } = new SubscriberMessageDropStrategy(DropOldestValue); + /// Determines if two values are the same. + public static bool operator ==(SubscriberMessageDropStrategy left, SubscriberMessageDropStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SubscriberMessageDropStrategy left, SubscriberMessageDropStrategy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SubscriberMessageDropStrategy(string value) => new SubscriberMessageDropStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SubscriberMessageDropStrategy other && Equals(other); + /// + public bool Equals(SubscriberMessageDropStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs new file mode 100644 index 000000000000..ff5331fdf1c0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class SubscriberQueueLimit : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteStringValue(Strategy.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SubscriberQueueLimit IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriberQueueLimit(document.RootElement, options); + } + + internal static SubscriberQueueLimit DeserializeSubscriberQueueLimit(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? length = default; + SubscriberMessageDropStrategy? strategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("strategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strategy = new SubscriberMessageDropStrategy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubscriberQueueLimit(length, strategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support writing '{options.Format}' format."); + } + } + + SubscriberQueueLimit IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSubscriberQueueLimit(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.cs new file mode 100644 index 000000000000..7101ae6dc058 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/SubscriberQueueLimit.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// The settings of Subscriber Queue Limit. + public partial class SubscriberQueueLimit + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SubscriberQueueLimit() + { + } + + /// Initializes a new instance of . + /// The maximum length of the queue before messages start getting dropped. + /// The strategy to use for dropping messages from the queue. + /// Keeps track of any properties unknown to the library. + internal SubscriberQueueLimit(long? length, SubscriberMessageDropStrategy? strategy, IDictionary serializedAdditionalRawData) + { + Length = length; + Strategy = strategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The maximum length of the queue before messages start getting dropped. + public long? Length { get; set; } + /// The strategy to use for dropping messages from the queue. + public SubscriberMessageDropStrategy? Strategy { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TlsCertMethodMode.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TlsCertMethodMode.cs new file mode 100644 index 000000000000..ea6f191d0dcb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TlsCertMethodMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Broker Authentication Mode. + public readonly partial struct TlsCertMethodMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TlsCertMethodMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string ManualValue = "Manual"; + + /// Automatic TLS server certificate configuration. + public static TlsCertMethodMode Automatic { get; } = new TlsCertMethodMode(AutomaticValue); + /// Manual TLS server certificate configuration. + public static TlsCertMethodMode Manual { get; } = new TlsCertMethodMode(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(TlsCertMethodMode left, TlsCertMethodMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TlsCertMethodMode left, TlsCertMethodMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TlsCertMethodMode(string value) => new TlsCertMethodMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TlsCertMethodMode other && Equals(other); + /// + public bool Equals(TlsCertMethodMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TransformationSerializationFormat.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TransformationSerializationFormat.cs new file mode 100644 index 000000000000..0f0bc84168ca --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/TransformationSerializationFormat.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// Transformation Format properties. + public readonly partial struct TransformationSerializationFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TransformationSerializationFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeltaValue = "Delta"; + private const string JsonValue = "Json"; + private const string ParquetValue = "Parquet"; + + /// Delta Format. + public static TransformationSerializationFormat Delta { get; } = new TransformationSerializationFormat(DeltaValue); + /// JSON Format. + public static TransformationSerializationFormat Json { get; } = new TransformationSerializationFormat(JsonValue); + /// Parquet Format. + public static TransformationSerializationFormat Parquet { get; } = new TransformationSerializationFormat(ParquetValue); + /// Determines if two values are the same. + public static bool operator ==(TransformationSerializationFormat left, TransformationSerializationFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TransformationSerializationFormat left, TransformationSerializationFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TransformationSerializationFormat(string value) => new TransformationSerializationFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TransformationSerializationFormat other && Equals(other); + /// + public bool Equals(TransformationSerializationFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs new file mode 100644 index 000000000000..3ca5c42a0615 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class VolumeClaimResourceRequirements : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Limits)) + { + writer.WritePropertyName("limits"u8); + writer.WriteStartObject(); + foreach (var item in Limits) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(Requests)) + { + writer.WritePropertyName("requests"u8); + writer.WriteStartObject(); + foreach (var item in Requests) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimResourceRequirements IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimResourceRequirements(document.RootElement, options); + } + + internal static VolumeClaimResourceRequirements DeserializeVolumeClaimResourceRequirements(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary limits = default; + IDictionary requests = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("limits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + limits = dictionary; + continue; + } + if (property.NameEquals("requests"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + requests = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimResourceRequirements(limits ?? new ChangeTrackingDictionary(), requests ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimResourceRequirements IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimResourceRequirements(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs new file mode 100644 index 000000000000..ee277898596a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// VolumeClaimResourceRequirements properties. + public partial class VolumeClaimResourceRequirements + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VolumeClaimResourceRequirements() + { + Limits = new ChangeTrackingDictionary(); + Requests = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimResourceRequirements(IDictionary limits, IDictionary requests, IDictionary serializedAdditionalRawData) + { + Limits = limits; + Requests = requests; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + public IDictionary Limits { get; } + /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + public IDictionary Requests { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs new file mode 100644 index 000000000000..2b6f4ed45c1b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class VolumeClaimSpec : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VolumeName)) + { + writer.WritePropertyName("volumeName"u8); + writer.WriteStringValue(VolumeName); + } + if (Optional.IsDefined(VolumeMode)) + { + writer.WritePropertyName("volumeMode"u8); + writer.WriteStringValue(VolumeMode); + } + if (Optional.IsDefined(StorageClassName)) + { + writer.WritePropertyName("storageClassName"u8); + writer.WriteStringValue(StorageClassName); + } + if (Optional.IsCollectionDefined(AccessModes)) + { + writer.WritePropertyName("accessModes"u8); + writer.WriteStartArray(); + foreach (var item in AccessModes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataSource)) + { + writer.WritePropertyName("dataSource"u8); + writer.WriteObjectValue(DataSource, options); + } + if (Optional.IsDefined(DataSourceRef)) + { + writer.WritePropertyName("dataSourceRef"u8); + writer.WriteObjectValue(DataSourceRef, options); + } + if (Optional.IsDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); + } + if (Optional.IsDefined(Selector)) + { + writer.WritePropertyName("selector"u8); + writer.WriteObjectValue(Selector, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpec(document.RootElement, options); + } + + internal static VolumeClaimSpec DeserializeVolumeClaimSpec(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string volumeName = default; + string volumeMode = default; + string storageClassName = default; + IList accessModes = default; + LocalKubernetesReference dataSource = default; + KubernetesReference dataSourceRef = default; + VolumeClaimResourceRequirements resources = default; + VolumeClaimSpecSelector selector = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("volumeName"u8)) + { + volumeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("volumeMode"u8)) + { + volumeMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageClassName"u8)) + { + storageClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + accessModes = array; + continue; + } + if (property.NameEquals("dataSource"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSource = LocalKubernetesReference.DeserializeLocalKubernetesReference(property.Value, options); + continue; + } + if (property.NameEquals("dataSourceRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSourceRef = KubernetesReference.DeserializeKubernetesReference(property.Value, options); + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resources = VolumeClaimResourceRequirements.DeserializeVolumeClaimResourceRequirements(property.Value, options); + continue; + } + if (property.NameEquals("selector"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selector = VolumeClaimSpecSelector.DeserializeVolumeClaimSpecSelector(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpec( + volumeName, + volumeMode, + storageClassName, + accessModes ?? new ChangeTrackingList(), + dataSource, + dataSourceRef, + resources, + selector, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpec(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.cs new file mode 100644 index 000000000000..3a4b0932fb28 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpec.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// VolumeClaimSpec properties. + public partial class VolumeClaimSpec + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VolumeClaimSpec() + { + AccessModes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// VolumeName is the binding reference to the PersistentVolume backing this claim. + /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature. + /// Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. + /// AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. + /// This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field. + /// Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + /// Resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. + /// A label query over volumes to consider for binding. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpec(string volumeName, string volumeMode, string storageClassName, IList accessModes, LocalKubernetesReference dataSource, KubernetesReference dataSourceRef, VolumeClaimResourceRequirements resources, VolumeClaimSpecSelector selector, IDictionary serializedAdditionalRawData) + { + VolumeName = volumeName; + VolumeMode = volumeMode; + StorageClassName = storageClassName; + AccessModes = accessModes; + DataSource = dataSource; + DataSourceRef = dataSourceRef; + Resources = resources; + Selector = selector; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// VolumeName is the binding reference to the PersistentVolume backing this claim. + public string VolumeName { get; set; } + /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature. + public string VolumeMode { get; set; } + /// Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. + public string StorageClassName { get; set; } + /// AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. + public IList AccessModes { get; } + /// This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field. + public LocalKubernetesReference DataSource { get; set; } + /// Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + public KubernetesReference DataSourceRef { get; set; } + /// Resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. + public VolumeClaimResourceRequirements Resources { get; set; } + /// A label query over volumes to consider for binding. + public VolumeClaimSpecSelector Selector { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs new file mode 100644 index 000000000000..ea5e8c853287 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class VolumeClaimSpecSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(MatchExpressions)) + { + writer.WritePropertyName("matchExpressions"u8); + writer.WriteStartArray(); + foreach (var item in MatchExpressions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(MatchLabels)) + { + writer.WritePropertyName("matchLabels"u8); + writer.WriteStartObject(); + foreach (var item in MatchLabels) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpecSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpecSelector(document.RootElement, options); + } + + internal static VolumeClaimSpecSelector DeserializeVolumeClaimSpecSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList matchExpressions = default; + IDictionary matchLabels = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("matchExpressions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VolumeClaimSpecSelectorMatchExpressions.DeserializeVolumeClaimSpecSelectorMatchExpressions(item, options)); + } + matchExpressions = array; + continue; + } + if (property.NameEquals("matchLabels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + matchLabels = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpecSelector(matchExpressions ?? new ChangeTrackingList(), matchLabels ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpecSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpecSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.cs new file mode 100644 index 000000000000..71d8c20b1197 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelector.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// VolumeClaimSpecSelector properties. + public partial class VolumeClaimSpecSelector + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VolumeClaimSpecSelector() + { + MatchExpressions = new ChangeTrackingList(); + MatchLabels = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// MatchExpressions is a list of label selector requirements. The requirements are ANDed. + /// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpecSelector(IList matchExpressions, IDictionary matchLabels, IDictionary serializedAdditionalRawData) + { + MatchExpressions = matchExpressions; + MatchLabels = matchLabels; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// MatchExpressions is a list of label selector requirements. The requirements are ANDed. + public IList MatchExpressions { get; } + /// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + public IDictionary MatchLabels { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs new file mode 100644 index 000000000000..c0dcc9bef09f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IotOperations.Models +{ + public partial class VolumeClaimSpecSelectorMatchExpressions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("operator"u8); + writer.WriteStringValue(Operator.ToString()); + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpecSelectorMatchExpressions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpecSelectorMatchExpressions(document.RootElement, options); + } + + internal static VolumeClaimSpecSelectorMatchExpressions DeserializeVolumeClaimSpecSelectorMatchExpressions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + BrokerOperatorValue @operator = default; + IList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("operator"u8)) + { + @operator = new BrokerOperatorValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpecSelectorMatchExpressions(key, @operator, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpecSelectorMatchExpressions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpecSelectorMatchExpressions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs new file mode 100644 index 000000000000..f408fe946931 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IotOperations.Models +{ + /// VolumeClaimSpecSelectorMatchExpressions properties. + public partial class VolumeClaimSpecSelectorMatchExpressions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// key is the label key that the selector applies to. + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + /// is null. + public VolumeClaimSpecSelectorMatchExpressions(string key, BrokerOperatorValue @operator) + { + Argument.AssertNotNull(key, nameof(key)); + + Key = key; + Operator = @operator; + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// key is the label key that the selector applies to. + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpecSelectorMatchExpressions(string key, BrokerOperatorValue @operator, IList values, IDictionary serializedAdditionalRawData) + { + Key = key; + Operator = @operator; + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VolumeClaimSpecSelectorMatchExpressions() + { + } + + /// key is the label key that the selector applies to. + public string Key { get; set; } + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + public BrokerOperatorValue Operator { get; set; } + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + public IList Values { get; } + } +} diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs similarity index 66% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs index d3efc32329bb..ef4e3e542c4b 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509CredentialsUpdate.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - internal partial class X509CredentialsUpdate : IUtf8JsonSerializable, IJsonModel + internal partial class X509ManualCertificate : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,17 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(X509CredentialsUpdate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support writing '{format}' format."); } - if (Optional.IsDefined(CertificateReference)) - { - writer.WritePropertyName("certificateReference"u8); - writer.WriteStringValue(CertificateReference); - } + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -56,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - X509CredentialsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + X509ManualCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(X509CredentialsUpdate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeX509CredentialsUpdate(document.RootElement, options); + return DeserializeX509ManualCertificate(document.RootElement, options); } - internal static X509CredentialsUpdate DeserializeX509CredentialsUpdate(JsonElement element, ModelReaderWriterOptions options = null) + internal static X509ManualCertificate DeserializeX509ManualCertificate(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,14 +73,14 @@ internal static X509CredentialsUpdate DeserializeX509CredentialsUpdate(JsonEleme { return null; } - string certificateReference = default; + string secretRef = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("certificateReference"u8)) + if (property.NameEquals("secretRef"u8)) { - certificateReference = property.Value.GetString(); + secretRef = property.Value.GetString(); continue; } if (options.Format != "W") @@ -92,38 +89,38 @@ internal static X509CredentialsUpdate DeserializeX509CredentialsUpdate(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new X509CredentialsUpdate(certificateReference, serializedAdditionalRawData); + return new X509ManualCertificate(secretRef, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(X509CredentialsUpdate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support writing '{options.Format}' format."); } } - X509CredentialsUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + X509ManualCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeX509CredentialsUpdate(document.RootElement, options); + return DeserializeX509ManualCertificate(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(X509CredentialsUpdate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.cs similarity index 61% rename from sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.cs rename to sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.cs index a638fce6428e..2fe5eea93e9c 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/src/Generated/Models/X509Credentials.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/X509ManualCertificate.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.DeviceRegistry.Models +namespace Azure.ResourceManager.IotOperations.Models { - /// The x509 certificate for authentication mode Certificate. - internal partial class X509Credentials + /// X509 Certificate Authentication properties. + internal partial class X509ManualCertificate { /// /// Keeps track of any properties unknown to the library. @@ -45,31 +45,31 @@ internal partial class X509Credentials /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). - /// is null. - public X509Credentials(string certificateReference) + /// Initializes a new instance of . + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + /// is null. + public X509ManualCertificate(string secretRef) { - Argument.AssertNotNull(certificateReference, nameof(certificateReference)); + Argument.AssertNotNull(secretRef, nameof(secretRef)); - CertificateReference = certificateReference; + SecretRef = secretRef; } - /// Initializes a new instance of . - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). + /// Initializes a new instance of . + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. /// Keeps track of any properties unknown to the library. - internal X509Credentials(string certificateReference, IDictionary serializedAdditionalRawData) + internal X509ManualCertificate(string secretRef, IDictionary serializedAdditionalRawData) { - CertificateReference = certificateReference; + SecretRef = secretRef; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal X509Credentials() + /// Initializes a new instance of for deserialization. + internal X509ManualCertificate() { } - /// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx). - public string CertificateReference { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string SecretRef { get; set; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ProviderConstants.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..6e409eacdadf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IotOperations +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs new file mode 100644 index 000000000000..0ed588b48af7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class BrokerAuthenticationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerAuthenticationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerAuthenticationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerAuthenticationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerAuthenticationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerAuthenticationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsBrokerAuthenticationData.DeserializeIotOperationsBrokerAuthenticationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerAuthenticationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, IotOperationsBrokerAuthenticationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, IotOperationsBrokerAuthenticationData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, IotOperationsBrokerAuthenticationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthenticationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthenticationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthenticationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthenticationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs new file mode 100644 index 000000000000..37500f6e8f54 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class BrokerAuthorizationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerAuthorizationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerAuthorizationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerAuthorizationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerAuthorizationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerAuthorizationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsBrokerAuthorizationData.DeserializeIotOperationsBrokerAuthorizationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerAuthorizationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, IotOperationsBrokerAuthorizationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, IotOperationsBrokerAuthorizationData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, IotOperationsBrokerAuthorizationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs new file mode 100644 index 000000000000..97dc2c199e2a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class BrokerListenerRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerListenerRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerListenerRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerListenerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerListenerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerListenerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsBrokerListenerData.DeserializeIotOperationsBrokerListenerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerListenerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, IotOperationsBrokerListenerData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, IotOperationsBrokerListenerData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, IotOperationsBrokerListenerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs new file mode 100644 index 000000000000..c496a2daf0c2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class BrokerRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsBrokerData.DeserializeIotOperationsBrokerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsBrokerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsBrokerData.DeserializeIotOperationsBrokerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsBrokerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, IotOperationsBrokerData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, IotOperationsBrokerData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, IotOperationsBrokerData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs new file mode 100644 index 000000000000..df99293a5e0c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class DataflowEndpointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowEndpointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowEndpointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowEndpointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowEndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowEndpointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsDataflowEndpointData.DeserializeIotOperationsDataflowEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowEndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, IotOperationsDataflowEndpointData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, IotOperationsDataflowEndpointData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, IotOperationsDataflowEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs new file mode 100644 index 000000000000..80408fb8d64b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class DataflowProfileRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowProfileRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowProfileRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowProfileData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowProfileData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsDataflowProfileData.DeserializeIotOperationsDataflowProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, IotOperationsDataflowProfileData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, IotOperationsDataflowProfileData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, IotOperationsDataflowProfileData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs new file mode 100644 index 000000000000..53c2adb9aa3c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class DataflowRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsDataflowData.DeserializeIotOperationsDataflowData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsDataflowData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsDataflowData.DeserializeIotOperationsDataflowData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsDataflowData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, IotOperationsDataflowData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, IotOperationsDataflowData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, IotOperationsDataflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs new file mode 100644 index 000000000000..bf2157a0760f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs @@ -0,0 +1,731 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IotOperations.Models; + +namespace Azure.ResourceManager.IotOperations +{ + internal partial class InstanceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of InstanceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public InstanceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IotOperationsInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, instanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IotOperationsInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string instanceName, IotOperationsInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, instanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IotOperationsInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IotOperationsInstanceData.DeserializeIotOperationsInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Properties/AssemblyInfo.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..126c6cd9b209 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.IotOperations.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.IoTOperations")] diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Azure.ResourceManager.IotOperations.Tests.csproj b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Azure.ResourceManager.IotOperations.Tests.csproj new file mode 100644 index 000000000000..9fcdc90073c9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Azure.ResourceManager.IotOperations.Tests.csproj @@ -0,0 +1,12 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementClientBase.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementClientBase.cs new file mode 100644 index 000000000000..89b0cdbbff27 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementClientBase.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public abstract class IotOperationsManagementClientBase + : ManagementRecordedTestBase + { + public string SubscriptionId { get; set; } + public ArmClient ArmClient { get; private set; } + public SubscriptionResource Subscription { get; set; } + public string ResourceGroup { get; set; } + public string InstanceName { get; set; } + public string BrokersName { get; set; } + public string BrokersListenersName { get; set; } + public string BrokersAuthenticationsName { get; set; } + public string DataflowProfilesName { get; set; } + public string DataflowEndpointsName { get; set; } + public string ExtendedLocation { get; set; } + public string CustomLocationName { get; set; } + public const string DefaultResourceLocation = "eastus2"; + + protected IotOperationsManagementClientBase(bool isAsync) + : base(isAsync) { } + + protected IotOperationsManagementClientBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) { } + + protected async Task InitializeClients() + { + ArmClient = GetArmClient(); + Subscription = await ArmClient.GetDefaultSubscriptionAsync(); + ResourceGroup = "aio-validation-113034243"; + CustomLocationName = "location-113034243"; + InstanceName = "aio-113034243"; + BrokersName = "default"; + BrokersListenersName = "default"; + BrokersAuthenticationsName = "default"; + DataflowProfilesName = "default"; + DataflowEndpointsName = "default"; + ExtendedLocation = + $"/subscriptions/d4ccd08b-0809-446d-a8b7-7af8a90109cd/resourceGroups{ResourceGroup}/providers/Microsoft.ExtendedLocation/customLocations/{CustomLocationName}"; + } + + public async Task GetResourceGroupAsync(string name) + { + return await Subscription.GetResourceGroups().GetAsync(name); + } + + // Get Instances + protected async Task GetInstanceCollectionAsync( + string resourceGroupName + ) + { + ResourceGroupResource rg = await GetResourceGroupAsync(resourceGroupName); + return rg.GetIotOperationsInstances(); + } + + // Get Brokers + protected async Task GetBrokerCollectionAsync( + string resourceGroupName + ) + { + ResourceGroupResource rg = await GetResourceGroupAsync(resourceGroupName); + IotOperationsInstanceCollection instances = rg.GetIotOperationsInstances(); + IotOperationsInstanceResource instance = await instances.GetAsync(InstanceName); + return instance.GetIotOperationsBrokers(); + } + + // Get BrokerAuthentications + protected async Task GetBrokerAuthenticationCollectionAsync( + string resourceGroupName + ) + { + IotOperationsBrokerCollection brokers = await GetBrokerCollectionAsync( + resourceGroupName + ); + IotOperationsBrokerResource broker = await brokers.GetAsync(BrokersName); + return broker.GetIotOperationsBrokerAuthentications(); + } + + // Get BrokerAuthorizations + protected async Task GetBrokerAuthorizationCollectionAsync( + string resourceGroupName + ) + { + IotOperationsBrokerCollection brokers = await GetBrokerCollectionAsync( + resourceGroupName + ); + IotOperationsBrokerResource broker = await brokers.GetAsync(BrokersName); + return broker.GetIotOperationsBrokerAuthorizations(); + } + + // Get BrokerListeners + protected async Task GetBrokerListenerCollectionAsync( + string resourceGroupName + ) + { + IotOperationsBrokerCollection brokers = await GetBrokerCollectionAsync( + resourceGroupName + ); + IotOperationsBrokerResource broker = await brokers.GetAsync(BrokersName); + return broker.GetIotOperationsBrokerListeners(); + } + + // Get DataflowProfiles + protected async Task GetDataflowProfileCollectionAsync( + string resourceGroupName + ) + { + ResourceGroupResource rg = await GetResourceGroupAsync(resourceGroupName); + IotOperationsInstanceCollection instances = rg.GetIotOperationsInstances(); + IotOperationsInstanceResource instance = await instances.GetAsync(InstanceName); + return instance.GetIotOperationsDataflowProfiles(); + } + + // Get Dataflows + protected async Task GetDataflowCollectionAsync( + string resourceGroupName + ) + { + IotOperationsDataflowProfileCollection dataflowProfiles = + await GetDataflowProfileCollectionAsync(resourceGroupName); + IotOperationsDataflowProfileResource dataflowProfile = await dataflowProfiles.GetAsync( + DataflowProfilesName + ); + return dataflowProfile.GetIotOperationsDataflows(); + } + + // Get DataflowEndpoints + protected async Task GetDataflowEndpointCollectionAsync( + string resourceGroupName + ) + { + ResourceGroupResource rg = await GetResourceGroupAsync(resourceGroupName); + IotOperationsInstanceCollection instances = rg.GetIotOperationsInstances(); + IotOperationsInstanceResource instance = await instances.GetAsync(InstanceName); + return instance.GetIotOperationsDataflowEndpoints(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementTestEnvironment.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementTestEnvironment.cs new file mode 100644 index 000000000000..aedff621b038 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/IotOperationsManagementTestEnvironment.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class IotOperationsManagementTestEnvironment : TestEnvironment { } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthenticationsTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthenticationsTests.cs new file mode 100644 index 000000000000..6901787a8fe5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthenticationsTests.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class BrokerAuthenticationsTests : IotOperationsManagementClientBase + { + public BrokerAuthenticationsTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestBrokerAuthentications() + { + // Get BrokerAuthentications + IotOperationsBrokerAuthenticationCollection brokerAuthenticationResourceCollection = + await GetBrokerAuthenticationCollectionAsync(ResourceGroup); + + IotOperationsBrokerAuthenticationResource brokerAuthenticationResource = + await brokerAuthenticationResourceCollection.GetAsync(BrokersAuthenticationsName); + + Assert.IsNotNull(brokerAuthenticationResource); + Assert.IsNotNull(brokerAuthenticationResource.Data); + Assert.AreEqual(brokerAuthenticationResource.Data.Name, BrokersAuthenticationsName); + + // Create BrokerAuthentication + IotOperationsBrokerAuthenticationData brokerAuthenticationResourceData = + CreateBrokerAuthenticationResourceData(brokerAuthenticationResource); + + ArmOperation resp = + await brokerAuthenticationResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-brokerauthentication", + brokerAuthenticationResourceData + ); + IotOperationsBrokerAuthenticationResource createdBrokerAuthentication = resp.Value; + + Assert.IsNotNull(createdBrokerAuthentication); + Assert.IsNotNull(createdBrokerAuthentication.Data); + Assert.IsNotNull(createdBrokerAuthentication.Data.Properties); + + // Delete BrokerAuthentication + await createdBrokerAuthentication.DeleteAsync(WaitUntil.Completed); + + // Verify BrokerAuthentication is deleted + Assert.ThrowsAsync( + async () => await createdBrokerAuthentication.GetAsync() + ); + } + + private IotOperationsBrokerAuthenticationData CreateBrokerAuthenticationResourceData( + IotOperationsBrokerAuthenticationResource brokerAuthenticationResource + ) + { + return new IotOperationsBrokerAuthenticationData( + brokerAuthenticationResource.Data.ExtendedLocation + ) + { + Properties = brokerAuthenticationResource.Data.Properties + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthorizationsTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthorizationsTests.cs new file mode 100644 index 000000000000..73b6dda67e97 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerAuthorizationsTests.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class BrokerAuthorizationsTests : IotOperationsManagementClientBase + { + public BrokerAuthorizationsTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestBrokerAuthorizations() + { + // Get BrokerAuthorizations + IotOperationsBrokerAuthorizationCollection brokerAuthorizationResourceCollection = + await GetBrokerAuthorizationCollectionAsync(ResourceGroup); + + // None are created in a fresh AIO deployment + // Create BrokerAuthorization + IotOperationsBrokerAuthorizationData brokerAuthorizationResourceData = + CreateBrokerAuthorizationData(); + + ArmOperation resp = + await brokerAuthorizationResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-brokerauthorization", + brokerAuthorizationResourceData + ); + IotOperationsBrokerAuthorizationResource createdBrokerAuthorization = resp.Value; + + Assert.IsNotNull(createdBrokerAuthorization); + Assert.IsNotNull(createdBrokerAuthorization.Data); + Assert.IsNotNull(createdBrokerAuthorization.Data.Properties); + + // Delete BrokerAuthorization + await createdBrokerAuthorization.DeleteAsync(WaitUntil.Completed); + + // Verify BrokerAuthorization is deleted + Assert.ThrowsAsync( + async () => await createdBrokerAuthorization.GetAsync() + ); + } + + private IotOperationsBrokerAuthorizationData CreateBrokerAuthorizationData() + { + return new IotOperationsBrokerAuthorizationData( + // Can normally use the CL from already deployed resource in other RTs but since we are creating new ones in this test we need to construct the CL. + new IotOperationsExtendedLocation(ExtendedLocation, IotOperationsExtendedLocationType.CustomLocation) + ) + { + Properties = new IotOperationsBrokerAuthorizationProperties( + new BrokerAuthorizationConfig + { + Cache = IotOperationsOperationalMode.Enabled, + Rules = + { + new BrokerAuthorizationRule( + new BrokerResourceRule[] + { + new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect) + { + }, + new BrokerResourceRule(BrokerResourceDefinitionMethod.Subscribe) + { + Topics = { "topic", "topic/with/wildcard/#" } + }, + }, + new PrincipalConfig + { + ClientIds = { "my-client-id" }, + Usernames = { "clientUserName" }, + } + ) + { + StateStoreResources = + { + new StateStoreResourceRule( + StateStoreResourceKeyType.Pattern, + new string[] { "*" }, + StateStoreResourceDefinitionMethod.ReadWrite + ) + }, + } + }, + } + ), + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerListenersTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerListenersTests.cs new file mode 100644 index 000000000000..e54009f414b7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokerListenersTests.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class BrokerListenersTests : IotOperationsManagementClientBase + { + public BrokerListenersTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestBrokerListeners() + { + // Get BrokerListeners + IotOperationsBrokerListenerCollection brokerListenerResourceCollection = + await GetBrokerListenerCollectionAsync(ResourceGroup); + + IotOperationsBrokerListenerResource brokerListenerResource = + await brokerListenerResourceCollection.GetAsync(BrokersListenersName); + + Assert.IsNotNull(brokerListenerResource); + Assert.IsNotNull(brokerListenerResource.Data); + Assert.AreEqual(brokerListenerResource.Data.Name, BrokersListenersName); + + // Create new BrokerListener + IotOperationsBrokerListenerData brokerListenerResourceData = + CreateBrokerListenerData(brokerListenerResource); + + ArmOperation resp = + await brokerListenerResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-brokerlistener", + brokerListenerResourceData + ); + + IotOperationsBrokerListenerResource createdBrokerListener = resp.Value; + Assert.IsNotNull(createdBrokerListener); + Assert.IsNotNull(createdBrokerListener.Data); + Assert.IsNotNull(createdBrokerListener.Data.Properties); + + // Delete BrokerListener + await createdBrokerListener.DeleteAsync(WaitUntil.Completed); + + // Verify BrokerListener is deleted + Assert.ThrowsAsync( + async () => await createdBrokerListener.GetAsync() + ); + } + + private IotOperationsBrokerListenerData CreateBrokerListenerData( + IotOperationsBrokerListenerResource brokerListenerResource + ) + { + return new IotOperationsBrokerListenerData(brokerListenerResource.Data.ExtendedLocation) + { + Properties = new IotOperationsBrokerListenerProperties( + [ + new BrokerListenerPort(1883) { Protocol = "Mqtt" }, + new BrokerListenerPort(9883) + { + Protocol = "Mqtt", + AuthenticationRef = "default", + Tls = new ListenerPortTlsCertMethod() + { + CertManagerCertificateSpec = new CertManagerCertificateSpec() + { + IssuerRef = new CertManagerIssuerRef() + { + Group = "cert-manager.io", + Kind = "ClusterIssuer", + Name = "azure-iot-operations-aio-certificate-issuer" + }, + PrivateKey = new CertManagerPrivateKey() + { + Algorithm = "Ec256", + RotationPolicy = "Always" + }, + }, + Mode = TlsCertMethodMode.Automatic, + } + }, + ] + ) + { + ServiceName = "aio-dmqtt-frontend-test", + ServiceType = "LoadBalancer", + }, + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokersTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokersTests.cs new file mode 100644 index 000000000000..7db4855c08e5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/BrokersTests.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class BrokersTests : IotOperationsManagementClientBase + { + public BrokersTests(bool isAsync) + : base(isAsync) //, RecordedTestMode.Record + { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestBrokers() + { + // Get Brokers + IotOperationsBrokerCollection brokerResourceCollection = + await GetBrokerCollectionAsync(ResourceGroup); + + IotOperationsBrokerResource brokerResource = await brokerResourceCollection.GetAsync(BrokersName); + + Assert.IsNotNull(brokerResource); + Assert.IsNotNull(brokerResource.Data); + Assert.AreEqual(brokerResource.Data.Name, BrokersName); + + // Cant update Broker + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowEndpointsTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowEndpointsTests.cs new file mode 100644 index 000000000000..5596e07d036e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowEndpointsTests.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class DataflowEndpointsTests : IotOperationsManagementClientBase + { + public DataflowEndpointsTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestDataflowEndpoints() + { + // Get DataflowEndpoints + IotOperationsDataflowEndpointCollection dataflowEndpointsResourceCollection = + await GetDataflowEndpointCollectionAsync(ResourceGroup); + + IotOperationsDataflowEndpointResource dataflowEndpointsResource = + await dataflowEndpointsResourceCollection.GetAsync(DataflowEndpointsName); + + Assert.IsNotNull(dataflowEndpointsResource); + Assert.IsNotNull(dataflowEndpointsResource.Data); + Assert.AreEqual(dataflowEndpointsResource.Data.Name, DataflowEndpointsName); + + // Create new DataflowEndpoint + + IotOperationsDataflowEndpointData dataflowEndpointsResourceData = + CreateDataflowEndpointData(dataflowEndpointsResource); + + ArmOperation resp = + await dataflowEndpointsResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-dataflowendpoints", + dataflowEndpointsResourceData + ); + IotOperationsDataflowEndpointResource createdDataflowEndpoint = resp.Value; + + Assert.IsNotNull(createdDataflowEndpoint); + Assert.IsNotNull(createdDataflowEndpoint.Data); + Assert.IsNotNull(createdDataflowEndpoint.Data.Properties); + + // Delete DataflowEndpoint + await createdDataflowEndpoint.DeleteAsync(WaitUntil.Completed); + + // Verify DataflowEndpoint is deleted + Assert.ThrowsAsync( + async () => await createdDataflowEndpoint.GetAsync() + ); + } + + private IotOperationsDataflowEndpointData CreateDataflowEndpointData( + IotOperationsDataflowEndpointResource dataflowEndpointsResource + ) + { + return new IotOperationsDataflowEndpointData(dataflowEndpointsResource.Data.ExtendedLocation) + { + Properties = dataflowEndpointsResource.Data.Properties + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowProfilesTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowProfilesTests.cs new file mode 100644 index 000000000000..090588ac9e97 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowProfilesTests.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class DataflowProfilesTests : IotOperationsManagementClientBase + { + public DataflowProfilesTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestDataflowProfiles() + { + // Get DataflowProfiles + IotOperationsDataflowProfileCollection dataflowProfileResourceCollection = + await GetDataflowProfileCollectionAsync(ResourceGroup); + + IotOperationsDataflowProfileResource dataflowProfileResource = + await dataflowProfileResourceCollection.GetAsync(DataflowEndpointsName); + + Assert.IsNotNull(dataflowProfileResource); + Assert.IsNotNull(dataflowProfileResource.Data); + Assert.AreEqual(dataflowProfileResource.Data.Name, DataflowEndpointsName); + + // Create new DataflowProfile + IotOperationsDataflowProfileData dataflowProfileResourceData = + CreateDataflowProfileData(dataflowProfileResource); + + ArmOperation resp = + await dataflowProfileResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-dataflowprofile", + dataflowProfileResourceData + ); + IotOperationsDataflowProfileResource createdDataflowProfile = resp.Value; + + Assert.IsNotNull(createdDataflowProfile); + Assert.IsNotNull(createdDataflowProfile.Data); + Assert.IsNotNull(createdDataflowProfile.Data.Properties); + + // delete dataflow profile + await createdDataflowProfile.DeleteAsync(WaitUntil.Completed); + + // Verify DataflowProfile is deleted + Assert.ThrowsAsync( + async () => await createdDataflowProfile.GetAsync() + ); + } + + private IotOperationsDataflowProfileData CreateDataflowProfileData( + IotOperationsDataflowProfileResource dataflowProfileResource + ) + { + return new IotOperationsDataflowProfileData(dataflowProfileResource.Data.ExtendedLocation) + { + Properties = dataflowProfileResource.Data.Properties + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowsTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowsTests.cs new file mode 100644 index 000000000000..2ed74e47e6a1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/DataflowsTests.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class DataflowsTests : IotOperationsManagementClientBase + { + public DataflowsTests(bool isAsync) + : base(isAsync) { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestDataflows() + { + // Get Dataflows + IotOperationsDataflowCollection dataflowResourceCollection = + await GetDataflowCollectionAsync(ResourceGroup); + + // None are created in a fresh AIO deployment + // Create Dataflow + IotOperationsDataflowData dataflowResourceData = CreateDataflowData(); + + ArmOperation resp = + await dataflowResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + "sdk-test-dataflows", + dataflowResourceData + ); + IotOperationsDataflowResource createdDataflow = resp.Value; + + Assert.IsNotNull(createdDataflow); + Assert.IsNotNull(createdDataflow.Data); + Assert.IsNotNull(createdDataflow.Data.Properties); + + // Delete Dataflow + await createdDataflow.DeleteAsync(WaitUntil.Completed); + + // Verify Dataflow is deleted + Assert.ThrowsAsync( + async () => await createdDataflow.GetAsync() + ); + } + + private IotOperationsDataflowData CreateDataflowData() + { + return new IotOperationsDataflowData( + // Can normally use the CL from already deployed resource in other RTs but since we are creating new ones in this test we need to construct the CL. + new IotOperationsExtendedLocation(ExtendedLocation, IotOperationsExtendedLocationType.CustomLocation) + ) + { + Properties = new IotOperationsDataflowProperties( + [ + new DataflowOperationProperties(DataflowOperationType.Source) + { + Name = "source1", + SourceSettings = new DataflowSourceOperationSettings( + "aio-builtin-broker-endpoint", + ["thermostats/+/telemetry/temperature/#"] + ), + }, + new DataflowOperationProperties(DataflowOperationType.Destination) + { + Name = "destination1", + DestinationSettings = new DataflowDestinationOperationSettings( + "event-grid-endpoint", + "factory/telemetry" + ), + } + ] + ) + { + Mode = IotOperationsOperationalMode.Enabled, + }, + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/InstancesTests.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/InstancesTests.cs new file mode 100644 index 000000000000..3fdf7ece39f6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tests/Tests/InstancesTests.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.IotOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IotOperations.Tests +{ + public class InstancesTests : IotOperationsManagementClientBase + { + public InstancesTests(bool isAsync) + : base(isAsync) //, RecordedTestMode.Record + { } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task TestInstance() + { + // Get Instances + IotOperationsInstanceCollection instanceResourceCollection = + await GetInstanceCollectionAsync(ResourceGroup); + + IotOperationsInstanceResource instanceResource = await instanceResourceCollection.GetAsync( + InstanceName + ); + + Assert.IsNotNull(instanceResource); + Assert.IsNotNull(instanceResource.Data); + Assert.AreEqual(instanceResource.Data.Name, InstanceName); + + // Update Instance + Random random = new Random(); + IotOperationsInstanceData instanceResourceData = CreateInstanceData( + random.ToString(), + instanceResource + ); + + ArmOperation resp = + await instanceResourceCollection.CreateOrUpdateAsync( + WaitUntil.Completed, + InstanceName, + instanceResourceData + ); + IotOperationsInstanceResource updatedInstance = resp.Value; + + Assert.IsNotNull(updatedInstance); + Assert.IsNotNull(updatedInstance.Data); + Assert.IsNotNull(updatedInstance.Data.Properties); + Assert.IsNotNull(updatedInstance.Data.Properties.Description); + Assert.AreEqual( + updatedInstance.Data.Properties.Description, + "Updated Description: " + random.ToString() + ); + } + + private IotOperationsInstanceData CreateInstanceData( + string value, + IotOperationsInstanceResource instanceResource + ) + { + return new IotOperationsInstanceData( + new AzureLocation(DefaultResourceLocation), + instanceResource.Data.ExtendedLocation + ) + { + Properties = new IotOperationsInstanceProperties( + instanceResource.Data.Properties.SchemaRegistryRef + ) + { + Description = "Updated Description: " + value, + }, + }; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml new file mode 100644 index 000000000000..b32a9b729547 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/iotoperations/IoTOperations.Management +commit: dbee439b1a1b0129a7e028658c0f0c7ffc305118 +repo: Azure/azure-rest-api-specs diff --git a/sdk/iotoperations/ci.mgmt.yml b/sdk/iotoperations/ci.mgmt.yml new file mode 100644 index 000000000000..4ce0ba5f603a --- /dev/null +++ b/sdk/iotoperations/ci.mgmt.yml @@ -0,0 +1,24 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotoperations/ci.mgmt.yml + - sdk/iotoperations/Azure.ResourceManager.IotOperations/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: iotoperations + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.IotOperations + safeName: AzureResourceManagerIotOperations diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md index c05c0ad094bd..1ffa7e1ada2f 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md @@ -277,5 +277,3 @@ additional questions or comments. [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftables%2FAzure.Data.Tables%2FREADME.png) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/README.md b/sdk/keyvault/Azure.Security.KeyVault.Certificates/README.md index b97facf0b0ef..3d0642a99644 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/README.md @@ -336,5 +336,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [migration_guide]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/keyvault/Azure.Security.KeyVault.Certificates/MigrationGuide.md [access_policy]: https://learn.microsoft.com/azure/key-vault/general/assign-access-policy [rbac_guide]: https://learn.microsoft.com/azure/key-vault/general/rbac-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fkeyvault%2FAzure.Security.KeyVault.Certificates%2FREADME.png) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md b/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md index 9b699dcf0cb3..2303a265c830 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md @@ -283,10 +283,10 @@ var cryptoClient = client.GetCryptographyClient(key.Name, key.Properties.Version byte[] plaintext = Encoding.UTF8.GetBytes("A single block of plaintext"); // encrypt the data using the algorithm RSAOAEP -EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep, plaintext); +EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep256, plaintext); // decrypt the encrypted data. -DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep, encryptResult.Ciphertext); +DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep256, encryptResult.Ciphertext); ``` ### Create a key asynchronously @@ -474,5 +474,3 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact + /// + /// [Not recommended] /// Gets an RSA1_5 . + /// + /// Microsoft recommends using or stronger algorithms for enhanced security. + /// Microsoft does not recommend , which is included solely for backwards compatibility. + /// Cryptographic standards no longer consider RSA with the PKCS#1 v1.5 padding scheme secure for encryption. + /// /// public static EncryptionAlgorithm Rsa15 { get; } = new EncryptionAlgorithm(Rsa15Value); /// + /// + /// [Not recommended] /// Gets an RSA-OAEP . + /// + /// Microsoft recommends using or stronger algorithms for enhanced security. + /// Microsoft does not recommend , which is included solely for backwards compatibility. + /// utilizes SHA1, which has known collision problems. + /// /// public static EncryptionAlgorithm RsaOaep { get; } = new EncryptionAlgorithm(RsaOaepValue); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecrypt.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecrypt.cs index dc684aca1b9e..0ef2ab19bd6d 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecrypt.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecrypt.cs @@ -44,12 +44,12 @@ public void EncryptDecryptSync() #region Snippet:KeysSample4EncryptKey byte[] plaintext = Encoding.UTF8.GetBytes("A single block of plaintext"); - EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep, plaintext); + EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep256, plaintext); Debug.WriteLine($"Encrypted data using the algorithm {encryptResult.Algorithm}, with key {encryptResult.KeyId}. The resulting encrypted data is {Convert.ToBase64String(encryptResult.Ciphertext)}"); #endregion #region Snippet:KeysSample4DecryptKey - DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep, encryptResult.Ciphertext); + DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep256, encryptResult.Ciphertext); Debug.WriteLine($"Decrypted data using the algorithm {decryptResult.Algorithm}, with key {decryptResult.KeyId}. The resulting decrypted data is {Encoding.UTF8.GetString(decryptResult.Plaintext)}"); #endregion diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecryptAsync.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecryptAsync.cs index c7375651846a..67eea7563774 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecryptAsync.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/Sample4_EncryptDecryptAsync.cs @@ -47,11 +47,11 @@ public async Task EncryptDecryptAsync() byte[] plaintext = Encoding.UTF8.GetBytes("A single block of plaintext"); // First encrypt the data using RSAOAEP with the created key. - EncryptResult encryptResult = await cryptoClient.EncryptAsync(EncryptionAlgorithm.RsaOaep, plaintext); + EncryptResult encryptResult = await cryptoClient.EncryptAsync(EncryptionAlgorithm.RsaOaep256, plaintext); Debug.WriteLine($"Encrypted data using the algorithm {encryptResult.Algorithm}, with key {encryptResult.KeyId}. The resulting encrypted data is {Convert.ToBase64String(encryptResult.Ciphertext)}"); // Now decrypt the encrypted data. Note that the same algorithm must always be used for both encrypt and decrypt - DecryptResult decryptResult = await cryptoClient.DecryptAsync(EncryptionAlgorithm.RsaOaep, encryptResult.Ciphertext); + DecryptResult decryptResult = await cryptoClient.DecryptAsync(EncryptionAlgorithm.RsaOaep256, encryptResult.Ciphertext); Debug.WriteLine($"Decrypted data using the algorithm {decryptResult.Algorithm}, with key {decryptResult.KeyId}. The resulting decrypted data is {Encoding.UTF8.GetString(decryptResult.Plaintext)}"); // The Cloud RSA Key is no longer needed, need to delete it from the Key Vault. diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/SampleSnippets.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/SampleSnippets.cs index 6b909d129a91..badba8c3ccff 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/SampleSnippets.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/samples/SampleSnippets.cs @@ -187,10 +187,10 @@ public void EncryptDecrypt() byte[] plaintext = Encoding.UTF8.GetBytes("A single block of plaintext"); // encrypt the data using the algorithm RSAOAEP - EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep, plaintext); + EncryptResult encryptResult = cryptoClient.Encrypt(EncryptionAlgorithm.RsaOaep256, plaintext); // decrypt the encrypted data. - DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep, encryptResult.Ciphertext); + DecryptResult decryptResult = cryptoClient.Decrypt(EncryptionAlgorithm.RsaOaep256, encryptResult.Ciphertext); #endregion } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/README.md b/sdk/keyvault/Azure.Security.KeyVault.Secrets/README.md index f0100ba364c4..6039fcfa2474 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/README.md @@ -350,5 +350,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [migration_guide]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/keyvault/Azure.Security.KeyVault.Secrets/MigrationGuide.md [access_policy]: https://learn.microsoft.com/azure/key-vault/general/assign-access-policy [rbac_guide]: https://learn.microsoft.com/azure/key-vault/general/rbac-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fkeyvault%2FAzure.Security.KeyVault.Secrets%2FREADME.png) diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md b/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md index d9ef7d314a29..3e8785de385d 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md +++ b/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.7.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.6.0 (2025-01-20) ### Features Added diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Azure.ResourceManager.Kusto.csproj b/sdk/kusto/Azure.ResourceManager.Kusto/src/Azure.ResourceManager.Kusto.csproj index 4eec97eb6206..06b26745e915 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Azure.ResourceManager.Kusto.csproj +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Azure.ResourceManager.Kusto.csproj @@ -1,8 +1,8 @@ - 1.6.0 + 1.7.0-beta.1 - 1.5.1 + 1.6.0 Azure.ResourceManager.Kusto Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.Kusto. azure;management;arm;resource manager;kusto diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Customized/ArmKustoModelFactory.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Customized/ArmKustoModelFactory.cs deleted file mode 100644 index 878193896bcb..000000000000 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Customized/ArmKustoModelFactory.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using System.Collections.Generic; -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Kusto.Models -{ - public static partial class ArmKustoModelFactory - { - /// Initializes a new instance of KustoClusterPatch. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The SKU of the cluster. - /// The identity of the cluster, if configured. - /// The state of the resource. - /// The provisioned state of the resource. - /// The cluster URI. - /// The cluster data ingestion URI. - /// The reason for the cluster's current state. - /// The cluster's external tenants. - /// Optimized auto scale definition. - /// A boolean value that indicates if the cluster's disks are encrypted. - /// A boolean value that indicates if the streaming ingest is enabled. - /// Virtual network definition. - /// KeyVault properties for the cluster encryption. - /// A boolean value that indicates if the purge operations are enabled. - /// List of the cluster's language extensions. - /// A boolean value that indicates if double encryption is enabled. - /// Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. - /// The list of ips in the format of CIDR allowed to connect to the cluster. - /// The engine type. - /// The cluster's accepted audiences. - /// A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). - /// Whether or not to restrict outbound network access. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. - /// List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. - /// Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). - /// Virtual Cluster graduation properties. - /// A list of private endpoint connections. - /// Properties of the peer cluster involved in a migration to/from this cluster. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static KustoClusterPatch KustoClusterPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, KustoSku sku, ManagedServiceIdentity identity, KustoClusterState? state, KustoProvisioningState? provisioningState, Uri uri, Uri dataIngestionUri, string stateReason, IEnumerable trustedExternalTenants, OptimizedAutoscale optimizedAutoscale, bool? isDiskEncryptionEnabled, bool? isStreamingIngestEnabled, KustoClusterVirtualNetworkConfiguration virtualNetworkConfiguration, KustoKeyVaultProperties keyVaultProperties, bool? isPurgeEnabled, IEnumerable languageExtensionsValue, bool? isDoubleEncryptionEnabled, KustoClusterPublicNetworkAccess? publicNetworkAccess, IEnumerable allowedIPRangeList, KustoClusterEngineType? engineType, IEnumerable acceptedAudiences, bool? isAutoStopEnabled, KustoClusterNetworkAccessFlag? restrictOutboundNetworkAccess, IEnumerable allowedFqdnList, KustoClusterPublicIPType? publicIPType, string virtualClusterGraduationProperties, IEnumerable privateEndpointConnections, MigrationClusterProperties migrationCluster) - { - return KustoClusterPatch(id, name, resourceType, systemData, tags, location, sku, default, identity, state, provisioningState, uri, dataIngestionUri, stateReason, trustedExternalTenants, optimizedAutoscale, isDiskEncryptionEnabled, isStreamingIngestEnabled, virtualNetworkConfiguration, keyVaultProperties, isPurgeEnabled, languageExtensionsValue, isDoubleEncryptionEnabled, publicNetworkAccess, allowedIPRangeList, engineType, acceptedAudiences, isAutoStopEnabled, restrictOutboundNetworkAccess, allowedFqdnList, publicIPType, virtualClusterGraduationProperties, privateEndpointConnections, migrationCluster); - } - } -} diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/ArmKustoModelFactory.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/ArmKustoModelFactory.cs index e0fb51c9d330..c78d60ed3046 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/ArmKustoModelFactory.cs +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/ArmKustoModelFactory.cs @@ -1037,6 +1037,47 @@ public static KustoCosmosDBDataConnection KustoCosmosDBDataConnection(ResourceId provisioningState); } + /// Initializes a new instance of KustoClusterPatch. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The SKU of the cluster. + /// The identity of the cluster, if configured. + /// The state of the resource. + /// The provisioned state of the resource. + /// The cluster URI. + /// The cluster data ingestion URI. + /// The reason for the cluster's current state. + /// The cluster's external tenants. + /// Optimized auto scale definition. + /// A boolean value that indicates if the cluster's disks are encrypted. + /// A boolean value that indicates if the streaming ingest is enabled. + /// Virtual network definition. + /// KeyVault properties for the cluster encryption. + /// A boolean value that indicates if the purge operations are enabled. + /// List of the cluster's language extensions. + /// A boolean value that indicates if double encryption is enabled. + /// Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. + /// The list of ips in the format of CIDR allowed to connect to the cluster. + /// The engine type. + /// The cluster's accepted audiences. + /// A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). + /// Whether or not to restrict outbound network access. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + /// Indicates what public IP type to create - IPv4 (default), or DualStack (both IPv4 and IPv6). + /// Virtual Cluster graduation properties. + /// A list of private endpoint connections. + /// Properties of the peer cluster involved in a migration to/from this cluster. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static KustoClusterPatch KustoClusterPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, KustoSku sku, ManagedServiceIdentity identity, KustoClusterState? state, KustoProvisioningState? provisioningState, Uri uri, Uri dataIngestionUri, string stateReason, IEnumerable trustedExternalTenants, OptimizedAutoscale optimizedAutoscale, bool? isDiskEncryptionEnabled, bool? isStreamingIngestEnabled, KustoClusterVirtualNetworkConfiguration virtualNetworkConfiguration, KustoKeyVaultProperties keyVaultProperties, bool? isPurgeEnabled, IEnumerable languageExtensionsValue, bool? isDoubleEncryptionEnabled, KustoClusterPublicNetworkAccess? publicNetworkAccess, IEnumerable allowedIPRangeList, KustoClusterEngineType? engineType, IEnumerable acceptedAudiences, bool? isAutoStopEnabled, KustoClusterNetworkAccessFlag? restrictOutboundNetworkAccess, IEnumerable allowedFqdnList, KustoClusterPublicIPType? publicIPType, string virtualClusterGraduationProperties, IEnumerable privateEndpointConnections, MigrationClusterProperties migrationCluster) + { + return KustoClusterPatch(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, zones: default, identity: identity, state: state, provisioningState: provisioningState, uri: uri, dataIngestionUri: dataIngestionUri, stateReason: stateReason, trustedExternalTenants: trustedExternalTenants, optimizedAutoscale: optimizedAutoscale, isDiskEncryptionEnabled: isDiskEncryptionEnabled, isStreamingIngestEnabled: isStreamingIngestEnabled, virtualNetworkConfiguration: virtualNetworkConfiguration, keyVaultProperties: keyVaultProperties, isPurgeEnabled: isPurgeEnabled, languageExtensionsValue: languageExtensionsValue, isDoubleEncryptionEnabled: isDoubleEncryptionEnabled, publicNetworkAccess: publicNetworkAccess, allowedIPRangeList: allowedIPRangeList, engineType: engineType, acceptedAudiences: acceptedAudiences, isAutoStopEnabled: isAutoStopEnabled, restrictOutboundNetworkAccess: restrictOutboundNetworkAccess, allowedFqdnList: allowedFqdnList, calloutPolicies: default, publicIPType: publicIPType, virtualClusterGraduationProperties: virtualClusterGraduationProperties, privateEndpointConnections: privateEndpointConnections, migrationCluster: migrationCluster, zoneStatus: default); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/loadtestservice/Azure.Developer.LoadTesting/CHANGELOG.md b/sdk/loadtestservice/Azure.Developer.LoadTesting/CHANGELOG.md index 6e122bbd5e17..a2ad4434e4ed 100644 --- a/sdk/loadtestservice/Azure.Developer.LoadTesting/CHANGELOG.md +++ b/sdk/loadtestservice/Azure.Developer.LoadTesting/CHANGELOG.md @@ -16,6 +16,11 @@ ### Other Changes - Add NOT_VALIDATED to the list of terminal states for the file validation poller. +## 1.0.2 (2025-01-20) + +### Other Changes +- Add NOT_VALIDATED to the list of terminal states for the file validation poller. + ## 1.0.1 (2023-03-11) ### Other Changes diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs index 1d70f2a3c088..af8a0825bd3b 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Customize/ArmManagedNetworkFabricModelFactory.cs @@ -16,54 +16,6 @@ namespace Azure.ResourceManager.ManagedNetworkFabric.Models /// Model factory for models. public static partial class ArmManagedNetworkFabricModelFactory { - /// - /// This constructor is added for the backward compatibility. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) - { - return NetworkFabricAccessControlListData(id, name, resourceType, systemData, tags, location, annotation, configurationType, aclsUri, null, matchConfigurations?.ToList(), dynamicMatchConfigurations?.ToList(), lastSyncedOn, configurationState, provisioningState, administrativeState); - } - - /// - /// This constructor is added for the backward compatibility - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IEnumerable statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) - { - return NetworkFabricRoutePolicyData(id, name, resourceType, systemData, tags, location, annotation, null, statements?.ToList(), networkFabricId, addressFamilyType, configurationState, provisioningState, administrativeState); - } - /// /// This constructor is added for the backward compatibility /// diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs index eb379b2110cb..fe690bef69d1 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/ArmManagedNetworkFabricModelFactory.cs @@ -1243,5 +1243,53 @@ public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(Resource administrativeState, serializedAdditionalRawData: null); } + + /// + /// This constructor is added for the backward compatibility. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricAccessControlListData NetworkFabricAccessControlListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, NetworkFabricConfigurationType? configurationType, Uri aclsUri, IEnumerable matchConfigurations, IEnumerable dynamicMatchConfigurations, DateTimeOffset? lastSyncedOn, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricAccessControlListData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, configurationType: configurationType, aclsUri: aclsUri, defaultAction: default, matchConfigurations: matchConfigurations, dynamicMatchConfigurations: dynamicMatchConfigurations, lastSyncedOn: lastSyncedOn, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + } + + /// + /// This constructor is added for the backward compatibility + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkFabricRoutePolicyData NetworkFabricRoutePolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string annotation, IEnumerable statements, ResourceIdentifier networkFabricId, AddressFamilyType? addressFamilyType, NetworkFabricConfigurationState? configurationState, NetworkFabricProvisioningState? provisioningState, NetworkFabricAdministrativeState? administrativeState) + { + return NetworkFabricRoutePolicyData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, annotation: annotation, defaultAction: default, statements: statements, networkFabricId: networkFabricId, addressFamilyType: addressFamilyType, configurationState: configurationState, provisioningState: provisioningState, administrativeState: administrativeState); + } } } diff --git a/sdk/maps/Azure.Maps.Common/README.md b/sdk/maps/Azure.Maps.Common/README.md index 4ee43345b527..426445640850 100644 --- a/sdk/maps/Azure.Maps.Common/README.md +++ b/sdk/maps/Azure.Maps.Common/README.md @@ -74,5 +74,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.Common/README.png) diff --git a/sdk/maps/Azure.Maps.Geolocation/README.md b/sdk/maps/Azure.Maps.Geolocation/README.md index 91c6f67d1b86..a69e645b872a 100644 --- a/sdk/maps/Azure.Maps.Geolocation/README.md +++ b/sdk/maps/Azure.Maps.Geolocation/README.md @@ -196,5 +196,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/template/Azure.Template/README.png) diff --git a/sdk/maps/Azure.Maps.Rendering/README.md b/sdk/maps/Azure.Maps.Rendering/README.md index 49543157bc7b..8b95970cc659 100644 --- a/sdk/maps/Azure.Maps.Rendering/README.md +++ b/sdk/maps/Azure.Maps.Rendering/README.md @@ -205,5 +205,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.Rendering/README.png) diff --git a/sdk/maps/Azure.Maps.Routing/README.md b/sdk/maps/Azure.Maps.Routing/README.md index 21179fcf3d3d..57f9f43eb093 100644 --- a/sdk/maps/Azure.Maps.Routing/README.md +++ b/sdk/maps/Azure.Maps.Routing/README.md @@ -328,5 +328,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.Routing/README.png) diff --git a/sdk/maps/Azure.Maps.Search/README.md b/sdk/maps/Azure.Maps.Search/README.md index 034af42ac21c..12e767ea7895 100644 --- a/sdk/maps/Azure.Maps.Search/README.md +++ b/sdk/maps/Azure.Maps.Search/README.md @@ -261,5 +261,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.Search/README.png) diff --git a/sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md b/sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md deleted file mode 100644 index 3f2cb968cbeb..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Release History - -## 1.0.0-beta.1 (Unreleased) - -### Features Added - -- Initial release diff --git a/sdk/maps/Azure.Maps.TimeZones/README.md b/sdk/maps/Azure.Maps.TimeZones/README.md index 7da7ac03eede..e43de16d3360 100644 --- a/sdk/maps/Azure.Maps.TimeZones/README.md +++ b/sdk/maps/Azure.Maps.TimeZones/README.md @@ -210,5 +210,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.TimeZones/README.png) diff --git a/sdk/maps/Azure.Maps.Weather/README.md b/sdk/maps/Azure.Maps.Weather/README.md index 45b5af719127..a9cf60c6bdc6 100644 --- a/sdk/maps/Azure.Maps.Weather/README.md +++ b/sdk/maps/Azure.Maps.Weather/README.md @@ -119,7 +119,7 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples -You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Weather/samples). +You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Weather/samples). ### Get Air Quality Daily Forecasts @@ -270,7 +270,8 @@ GetSevereWeatherAlertsOptions options = new GetSevereWeatherAlertsOptions() Language = WeatherLanguage.EnglishUsa }; Response response = client.GetSevereWeatherAlerts(options); -if (response.Value.Results.Count > 0) { +if (response.Value.Results.Count > 0) +{ Console.WriteLine("Description: " + response.Value.Results[0].Description); } ``` @@ -278,7 +279,14 @@ if (response.Value.Results.Count > 0) { ```C# Snippet:GetTropicalStormActive Response response = client.GetTropicalStormActive(); -Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); +if (response.Value.ActiveStorms.Count > 0) +{ + Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); +} +else +{ + Console.WriteLine("No active storm"); +} ``` ### Get Tropical Storm Forecast @@ -292,12 +300,22 @@ GetTropicalStormForecastOptions options = new GetTropicalStormForecastOptions() IncludeGeometricDetails = true }; Response response = client.GetTropicalStormForecast(options); -if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) { + +if (response.Value.StormForecasts.Count == 0) +{ + Console.WriteLine("No storm forecast found."); + return; +} + +if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) +{ Console.WriteLine("Geometry type: Polygon"); - for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) { + for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) + { Console.WriteLine("Point {0}: {1}", i, geoPolygon.Coordinates[0][i]); } } + Console.WriteLine( "Windspeed: {0}{1}", response.Value.StormForecasts[0].WindRadiiSummary[0].WindSpeed.Value, @@ -314,11 +332,18 @@ GetTropicalStormLocationsOptions options = new GetTropicalStormLocationsOptions( GovernmentStormId = 2 }; Response response = client.GetTropicalStormLocations(options); -Console.WriteLine( - "Coordinates(longitude, latitude): ({0}, {1})", - response.Value.StormLocations[0].Coordinates.Longitude, - response.Value.StormLocations[0].Coordinates.Latitude -); +if (response.Value.StormLocations.Count > 0) +{ + Console.WriteLine( + "Coordinates(longitude, latitude): ({0}, {1})", + response.Value.StormLocations[0].Coordinates.Longitude, + response.Value.StormLocations[0].Coordinates.Latitude + ); +} +else +{ + Console.WriteLine("No storm location found."); +} ``` ### Get Tropical Storm Search @@ -330,7 +355,14 @@ GetTropicalStormSearchOptions options = new GetTropicalStormSearchOptions() GovernmentStormId = 2 }; Response response = client.GetTropicalStormSearch(options); -Console.WriteLine("Name: " + response.Value.Storms[0].Name); +if (response.Value.Storms.Count > 0) +{ + Console.WriteLine("Name: " + response.Value.Storms[0].Name); +} +else +{ + Console.WriteLine("No storm found."); +} ``` ### Get Weather Along Route @@ -356,7 +388,14 @@ Response response = client.GetWeatherAlongRoute( query, WeatherLanguage.EnglishUsa ); -Console.WriteLine("Temperature: " + response.Value.Waypoints[0].Temperature.Value); +if (response.Value.Waypoints.Count > 0) +{ + Console.WriteLine("Temperature of waypoints 0: " + response.Value.Waypoints[0].Temperature.Value); +} +else +{ + Console.WriteLine("No weather information found."); +} ``` @@ -383,5 +422,3 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.Weather/README.png) diff --git a/sdk/maps/Azure.Maps.Weather/samples/MapsWeatherSamples.md b/sdk/maps/Azure.Maps.Weather/samples/MapsWeatherSamples.md index b49799cb765a..672b07a68026 100644 --- a/sdk/maps/Azure.Maps.Weather/samples/MapsWeatherSamples.md +++ b/sdk/maps/Azure.Maps.Weather/samples/MapsWeatherSamples.md @@ -150,7 +150,8 @@ GetSevereWeatherAlertsOptions options = new GetSevereWeatherAlertsOptions() Language = WeatherLanguage.EnglishUsa }; Response response = client.GetSevereWeatherAlerts(options); -if (response.Value.Results.Count > 0) { +if (response.Value.Results.Count > 0) +{ Console.WriteLine("Description: " + response.Value.Results[0].Description); } ``` @@ -158,7 +159,14 @@ if (response.Value.Results.Count > 0) { ```C# Snippet:GetTropicalStormActive Response response = client.GetTropicalStormActive(); -Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); +if (response.Value.ActiveStorms.Count > 0) +{ + Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); +} +else +{ + Console.WriteLine("No active storm"); +} ``` ### Get Tropical Storm Forecast @@ -172,12 +180,22 @@ GetTropicalStormForecastOptions options = new GetTropicalStormForecastOptions() IncludeGeometricDetails = true }; Response response = client.GetTropicalStormForecast(options); -if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) { + +if (response.Value.StormForecasts.Count == 0) +{ + Console.WriteLine("No storm forecast found."); + return; +} + +if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) +{ Console.WriteLine("Geometry type: Polygon"); - for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) { + for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) + { Console.WriteLine("Point {0}: {1}", i, geoPolygon.Coordinates[0][i]); } } + Console.WriteLine( "Windspeed: {0}{1}", response.Value.StormForecasts[0].WindRadiiSummary[0].WindSpeed.Value, @@ -194,11 +212,18 @@ GetTropicalStormLocationsOptions options = new GetTropicalStormLocationsOptions( GovernmentStormId = 2 }; Response response = client.GetTropicalStormLocations(options); -Console.WriteLine( - "Coordinates(longitude, latitude): ({0}, {1})", - response.Value.StormLocations[0].Coordinates.Longitude, - response.Value.StormLocations[0].Coordinates.Latitude -); +if (response.Value.StormLocations.Count > 0) +{ + Console.WriteLine( + "Coordinates(longitude, latitude): ({0}, {1})", + response.Value.StormLocations[0].Coordinates.Longitude, + response.Value.StormLocations[0].Coordinates.Latitude + ); +} +else +{ + Console.WriteLine("No storm location found."); +} ``` ### Get Tropical Storm Search @@ -210,7 +235,14 @@ GetTropicalStormSearchOptions options = new GetTropicalStormSearchOptions() GovernmentStormId = 2 }; Response response = client.GetTropicalStormSearch(options); -Console.WriteLine("Name: " + response.Value.Storms[0].Name); +if (response.Value.Storms.Count > 0) +{ + Console.WriteLine("Name: " + response.Value.Storms[0].Name); +} +else +{ + Console.WriteLine("No storm found."); +} ``` ### Get Weather Along Route @@ -236,5 +268,12 @@ Response response = client.GetWeatherAlongRoute( query, WeatherLanguage.EnglishUsa ); -Console.WriteLine("Temperature: " + response.Value.Waypoints[0].Temperature.Value); +if (response.Value.Waypoints.Count > 0) +{ + Console.WriteLine("Temperature of waypoints 0: " + response.Value.Waypoints[0].Temperature.Value); +} +else +{ + Console.WriteLine("No weather information found."); +} ``` diff --git a/sdk/maps/Azure.Maps.Weather/tests/Samples/WeatherClientSamples.cs b/sdk/maps/Azure.Maps.Weather/tests/Samples/WeatherClientSamples.cs index 0dfd43a4b372..871b9814f7c7 100644 --- a/sdk/maps/Azure.Maps.Weather/tests/Samples/WeatherClientSamples.cs +++ b/sdk/maps/Azure.Maps.Weather/tests/Samples/WeatherClientSamples.cs @@ -334,7 +334,8 @@ public void GetSevereWeatherAlerts() Language = WeatherLanguage.EnglishUsa }; Response response = client.GetSevereWeatherAlerts(options); - if (response.Value.Results.Count > 0) { + if (response.Value.Results.Count > 0) + { Console.WriteLine("Description: " + response.Value.Results[0].Description); } #endregion @@ -351,7 +352,14 @@ public void GetTropicalStormActive() MapsWeatherClient client = new MapsWeatherClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetTropicalStormActive Response response = client.GetTropicalStormActive(); - Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); + if (response.Value.ActiveStorms.Count > 0) + { + Console.WriteLine("Name: " + response.Value.ActiveStorms[0].Name); + } + else + { + Console.WriteLine("No active storm"); + } #endregion } @@ -374,12 +382,22 @@ public void GetTropicalStormForecast() IncludeGeometricDetails = true }; Response response = client.GetTropicalStormForecast(options); - if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) { + + if (response.Value.StormForecasts.Count == 0) + { + Console.WriteLine("No storm forecast found."); + return; + } + + if (response.Value.StormForecasts[0].WindRadiiSummary[0].RadiiGeometry is GeoPolygon geoPolygon) + { Console.WriteLine("Geometry type: Polygon"); - for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) { + for (int i = 0; i < geoPolygon.Coordinates[0].Count; ++i) + { Console.WriteLine("Point {0}: {1}", i, geoPolygon.Coordinates[0][i]); } } + Console.WriteLine( "Windspeed: {0}{1}", response.Value.StormForecasts[0].WindRadiiSummary[0].WindSpeed.Value, @@ -405,11 +423,18 @@ public void GetTropicalStormLocations() GovernmentStormId = 2 }; Response response = client.GetTropicalStormLocations(options); - Console.WriteLine( - "Coordinates(longitude, latitude): ({0}, {1})", - response.Value.StormLocations[0].Coordinates.Longitude, - response.Value.StormLocations[0].Coordinates.Latitude - ); + if (response.Value.StormLocations.Count > 0) + { + Console.WriteLine( + "Coordinates(longitude, latitude): ({0}, {1})", + response.Value.StormLocations[0].Coordinates.Longitude, + response.Value.StormLocations[0].Coordinates.Latitude + ); + } + else + { + Console.WriteLine("No storm location found."); + } #endregion } @@ -430,7 +455,14 @@ public void GetTropicalStormSearch() GovernmentStormId = 2 }; Response response = client.GetTropicalStormSearch(options); - Console.WriteLine("Name: " + response.Value.Storms[0].Name); + if (response.Value.Storms.Count > 0) + { + Console.WriteLine("Name: " + response.Value.Storms[0].Name); + } + else + { + Console.WriteLine("No storm found."); + } #endregion } @@ -465,7 +497,14 @@ public void GetWeatherAlongRoute() query, WeatherLanguage.EnglishUsa ); - Console.WriteLine("Temperature: " + response.Value.Waypoints[0].Temperature.Value); + if (response.Value.Waypoints.Count > 0) + { + Console.WriteLine("Temperature of waypoints 0: " + response.Value.Waypoints[0].Temperature.Value); + } + else + { + Console.WriteLine("No weather information found."); + } #endregion } } diff --git a/sdk/maps/README.md b/sdk/maps/README.md index a1bce4cff2f1..6287495b2074 100644 --- a/sdk/maps/README.md +++ b/sdk/maps/README.md @@ -213,8 +213,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/README.png) - [common]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Common [render]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md index 416f1035ac83..27f336a716f0 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md @@ -564,8 +564,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fmetricsadvisor%2FAzure.AI.MetricsAdvisor%2FREADME.png) - [metricsadv_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src [metricsadv_docs]: https://learn.microsoft.com/azure/cognitive-services/metrics-advisor diff --git a/sdk/mixedreality/Azure.MixedReality.Authentication/README.md b/sdk/mixedreality/Azure.MixedReality.Authentication/README.md index 787f0f7d1a79..3910c4d15ebf 100644 --- a/sdk/mixedreality/Azure.MixedReality.Authentication/README.md +++ b/sdk/mixedreality/Azure.MixedReality.Authentication/README.md @@ -1,13 +1,11 @@ # Azure Mixed Reality Authentication client library for .NET -Mixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and others, use the Mixed Reality security +Mixed Reality services, like Azure Remote Rendering, use the Mixed Reality security token service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access token from the STS that can be used to access Mixed Reality services. [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/mixedreality/Azure.MixedReality.Authentication/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.MixedReality.Authentication) -![Mixed Reality service authentication diagram](https://learn.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) - - [Azure Mixed Reality Authentication client library for .NET](#azure-mixed-reality-authentication-client-library-for-net) - [Getting started](#getting-started) - [Install the package](#install-the-package) @@ -51,7 +49,6 @@ Add a package reference: - You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). - You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/): - [Azure Remote Rendering](https://learn.microsoft.com/azure/remote-rendering/) - - [Azure Spatial Anchors](https://learn.microsoft.com/azure/spatial-anchors/) - Familiarity with the authentication and credential concepts from [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ### Authenticate the client @@ -69,8 +66,6 @@ Mixed Reality services support a few different forms of authentication: method for production applications because it allows you to avoid embedding the credentials for access to a Mixed Reality service in your client application. -See [here](https://learn.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. - #### Authentication examples Below are some examples of some common authentication scenarios, but more examples and information can be found at diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md b/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md index 835b27f37e1c..7c87fe01074d 100644 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md @@ -1,6 +1,6 @@ # Microsoft Azure Mixed Reality management client library for .NET -Microsoft Azure Mixed Reality cloud services like Azure Remote Rendering and Azure Spatial Anchors help developers build compelling immersive experiences on a variety of platforms. These services allow you to integrate spatial awareness into your projects when you're making applications for 3D training, predictive equipment maintenance, and design review, all in the context of your users’ environments. +Microsoft Azure Mixed Reality cloud services like Azure Remote Rendering help developers build compelling immersive experiences on a variety of platforms. This library supports managing Microsoft Azure Mixed Reality resources. diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Custom/ArmMobileNetworkModelFactory.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Custom/ArmMobileNetworkModelFactory.cs index 0afa84db5d6e..6b574018498c 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Custom/ArmMobileNetworkModelFactory.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Custom/ArmMobileNetworkModelFactory.cs @@ -12,65 +12,6 @@ namespace Azure.ResourceManager.MobileNetwork.Models { public static partial class ArmMobileNetworkModelFactory { - /// Initializes a new instance of MobileNetworkPacketCaptureData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The provisioning state of the packet capture session resource. - /// The status of the packet capture session. - /// The reason the current packet capture session state. - /// The start time of the packet capture session. - /// List of network interfaces to capture on. - /// Number of bytes captured per packet, the remaining bytes are truncated. The default "0" means the entire packet is captured. - /// Maximum size of the capture output. - /// Maximum duration of the capture session in seconds. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static MobileNetworkPacketCaptureData MobileNetworkPacketCaptureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MobileNetworkProvisioningState? provisioningState, MobileNetworkPacketCaptureStatus? status, string reason, DateTimeOffset? captureStartOn, IEnumerable networkInterfaces, long? bytesToCapturePerPacket, long? totalBytesPerSession, int? timeLimitInSeconds) - => MobileNetworkPacketCaptureData(id, name, resourceType, systemData, provisioningState, status, reason, captureStartOn, networkInterfaces, bytesToCapturePerPacket, totalBytesPerSession, timeLimitInSeconds, outputFiles: default); - - /// Initializes a new instance of PacketCoreControlPlaneData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The identity used to retrieve the ingress certificate from Azure key vault. - /// The provisioning state of the packet core control plane resource. - /// The installation state of the packet core control plane resource. - /// Site(s) under which this packet core control plane should be deployed. The sites must be in the same location as the packet core control plane. - /// The platform where the packet core is deployed. - /// The core network technology generation (5G core or EPC / 4G core). - /// The desired version of the packet core software. - /// The currently installed version of the packet core software. - /// The previous version of the packet core software that was deployed. Used when performing the rollback action. - /// The control plane interface on the access network. For 5G networks, this is the N2 interface. For 4G networks, this is the S1-MME interface. - /// The SKU defining the throughput and SIM allowances for this packet core control plane deployment. - /// The MTU (in bytes) signaled to the UE. The same MTU is set on the user plane data links for all data networks. The MTU set on the user plane access link is calculated to be 60 bytes greater than this value to allow for GTP encapsulation. - /// The kubernetes ingress configuration to control access to packet core diagnostics over local APIs. - /// Configuration for uploading packet core diagnostics. - /// Settings to allow interoperability with third party components e.g. RANs and UEs. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static PacketCoreControlPlaneData PacketCoreControlPlaneData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MobileNetworkManagedServiceIdentity userAssignedIdentity, MobileNetworkProvisioningState? provisioningState, MobileNetworkInstallation installation, IEnumerable sites, MobileNetworkPlatformConfiguration platform, MobileNetworkCoreNetworkType? coreNetworkTechnology, string version, string installedVersion, string rollbackVersion, MobileNetworkInterfaceProperties controlPlaneAccessInterface, MobileNetworkBillingSku sku, int? ueMtu, MobileNetworkLocalDiagnosticsAccessConfiguration localDiagnosticsAccess, Uri diagnosticsUploadStorageAccountContainerUri, BinaryData interopSettings) - => PacketCoreControlPlaneData(id, name, resourceType, systemData, tags, location, userAssignedIdentity, provisioningState, installation, sites, platform, coreNetworkTechnology, version, installedVersion, rollbackVersion, controlPlaneAccessInterface, controlPlaneAccessVirtualIPv4Addresses: default, sku, ueMtu, localDiagnosticsAccess, diagnosticsUploadStorageAccountContainerUri, eventHub: default, signaling: default, interopSettings); - - /// Initializes a new instance of PacketCoreDataPlaneData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The provisioning state of the packet core data plane resource. - /// The user plane interface on the access network. For 5G networks, this is the N3 interface. For 4G networks, this is the S1-U interface. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static PacketCoreDataPlaneData PacketCoreDataPlaneData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MobileNetworkProvisioningState? provisioningState, MobileNetworkInterfaceProperties userPlaneAccessInterface) - => PacketCoreDataPlaneData(id, name, resourceType, systemData, tags, location, provisioningState, userPlaneAccessInterface, userPlaneAccessVirtualIPv4Addresses: default); - /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/ArmMobileNetworkModelFactory.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/ArmMobileNetworkModelFactory.cs index 9c35cca71ef1..2814aa968cbb 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/ArmMobileNetworkModelFactory.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/ArmMobileNetworkModelFactory.cs @@ -1134,6 +1134,71 @@ public static UEInfo UEInfo(ResourceIdentifier id = null, string name = null, Re serializedAdditionalRawData: null); } + /// Initializes a new instance of MobileNetworkPacketCaptureData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the packet capture session resource. + /// The status of the packet capture session. + /// The reason the current packet capture session state. + /// The start time of the packet capture session. + /// List of network interfaces to capture on. + /// Number of bytes captured per packet, the remaining bytes are truncated. The default "0" means the entire packet is captured. + /// Maximum size of the capture output. + /// Maximum duration of the capture session in seconds. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static MobileNetworkPacketCaptureData MobileNetworkPacketCaptureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MobileNetworkProvisioningState? provisioningState, MobileNetworkPacketCaptureStatus? status, string reason, DateTimeOffset? captureStartOn, IEnumerable networkInterfaces, long? bytesToCapturePerPacket, long? totalBytesPerSession, int? timeLimitInSeconds) + { + return MobileNetworkPacketCaptureData(id: id, name: name, resourceType: resourceType, systemData: systemData, provisioningState: provisioningState, status: status, reason: reason, captureStartOn: captureStartOn, networkInterfaces: networkInterfaces, bytesToCapturePerPacket: bytesToCapturePerPacket, totalBytesPerSession: totalBytesPerSession, timeLimitInSeconds: timeLimitInSeconds, outputFiles: default); + } + + /// Initializes a new instance of PacketCoreControlPlaneData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The identity used to retrieve the ingress certificate from Azure key vault. + /// The provisioning state of the packet core control plane resource. + /// The installation state of the packet core control plane resource. + /// Site(s) under which this packet core control plane should be deployed. The sites must be in the same location as the packet core control plane. + /// The platform where the packet core is deployed. + /// The core network technology generation (5G core or EPC / 4G core). + /// The desired version of the packet core software. + /// The currently installed version of the packet core software. + /// The previous version of the packet core software that was deployed. Used when performing the rollback action. + /// The control plane interface on the access network. For 5G networks, this is the N2 interface. For 4G networks, this is the S1-MME interface. + /// The SKU defining the throughput and SIM allowances for this packet core control plane deployment. + /// The MTU (in bytes) signaled to the UE. The same MTU is set on the user plane data links for all data networks. The MTU set on the user plane access link is calculated to be 60 bytes greater than this value to allow for GTP encapsulation. + /// The kubernetes ingress configuration to control access to packet core diagnostics over local APIs. + /// Configuration for uploading packet core diagnostics. + /// Settings to allow interoperability with third party components e.g. RANs and UEs. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static PacketCoreControlPlaneData PacketCoreControlPlaneData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MobileNetworkManagedServiceIdentity userAssignedIdentity, MobileNetworkProvisioningState? provisioningState, MobileNetworkInstallation installation, IEnumerable sites, MobileNetworkPlatformConfiguration platform, MobileNetworkCoreNetworkType? coreNetworkTechnology, string version, string installedVersion, string rollbackVersion, MobileNetworkInterfaceProperties controlPlaneAccessInterface, MobileNetworkBillingSku sku, int? ueMtu, MobileNetworkLocalDiagnosticsAccessConfiguration localDiagnosticsAccess, Uri diagnosticsUploadStorageAccountContainerUri, BinaryData interopSettings) + { + return PacketCoreControlPlaneData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, userAssignedIdentity: userAssignedIdentity, provisioningState: provisioningState, installation: installation, sites: sites, platform: platform, coreNetworkTechnology: coreNetworkTechnology, version: version, installedVersion: installedVersion, rollbackVersion: rollbackVersion, controlPlaneAccessInterface: controlPlaneAccessInterface, controlPlaneAccessVirtualIPv4Addresses: default, sku: sku, ueMtu: ueMtu, localDiagnosticsAccess: localDiagnosticsAccess, diagnosticsUploadStorageAccountContainerUri: diagnosticsUploadStorageAccountContainerUri, eventHub: default, signaling: default, interopSettings: interopSettings, homeNetworkPrivateKeysProvisioningState: default, allowSupportTelemetryAccess: default); + } + + /// Initializes a new instance of PacketCoreDataPlaneData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state of the packet core data plane resource. + /// The user plane interface on the access network. For 5G networks, this is the N3 interface. For 4G networks, this is the S1-U interface. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static PacketCoreDataPlaneData PacketCoreDataPlaneData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MobileNetworkProvisioningState? provisioningState, MobileNetworkInterfaceProperties userPlaneAccessInterface) + { + return PacketCoreDataPlaneData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, provisioningState: provisioningState, userPlaneAccessInterface: userPlaneAccessInterface, userPlaneAccessVirtualIPv4Addresses: default); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/monitor/Azure.Monitor.Ingestion/README.md b/sdk/monitor/Azure.Monitor.Ingestion/README.md index a15eb9370509..39d63c715ab0 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/README.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/README.md @@ -284,5 +284,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [data_collection_endpoint]: https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-endpoint-overview [data_collection_rule]: https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-rule-overview [logging]: https://learn.microsoft.com/dotnet/azure/sdk/logging - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/monitor/Azure.Monitor.Ingestion/README.png) diff --git a/sdk/monitor/Azure.Monitor.Query/README.md b/sdk/monitor/Azure.Monitor.Query/README.md index 8cb296386259..9e7ce91c984a 100644 --- a/sdk/monitor/Azure.Monitor.Query/README.md +++ b/sdk/monitor/Azure.Monitor.Query/README.md @@ -793,5 +793,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fmonitor%2FAzure.Monitor.Query%2FREADME.png) diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.net8.0.cs b/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.net8.0.cs index ad597f2a00d7..2bd7e10ed147 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.net8.0.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.net8.0.cs @@ -1083,15 +1083,15 @@ public static partial class ArmNetAppModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupDetail NetAppVolumeBackupDetail(string volumeName, int? backupsCount, bool? isPolicyEnabled) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus = default(Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus?), Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState = default(Azure.ResourceManager.NetApp.Models.NetAppMirrorState?), string unhealthyReason = null, string errorMessage = null, long? lastTransferSize = default(long?), string lastTransferType = null, long? totalTransferBytes = default(long?)) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy, Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus, Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState, string unhealthyReason, string errorMessage, long? lastTransferSize, string lastTransferType, long? totalTransferBytes) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus = default(Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus?), Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState = default(Azure.ResourceManager.NetApp.Models.NetAppMirrorState?), string unhealthyReason = null, string errorMessage = null, long? lastTransferSize = default(long?), string lastTransferType = null, long? totalTransferBytes = default(long?), long? transferProgressBytes = default(long?)) { throw null; } public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, Azure.ResourceManager.NetApp.Models.AcceptGrowCapacityPoolForShortTermCloneSplit? acceptGrowCapacityPoolForShortTermCloneSplit = default(Azure.ResourceManager.NetApp.Models.AcceptGrowCapacityPoolForShortTermCloneSplit?), bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null, long? inheritedSizeInBytes = default(long?), Azure.ResourceManager.NetApp.Models.NetAppVolumeLanguage? language = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeLanguage?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } public static Azure.ResourceManager.NetApp.NetAppVolumeGroupData NetAppVolumeGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string provisioningState = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupMetadata groupMetaData = null, System.Collections.Generic.IEnumerable volumes = null) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupMetadata NetAppVolumeGroupMetadata(string groupDescription = null, Azure.ResourceManager.NetApp.Models.NetAppApplicationType? applicationType = default(Azure.ResourceManager.NetApp.Models.NetAppApplicationType?), string applicationIdentifier = null, System.Collections.Generic.IEnumerable globalPlacementRules = null, long? volumesCount = default(long?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1101,9 +1101,9 @@ public static partial class ArmNetAppModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IDictionary tags = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeMountTarget NetAppVolumeMountTarget(System.Guid? mountTargetId = default(System.Guid?), System.Guid fileSystemId = default(System.Guid), System.Net.IPAddress ipAddress = null, string smbServerFqdn = null) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumePatch NetAppVolumePatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long? usageThreshold = default(long?), System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, float? throughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppVolumePatchDataProtection dataProtection = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = null, bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), bool? isSnapshotDirectoryVisible = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.netstandard2.0.cs b/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.netstandard2.0.cs index ad597f2a00d7..2bd7e10ed147 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.netstandard2.0.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/api/Azure.ResourceManager.NetApp.netstandard2.0.cs @@ -1083,15 +1083,15 @@ public static partial class ArmNetAppModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupDetail NetAppVolumeBackupDetail(string volumeName, int? backupsCount, bool? isPolicyEnabled) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus = default(Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus?), Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState = default(Azure.ResourceManager.NetApp.Models.NetAppMirrorState?), string unhealthyReason = null, string errorMessage = null, long? lastTransferSize = default(long?), string lastTransferType = null, long? totalTransferBytes = default(long?)) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy, Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus, Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState, string unhealthyReason, string errorMessage, long? lastTransferSize, string lastTransferType, long? totalTransferBytes) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus? relationshipStatus = default(Azure.ResourceManager.NetApp.Models.NetAppRelationshipStatus?), Azure.ResourceManager.NetApp.Models.NetAppMirrorState? mirrorState = default(Azure.ResourceManager.NetApp.Models.NetAppMirrorState?), string unhealthyReason = null, string errorMessage = null, long? lastTransferSize = default(long?), string lastTransferType = null, long? totalTransferBytes = default(long?), long? transferProgressBytes = default(long?)) { throw null; } public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, Azure.ResourceManager.NetApp.Models.AcceptGrowCapacityPoolForShortTermCloneSplit? acceptGrowCapacityPoolForShortTermCloneSplit = default(Azure.ResourceManager.NetApp.Models.AcceptGrowCapacityPoolForShortTermCloneSplit?), bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null, long? inheritedSizeInBytes = default(long?), Azure.ResourceManager.NetApp.Models.NetAppVolumeLanguage? language = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeLanguage?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.NetAppVolumeData NetAppVolumeData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } public static Azure.ResourceManager.NetApp.NetAppVolumeGroupData NetAppVolumeGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string provisioningState = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupMetadata groupMetaData = null, System.Collections.Generic.IEnumerable volumes = null) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupMetadata NetAppVolumeGroupMetadata(string groupDescription = null, Azure.ResourceManager.NetApp.Models.NetAppApplicationType? applicationType = default(Azure.ResourceManager.NetApp.Models.NetAppApplicationType?), string applicationIdentifier = null, System.Collections.Generic.IEnumerable globalPlacementRules = null, long? volumesCount = default(long?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1101,9 +1101,9 @@ public static partial class ArmNetAppModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? effectiveNetworkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IEnumerable zones = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Collections.Generic.IEnumerable zones, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IDictionary tags = null, System.Guid? fileSystemId = default(System.Guid?), string creationToken = null, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long usageThreshold = (long)0, System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = default(bool?), string backupId = null, string baremetalTenantId = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures = default(Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature?), System.Guid? networkSiblingSetId = default(System.Guid?), Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity?), System.Collections.Generic.IEnumerable mountTargets = null, string volumeType = null, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = default(bool?), bool? isSnapshotDirectoryVisible = default(bool?), bool? isKerberosEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle = default(Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle?), bool? isSmbEncryptionEnabled = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?), bool? isSmbContinuouslyAvailable = default(bool?), float? throughputMibps = default(float?), float? actualThroughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource = default(Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource?), Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = default(bool?), bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = null, int? cloneProgress = default(int?), Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs = default(Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog?), Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore = default(Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore?), System.Collections.Generic.IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = null, Azure.Core.ResourceIdentifier capacityPoolResourceId = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = default(bool?), System.Collections.Generic.IEnumerable placementRules = null, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes = default(Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume?), string provisionedAvailabilityZone = null, bool? isLargeVolume = default(bool?), Azure.Core.ResourceIdentifier originatingResourceId = null) { throw null; } + public static Azure.ResourceManager.NetApp.Models.NetAppVolumeGroupVolume NetAppVolumeGroupVolume(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, System.Collections.Generic.IDictionary tags, System.Guid? fileSystemId, string creationToken, Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel, long usageThreshold, System.Collections.Generic.IEnumerable exportRules, System.Collections.Generic.IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, Azure.Core.ResourceIdentifier subnetId, Azure.ResourceManager.NetApp.Models.NetAppNetworkFeature? networkFeatures, System.Guid? networkSiblingSetId, Azure.ResourceManager.NetApp.Models.NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, System.Collections.Generic.IEnumerable mountTargets, string volumeType, Azure.ResourceManager.NetApp.Models.NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, Azure.ResourceManager.NetApp.Models.NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration, Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, Azure.ResourceManager.NetApp.Models.NetAppEncryptionKeySource? encryptionKeySource, Azure.Core.ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, Azure.ResourceManager.NetApp.Models.NetAppFileAccessLog? fileAccessLogs, Azure.ResourceManager.NetApp.Models.NetAppAvsDataStore? avsDataStore, System.Collections.Generic.IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, Azure.Core.ResourceIdentifier capacityPoolResourceId, Azure.Core.ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, System.Collections.Generic.IEnumerable placementRules, Azure.ResourceManager.NetApp.Models.EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, Azure.Core.ResourceIdentifier originatingResourceId) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumeMountTarget NetAppVolumeMountTarget(System.Guid? mountTargetId = default(System.Guid?), System.Guid fileSystemId = default(System.Guid), System.Net.IPAddress ipAddress = null, string smbServerFqdn = null) { throw null; } public static Azure.ResourceManager.NetApp.Models.NetAppVolumePatch NetAppVolumePatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel? serviceLevel = default(Azure.ResourceManager.NetApp.Models.NetAppFileServiceLevel?), long? usageThreshold = default(long?), System.Collections.Generic.IEnumerable exportRules = null, System.Collections.Generic.IEnumerable protocolTypes = null, float? throughputMibps = default(float?), Azure.ResourceManager.NetApp.Models.NetAppVolumePatchDataProtection dataProtection = null, bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = null, bool? isCoolAccessEnabled = default(bool?), int? coolnessPeriod = default(int?), Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = default(Azure.ResourceManager.NetApp.Models.CoolAccessRetrievalPolicy?), bool? isSnapshotDirectoryVisible = default(bool?), Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration? smbAccessBasedEnumeration = default(Azure.ResourceManager.NetApp.Models.SmbAccessBasedEnumeration?), Azure.ResourceManager.NetApp.Models.SmbNonBrowsable? smbNonBrowsable = default(Azure.ResourceManager.NetApp.Models.SmbNonBrowsable?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Custom/ArmNetAppModelFactory.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Custom/ArmNetAppModelFactory.cs index b3b02c52cfc3..e051ed324e63 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Custom/ArmNetAppModelFactory.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Custom/ArmNetAppModelFactory.cs @@ -16,22 +16,6 @@ namespace Azure.ResourceManager.NetApp.Models /// Model factory for models. public static partial class ArmNetAppModelFactory { - /// Initializes a new instance of NetAppVolumeBackupStatus. - /// Backup health status. - /// Status of the backup mirror relationship. - /// The status of the backup. - /// Reason for the unhealthy backup relationship. - /// Displays error message if the backup is in an error state. - /// Displays the last transfer size. - /// Displays the last transfer type. - /// Displays the total bytes transferred. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy = null, NetAppRelationshipStatus? relationshipStatus = null, NetAppMirrorState? mirrorState = null, string unhealthyReason = null, string errorMessage = null, long? lastTransferSize = null, string lastTransferType = null, long? totalTransferBytes = null) - { - return new NetAppVolumeBackupStatus(isHealthy, relationshipStatus, mirrorState, unhealthyReason, errorMessage, lastTransferSize, lastTransferType, totalTransferBytes, null, serializedAdditionalRawData: null); - } - /// Initializes a new instance of NetAppBackupData. /// The id. /// The name. @@ -55,381 +39,6 @@ public static NetAppBackupData NetAppBackupData(ResourceIdentifier id = null, st return new NetAppBackupData(id, name, resourceType, systemData, backupId, createdOn, provisioningState, size, label, backupType, failureReason, null, useExistingSnapshot, snapshotName: null, backupPolicyArmResourceId: null, isLargeVolume:null, serializedAdditionalRawData: null); } - /// Initializes a new instance of NetAppVolumeGroupVolume. - /// Resource Id. - /// Resource name. - /// Resource type. - /// Resource tags. - /// Unique FileSystem Identifier. - /// A unique file path for the volume. Used when creating mount targets. - /// The service level of the file system. - /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. - /// Set of export policy rules. - /// Set of protocol types, default NFSv3, CIFS for SMB protocol. - /// Azure lifecycle management. - /// UUID v4 or resource identifier used to identify the Snapshot. - /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. - /// UUID v4 or resource identifier used to identify the Backup. - /// Unique Baremetal Tenant Identifier. - /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. - /// Basic network, or Standard features available to the volume. - /// Network Sibling Set ID for the the group of volumes sharing networking resources. - /// Provides storage to network proximity information for the volume. - /// List of mount targets. - /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. - /// DataProtection type volumes include an object containing details of the replication. - /// Restoring. - /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). - /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. - /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. - /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. - /// Enables access based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables non browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables continuously available share property for smb volume. Only applicable for SMB volume. - /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. - /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. - /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not for a given NFS volume. - /// Specifies whether Cool Access(tiering) is enabled for the volume. - /// Specifies the number of days after which data that is not accessed by clients will be tiered. - /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. - /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. - /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. - /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. - /// Data store resource unique identifier. - /// Specifies if default quota is enabled for the volume. - /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. - /// Volume Group Name. - /// Pool Resource Id used in case of creating a volume through volume group. - /// Proximity placement group associated with the volume. - /// T2 network information. - /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. - /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. - /// Application specific placement rules for the particular volume. - /// Flag indicating whether subvolume operations are enabled on the volume. - /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. - /// Specifies whether volume is a Large Volume or Regular Volume. - /// Id of the snapshot or backup that the volume is restored from. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetAppVolumeGroupVolume NetAppVolumeGroupVolume(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, IDictionary tags = null, Guid? fileSystemId = null, string creationToken = null, NetAppFileServiceLevel? serviceLevel = null, long usageThreshold = default, IEnumerable exportRules = null, IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = null, string backupId = null, string baremetalTenantId = null, ResourceIdentifier subnetId = null, NetAppNetworkFeature? networkFeatures = null, Guid? networkSiblingSetId = null, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = null, IEnumerable mountTargets = null, string volumeType = null, NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = null, bool? isSnapshotDirectoryVisible = null, bool? isKerberosEnabled = null, NetAppVolumeSecurityStyle? securityStyle = null, bool? isSmbEncryptionEnabled = null, SmbAccessBasedEnumeration? smbAccessBasedEnumeration = null, SmbNonBrowsable? smbNonBrowsable = null, bool? isSmbContinuouslyAvailable = null, float? throughputMibps = null, float? actualThroughputMibps = null, NetAppEncryptionKeySource? encryptionKeySource = null, ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = null, bool? isCoolAccessEnabled = null, int? coolnessPeriod = null, string unixPermissions = null, int? cloneProgress = null, NetAppFileAccessLog? fileAccessLogs = null, NetAppAvsDataStore? avsDataStore = null, IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = null, long? defaultUserQuotaInKiBs = null, long? defaultGroupQuotaInKiBs = null, long? maximumNumberOfFiles = null, string volumeGroupName = null, ResourceIdentifier capacityPoolResourceId = null, ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = null, IEnumerable placementRules = null, EnableNetAppSubvolume? enableSubvolumes = null, string provisionedAvailabilityZone = null, bool? isLargeVolume = null, ResourceIdentifier originatingResourceId = null) - { - tags ??= new Dictionary(); - exportRules ??= new List(); - protocolTypes ??= new List(); - mountTargets ??= new List(); - dataStoreResourceId ??= new List(); - placementRules ??= new List(); - //Set null for zones, coolAccessRetrievalPolicy and effectiveNetworkFeatures for backwards compat - return new NetAppVolumeGroupVolume(id, name, resourceType, tags, null, fileSystemId, creationToken, serviceLevel, usageThreshold, exportRules != null ? new VolumePropertiesExportPolicy(exportRules?.ToList(), serializedAdditionalRawData: null) : null, protocolTypes?.ToList(), provisioningState, new ResourceIdentifier(snapshotId), deleteBaseSnapshot, new ResourceIdentifier(backupId), baremetalTenantId, subnetId, networkFeatures, null, networkSiblingSetId, storageToNetworkProximity, mountTargets?.ToList(), volumeType, dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: null, isRestoring, isSnapshotDirectoryVisible, isKerberosEnabled, securityStyle, isSmbEncryptionEnabled, smbAccessBasedEnumeration, smbNonBrowsable, isSmbContinuouslyAvailable, throughputMibps, actualThroughputMibps, encryptionKeySource, keyVaultPrivateEndpointResourceId, isLdapEnabled, isCoolAccessEnabled, coolnessPeriod, null, unixPermissions, cloneProgress, fileAccessLogs, avsDataStore, dataStoreResourceId?.ToList(), isDefaultQuotaEnabled, defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs, maximumNumberOfFiles, volumeGroupName, capacityPoolResourceId, proximityPlacementGroupId, t2Network, volumeSpecName, isEncrypted: isEncrypted, placementRules: placementRules?.ToList(), enableSubvolumes: enableSubvolumes, provisionedAvailabilityZone: provisionedAvailabilityZone, isLargeVolume: isLargeVolume, originatingResourceId: originatingResourceId, inheritedSizeInBytes: null, language:null, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Resource Id. - /// Resource name. - /// Resource type. - /// Resource tags. - /// Availability Zone. - /// Unique FileSystem Identifier. - /// A unique file path for the volume. Used when creating mount targets. - /// The service level of the file system. - /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. - /// Set of export policy rules. - /// Set of protocol types, default NFSv3, CIFS for SMB protocol. - /// Azure lifecycle management. - /// Resource identifier used to identify the Snapshot. - /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. - /// Resource identifier used to identify the Backup. - /// Unique Baremetal Tenant Identifier. - /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. - /// Network features available to the volume, or current state of update. - /// Network Sibling Set ID for the the group of volumes sharing networking resources. - /// Provides storage to network proximity information for the volume. - /// List of mount targets. - /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. - /// DataProtection type volumes include an object containing details of the replication. - /// Restoring. - /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). - /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. - /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. - /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. - /// Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables continuously available share property for smb volume. Only applicable for SMB volume. - /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. - /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. - /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not for a given NFS volume. - /// Specifies whether Cool Access(tiering) is enabled for the volume. - /// Specifies the number of days after which data that is not accessed by clients will be tiered. - /// - /// coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read pattern for cool access enabled volumes. The possible values for this field are: - /// Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. - /// OnRead - All client-driven data read is pulled from cool tier to standard storage on both sequential and random reads. - /// Never - No client-driven data is pulled from cool tier to standard storage. - /// - /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. - /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. - /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. - /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. - /// Data store resource unique identifier. - /// Specifies if default quota is enabled for the volume. - /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. - /// Volume Group Name. - /// Pool Resource Id used in case of creating a volume through volume group. - /// Proximity placement group associated with the volume. - /// T2 network information. - /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. - /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. - /// Application specific placement rules for the particular volume. - /// Flag indicating whether subvolume operations are enabled on the volume. - /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. - /// Specifies whether volume is a Large Volume or Regular Volume. - /// Id of the snapshot or backup that the volume is restored from. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetAppVolumeGroupVolume NetAppVolumeGroupVolume(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, IDictionary tags = null, IEnumerable zones = null, Guid? fileSystemId = null, string creationToken = null, NetAppFileServiceLevel? serviceLevel = null, long usageThreshold = default, IEnumerable exportRules = null, IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = null, string backupId = null, string baremetalTenantId = null, ResourceIdentifier subnetId = null, NetAppNetworkFeature? networkFeatures = null, Guid? networkSiblingSetId = null, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = null, IEnumerable mountTargets = null, string volumeType = null, NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = null, bool? isSnapshotDirectoryVisible = null, bool? isKerberosEnabled = null, NetAppVolumeSecurityStyle? securityStyle = null, bool? isSmbEncryptionEnabled = null, SmbAccessBasedEnumeration? smbAccessBasedEnumeration = null, SmbNonBrowsable? smbNonBrowsable = null, bool? isSmbContinuouslyAvailable = null, float? throughputMibps = null, float? actualThroughputMibps = null, NetAppEncryptionKeySource? encryptionKeySource = null, ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = null, bool? isCoolAccessEnabled = null, int? coolnessPeriod = null, CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = null, string unixPermissions = null, int? cloneProgress = null, NetAppFileAccessLog? fileAccessLogs = null, NetAppAvsDataStore? avsDataStore = null, IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = null, long? defaultUserQuotaInKiBs = null, long? defaultGroupQuotaInKiBs = null, long? maximumNumberOfFiles = null, string volumeGroupName = null, ResourceIdentifier capacityPoolResourceId = null, ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = null, IEnumerable placementRules = null, EnableNetAppSubvolume? enableSubvolumes = null, string provisionedAvailabilityZone = null, bool? isLargeVolume = null, ResourceIdentifier originatingResourceId = null) - { - //For Backwards compatability sets effective networkfeatures to null - tags ??= new Dictionary(); - zones ??= new List(); - exportRules ??= new List(); - protocolTypes ??= new List(); - mountTargets ??= new List(); - dataStoreResourceId ??= new List(); - placementRules ??= new List(); - - return new NetAppVolumeGroupVolume( - id, - name, - resourceType, - tags, - zones?.ToList(), - fileSystemId, - creationToken, - serviceLevel, - usageThreshold, - exportRules != null ? new VolumePropertiesExportPolicy(exportRules?.ToList(), serializedAdditionalRawData: null) : null, - protocolTypes?.ToList(), - provisioningState, - new ResourceIdentifier(snapshotId), - deleteBaseSnapshot, - new ResourceIdentifier(backupId), - baremetalTenantId, - subnetId, - networkFeatures, - null, - networkSiblingSetId, - storageToNetworkProximity, - mountTargets?.ToList(), - volumeType, - dataProtection, - acceptGrowCapacityPoolForShortTermCloneSplit: null, - isRestoring, - isSnapshotDirectoryVisible, - isKerberosEnabled, - securityStyle, - isSmbEncryptionEnabled, - smbAccessBasedEnumeration, - smbNonBrowsable, - isSmbContinuouslyAvailable, - throughputMibps, - actualThroughputMibps, - encryptionKeySource, - keyVaultPrivateEndpointResourceId, - isLdapEnabled, - isCoolAccessEnabled, - coolnessPeriod, - coolAccessRetrievalPolicy, - unixPermissions, - cloneProgress, - fileAccessLogs, - avsDataStore, - dataStoreResourceId?.ToList(), - isDefaultQuotaEnabled, - defaultUserQuotaInKiBs, - defaultGroupQuotaInKiBs, - maximumNumberOfFiles, - volumeGroupName, - capacityPoolResourceId, - proximityPlacementGroupId, - t2Network, - volumeSpecName, - isEncrypted, - placementRules?.ToList(), - enableSubvolumes, - provisionedAvailabilityZone, - isLargeVolume, - originatingResourceId: originatingResourceId, - inheritedSizeInBytes: null, - language: null, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of NetAppVolumeData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A unique read-only string that changes whenever the resource is updated. - /// Availability Zone. - /// Unique FileSystem Identifier. - /// A unique file path for the volume. Used when creating mount targets. - /// The service level of the file system. - /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. - /// Set of export policy rules. - /// Set of protocol types, default NFSv3, CIFS for SMB protocol. - /// Azure lifecycle management. - /// UUID v4 or resource identifier used to identify the Snapshot. - /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. - /// UUID v4 or resource identifier used to identify the Backup. - /// Unique Baremetal Tenant Identifier. - /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. - /// Basic network, or Standard features available to the volume. - /// Network Sibling Set ID for the the group of volumes sharing networking resources. - /// Provides storage to network proximity information for the volume. - /// List of mount targets. - /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. - /// DataProtection type volumes include an object containing details of the replication. - /// Restoring. - /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). - /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. - /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. - /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. - /// Enables access based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables non browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables continuously available share property for smb volume. Only applicable for SMB volume. - /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. - /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. - /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not for a given NFS volume. - /// Specifies whether Cool Access(tiering) is enabled for the volume. - /// Specifies the number of days after which data that is not accessed by clients will be tiered. - /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. - /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. - /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. - /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. - /// Data store resource unique identifier. - /// Specifies if default quota is enabled for the volume. - /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. - /// Volume Group Name. - /// Pool Resource Id used in case of creating a volume through volume group. - /// Proximity placement group associated with the volume. - /// T2 network information. - /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. - /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. - /// Application specific placement rules for the particular volume. - /// Flag indicating whether subvolume operations are enabled on the volume. - /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. - /// Specifies whether volume is a Large Volume or Regular Volume. - /// Id of the snapshot or backup that the volume is restored from. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetAppVolumeData NetAppVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, Azure.ResourceManager.Models.SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, IEnumerable zones = null, Guid? fileSystemId = null, string creationToken = null, NetAppFileServiceLevel? serviceLevel = null, long usageThreshold = default, IEnumerable exportRules = null, IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = null, string backupId = null, string baremetalTenantId = null, ResourceIdentifier subnetId = null, NetAppNetworkFeature? networkFeatures = null, Guid? networkSiblingSetId = null, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = null, IEnumerable mountTargets = null, string volumeType = null, NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = null, bool? isSnapshotDirectoryVisible = null, bool? isKerberosEnabled = null, NetAppVolumeSecurityStyle? securityStyle = null, bool? isSmbEncryptionEnabled = null, SmbAccessBasedEnumeration? smbAccessBasedEnumeration = null, SmbNonBrowsable? smbNonBrowsable = null, bool? isSmbContinuouslyAvailable = null, float? throughputMibps = null, float? actualThroughputMibps = null, NetAppEncryptionKeySource? encryptionKeySource = null, ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = null, bool? isCoolAccessEnabled = null, int? coolnessPeriod = null, string unixPermissions = null, int? cloneProgress = null, NetAppFileAccessLog? fileAccessLogs = null, NetAppAvsDataStore? avsDataStore = null, IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = null, long? defaultUserQuotaInKiBs = null, long? defaultGroupQuotaInKiBs = null, long? maximumNumberOfFiles = null, string volumeGroupName = null, ResourceIdentifier capacityPoolResourceId = null, ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = null, IEnumerable placementRules = null, EnableNetAppSubvolume? enableSubvolumes = null, string provisionedAvailabilityZone = null, bool? isLargeVolume = null, ResourceIdentifier originatingResourceId = null) - { - tags ??= new Dictionary(); - zones ??= new List(); - exportRules ??= new List(); - protocolTypes ??= new List(); - mountTargets ??= new List(); - dataStoreResourceId ??= new List(); - placementRules ??= new List(); - //Set null for zones and coolAccessRetrievalPolicy for backwards compat - return new NetAppVolumeData(id, name, resourceType, systemData, tags, location, etag, zones?.ToList(), fileSystemId, creationToken, serviceLevel, usageThreshold, exportRules != null ? new VolumePropertiesExportPolicy(exportRules?.ToList(), serializedAdditionalRawData: null) : null, protocolTypes?.ToList(), provisioningState, new ResourceIdentifier(snapshotId), deleteBaseSnapshot, new ResourceIdentifier(backupId), baremetalTenantId, subnetId, networkFeatures, null, networkSiblingSetId, storageToNetworkProximity, mountTargets?.ToList(), volumeType, dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: null, isRestoring, isSnapshotDirectoryVisible, isKerberosEnabled, securityStyle, isSmbEncryptionEnabled, smbAccessBasedEnumeration, smbNonBrowsable, isSmbContinuouslyAvailable, throughputMibps, actualThroughputMibps, encryptionKeySource, keyVaultPrivateEndpointResourceId, isLdapEnabled, isCoolAccessEnabled, coolnessPeriod, null, unixPermissions, cloneProgress, fileAccessLogs, avsDataStore, dataStoreResourceId?.ToList(), isDefaultQuotaEnabled, defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs, maximumNumberOfFiles, volumeGroupName, capacityPoolResourceId, proximityPlacementGroupId, t2Network, volumeSpecName, isEncrypted, placementRules?.ToList(), enableSubvolumes, provisionedAvailabilityZone, isLargeVolume, originatingResourceId, inheritedSizeInBytes: null, language: null, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A unique read-only string that changes whenever the resource is updated. - /// Availability Zone. - /// Unique FileSystem Identifier. - /// A unique file path for the volume. Used when creating mount targets. - /// The service level of the file system. - /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. - /// Set of export policy rules. - /// Set of protocol types, default NFSv3, CIFS for SMB protocol. - /// Azure lifecycle management. - /// Resource identifier used to identify the Snapshot. - /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. - /// Resource identifier used to identify the Backup. - /// Unique Baremetal Tenant Identifier. - /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. - /// Network features available to the volume, or current state of update. - /// Network Sibling Set ID for the the group of volumes sharing networking resources. - /// Provides storage to network proximity information for the volume. - /// List of mount targets. - /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. - /// DataProtection type volumes include an object containing details of the replication. - /// Restoring. - /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). - /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. - /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. - /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. - /// Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. - /// Enables continuously available share property for smb volume. Only applicable for SMB volume. - /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. - /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. - /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not for a given NFS volume. - /// Specifies whether Cool Access(tiering) is enabled for the volume. - /// Specifies the number of days after which data that is not accessed by clients will be tiered. - /// - /// coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read pattern for cool access enabled volumes. The possible values for this field are: - /// Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. - /// OnRead - All client-driven data read is pulled from cool tier to standard storage on both sequential and random reads. - /// Never - No client-driven data is pulled from cool tier to standard storage. - /// - /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. - /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. - /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. - /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. - /// Data store resource unique identifier. - /// Specifies if default quota is enabled for the volume. - /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. - /// Volume Group Name. - /// Pool Resource Id used in case of creating a volume through volume group. - /// Proximity placement group associated with the volume. - /// T2 network information. - /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. - /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. - /// Application specific placement rules for the particular volume. - /// Flag indicating whether subvolume operations are enabled on the volume. - /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. - /// Specifies whether volume is a Large Volume or Regular Volume. - /// Id of the snapshot or backup that the volume is restored from. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static NetAppVolumeData NetAppVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, IEnumerable zones = null, Guid? fileSystemId = null, string creationToken = null, NetAppFileServiceLevel? serviceLevel = null, long usageThreshold = default, IEnumerable exportRules = null, IEnumerable protocolTypes = null, string provisioningState = null, string snapshotId = null, bool? deleteBaseSnapshot = null, string backupId = null, string baremetalTenantId = null, ResourceIdentifier subnetId = null, NetAppNetworkFeature? networkFeatures = null, Guid? networkSiblingSetId = null, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity = null, IEnumerable mountTargets = null, string volumeType = null, NetAppVolumeDataProtection dataProtection = null, bool? isRestoring = null, bool? isSnapshotDirectoryVisible = null, bool? isKerberosEnabled = null, NetAppVolumeSecurityStyle? securityStyle = null, bool? isSmbEncryptionEnabled = null, SmbAccessBasedEnumeration? smbAccessBasedEnumeration = null, SmbNonBrowsable? smbNonBrowsable = null, bool? isSmbContinuouslyAvailable = null, float? throughputMibps = null, float? actualThroughputMibps = null, NetAppEncryptionKeySource? encryptionKeySource = null, ResourceIdentifier keyVaultPrivateEndpointResourceId = null, bool? isLdapEnabled = null, bool? isCoolAccessEnabled = null, int? coolnessPeriod = null, CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy = null, string unixPermissions = null, int? cloneProgress = null, NetAppFileAccessLog? fileAccessLogs = null, NetAppAvsDataStore? avsDataStore = null, IEnumerable dataStoreResourceId = null, bool? isDefaultQuotaEnabled = null, long? defaultUserQuotaInKiBs = null, long? defaultGroupQuotaInKiBs = null, long? maximumNumberOfFiles = null, string volumeGroupName = null, ResourceIdentifier capacityPoolResourceId = null, ResourceIdentifier proximityPlacementGroupId = null, string t2Network = null, string volumeSpecName = null, bool? isEncrypted = null, IEnumerable placementRules = null, EnableNetAppSubvolume? enableSubvolumes = null, string provisionedAvailabilityZone = null, bool? isLargeVolume = null, ResourceIdentifier originatingResourceId = null) - { - tags ??= new Dictionary(); - exportRules ??= new List(); - protocolTypes ??= new List(); - mountTargets ??= new List(); - dataStoreResourceId ??= new List(); - placementRules ??= new List(); - return new NetAppVolumeData(id, name, resourceType, systemData, tags, location, etag, zones?.ToList(), fileSystemId, creationToken, serviceLevel, usageThreshold, exportRules != null ? new VolumePropertiesExportPolicy(exportRules?.ToList(), serializedAdditionalRawData: null) : null, protocolTypes?.ToList(), provisioningState, new ResourceIdentifier(snapshotId), deleteBaseSnapshot, new ResourceIdentifier(backupId), baremetalTenantId, subnetId, networkFeatures, null, networkSiblingSetId, storageToNetworkProximity, mountTargets?.ToList(), volumeType, dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit:null, isRestoring, isSnapshotDirectoryVisible, isKerberosEnabled, securityStyle, isSmbEncryptionEnabled, smbAccessBasedEnumeration, smbNonBrowsable, isSmbContinuouslyAvailable, throughputMibps, actualThroughputMibps, encryptionKeySource, keyVaultPrivateEndpointResourceId, isLdapEnabled, isCoolAccessEnabled, coolnessPeriod, coolAccessRetrievalPolicy, unixPermissions, cloneProgress, fileAccessLogs, avsDataStore, dataStoreResourceId?.ToList(), isDefaultQuotaEnabled, defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs, maximumNumberOfFiles, volumeGroupName, capacityPoolResourceId, proximityPlacementGroupId, t2Network, volumeSpecName, isEncrypted, placementRules?.ToList(), enableSubvolumes, provisionedAvailabilityZone, isLargeVolume, originatingResourceId, inheritedSizeInBytes: null, language: null, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Group Description. /// Application Type. diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/ArmNetAppModelFactory.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/ArmNetAppModelFactory.cs index aa37844d0988..f3a72cef6471 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/ArmNetAppModelFactory.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/ArmNetAppModelFactory.cs @@ -1367,6 +1367,303 @@ public static NetAppVolumeBackupBackupRestoreFilesContent NetAppVolumeBackupBack return new NetAppVolumeBackupBackupRestoreFilesContent(fileList?.ToList(), restoreFilePath, destinationVolumeId, serializedAdditionalRawData: null); } + /// Initializes a new instance of NetAppVolumeBackupStatus. + /// Backup health status. + /// Status of the backup mirror relationship. + /// The status of the backup. + /// Reason for the unhealthy backup relationship. + /// Displays error message if the backup is in an error state. + /// Displays the last transfer size. + /// Displays the last transfer type. + /// Displays the total bytes transferred. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetAppVolumeBackupStatus NetAppVolumeBackupStatus(bool? isHealthy, NetAppRelationshipStatus? relationshipStatus, NetAppMirrorState? mirrorState, string unhealthyReason, string errorMessage, long? lastTransferSize, string lastTransferType, long? totalTransferBytes) + { + return NetAppVolumeBackupStatus(isHealthy: isHealthy, relationshipStatus: relationshipStatus, mirrorState: mirrorState, unhealthyReason: unhealthyReason, errorMessage: errorMessage, lastTransferSize: lastTransferSize, lastTransferType: lastTransferType, totalTransferBytes: totalTransferBytes, transferProgressBytes: default); + } + + /// Initializes a new instance of NetAppVolumeGroupVolume. + /// Resource Id. + /// Resource name. + /// Resource type. + /// Resource tags. + /// Unique FileSystem Identifier. + /// A unique file path for the volume. Used when creating mount targets. + /// The service level of the file system. + /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// Set of export policy rules. + /// Set of protocol types, default NFSv3, CIFS for SMB protocol. + /// Azure lifecycle management. + /// UUID v4 or resource identifier used to identify the Snapshot. + /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. + /// UUID v4 or resource identifier used to identify the Backup. + /// Unique Baremetal Tenant Identifier. + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + /// Basic network, or Standard features available to the volume. + /// Network Sibling Set ID for the the group of volumes sharing networking resources. + /// Provides storage to network proximity information for the volume. + /// List of mount targets. + /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. + /// DataProtection type volumes include an object containing details of the replication. + /// Restoring. + /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). + /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. + /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. + /// Enables access based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables non browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables continuously available share property for smb volume. Only applicable for SMB volume. + /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. + /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. + /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// Specifies the number of days after which data that is not accessed by clients will be tiered. + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. + /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. + /// Data store resource unique identifier. + /// Specifies if default quota is enabled for the volume. + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + /// Volume Group Name. + /// Pool Resource Id used in case of creating a volume through volume group. + /// Proximity placement group associated with the volume. + /// T2 network information. + /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. + /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. + /// Application specific placement rules for the particular volume. + /// Flag indicating whether subvolume operations are enabled on the volume. + /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. + /// Specifies whether volume is a Large Volume or Regular Volume. + /// Id of the snapshot or backup that the volume is restored from. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetAppVolumeGroupVolume NetAppVolumeGroupVolume(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary tags, Guid? fileSystemId, string creationToken, NetAppFileServiceLevel? serviceLevel, long usageThreshold, IEnumerable exportRules, IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, ResourceIdentifier subnetId, NetAppNetworkFeature? networkFeatures, Guid? networkSiblingSetId, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, IEnumerable mountTargets, string volumeType, NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, SmbAccessBasedEnumeration? smbAccessBasedEnumeration, SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, NetAppEncryptionKeySource? encryptionKeySource, ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, NetAppFileAccessLog? fileAccessLogs, NetAppAvsDataStore? avsDataStore, IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, ResourceIdentifier capacityPoolResourceId, ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, IEnumerable placementRules, EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, ResourceIdentifier originatingResourceId) + { + return NetAppVolumeGroupVolume(id: id, name: name, resourceType: resourceType, tags: tags, zones: default, fileSystemId: fileSystemId, creationToken: creationToken, serviceLevel: serviceLevel, usageThreshold: usageThreshold, exportRules: exportRules, protocolTypes: protocolTypes, provisioningState: provisioningState, snapshotId: snapshotId, deleteBaseSnapshot: deleteBaseSnapshot, backupId: backupId, baremetalTenantId: baremetalTenantId, subnetId: subnetId, networkFeatures: networkFeatures, effectiveNetworkFeatures: default, networkSiblingSetId: networkSiblingSetId, storageToNetworkProximity: storageToNetworkProximity, mountTargets: mountTargets, volumeType: volumeType, dataProtection: dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: default, isRestoring: isRestoring, isSnapshotDirectoryVisible: isSnapshotDirectoryVisible, isKerberosEnabled: isKerberosEnabled, securityStyle: securityStyle, isSmbEncryptionEnabled: isSmbEncryptionEnabled, smbAccessBasedEnumeration: smbAccessBasedEnumeration, smbNonBrowsable: smbNonBrowsable, isSmbContinuouslyAvailable: isSmbContinuouslyAvailable, throughputMibps: throughputMibps, actualThroughputMibps: actualThroughputMibps, encryptionKeySource: encryptionKeySource, keyVaultPrivateEndpointResourceId: keyVaultPrivateEndpointResourceId, isLdapEnabled: isLdapEnabled, isCoolAccessEnabled: isCoolAccessEnabled, coolnessPeriod: coolnessPeriod, coolAccessRetrievalPolicy: default, unixPermissions: unixPermissions, cloneProgress: cloneProgress, fileAccessLogs: fileAccessLogs, avsDataStore: avsDataStore, dataStoreResourceId: dataStoreResourceId, isDefaultQuotaEnabled: isDefaultQuotaEnabled, defaultUserQuotaInKiBs: defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs: defaultGroupQuotaInKiBs, maximumNumberOfFiles: maximumNumberOfFiles, volumeGroupName: volumeGroupName, capacityPoolResourceId: capacityPoolResourceId, proximityPlacementGroupId: proximityPlacementGroupId, t2Network: t2Network, volumeSpecName: volumeSpecName, isEncrypted: isEncrypted, placementRules: placementRules, enableSubvolumes: enableSubvolumes, provisionedAvailabilityZone: provisionedAvailabilityZone, isLargeVolume: isLargeVolume, originatingResourceId: originatingResourceId, inheritedSizeInBytes: default, language: default); + } + + /// Initializes a new instance of . + /// Resource Id. + /// Resource name. + /// Resource type. + /// Resource tags. + /// Availability Zone. + /// Unique FileSystem Identifier. + /// A unique file path for the volume. Used when creating mount targets. + /// The service level of the file system. + /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. + /// Set of export policy rules. + /// Set of protocol types, default NFSv3, CIFS for SMB protocol. + /// Azure lifecycle management. + /// Resource identifier used to identify the Snapshot. + /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. + /// Resource identifier used to identify the Backup. + /// Unique Baremetal Tenant Identifier. + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + /// Network features available to the volume, or current state of update. + /// Network Sibling Set ID for the the group of volumes sharing networking resources. + /// Provides storage to network proximity information for the volume. + /// List of mount targets. + /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. + /// DataProtection type volumes include an object containing details of the replication. + /// Restoring. + /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). + /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. + /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. + /// Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables continuously available share property for smb volume. Only applicable for SMB volume. + /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. + /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. + /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// Specifies the number of days after which data that is not accessed by clients will be tiered. + /// + /// coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read pattern for cool access enabled volumes. The possible values for this field are: + /// Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. + /// OnRead - All client-driven data read is pulled from cool tier to standard storage on both sequential and random reads. + /// Never - No client-driven data is pulled from cool tier to standard storage. + /// + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. + /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. + /// Data store resource unique identifier. + /// Specifies if default quota is enabled for the volume. + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + /// Volume Group Name. + /// Pool Resource Id used in case of creating a volume through volume group. + /// Proximity placement group associated with the volume. + /// T2 network information. + /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. + /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. + /// Application specific placement rules for the particular volume. + /// Flag indicating whether subvolume operations are enabled on the volume. + /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. + /// Specifies whether volume is a Large Volume or Regular Volume. + /// Id of the snapshot or backup that the volume is restored from. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetAppVolumeGroupVolume NetAppVolumeGroupVolume(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary tags, IEnumerable zones, Guid? fileSystemId, string creationToken, NetAppFileServiceLevel? serviceLevel, long usageThreshold, IEnumerable exportRules, IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, ResourceIdentifier subnetId, NetAppNetworkFeature? networkFeatures, Guid? networkSiblingSetId, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, IEnumerable mountTargets, string volumeType, NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, SmbAccessBasedEnumeration? smbAccessBasedEnumeration, SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, NetAppEncryptionKeySource? encryptionKeySource, ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, NetAppFileAccessLog? fileAccessLogs, NetAppAvsDataStore? avsDataStore, IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, ResourceIdentifier capacityPoolResourceId, ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, IEnumerable placementRules, EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, ResourceIdentifier originatingResourceId) + { + return NetAppVolumeGroupVolume(id: id, name: name, resourceType: resourceType, tags: tags, zones: zones, fileSystemId: fileSystemId, creationToken: creationToken, serviceLevel: serviceLevel, usageThreshold: usageThreshold, exportRules: exportRules, protocolTypes: protocolTypes, provisioningState: provisioningState, snapshotId: snapshotId, deleteBaseSnapshot: deleteBaseSnapshot, backupId: backupId, baremetalTenantId: baremetalTenantId, subnetId: subnetId, networkFeatures: networkFeatures, effectiveNetworkFeatures: default, networkSiblingSetId: networkSiblingSetId, storageToNetworkProximity: storageToNetworkProximity, mountTargets: mountTargets, volumeType: volumeType, dataProtection: dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: default, isRestoring: isRestoring, isSnapshotDirectoryVisible: isSnapshotDirectoryVisible, isKerberosEnabled: isKerberosEnabled, securityStyle: securityStyle, isSmbEncryptionEnabled: isSmbEncryptionEnabled, smbAccessBasedEnumeration: smbAccessBasedEnumeration, smbNonBrowsable: smbNonBrowsable, isSmbContinuouslyAvailable: isSmbContinuouslyAvailable, throughputMibps: throughputMibps, actualThroughputMibps: actualThroughputMibps, encryptionKeySource: encryptionKeySource, keyVaultPrivateEndpointResourceId: keyVaultPrivateEndpointResourceId, isLdapEnabled: isLdapEnabled, isCoolAccessEnabled: isCoolAccessEnabled, coolnessPeriod: coolnessPeriod, coolAccessRetrievalPolicy: coolAccessRetrievalPolicy, unixPermissions: unixPermissions, cloneProgress: cloneProgress, fileAccessLogs: fileAccessLogs, avsDataStore: avsDataStore, dataStoreResourceId: dataStoreResourceId, isDefaultQuotaEnabled: isDefaultQuotaEnabled, defaultUserQuotaInKiBs: defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs: defaultGroupQuotaInKiBs, maximumNumberOfFiles: maximumNumberOfFiles, volumeGroupName: volumeGroupName, capacityPoolResourceId: capacityPoolResourceId, proximityPlacementGroupId: proximityPlacementGroupId, t2Network: t2Network, volumeSpecName: volumeSpecName, isEncrypted: isEncrypted, placementRules: placementRules, enableSubvolumes: enableSubvolumes, provisionedAvailabilityZone: provisionedAvailabilityZone, isLargeVolume: isLargeVolume, originatingResourceId: originatingResourceId, inheritedSizeInBytes: default, language: default); + } + + /// Initializes a new instance of NetAppVolumeData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A unique read-only string that changes whenever the resource is updated. + /// Availability Zone. + /// Unique FileSystem Identifier. + /// A unique file path for the volume. Used when creating mount targets. + /// The service level of the file system. + /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// Set of export policy rules. + /// Set of protocol types, default NFSv3, CIFS for SMB protocol. + /// Azure lifecycle management. + /// UUID v4 or resource identifier used to identify the Snapshot. + /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. + /// UUID v4 or resource identifier used to identify the Backup. + /// Unique Baremetal Tenant Identifier. + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + /// Basic network, or Standard features available to the volume. + /// Network Sibling Set ID for the the group of volumes sharing networking resources. + /// Provides storage to network proximity information for the volume. + /// List of mount targets. + /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. + /// DataProtection type volumes include an object containing details of the replication. + /// Restoring. + /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). + /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. + /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. + /// Enables access based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables non browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables continuously available share property for smb volume. Only applicable for SMB volume. + /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. + /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. + /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// Specifies the number of days after which data that is not accessed by clients will be tiered. + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. + /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. + /// Data store resource unique identifier. + /// Specifies if default quota is enabled for the volume. + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + /// Volume Group Name. + /// Pool Resource Id used in case of creating a volume through volume group. + /// Proximity placement group associated with the volume. + /// T2 network information. + /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. + /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. + /// Application specific placement rules for the particular volume. + /// Flag indicating whether subvolume operations are enabled on the volume. + /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. + /// Specifies whether volume is a Large Volume or Regular Volume. + /// Id of the snapshot or backup that the volume is restored from. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetAppVolumeData NetAppVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, IEnumerable zones, Guid? fileSystemId, string creationToken, NetAppFileServiceLevel? serviceLevel, long usageThreshold, IEnumerable exportRules, IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, ResourceIdentifier subnetId, NetAppNetworkFeature? networkFeatures, Guid? networkSiblingSetId, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, IEnumerable mountTargets, string volumeType, NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, SmbAccessBasedEnumeration? smbAccessBasedEnumeration, SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, NetAppEncryptionKeySource? encryptionKeySource, ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, string unixPermissions, int? cloneProgress, NetAppFileAccessLog? fileAccessLogs, NetAppAvsDataStore? avsDataStore, IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, ResourceIdentifier capacityPoolResourceId, ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, IEnumerable placementRules, EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, ResourceIdentifier originatingResourceId) + { + return NetAppVolumeData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, zones: zones, fileSystemId: fileSystemId, creationToken: creationToken, serviceLevel: serviceLevel, usageThreshold: usageThreshold, exportRules: exportRules, protocolTypes: protocolTypes, provisioningState: provisioningState, snapshotId: snapshotId, deleteBaseSnapshot: deleteBaseSnapshot, backupId: backupId, baremetalTenantId: baremetalTenantId, subnetId: subnetId, networkFeatures: networkFeatures, effectiveNetworkFeatures: default, networkSiblingSetId: networkSiblingSetId, storageToNetworkProximity: storageToNetworkProximity, mountTargets: mountTargets, volumeType: volumeType, dataProtection: dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: default, isRestoring: isRestoring, isSnapshotDirectoryVisible: isSnapshotDirectoryVisible, isKerberosEnabled: isKerberosEnabled, securityStyle: securityStyle, isSmbEncryptionEnabled: isSmbEncryptionEnabled, smbAccessBasedEnumeration: smbAccessBasedEnumeration, smbNonBrowsable: smbNonBrowsable, isSmbContinuouslyAvailable: isSmbContinuouslyAvailable, throughputMibps: throughputMibps, actualThroughputMibps: actualThroughputMibps, encryptionKeySource: encryptionKeySource, keyVaultPrivateEndpointResourceId: keyVaultPrivateEndpointResourceId, isLdapEnabled: isLdapEnabled, isCoolAccessEnabled: isCoolAccessEnabled, coolnessPeriod: coolnessPeriod, coolAccessRetrievalPolicy: default, unixPermissions: unixPermissions, cloneProgress: cloneProgress, fileAccessLogs: fileAccessLogs, avsDataStore: avsDataStore, dataStoreResourceId: dataStoreResourceId, isDefaultQuotaEnabled: isDefaultQuotaEnabled, defaultUserQuotaInKiBs: defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs: defaultGroupQuotaInKiBs, maximumNumberOfFiles: maximumNumberOfFiles, volumeGroupName: volumeGroupName, capacityPoolResourceId: capacityPoolResourceId, proximityPlacementGroupId: proximityPlacementGroupId, t2Network: t2Network, volumeSpecName: volumeSpecName, isEncrypted: isEncrypted, placementRules: placementRules, enableSubvolumes: enableSubvolumes, provisionedAvailabilityZone: provisionedAvailabilityZone, isLargeVolume: isLargeVolume, originatingResourceId: originatingResourceId, inheritedSizeInBytes: default, language: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A unique read-only string that changes whenever the resource is updated. + /// Availability Zone. + /// Unique FileSystem Identifier. + /// A unique file path for the volume. Used when creating mount targets. + /// The service level of the file system. + /// Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. For regular volumes, valid values are in the range 50GiB to 100TiB. For large volumes, valid values are in the range 100TiB to 500TiB, and on an exceptional basis, from to 2400GiB to 2400TiB. Values expressed in bytes as multiples of 1 GiB. + /// Set of export policy rules. + /// Set of protocol types, default NFSv3, CIFS for SMB protocol. + /// Azure lifecycle management. + /// Resource identifier used to identify the Snapshot. + /// If enabled (true) the snapshot the volume was created from will be automatically deleted after the volume create operation has finished. Defaults to false. + /// Resource identifier used to identify the Backup. + /// Unique Baremetal Tenant Identifier. + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + /// Network features available to the volume, or current state of update. + /// Network Sibling Set ID for the the group of volumes sharing networking resources. + /// Provides storage to network proximity information for the volume. + /// List of mount targets. + /// What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. + /// DataProtection type volumes include an object containing details of the replication. + /// Restoring. + /// If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (defaults to true). + /// Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + /// The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. + /// Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. + /// Enables access-based enumeration share property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables non-browsable property for SMB Shares. Only applicable for SMB/DualProtocol volume. + /// Enables continuously available share property for smb volume. Only applicable for SMB volume. + /// Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType volume. + /// Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel. + /// Source of key used to encrypt data in volume. Applicable if NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// The resource ID of private endpoint for KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource = 'Microsoft.KeyVault'. + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// Specifies the number of days after which data that is not accessed by clients will be tiered. + /// + /// coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read pattern for cool access enabled volumes. The possible values for this field are: + /// Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. + /// OnRead - All client-driven data read is pulled from cool tier to standard storage on both sequential and random reads. + /// Never - No client-driven data is pulled from cool tier to standard storage. + /// + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + /// When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. + /// Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present on the volume. + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. + /// Data store resource unique identifier. + /// Specifies if default quota is enabled for the volume. + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + /// Volume Group Name. + /// Pool Resource Id used in case of creating a volume through volume group. + /// Proximity placement group associated with the volume. + /// T2 network information. + /// Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log. + /// Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. + /// Application specific placement rules for the particular volume. + /// Flag indicating whether subvolume operations are enabled on the volume. + /// The availability zone where the volume is provisioned. This refers to the logical availability zone where the volume resides. + /// Specifies whether volume is a Large Volume or Regular Volume. + /// Id of the snapshot or backup that the volume is restored from. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetAppVolumeData NetAppVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, IEnumerable zones, Guid? fileSystemId, string creationToken, NetAppFileServiceLevel? serviceLevel, long usageThreshold, IEnumerable exportRules, IEnumerable protocolTypes, string provisioningState, string snapshotId, bool? deleteBaseSnapshot, string backupId, string baremetalTenantId, ResourceIdentifier subnetId, NetAppNetworkFeature? networkFeatures, Guid? networkSiblingSetId, NetAppVolumeStorageToNetworkProximity? storageToNetworkProximity, IEnumerable mountTargets, string volumeType, NetAppVolumeDataProtection dataProtection, bool? isRestoring, bool? isSnapshotDirectoryVisible, bool? isKerberosEnabled, NetAppVolumeSecurityStyle? securityStyle, bool? isSmbEncryptionEnabled, SmbAccessBasedEnumeration? smbAccessBasedEnumeration, SmbNonBrowsable? smbNonBrowsable, bool? isSmbContinuouslyAvailable, float? throughputMibps, float? actualThroughputMibps, NetAppEncryptionKeySource? encryptionKeySource, ResourceIdentifier keyVaultPrivateEndpointResourceId, bool? isLdapEnabled, bool? isCoolAccessEnabled, int? coolnessPeriod, CoolAccessRetrievalPolicy? coolAccessRetrievalPolicy, string unixPermissions, int? cloneProgress, NetAppFileAccessLog? fileAccessLogs, NetAppAvsDataStore? avsDataStore, IEnumerable dataStoreResourceId, bool? isDefaultQuotaEnabled, long? defaultUserQuotaInKiBs, long? defaultGroupQuotaInKiBs, long? maximumNumberOfFiles, string volumeGroupName, ResourceIdentifier capacityPoolResourceId, ResourceIdentifier proximityPlacementGroupId, string t2Network, string volumeSpecName, bool? isEncrypted, IEnumerable placementRules, EnableNetAppSubvolume? enableSubvolumes, string provisionedAvailabilityZone, bool? isLargeVolume, ResourceIdentifier originatingResourceId) + { + return NetAppVolumeData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, zones: zones, fileSystemId: fileSystemId, creationToken: creationToken, serviceLevel: serviceLevel, usageThreshold: usageThreshold, exportRules: exportRules, protocolTypes: protocolTypes, provisioningState: provisioningState, snapshotId: snapshotId, deleteBaseSnapshot: deleteBaseSnapshot, backupId: backupId, baremetalTenantId: baremetalTenantId, subnetId: subnetId, networkFeatures: networkFeatures, effectiveNetworkFeatures: default, networkSiblingSetId: networkSiblingSetId, storageToNetworkProximity: storageToNetworkProximity, mountTargets: mountTargets, volumeType: volumeType, dataProtection: dataProtection, acceptGrowCapacityPoolForShortTermCloneSplit: default, isRestoring: isRestoring, isSnapshotDirectoryVisible: isSnapshotDirectoryVisible, isKerberosEnabled: isKerberosEnabled, securityStyle: securityStyle, isSmbEncryptionEnabled: isSmbEncryptionEnabled, smbAccessBasedEnumeration: smbAccessBasedEnumeration, smbNonBrowsable: smbNonBrowsable, isSmbContinuouslyAvailable: isSmbContinuouslyAvailable, throughputMibps: throughputMibps, actualThroughputMibps: actualThroughputMibps, encryptionKeySource: encryptionKeySource, keyVaultPrivateEndpointResourceId: keyVaultPrivateEndpointResourceId, isLdapEnabled: isLdapEnabled, isCoolAccessEnabled: isCoolAccessEnabled, coolnessPeriod: coolnessPeriod, coolAccessRetrievalPolicy: coolAccessRetrievalPolicy, unixPermissions: unixPermissions, cloneProgress: cloneProgress, fileAccessLogs: fileAccessLogs, avsDataStore: avsDataStore, dataStoreResourceId: dataStoreResourceId, isDefaultQuotaEnabled: isDefaultQuotaEnabled, defaultUserQuotaInKiBs: defaultUserQuotaInKiBs, defaultGroupQuotaInKiBs: defaultGroupQuotaInKiBs, maximumNumberOfFiles: maximumNumberOfFiles, volumeGroupName: volumeGroupName, capacityPoolResourceId: capacityPoolResourceId, proximityPlacementGroupId: proximityPlacementGroupId, t2Network: t2Network, volumeSpecName: volumeSpecName, isEncrypted: isEncrypted, placementRules: placementRules, enableSubvolumes: enableSubvolumes, provisionedAvailabilityZone: provisionedAvailabilityZone, isLargeVolume: isLargeVolume, originatingResourceId: originatingResourceId, inheritedSizeInBytes: default, language: default); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs index bdfe73915cd7..eb5fc08c6459 100644 --- a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs +++ b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs @@ -9764,6 +9764,7 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.Models.ApplicationGatewayFrontendPort ApplicationGatewayFrontendPort(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), int? port = default(int?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayHttpListener ApplicationGatewayHttpListener(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier frontendPortId = null, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol = default(Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol?), string hostName = null, Azure.Core.ResourceIdentifier sslCertificateId = null, Azure.Core.ResourceIdentifier sslProfileId = null, bool? requireServerNameIndication = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IEnumerable customErrorConfigurations = null, Azure.Core.ResourceIdentifier firewallPolicyId = null, System.Collections.Generic.IEnumerable hostNames = null) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayIPConfiguration ApplicationGatewayIPConfiguration(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.Models.ApplicationGatewayListener ApplicationGatewayListener(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.ETag? etag, Azure.Core.ResourceIdentifier frontendIPConfigurationId, Azure.Core.ResourceIdentifier frontendPortId, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol, Azure.Core.ResourceIdentifier sslCertificateId, Azure.Core.ResourceIdentifier sslProfileId, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayListener ApplicationGatewayListener(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier frontendPortId = null, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol = default(Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol?), Azure.Core.ResourceIdentifier sslCertificateId = null, Azure.Core.ResourceIdentifier sslProfileId = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IEnumerable hostNames = null) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionPolicy ApplicationGatewayLoadDistributionPolicy(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable loadDistributionTargets = null, Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionAlgorithm? loadDistributionAlgorithm = default(Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionAlgorithm?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } @@ -10005,6 +10006,7 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.NetworkVirtualApplianceConnectionData NetworkVirtualApplianceConnectionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, string namePropertiesName, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, long? asn, long? tunnelIdentifier, System.Collections.Generic.IEnumerable bgpPeerAddress, bool? enableInternetSecurity, Azure.ResourceManager.Network.Models.RoutingConfigurationNfv routingConfiguration) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.Core.AzureLocation? location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ETag? etag, Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku, string addressPrefix, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs, Azure.Core.ResourceIdentifier virtualHubId, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, System.Collections.Generic.IEnumerable virtualApplianceNics, System.Collections.Generic.IEnumerable additionalNics, System.Collections.Generic.IEnumerable internetIngressPublicIPs, System.Collections.Generic.IEnumerable virtualApplianceSites, System.Collections.Generic.IEnumerable virtualApplianceConnections, System.Collections.Generic.IEnumerable inboundSecurityRules, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, string deploymentType, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.Core.AzureLocation? location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ETag? etag, Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku, string addressPrefix, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs, Azure.Core.ResourceIdentifier virtualHubId, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, System.Collections.Generic.IEnumerable virtualApplianceNics, System.Collections.Generic.IEnumerable additionalNics, System.Collections.Generic.IEnumerable virtualApplianceSites, System.Collections.Generic.IEnumerable virtualApplianceConnections, System.Collections.Generic.IEnumerable inboundSecurityRules, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, string deploymentType, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource) { throw null; } public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku = null, string addressPrefix = null, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs = null, Azure.Core.ResourceIdentifier virtualHubId = null, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs = null, string cloudInitConfiguration = null, long? virtualApplianceAsn = default(long?), string sshPublicKey = null, System.Collections.Generic.IEnumerable virtualApplianceNics = null, System.Collections.Generic.IEnumerable networkInterfaceConfigurations = null, System.Collections.Generic.IEnumerable additionalNics = null, System.Collections.Generic.IEnumerable internetIngressPublicIPs = null, System.Collections.Generic.IEnumerable virtualApplianceSites = null, System.Collections.Generic.IEnumerable virtualApplianceConnections = null, System.Collections.Generic.IEnumerable inboundSecurityRules = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), string deploymentType = null, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation = null, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource = null) { throw null; } public static Azure.ResourceManager.Network.NetworkVirtualApplianceSkuData NetworkVirtualApplianceSkuData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), string vendor = null, System.Collections.Generic.IEnumerable availableVersions = null, System.Collections.Generic.IEnumerable availableScaleUnits = null) { throw null; } diff --git a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs index bdfe73915cd7..eb5fc08c6459 100644 --- a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs +++ b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs @@ -9764,6 +9764,7 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.Models.ApplicationGatewayFrontendPort ApplicationGatewayFrontendPort(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), int? port = default(int?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayHttpListener ApplicationGatewayHttpListener(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier frontendPortId = null, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol = default(Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol?), string hostName = null, Azure.Core.ResourceIdentifier sslCertificateId = null, Azure.Core.ResourceIdentifier sslProfileId = null, bool? requireServerNameIndication = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IEnumerable customErrorConfigurations = null, Azure.Core.ResourceIdentifier firewallPolicyId = null, System.Collections.Generic.IEnumerable hostNames = null) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayIPConfiguration ApplicationGatewayIPConfiguration(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.Models.ApplicationGatewayListener ApplicationGatewayListener(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.ETag? etag, Azure.Core.ResourceIdentifier frontendIPConfigurationId, Azure.Core.ResourceIdentifier frontendPortId, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol, Azure.Core.ResourceIdentifier sslCertificateId, Azure.Core.ResourceIdentifier sslProfileId, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayListener ApplicationGatewayListener(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier frontendPortId = null, Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol? protocol = default(Azure.ResourceManager.Network.Models.ApplicationGatewayProtocol?), Azure.Core.ResourceIdentifier sslCertificateId = null, Azure.Core.ResourceIdentifier sslProfileId = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IEnumerable hostNames = null) { throw null; } public static Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionPolicy ApplicationGatewayLoadDistributionPolicy(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable loadDistributionTargets = null, Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionAlgorithm? loadDistributionAlgorithm = default(Azure.ResourceManager.Network.Models.ApplicationGatewayLoadDistributionAlgorithm?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } @@ -10005,6 +10006,7 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.NetworkVirtualApplianceConnectionData NetworkVirtualApplianceConnectionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, string namePropertiesName, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, long? asn, long? tunnelIdentifier, System.Collections.Generic.IEnumerable bgpPeerAddress, bool? enableInternetSecurity, Azure.ResourceManager.Network.Models.RoutingConfigurationNfv routingConfiguration) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.Core.AzureLocation? location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ETag? etag, Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku, string addressPrefix, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs, Azure.Core.ResourceIdentifier virtualHubId, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, System.Collections.Generic.IEnumerable virtualApplianceNics, System.Collections.Generic.IEnumerable additionalNics, System.Collections.Generic.IEnumerable internetIngressPublicIPs, System.Collections.Generic.IEnumerable virtualApplianceSites, System.Collections.Generic.IEnumerable virtualApplianceConnections, System.Collections.Generic.IEnumerable inboundSecurityRules, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, string deploymentType, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.Core.AzureLocation? location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ETag? etag, Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku, string addressPrefix, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs, Azure.Core.ResourceIdentifier virtualHubId, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, System.Collections.Generic.IEnumerable virtualApplianceNics, System.Collections.Generic.IEnumerable additionalNics, System.Collections.Generic.IEnumerable virtualApplianceSites, System.Collections.Generic.IEnumerable virtualApplianceConnections, System.Collections.Generic.IEnumerable inboundSecurityRules, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState, string deploymentType, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource) { throw null; } public static Azure.ResourceManager.Network.NetworkVirtualApplianceData NetworkVirtualApplianceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Network.Models.VirtualApplianceSkuProperties nvaSku = null, string addressPrefix = null, System.Collections.Generic.IEnumerable bootStrapConfigurationBlobs = null, Azure.Core.ResourceIdentifier virtualHubId = null, System.Collections.Generic.IEnumerable cloudInitConfigurationBlobs = null, string cloudInitConfiguration = null, long? virtualApplianceAsn = default(long?), string sshPublicKey = null, System.Collections.Generic.IEnumerable virtualApplianceNics = null, System.Collections.Generic.IEnumerable networkInterfaceConfigurations = null, System.Collections.Generic.IEnumerable additionalNics = null, System.Collections.Generic.IEnumerable internetIngressPublicIPs = null, System.Collections.Generic.IEnumerable virtualApplianceSites = null, System.Collections.Generic.IEnumerable virtualApplianceConnections = null, System.Collections.Generic.IEnumerable inboundSecurityRules = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), string deploymentType = null, Azure.ResourceManager.Network.Models.VirtualApplianceDelegationProperties delegation = null, Azure.ResourceManager.Network.Models.PartnerManagedResourceProperties partnerManagedResource = null) { throw null; } public static Azure.ResourceManager.Network.NetworkVirtualApplianceSkuData NetworkVirtualApplianceSkuData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), string vendor = null, System.Collections.Generic.IEnumerable availableVersions = null, System.Collections.Generic.IEnumerable availableScaleUnits = null) { throw null; } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs b/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs index 9dff21e4f2e2..17efd103a505 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs @@ -37,148 +37,6 @@ public static partial class ArmNetworkModelFactory public static ApplicationGatewayFrontendIPConfiguration ApplicationGatewayFrontendIPConfiguration(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, string privateIPAddress, NetworkIPAllocationMethod? privateIPAllocationMethod, ResourceIdentifier subnetId, ResourceIdentifier publicIPAddressId, ResourceIdentifier privateLinkConfigurationId, NetworkProvisioningState? provisioningState) => ApplicationGatewayFrontendIPConfiguration(id, name, resourceType, etag, privateIPAddress, privateIPAllocationMethod, subnetId, publicIPAddressId, privateLinkConfigurationId, provisioningState); - /// Initializes a new instance of BackendAddressPoolData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever the resource is updated. - /// The location of the backend address pool. - /// An array of gateway load balancer tunnel interfaces. - /// An array of backend addresses. - /// An array of references to IP addresses defined in network interfaces. - /// An array of references to load balancing rules that use this backend address pool. - /// A reference to an outbound rule that uses this backend address pool. - /// An array of references to outbound rules that use this backend address pool. - /// An array of references to inbound NAT rules that use this backend address pool. - /// The provisioning state of the backend address pool resource. - /// Amount of seconds Load Balancer waits for before sending RESET to client and backend address. - /// A reference to a virtual network. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackendAddressPoolData BackendAddressPoolData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, AzureLocation? location, IEnumerable tunnelInterfaces, IEnumerable loadBalancerBackendAddresses, IEnumerable backendIPConfigurations, IEnumerable loadBalancingRules, ResourceIdentifier outboundRuleId, IEnumerable outboundRules, IEnumerable inboundNatRules, NetworkProvisioningState? provisioningState, int? drainPeriodInSeconds, ResourceIdentifier virtualNetworkId) - => BackendAddressPoolData(id, name, resourceType, etag, location, tunnelInterfaces, loadBalancerBackendAddresses, backendIPConfigurations, loadBalancingRules, outboundRuleId, outboundRules, inboundNatRules, provisioningState, drainPeriodInSeconds, virtualNetworkId); - - /// Initializes a new instance of BastionHostData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever the resource is updated. - /// The sku of this Bastion Host. - /// IP configuration of the Bastion Host resource. - /// FQDN for the endpoint on which bastion host is accessible. - /// The provisioning state of the bastion host resource. - /// The scale units for the Bastion Host resource. - /// Enable/Disable Copy/Paste feature of the Bastion Host resource. - /// Enable/Disable File Copy feature of the Bastion Host resource. - /// Enable/Disable IP Connect feature of the Bastion Host resource. - /// Enable/Disable Shareable Link of the Bastion Host resource. - /// Enable/Disable Tunneling feature of the Bastion Host resource. - /// Enable/Disable Kerberos feature of the Bastion Host resource. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BastionHostData BastionHostData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, BastionHostSkuName? skuName, IEnumerable ipConfigurations, string dnsName, NetworkProvisioningState? provisioningState, int? scaleUnits, bool? disableCopyPaste, bool? enableFileCopy, bool? enableIPConnect, bool? enableShareableLink, bool? enableTunneling, bool? enableKerberos) - => BastionHostData(id, name, resourceType, location, tags, null, etag, skuName, ipConfigurations, dnsName, null, null, provisioningState, scaleUnits, disableCopyPaste, enableFileCopy, enableIPConnect, enableShareableLink, enableTunneling, enableKerberos); - - /// Initializes a new instance of . - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever the resource is updated. - /// The sku of this Bastion Host. - /// IP configuration of the Bastion Host resource. - /// FQDN for the endpoint on which bastion host is accessible. - /// Reference to an existing virtual network required for Developer Bastion Host only. - /// - /// The provisioning state of the bastion host resource. - /// The scale units for the Bastion Host resource. - /// Enable/Disable Copy/Paste feature of the Bastion Host resource. - /// Enable/Disable File Copy feature of the Bastion Host resource. - /// Enable/Disable IP Connect feature of the Bastion Host resource. - /// Enable/Disable Shareable Link of the Bastion Host resource. - /// Enable/Disable Tunneling feature of the Bastion Host resource. - /// Enable/Disable Kerberos feature of the Bastion Host resource. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BastionHostData BastionHostData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, BastionHostSkuName? skuName, IEnumerable ipConfigurations, string dnsName, ResourceIdentifier virtualNetworkId, IEnumerable networkAclsIPRules, NetworkProvisioningState? provisioningState, int? scaleUnits, bool? disableCopyPaste, bool? enableFileCopy, bool? enableIPConnect, bool? enableShareableLink, bool? enableTunneling, bool? enableKerberos) - => BastionHostData(id, name, resourceType, location, tags, null, etag, skuName, ipConfigurations, dnsName, virtualNetworkId, networkAclsIPRules, provisioningState, scaleUnits, disableCopyPaste, enableFileCopy, enableIPConnect, enableShareableLink, enableTunneling, enableKerberos); - - /// Initializes a new instance of FirewallPolicyData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever the resource is updated. - /// The identity of the firewall policy. - /// List of references to FirewallPolicyRuleCollectionGroups. - /// The provisioning state of the firewall policy resource. - /// The parent firewall policy from which rules are inherited. - /// List of references to Azure Firewalls that this Firewall Policy is associated with. - /// List of references to Child Firewall Policies. - /// The operation mode for Threat Intelligence. - /// ThreatIntel Whitelist for Firewall Policy. - /// Insights on Firewall Policy. - /// The private IP addresses/IP ranges to which traffic will not be SNAT. - /// SQL Settings definition. - /// DNS Proxy Settings definition. - /// Explicit Proxy Settings definition. - /// The configuration for Intrusion detection. - /// TLS Configuration definition. - /// The Firewall Policy SKU. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static FirewallPolicyData FirewallPolicyData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, ManagedServiceIdentity identity, IEnumerable ruleCollectionGroups, NetworkProvisioningState? provisioningState, ResourceIdentifier basePolicyId, IEnumerable firewalls, IEnumerable childPolicies, AzureFirewallThreatIntelMode? threatIntelMode, FirewallPolicyThreatIntelWhitelist threatIntelWhitelist, FirewallPolicyInsights insights, FirewallPolicySnat snat, bool? allowSqlRedirect, DnsSettings dnsSettings, FirewallPolicyExplicitProxy explicitProxy, FirewallPolicyIntrusionDetection intrusionDetection, FirewallPolicyCertificateAuthority transportSecurityCertificateAuthority, FirewallPolicySkuTier? skuTier) - => FirewallPolicyData(id, name, resourceType, location, tags, etag, identity, null, ruleCollectionGroups, provisioningState, basePolicyId, firewalls, childPolicies, threatIntelMode, threatIntelWhitelist, insights, snat, allowSqlRedirect, dnsSettings, explicitProxy, intrusionDetection, transportSecurityCertificateAuthority, skuTier); - - /// Initializes a new instance of FirewallPolicyRuleCollectionGroupData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever the resource is updated. - /// Priority of the Firewall Policy Rule Collection Group resource. - /// - /// Group of Firewall Policy rule collections. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// The provisioning state of the firewall policy rule collection group resource. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static FirewallPolicyRuleCollectionGroupData FirewallPolicyRuleCollectionGroupData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, int? priority, IEnumerable ruleCollections, NetworkProvisioningState? provisioningState) - => FirewallPolicyRuleCollectionGroupData(id, name, resourceType, etag, null, priority, ruleCollections, provisioningState); - - /// Initializes a new instance of SubnetData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever the resource is updated. - /// The address prefix for the subnet. - /// List of address prefixes for the subnet. - /// The reference to the NetworkSecurityGroup resource. - /// The reference to the RouteTable resource. - /// Nat gateway associated with this subnet. - /// An array of service endpoints. - /// An array of service endpoint policies. - /// An array of references to private endpoints. - /// An array of references to the network interface IP configurations using subnet. - /// Array of IP configuration profiles which reference this subnet. - /// Array of IpAllocation which reference this subnet. - /// An array of references to the external resources using subnet. - /// An array of references to services injecting into this subnet. - /// An array of references to the delegations on the subnet. - /// A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. - /// The provisioning state of the subnet resource. - /// Enable or Disable apply network policies on private end point in the subnet. - /// Enable or Disable apply network policies on private link service in the subnet. - /// Application gateway IP configurations of virtual network resource. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static SubnetData SubnetData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, string addressPrefix, IEnumerable addressPrefixes, NetworkSecurityGroupData networkSecurityGroup, RouteTableData routeTable, ResourceIdentifier natGatewayId, IEnumerable serviceEndpoints, IEnumerable serviceEndpointPolicies, IEnumerable privateEndpoints, IEnumerable ipConfigurations, IEnumerable ipConfigurationProfiles, IEnumerable ipAllocations, IEnumerable resourceNavigationLinks, IEnumerable serviceAssociationLinks, IEnumerable delegations, string purpose, NetworkProvisioningState? provisioningState, VirtualNetworkPrivateEndpointNetworkPolicy? privateEndpointNetworkPolicy, VirtualNetworkPrivateLinkServiceNetworkPolicy? privateLinkServiceNetworkPolicy, IEnumerable applicationGatewayIPConfigurations) - => SubnetData(id, name, resourceType, etag, addressPrefix, addressPrefixes, networkSecurityGroup, routeTable, natGatewayId, serviceEndpoints, serviceEndpointPolicies, privateEndpoints, ipConfigurations, ipConfigurationProfiles, ipAllocations, resourceNavigationLinks, serviceAssociationLinks, delegations, purpose, provisioningState, privateEndpointNetworkPolicy, privateLinkServiceNetworkPolicy, applicationGatewayIPConfigurations, null); - /// Initializes a new instance of VirtualNetworkGatewayData. /// Resource ID. /// Resource name. @@ -253,7 +111,7 @@ public static VirtualNetworkGatewayData VirtualNetworkGatewayData(ResourceIdenti /// Property to indicate if the Express Route Gateway has resiliency model of MultiHomed or SingleHomed. /// A new instance for mocking. public static VirtualNetworkGatewayData VirtualNetworkGatewayData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ExtendedLocation extendedLocation, ETag? etag, ManagedServiceIdentity identity, VirtualNetworkGatewayAutoScaleBounds autoScaleBounds, IEnumerable ipConfigurations, VirtualNetworkGatewayType? gatewayType, VpnType? vpnType, VpnGatewayGeneration? vpnGatewayGeneration, bool? enableBgp, bool? enablePrivateIPAddress, bool? active, bool? disableIPSecReplayProtection, ResourceIdentifier gatewayDefaultSiteId, VirtualNetworkGatewaySku sku, VpnClientConfiguration vpnClientConfiguration, IEnumerable virtualNetworkGatewayPolicyGroups, BgpSettings bgpSettings, IEnumerable customRoutesAddressPrefixes, Guid? resourceGuid, NetworkProvisioningState? provisioningState, bool? enableDnsForwarding, string inboundDnsForwardingEndpoint, ResourceIdentifier vNetExtendedLocationResourceId, IEnumerable natRules, bool? enableBgpRouteTranslationForNat, bool? allowVirtualWanTraffic, bool? allowRemoteVnetTraffic, ExpressRouteGatewayAdminState? adminState, ExpressRouteGatewayResiliencyModel? resiliencyModel) - => VirtualNetworkGatewayData(id, name, resourceType, location, tags, extendedLocation, etag, identity, autoScaleBounds, ipConfigurations, gatewayType, vpnType, vpnGatewayGeneration, enableBgp, enablePrivateIPAddress, active, disableIPSecReplayProtection, gatewayDefaultSiteId, sku, vpnClientConfiguration, virtualNetworkGatewayPolicyGroups, bgpSettings, + => VirtualNetworkGatewayData(id, name, resourceType, location, tags, extendedLocation, etag, identity, autoScaleBounds, ipConfigurations, gatewayType, vpnType, vpnGatewayGeneration, enableBgp, enablePrivateIPAddress, active, disableIPSecReplayProtection, gatewayDefaultSiteId, sku, vpnClientConfiguration, virtualNetworkGatewayPolicyGroups, bgpSettings, customRoutesAddressPrefixes != null ? new VirtualNetworkAddressSpace(customRoutesAddressPrefixes?.ToList(), new ChangeTrackingList(), null) : null, resourceGuid, provisioningState, enableDnsForwarding, inboundDnsForwardingEndpoint, vNetExtendedLocationResourceId, natRules, enableBgpRouteTranslationForNat, allowVirtualWanTraffic, allowRemoteVnetTraffic, adminState, resiliencyModel); @@ -272,50 +130,6 @@ public static VirtualNetworkGatewayData VirtualNetworkGatewayData(ResourceIdenti public static NetworkVirtualApplianceConnectionData NetworkVirtualApplianceConnectionData(ResourceIdentifier id, string name, ResourceType? resourceType, string namePropertiesName, NetworkProvisioningState? provisioningState, long? asn, long? tunnelIdentifier, IEnumerable bgpPeerAddress, bool? enableInternetSecurity, RoutingConfigurationNfv routingConfiguration) => NetworkVirtualApplianceConnectionData(id, name, resourceType, namePropertiesName, provisioningState, asn, tunnelIdentifier, bgpPeerAddress, enableInternetSecurity, connectionRoutingConfiguration : null); - /// Initializes a new instance of ApplicationGatewayListener. - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever the resource is updated. - /// Frontend IP configuration resource of an application gateway. - /// Frontend port resource of an application gateway. - /// Protocol of the listener. - /// SSL certificate resource of an application gateway. - /// SSL profile resource of the application gateway. - /// The provisioning state of the listener resource. - /// A new instance for mocking. - public static ApplicationGatewayListener ApplicationGatewayListener(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, ResourceIdentifier frontendIPConfigurationId, ResourceIdentifier frontendPortId, ApplicationGatewayProtocol? protocol, ResourceIdentifier sslCertificateId, ResourceIdentifier sslProfileId, NetworkProvisioningState? provisioningState) - => ApplicationGatewayListener(id, name, resourceType, etag, frontendIPConfigurationId, frontendPortId, protocol, sslCertificateId, sslProfileId, provisioningState, null); - - /// Initializes a new instance of NetworkVirtualApplianceData. - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// The service principal that has read access to cloud-init and config blob. - /// A unique read-only string that changes whenever the resource is updated. - /// Network Virtual Appliance SKU. - /// Address Prefix. - /// BootStrapConfigurationBlobs storage URLs. - /// The Virtual Hub where Network Virtual Appliance is being deployed. - /// CloudInitConfigurationBlob storage URLs. - /// CloudInitConfiguration string in plain text. - /// VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. - /// Public key for SSH login. - /// List of Virtual Appliance Network Interfaces. - /// Details required for Additional Network Interface. - /// List of references to VirtualApplianceSite. - /// List of references to VirtualApplianceConnections. - /// List of references to InboundSecurityRules. - /// The provisioning state of the resource. - /// The deployment type. PartnerManaged for the SaaS NVA. - /// The delegation for the Virtual Appliance. - /// The delegation for the Virtual Appliance. - /// A new instance for mocking. - public static NetworkVirtualApplianceData NetworkVirtualApplianceData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ManagedServiceIdentity identity, ETag? etag, VirtualApplianceSkuProperties nvaSku, string addressPrefix, IEnumerable bootStrapConfigurationBlobs, ResourceIdentifier virtualHubId, IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, IEnumerable virtualApplianceNics, IEnumerable additionalNics, IEnumerable virtualApplianceSites, IEnumerable virtualApplianceConnections, IEnumerable inboundSecurityRules, NetworkProvisioningState? provisioningState, string deploymentType, VirtualApplianceDelegationProperties delegation, PartnerManagedResourceProperties partnerManagedResource) - => NetworkVirtualApplianceData(id, name, resourceType, location, tags, identity, etag, nvaSku, addressPrefix, bootStrapConfigurationBlobs, virtualHubId, cloudInitConfigurationBlobs, cloudInitConfiguration, virtualApplianceAsn, sshPublicKey, virtualApplianceNics, additionalNics, null, virtualApplianceSites, virtualApplianceConnections, inboundSecurityRules, provisioningState, deploymentType, delegation, partnerManagedResource); - /// Initializes a new instance of . /// Resource ID. /// Resource name. @@ -332,10 +146,10 @@ public static NetworkVirtualApplianceData NetworkVirtualApplianceData(ResourceId /// A new instance for mocking. [EditorBrowsable(EditorBrowsableState.Never)] public static LocalNetworkGatewayData LocalNetworkGatewayData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, IEnumerable localNetworkAddressPrefixes, string gatewayIPAddress, string fqdn, BgpSettings bgpSettings, Guid? resourceGuid, NetworkProvisioningState? provisioningState) - => LocalNetworkGatewayData(id, name, resourceType, location, tags, etag, + => LocalNetworkGatewayData(id, name, resourceType, location, tags, etag, localNetworkAddressPrefixes != null ? new VirtualNetworkAddressSpace(localNetworkAddressPrefixes?.ToList(), new ChangeTrackingList(), null) : null, gatewayIPAddress, fqdn, bgpSettings, resourceGuid, provisioningState); - + /// Initializes a new instance of . /// Resource ID. /// Resource name. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs index 6d61ca5e21d4..191b27658c9d 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs @@ -8650,6 +8650,210 @@ public static NetworkDefaultAdminRule NetworkDefaultAdminRule(ResourceIdentifier resourceGuid); } + /// Initializes a new instance of BackendAddressPoolData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// The location of the backend address pool. + /// An array of gateway load balancer tunnel interfaces. + /// An array of backend addresses. + /// An array of references to IP addresses defined in network interfaces. + /// An array of references to load balancing rules that use this backend address pool. + /// A reference to an outbound rule that uses this backend address pool. + /// An array of references to outbound rules that use this backend address pool. + /// An array of references to inbound NAT rules that use this backend address pool. + /// The provisioning state of the backend address pool resource. + /// Amount of seconds Load Balancer waits for before sending RESET to client and backend address. + /// A reference to a virtual network. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackendAddressPoolData BackendAddressPoolData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, AzureLocation? location, IEnumerable tunnelInterfaces, IEnumerable loadBalancerBackendAddresses, IEnumerable backendIPConfigurations, IEnumerable loadBalancingRules, ResourceIdentifier outboundRuleId, IEnumerable outboundRules, IEnumerable inboundNatRules, NetworkProvisioningState? provisioningState, int? drainPeriodInSeconds, ResourceIdentifier virtualNetworkId) + { + return BackendAddressPoolData(id: id, name: name, resourceType: resourceType, etag: etag, location: location, tunnelInterfaces: tunnelInterfaces, loadBalancerBackendAddresses: loadBalancerBackendAddresses, backendIPConfigurations: backendIPConfigurations, loadBalancingRules: loadBalancingRules, outboundRuleId: outboundRuleId, outboundRules: outboundRules, inboundNatRules: inboundNatRules, provisioningState: provisioningState, drainPeriodInSeconds: drainPeriodInSeconds, virtualNetworkId: virtualNetworkId, syncMode: default); + } + + /// Initializes a new instance of BastionHostData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A unique read-only string that changes whenever the resource is updated. + /// The sku of this Bastion Host. + /// IP configuration of the Bastion Host resource. + /// FQDN for the endpoint on which bastion host is accessible. + /// The provisioning state of the bastion host resource. + /// The scale units for the Bastion Host resource. + /// Enable/Disable Copy/Paste feature of the Bastion Host resource. + /// Enable/Disable File Copy feature of the Bastion Host resource. + /// Enable/Disable IP Connect feature of the Bastion Host resource. + /// Enable/Disable Shareable Link of the Bastion Host resource. + /// Enable/Disable Tunneling feature of the Bastion Host resource. + /// Enable/Disable Kerberos feature of the Bastion Host resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BastionHostData BastionHostData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, BastionHostSkuName? skuName, IEnumerable ipConfigurations, string dnsName, NetworkProvisioningState? provisioningState, int? scaleUnits, bool? disableCopyPaste, bool? enableFileCopy, bool? enableIPConnect, bool? enableShareableLink, bool? enableTunneling, bool? enableKerberos) + { + return BastionHostData(id: id, name: name, resourceType: resourceType, location: location, tags: tags, zones: default, etag: etag, skuName: skuName, ipConfigurations: ipConfigurations, dnsName: dnsName, virtualNetworkId: default, networkAclsIPRules: default, provisioningState: provisioningState, scaleUnits: scaleUnits, disableCopyPaste: disableCopyPaste, enableFileCopy: enableFileCopy, enableIPConnect: enableIPConnect, enableShareableLink: enableShareableLink, enableTunneling: enableTunneling, enableKerberos: enableKerberos, enableSessionRecording: default, enablePrivateOnlyBastion: default); + } + + /// Initializes a new instance of . + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A unique read-only string that changes whenever the resource is updated. + /// The sku of this Bastion Host. + /// IP configuration of the Bastion Host resource. + /// FQDN for the endpoint on which bastion host is accessible. + /// Reference to an existing virtual network required for Developer Bastion Host only. + /// + /// The provisioning state of the bastion host resource. + /// The scale units for the Bastion Host resource. + /// Enable/Disable Copy/Paste feature of the Bastion Host resource. + /// Enable/Disable File Copy feature of the Bastion Host resource. + /// Enable/Disable IP Connect feature of the Bastion Host resource. + /// Enable/Disable Shareable Link of the Bastion Host resource. + /// Enable/Disable Tunneling feature of the Bastion Host resource. + /// Enable/Disable Kerberos feature of the Bastion Host resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BastionHostData BastionHostData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, BastionHostSkuName? skuName, IEnumerable ipConfigurations, string dnsName, ResourceIdentifier virtualNetworkId, IEnumerable networkAclsIPRules, NetworkProvisioningState? provisioningState, int? scaleUnits, bool? disableCopyPaste, bool? enableFileCopy, bool? enableIPConnect, bool? enableShareableLink, bool? enableTunneling, bool? enableKerberos) + { + return BastionHostData(id: id, name: name, resourceType: resourceType, location: location, tags: tags, zones: default, etag: etag, skuName: skuName, ipConfigurations: ipConfigurations, dnsName: dnsName, virtualNetworkId: virtualNetworkId, networkAclsIPRules: networkAclsIPRules, provisioningState: provisioningState, scaleUnits: scaleUnits, disableCopyPaste: disableCopyPaste, enableFileCopy: enableFileCopy, enableIPConnect: enableIPConnect, enableShareableLink: enableShareableLink, enableTunneling: enableTunneling, enableKerberos: enableKerberos, enableSessionRecording: default, enablePrivateOnlyBastion: default); + } + + /// Initializes a new instance of FirewallPolicyData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A unique read-only string that changes whenever the resource is updated. + /// The identity of the firewall policy. + /// List of references to FirewallPolicyRuleCollectionGroups. + /// The provisioning state of the firewall policy resource. + /// The parent firewall policy from which rules are inherited. + /// List of references to Azure Firewalls that this Firewall Policy is associated with. + /// List of references to Child Firewall Policies. + /// The operation mode for Threat Intelligence. + /// ThreatIntel Whitelist for Firewall Policy. + /// Insights on Firewall Policy. + /// The private IP addresses/IP ranges to which traffic will not be SNAT. + /// SQL Settings definition. + /// DNS Proxy Settings definition. + /// Explicit Proxy Settings definition. + /// The configuration for Intrusion detection. + /// TLS Configuration definition. + /// The Firewall Policy SKU. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static FirewallPolicyData FirewallPolicyData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, ManagedServiceIdentity identity, IEnumerable ruleCollectionGroups, NetworkProvisioningState? provisioningState, ResourceIdentifier basePolicyId, IEnumerable firewalls, IEnumerable childPolicies, AzureFirewallThreatIntelMode? threatIntelMode, FirewallPolicyThreatIntelWhitelist threatIntelWhitelist, FirewallPolicyInsights insights, FirewallPolicySnat snat, bool? allowSqlRedirect, DnsSettings dnsSettings, FirewallPolicyExplicitProxy explicitProxy, FirewallPolicyIntrusionDetection intrusionDetection, FirewallPolicyCertificateAuthority transportSecurityCertificateAuthority, FirewallPolicySkuTier? skuTier) + { + return FirewallPolicyData(id: id, name: name, resourceType: resourceType, location: location, tags: tags, etag: etag, identity: identity, size: default, ruleCollectionGroups: ruleCollectionGroups, provisioningState: provisioningState, basePolicyId: basePolicyId, firewalls: firewalls, childPolicies: childPolicies, threatIntelMode: threatIntelMode, threatIntelWhitelist: threatIntelWhitelist, insights: insights, snat: snat, allowSqlRedirect: allowSqlRedirect, dnsSettings: dnsSettings, explicitProxy: explicitProxy, intrusionDetection: intrusionDetection, transportSecurityCertificateAuthority: transportSecurityCertificateAuthority, skuTier: skuTier); + } + + /// Initializes a new instance of FirewallPolicyRuleCollectionGroupData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// Priority of the Firewall Policy Rule Collection Group resource. + /// + /// Group of Firewall Policy rule collections. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The provisioning state of the firewall policy rule collection group resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static FirewallPolicyRuleCollectionGroupData FirewallPolicyRuleCollectionGroupData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, int? priority, IEnumerable ruleCollections, NetworkProvisioningState? provisioningState) + { + return FirewallPolicyRuleCollectionGroupData(id: id, name: name, resourceType: resourceType, etag: etag, size: default, priority: priority, ruleCollections: ruleCollections, provisioningState: provisioningState); + } + + /// Initializes a new instance of SubnetData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// The address prefix for the subnet. + /// List of address prefixes for the subnet. + /// The reference to the NetworkSecurityGroup resource. + /// The reference to the RouteTable resource. + /// Nat gateway associated with this subnet. + /// An array of service endpoints. + /// An array of service endpoint policies. + /// An array of references to private endpoints. + /// An array of references to the network interface IP configurations using subnet. + /// Array of IP configuration profiles which reference this subnet. + /// Array of IpAllocation which reference this subnet. + /// An array of references to the external resources using subnet. + /// An array of references to services injecting into this subnet. + /// An array of references to the delegations on the subnet. + /// A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. + /// The provisioning state of the subnet resource. + /// Enable or Disable apply network policies on private end point in the subnet. + /// Enable or Disable apply network policies on private link service in the subnet. + /// Application gateway IP configurations of virtual network resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SubnetData SubnetData(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, string addressPrefix, IEnumerable addressPrefixes, NetworkSecurityGroupData networkSecurityGroup, RouteTableData routeTable, ResourceIdentifier natGatewayId, IEnumerable serviceEndpoints, IEnumerable serviceEndpointPolicies, IEnumerable privateEndpoints, IEnumerable ipConfigurations, IEnumerable ipConfigurationProfiles, IEnumerable ipAllocations, IEnumerable resourceNavigationLinks, IEnumerable serviceAssociationLinks, IEnumerable delegations, string purpose, NetworkProvisioningState? provisioningState, VirtualNetworkPrivateEndpointNetworkPolicy? privateEndpointNetworkPolicy, VirtualNetworkPrivateLinkServiceNetworkPolicy? privateLinkServiceNetworkPolicy, IEnumerable applicationGatewayIPConfigurations) + { + return SubnetData(id: id, name: name, resourceType: resourceType, etag: etag, addressPrefix: addressPrefix, addressPrefixes: addressPrefixes, networkSecurityGroup: networkSecurityGroup, routeTable: routeTable, natGatewayId: natGatewayId, serviceEndpoints: serviceEndpoints, serviceEndpointPolicies: serviceEndpointPolicies, privateEndpoints: privateEndpoints, ipConfigurations: ipConfigurations, ipConfigurationProfiles: ipConfigurationProfiles, ipAllocations: ipAllocations, resourceNavigationLinks: resourceNavigationLinks, serviceAssociationLinks: serviceAssociationLinks, delegations: delegations, purpose: purpose, provisioningState: provisioningState, privateEndpointNetworkPolicy: privateEndpointNetworkPolicy, privateLinkServiceNetworkPolicy: privateLinkServiceNetworkPolicy, applicationGatewayIPConfigurations: applicationGatewayIPConfigurations, sharingScope: default, defaultOutboundAccess: default, ipamPoolPrefixAllocations: default); + } + + /// Initializes a new instance of ApplicationGatewayListener. + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// Frontend IP configuration resource of an application gateway. + /// Frontend port resource of an application gateway. + /// Protocol of the listener. + /// SSL certificate resource of an application gateway. + /// SSL profile resource of the application gateway. + /// The provisioning state of the listener resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ApplicationGatewayListener ApplicationGatewayListener(ResourceIdentifier id, string name, ResourceType? resourceType, ETag? etag, ResourceIdentifier frontendIPConfigurationId, ResourceIdentifier frontendPortId, ApplicationGatewayProtocol? protocol, ResourceIdentifier sslCertificateId, ResourceIdentifier sslProfileId, NetworkProvisioningState? provisioningState) + { + return ApplicationGatewayListener(id: id, name: name, resourceType: resourceType, etag: etag, frontendIPConfigurationId: frontendIPConfigurationId, frontendPortId: frontendPortId, protocol: protocol, sslCertificateId: sslCertificateId, sslProfileId: sslProfileId, provisioningState: provisioningState, hostNames: default); + } + + /// Initializes a new instance of NetworkVirtualApplianceData. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The service principal that has read access to cloud-init and config blob. + /// A unique read-only string that changes whenever the resource is updated. + /// Network Virtual Appliance SKU. + /// Address Prefix. + /// BootStrapConfigurationBlobs storage URLs. + /// The Virtual Hub where Network Virtual Appliance is being deployed. + /// CloudInitConfigurationBlob storage URLs. + /// CloudInitConfiguration string in plain text. + /// VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. + /// Public key for SSH login. + /// List of Virtual Appliance Network Interfaces. + /// Details required for Additional Network Interface. + /// List of references to VirtualApplianceSite. + /// List of references to VirtualApplianceConnections. + /// List of references to InboundSecurityRules. + /// The provisioning state of the resource. + /// The deployment type. PartnerManaged for the SaaS NVA. + /// The delegation for the Virtual Appliance. + /// The delegation for the Virtual Appliance. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NetworkVirtualApplianceData NetworkVirtualApplianceData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ManagedServiceIdentity identity, ETag? etag, VirtualApplianceSkuProperties nvaSku, string addressPrefix, IEnumerable bootStrapConfigurationBlobs, ResourceIdentifier virtualHubId, IEnumerable cloudInitConfigurationBlobs, string cloudInitConfiguration, long? virtualApplianceAsn, string sshPublicKey, IEnumerable virtualApplianceNics, IEnumerable additionalNics, IEnumerable virtualApplianceSites, IEnumerable virtualApplianceConnections, IEnumerable inboundSecurityRules, NetworkProvisioningState? provisioningState, string deploymentType, VirtualApplianceDelegationProperties delegation, PartnerManagedResourceProperties partnerManagedResource) + { + return NetworkVirtualApplianceData(id: id, name: name, resourceType: resourceType, location: location, tags: tags, identity: identity, etag: etag, nvaSku: nvaSku, addressPrefix: addressPrefix, bootStrapConfigurationBlobs: bootStrapConfigurationBlobs, virtualHubId: virtualHubId, cloudInitConfigurationBlobs: cloudInitConfigurationBlobs, cloudInitConfiguration: cloudInitConfiguration, virtualApplianceAsn: virtualApplianceAsn, sshPublicKey: sshPublicKey, virtualApplianceNics: virtualApplianceNics, networkInterfaceConfigurations: default, additionalNics: additionalNics, internetIngressPublicIPs: default, virtualApplianceSites: virtualApplianceSites, virtualApplianceConnections: virtualApplianceConnections, inboundSecurityRules: inboundSecurityRules, provisioningState: provisioningState, deploymentType: deploymentType, delegation: delegation, partnerManagedResource: partnerManagedResource); + } + /// Initializes a new instance of . /// Resource ID. /// Resource name. diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md index aa1f459b481b..d6667f5a7606 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.2.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.1.0 (2025-01-31) ### Features Added diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj index 5227a3ed8403..216588e39aa9 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj @@ -1,8 +1,8 @@ - 1.1.0 + 1.2.0-beta.1 - 1.0.1 + 1.1.0 Azure.ResourceManager.NetworkCloud Azure Resource Manager client SDK for Azure resource provider NetworkCloud. azure;management;arm;resource manager;networkcloud diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RackSkusRestOperations.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RackSkusRestOperations.cs index f098daceec78..c1c737091a6a 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RackSkusRestOperations.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RackSkusRestOperations.cs @@ -32,7 +32,7 @@ public RackSkusRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RacksRestOperations.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RacksRestOperations.cs index 04ddf0114a41..b880e3419403 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RacksRestOperations.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/RestOperations/RacksRestOperations.cs @@ -32,7 +32,7 @@ public RacksRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-06-01-preview"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/README.md b/sdk/openai/Azure.AI.OpenAI.Assistants/README.md index 48e1dad10e13..017ab78240f4 100644 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/README.md +++ b/sdk/openai/Azure.AI.OpenAI.Assistants/README.md @@ -370,5 +370,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png) diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 49fef6090179..299d28381834 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 2.2.0-beta.1 (2025-02-07) + +This preview release aligns with the corresponding `2.2.0` beta of `OpenAI` and the `2025-01-01-Preview` Azure OpenAI Service API version. + +New features include since 2.1.0-beta.2 include: + +- Audio input for Chat Completions using `gpt-4o-audio-preview` or other compatible models: provide input audio via `ChatMessageContentPart.CreateInputAudioPart()`, set `AudioOptions` and `ResponseModalities` on `ChatCompletionOptions`, retrieve response audio via `OutputAudio` on `ChatCompletion`, and reference audio history from the assistant by using the `AssistantChatMessage(ChatCompletion)` constructor or using `ChatMessageContentPart.CreateAudioPart(string)`. For more information, refer to the examples in [the OpenAI README](https://github.com/openai/openai-dotnet/blob/main/README.md). +- Predicted outputs in Chat Completions: `ChatCompletionOptions` accepts an `OutputPrediction` property that can be used via `ChatOutputPrediction.CreateStaticContentPrediction()` with text content to optimize operation efficiency for scenarios like code completion. For more information, see [OpenAI's predicted outputs announcement](https://community.openai.com/t/introducing-predicted-outputs/1004502). +- Chat Completions `o`-series model feature support: the new `developer` message role via `DeveloperChatMessage` (used just like `SystemChatMessage`), `ReasoningEffortLevel` on Chat Completion options +- [AOAI exclusive] `UserSecurityContext` integration with [Defender for Cloud](https://learn.microsoft.com/azure/defender-for-cloud/gain-end-user-context-ai); add a `UserSecurityContext` instance to `ChatCompletionOptions` with `SetUserSecurityContext()` + +### Breaking Changes + +- **Batch**: files uploaded for batch operations (`UploadFile` with `FileUploadPurpose.Batch`) will now report a `status` of `processed`, matching expected behavior against OpenAI's `/v1` endpoint. This is a change from past behavior where such files would initially report `pending` and a later `processed`, `error`, or other status depending on operation progress. Batch input validation is instead consistently performed from the batch client. + ## 2.1.0 (2024-12-05) This GA library release aligns functionality with the latest `2024-10-21` stable service API label. diff --git a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props index 5304268972e9..fb4ad17aae46 100644 --- a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props +++ b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props @@ -1,14 +1,14 @@  - 2.1.0 - 2024_10_21 + 2.2.0 From file: {annotation.InputFileId}, replacement: {annotation.TextToReplace}"); + Assert.That(annotation.InputFileId, Is.Not.Null.And.Not.Empty); + Assert.That(annotation.TextToReplace, Is.Not.Null.And.Not.Empty); } } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AzureOpenAIClientSmokeTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AzureOpenAIClientSmokeTests.cs new file mode 100644 index 000000000000..c4872a707c27 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/AzureOpenAIClientSmokeTests.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using Azure.AI.OpenAI.Tests.Utils.Config; +using OpenAI; +using System; + +namespace Azure.AI.OpenAI.Tests; + +[Category("Smoke")] +public class AzureOpenAIClientSmokeTests : AoaiTestBase +{ + private IConfiguration DefaultTestConfig { get; } + + public AzureOpenAIClientSmokeTests(bool isAsync) : base(isAsync) + { + DefaultTestConfig = TestConfig.GetConfig("default"); + } + + [Test] + public void CanCreateClient() + { + AzureOpenAIClient azureOpenAIClient = GetTestTopLevelClient(DefaultTestConfig); + Assert.That(azureOpenAIClient, Is.InstanceOf()); + Assert.That(azureOpenAIClient as OpenAIClient, Is.Not.Null); + } + + [Test] + public void VerifyAllVersionsStringify() + { + foreach (AzureOpenAIClientOptions.ServiceVersion possibleVersionValue + in Enum.GetValues(typeof(AzureOpenAIClientOptions.ServiceVersion))) + { + AzureOpenAIClientOptions clientOptionsWithVersion = new(possibleVersionValue); + string stringifiedVersion = clientOptionsWithVersion.GetRawServiceApiValueForClient(null); + Assert.That(stringifiedVersion, Is.Not.Null.And.Not.Empty); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs index 0999e43bcb52..c0d379b0e5fc 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs @@ -1,27 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Azure.AI.OpenAI.Files; +using OpenAI.Batch; +using OpenAI.Chat; +using OpenAI.Files; +using OpenAI.TestFramework; using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net.Http; using System.Text.Json; -using System.Text.RegularExpressions; using System.Threading.Tasks; -using Azure.AI.OpenAI.Files; -using Azure.AI.OpenAI.Tests.Models; -using Azure.AI.OpenAI.Tests.Utils; -using Azure.AI.OpenAI.Tests.Utils.Config; -using OpenAI.Batch; -using OpenAI.Chat; -using OpenAI.Embeddings; -using OpenAI.Files; -using OpenAI.TestFramework; -using OpenAI.TestFramework.Mocks; -using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -30,16 +22,25 @@ namespace Azure.AI.OpenAI.Tests; public class BatchTests : AoaiTestBase { public BatchTests(bool isAsync) : base(isAsync) - { } + { + } [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); [RecordedTest] - public async Task CanUploadFileForBatch() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CanUploadFileForBatch(AzureOpenAIClientOptions.ServiceVersion? version) { - BatchClient batchClient = GetTestClient(); + BatchClient batchClient = GetTestClient(GetTestClientOptions(version)); OpenAIFileClient fileClient = GetTestClientFrom(batchClient); OpenAIFile newFile = await fileClient.UploadFileAsync( @@ -48,26 +49,31 @@ public async Task CanUploadFileForBatch() FileUploadPurpose.Batch); Validate(newFile); - AzureOpenAIFileStatus azureStatus = newFile.Status.ToAzureOpenAIFileStatus(); - Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Pending)); - - TimeSpan filePollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(5); - - for (int i = 0; i < 10 && azureStatus == AzureOpenAIFileStatus.Pending; i++) - { - await Task.Delay(filePollingInterval); - newFile = await fileClient.GetFileAsync(newFile.Id); - azureStatus = newFile.Status.ToAzureOpenAIFileStatus(); - } + // In contrast to fine-tuning, files uploaded for batch will immediately enter -- and remain -- in a + // 'processed' state. Validation is performed via the batch client directly. + AzureOpenAIFileStatus azureStatus = newFile.GetAzureOpenAIFileStatus(); + Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Processed)); - Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Error)); - Assert.That(newFile.StatusDetails, Does.Contain("valid json")); + string createdFileId = newFile.Id; + newFile = await fileClient.GetFileAsync(createdFileId); + Validate(newFile); + Assert.That(newFile.Id, Is.EqualTo(createdFileId)); + Assert.That(newFile.GetAzureOpenAIFileStatus(), Is.EqualTo(AzureOpenAIFileStatus.Processed)); } [RecordedTest] - public async Task CanCancelBatch() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + // [TestCase(null)] + [Category("LongRunning")] // observed live runtime up to 5 minutes + public async Task CanCancelBatch(AzureOpenAIClientOptions.ServiceVersion? version) { - BatchClient batchClient = GetTestClient(); + BatchClient batchClient = GetTestClient(GetTestClientOptions(version)); OpenAIFileClient fileClient = GetTestClientFrom(batchClient); string deploymentName = TestConfig.GetConfig()!.Deployment!; @@ -112,10 +118,18 @@ public async Task CanCancelBatch() } [RecordedTest] +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] [Category("LongRunning")] // observed live runtime typically varies from 6 - 15 minutes - public async Task SimpleBatchCompletionsTest() + public async Task SimpleBatchCompletionsTest(AzureOpenAIClientOptions.ServiceVersion? version) { - BatchClient batchClient = GetTestClient(); + BatchClient batchClient = GetTestClient(GetTestClientOptions(version)); OpenAIFileClient fileClient = GetTestClientFrom(batchClient); string deploymentName = TestConfig.GetConfig()!.Deployment!; @@ -207,6 +221,11 @@ public async Task SimpleBatchCompletionsTest() } } + private TestClientOptions GetTestClientOptions(AzureOpenAIClientOptions.ServiceVersion? version) + { + return version is null ? new TestClientOptions() : new TestClientOptions(version.Value); + } + private List GetVerifiedBatchOutputsOf( BinaryData downloadBytes, IList expectedCustomIds) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Audio.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Audio.cs new file mode 100644 index 000000000000..d1dcfd9b4424 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Audio.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.OpenAI.Chat; +using OpenAI.Chat; +using OpenAI.TestFramework; + +namespace Azure.AI.OpenAI.Tests; + +public partial class ChatTests +{ + [RecordedTest] + public async Task ChatAudioWorks() + { + ChatClient client = GetTestClient("chat_audio"); + + // Part 1a: exercise non-streaming request for text & audio via a user message with (input) audio content + + BinaryData helloWorldAudioBytes = BinaryData.FromBytes(File.ReadAllBytes(Assets.HelloWorldMp3.RelativePath)); + ChatMessageContentPart helloWorldAudioContentPart = ChatMessageContentPart.CreateInputAudioPart( + helloWorldAudioBytes, + ChatInputAudioFormat.Mp3); + + List messages = [new UserChatMessage([helloWorldAudioContentPart])]; + + ChatCompletionOptions options = new() + { + ResponseModalities = ChatResponseModalities.Text | ChatResponseModalities.Audio, + AudioOptions = new(ChatOutputAudioVoice.Alloy, ChatOutputAudioFormat.Pcm16) + }; + + // Part 1b: verify non-streaming response audio + + ChatCompletion completion = await client.CompleteChatAsync(messages, options); + Assert.That(completion, Is.Not.Null); + Assert.That(completion.Content, Has.Count.EqualTo(0)); + + ChatOutputAudio outputAudio = completion.OutputAudio; + Assert.That(outputAudio, Is.Not.Null); + Assert.That(outputAudio.Id, Is.Not.Null.And.Not.Empty); + Assert.That(outputAudio.AudioBytes, Is.Not.Null); + Assert.That(outputAudio.Transcript, Is.Not.Null.And.Not.Empty); + Assert.That(outputAudio.ExpiresAt, Is.GreaterThan(new DateTimeOffset(2024, 11, 1, 0, 0, 0, TimeSpan.Zero))); + + // Part 2: verify construction of conversation history with past response message audio (via ID) + + AssistantChatMessage audioHistoryMessage = ChatMessage.CreateAssistantMessage(completion); + Assert.That(audioHistoryMessage, Is.InstanceOf()); + Assert.That(audioHistoryMessage.Content, Has.Count.EqualTo(0)); + + Assert.That(audioHistoryMessage.OutputAudioReference?.Id, Is.EqualTo(completion.OutputAudio.Id)); + messages.Add(audioHistoryMessage); + + // Part 2b: add another, new audio content part (user message) afterwards + + BinaryData whatsTheWeatherAudioBytes = BinaryData.FromBytes(File.ReadAllBytes(Assets.AudioWhatsTheWeatherPcm16.RelativePath)); + ChatMessageContentPart whatsTheWeatherAudioContentPart = ChatMessageContentPart.CreateInputAudioPart( + whatsTheWeatherAudioBytes, + ChatInputAudioFormat.Wav); + + messages.Add( + new UserChatMessage( + [ + "Please answer the following spoken question:", + ChatMessageContentPart.CreateInputAudioPart(whatsTheWeatherAudioBytes, ChatInputAudioFormat.Wav), + ])); + + // Part 3: verify streaming response audio + + string? streamedCorrelationId = null; + DateTimeOffset? streamedExpiresAt = null; + StringBuilder streamedTranscriptBuilder = new(); + using MemoryStream outputAudioStream = new(); + await foreach (StreamingChatCompletionUpdate update in client.CompleteChatStreamingAsync(messages, options)) + { + Assert.That(update.ContentUpdate, Has.Count.EqualTo(0)); + StreamingChatOutputAudioUpdate outputAudioUpdate = update.OutputAudioUpdate; + + if (outputAudioUpdate is not null) + { + string serializedOutputAudioUpdate = ModelReaderWriter.Write(outputAudioUpdate).ToString(); + Assert.That(serializedOutputAudioUpdate, Is.Not.Null.And.Not.Empty); + + if (outputAudioUpdate.Id is not null) + { + Assert.That(streamedCorrelationId, Is.Null.Or.EqualTo(streamedCorrelationId)); + streamedCorrelationId ??= outputAudioUpdate.Id; + } + if (outputAudioUpdate.ExpiresAt.HasValue) + { + Assert.That(streamedExpiresAt.HasValue, Is.False); + streamedExpiresAt = outputAudioUpdate.ExpiresAt; + } + streamedTranscriptBuilder.Append(outputAudioUpdate.TranscriptUpdate); + byte[] audioUpdateBytes = outputAudioUpdate.AudioBytesUpdate?.ToArray() ?? []; + outputAudioStream.Write(audioUpdateBytes, 0, audioUpdateBytes.Length); + } + } + Assert.That(streamedCorrelationId, Is.Not.Null.And.Not.Empty); + Assert.That(streamedExpiresAt.HasValue, Is.True); + Assert.That(streamedTranscriptBuilder.ToString(), Is.Not.Null.And.Not.Empty); + Assert.That(outputAudioStream.Length, Is.GreaterThan(9000)); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs index 535a599a027e..35b46d7a5116 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs @@ -60,7 +60,7 @@ public enum ToolChoiceTestType [TestCase(ToolChoiceTestType.None)] [TestCase(ToolChoiceTestType.Auto)] [TestCase(ToolChoiceTestType.Tool)] - [TestCase(ToolChoiceTestType.Required, Ignore = "This seems to be considered invalid")] + [TestCase(ToolChoiceTestType.Required)] public async Task SimpleToolWorks(ToolChoiceTestType toolChoice) { ChatClient client = GetTestClient(); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs index 3f3d7486cd12..737f80951179 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs @@ -234,6 +234,7 @@ public async Task DefaultAzureCredentialWorks() [RecordedTest] [Ignore("Delay behavior not emulated by recordings, and needs to be run manually with some time in between iterations due to service throttling behavior")] + [Category("Live")] [TestCase("x-ms-retry-after-ms", "1000", 1000)] [TestCase("retry-after-ms", "1400", 1400)] [TestCase("Retry-After", "1", 1000)] @@ -516,6 +517,31 @@ public async Task StructuredOutputsWork() Assert.IsTrue(stepsProperty.ValueKind == JsonValueKind.Array); } + [RecordedTest] + public async Task UserSecurityContextWorks() + { + ChatClient client = GetTestClient(); + + string userId = Guid.NewGuid().ToString(); + string sourceIP = "123.456.78.9"; + UserSecurityContext userSecurityContext = new() + { + EndUserId = userId, + SourceIP = sourceIP, + }; + + ChatCompletionOptions options = new(); + options.SetUserSecurityContext(userSecurityContext); + + UserSecurityContext retrievedUserSecurityContext = options.GetUserSecurityContext(); + Assert.That(retrievedUserSecurityContext, Is.Not.Null); + Assert.That(retrievedUserSecurityContext.EndUserId, Is.EqualTo(userId)); + Assert.That(retrievedUserSecurityContext.SourceIP, Is.EqualTo(sourceIP)); + + ChatCompletion completion = await client.CompleteChatAsync([ChatMessage.CreateUserMessage("Hello, world!")]); + Assert.That(completion, Is.Not.Null); + } + #endregion #region Streaming chat completion tests @@ -647,12 +673,22 @@ public async Task SearchExtensionWorksStreaming() } [RecordedTest] - public async Task AsyncContentFilterWorksStreaming() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task AsyncContentFilterWorksStreaming(AzureOpenAIClientOptions.ServiceVersion? version) { // Precondition: the target deployment is configured with an async content filter that includes a // custom blocklist that will filter variations of the word 'banana.' - ChatClient client = GetTestClient(TestConfig.GetConfig("chat_with_async_filter")); + ChatClient client = GetTestClient( + TestConfig.GetConfig("chat_with_async_filter"), + GetTestClientOptions(version)); StringBuilder contentBuilder = new(); @@ -697,11 +733,80 @@ in client.CompleteChatStreamingAsync( #endregion - #region Tests for interim o1 model support regarding new max_completion_tokens + [RecordedTest] + public async Task ChatWithO1Works() + { + IConfiguration testConfig = TestConfig.GetConfig("chat_o1")!; + + ChatClient client = GetTestClient(testConfig); + + ChatCompletion completion = await client.CompleteChatAsync([ChatMessage.CreateUserMessage("Hello, world!")]); + Assert.That(completion, Is.Not.Null); + } + +#if NET + [RecordedTest] + public async Task PredictedOutputsWork() + { + ChatClient client = GetTestClient(); + + foreach (ChatOutputPrediction predictionVariant in new List( + [ + // Plain string + ChatOutputPrediction.CreateStaticContentPrediction(""" + { + "feature_name": "test_feature", + "enabled": true + } + """.ReplaceLineEndings("\n")), + // One content part + ChatOutputPrediction.CreateStaticContentPrediction( + [ + ChatMessageContentPart.CreateTextPart(""" + { + "feature_name": "test_feature", + "enabled": true + } + """.ReplaceLineEndings("\n")), + ]), + // Several content parts + ChatOutputPrediction.CreateStaticContentPrediction( + [ + "{\n", + " \"feature_name\": \"test_feature\",\n", + " \"enabled\": true\n", + "}", + ]), + ])) + { + ChatCompletionOptions options = new() + { + OutputPrediction = predictionVariant, + }; + + ChatMessage message = ChatMessage.CreateUserMessage(""" + Modify the following input to enable the feature. Only respond with the JSON and include no other text. Do not enclose in markdown backticks or any other additional annotations. + + { + "feature_name": "test_feature", + "enabled": false + } + """.ReplaceLineEndings("\n")); + + ChatCompletion completion = await client.CompleteChatAsync([message], options); + + Assert.That(completion.Usage.OutputTokenDetails.AcceptedPredictionTokenCount, Is.GreaterThan(0)); + } + } +#endif - #endregion #region Helper methods + private TestClientOptions GetTestClientOptions(AzureOpenAIClientOptions.ServiceVersion? version) + { + return version is null ? new TestClientOptions() : new TestClientOptions(version.Value); + } + private void ValidateUpdate(StreamingChatCompletionUpdate update, StringBuilder builder, ref bool foundPromptFilter, ref bool foundResponseFilter, ref ChatTokenUsage? usage) { if (update.CreatedAt == UNIX_EPOCH) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs index e489f1922714..e8b8fecc6a2a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs @@ -23,9 +23,11 @@ public ConversationProtocolTests(bool isAsync) : base(isAsync) #if NET6_0_OR_GREATER [Test] - public async Task ProtocolCanConfigureSession() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(null)] + public async Task ProtocolCanConfigureSession(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); BinaryData configureSessionCommand = BinaryData.FromString(""" diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTestFixtureBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTestFixtureBase.cs index d718cc1eb581..86042d699181 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTestFixtureBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTestFixtureBase.cs @@ -16,6 +16,7 @@ namespace Azure.AI.OpenAI.Tests; [Parallelizable(ParallelScope.All)] [Category("Conversation")] +[Category("Live")] public class ConversationTestFixtureBase { internal TestConfig TestConfig { get; } = new(() => RecordedTestMode.Live); @@ -39,17 +40,24 @@ public ConversationTestFixtureBase(bool isAsync) } } - public RealtimeConversationClient GetTestClient() => GetTestClient(DefaultConfiguration); - public RealtimeConversationClient GetTestClient(string configurationName) => GetTestClient(TestConfig.GetConfig(configurationName)); - public RealtimeConversationClient GetTestClient(IConfiguration testConfig) + public TestClientOptions GetTestClientOptions(AzureOpenAIClientOptions.ServiceVersion? version) { + return version is null ? new TestClientOptions() : new TestClientOptions(version.Value); + } + + public RealtimeConversationClient GetTestClient(TestClientOptions clientOptions = null) => GetTestClient(DefaultConfiguration, clientOptions); + public RealtimeConversationClient GetTestClient(string configurationName, TestClientOptions clientOptions = null) => GetTestClient(TestConfig.GetConfig(configurationName), clientOptions); + public RealtimeConversationClient GetTestClient(IConfiguration testConfig, TestClientOptions clientOptions = null) + { + clientOptions ??= new(); + Uri endpoint = testConfig.Endpoint; ApiKeyCredential key = new(testConfig.Key); string deployment = testConfig.Deployment; Console.WriteLine($"--- Connecting to endpoint: {endpoint.AbsoluteUri}"); - AzureOpenAIClient topLevelClient = new(endpoint, key); + AzureOpenAIClient topLevelClient = new(endpoint, key, clientOptions); RealtimeConversationClient client = topLevelClient.GetRealtimeConversationClient(testConfig.Deployment); client.OnSendingCommand += (_, data) => PrintMessageData(data, "> "); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs index d9ecf1b2fa2b..2ea29e967312 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs @@ -1,6 +1,4 @@ -using NUnit.Framework; -using OpenAI; -using OpenAI.RealtimeConversation; +using OpenAI.RealtimeConversation; using System; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -18,14 +16,34 @@ namespace Azure.AI.OpenAI.Tests; [TestFixture(false)] public class ConversationTests : ConversationTestFixtureBase { - public ConversationTests(bool isAsync) : base(isAsync) { } -#if !AZURE_OPENAI_GA +#if AZURE_OPENAI_GA [Test] - public async Task CanConfigureSession() + [Category("Smoke")] + public void VersionNotSupportedThrows() { - RealtimeConversationClient client = GetTestClient(); + Assert.Throws(() => GetTestClient()); + } +#elif !NET + [Test] + public void ThrowsOnOldNetFramework() + { + _ = Assert.ThrowsAsync(async () => + { + RealtimeConversationClient client = GetTestClient(); + using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); + }); + } +#else + [Test] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task CanConfigureSession(AzureOpenAIClientOptions.ServiceVersion? version) + { + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); ConversationSessionOptions sessionOptions = new() @@ -37,7 +55,7 @@ public async Task CanConfigureSession() }; await session.ConfigureSessionAsync(sessionOptions, CancellationToken); - ConversationSessionOptions responseOverrideOptions = new() + ConversationResponseOptions responseOverrideOptions = new() { ContentModalities = ConversationContentModalities.Text, }; @@ -91,9 +109,13 @@ List GetReceivedUpdates() where T : ConversationUpdate } [Test] - public async Task TextOnlyWorks() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task TextOnlyWorks(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); await session.AddItemAsync( ConversationItem.CreateUserMessage(["Hello, world!"]), @@ -143,14 +165,17 @@ await session.AddItemAsync( if (update is ConversationRateLimitsUpdate rateLimitsUpdate) { - Assert.That(rateLimitsUpdate.AllDetails, Has.Count.EqualTo(2)); - Assert.That(rateLimitsUpdate.TokenDetails, Is.Not.Null); - Assert.That(rateLimitsUpdate.TokenDetails.Name, Is.EqualTo("tokens")); - Assert.That(rateLimitsUpdate.TokenDetails.MaximumCount, Is.GreaterThan(0)); - Assert.That(rateLimitsUpdate.TokenDetails.RemainingCount, Is.GreaterThan(0)); - Assert.That(rateLimitsUpdate.TokenDetails.RemainingCount, Is.LessThan(rateLimitsUpdate.TokenDetails.MaximumCount)); - Assert.That(rateLimitsUpdate.TokenDetails.TimeUntilReset, Is.GreaterThan(TimeSpan.Zero)); - Assert.That(rateLimitsUpdate.RequestDetails, Is.Not.Null); + // Errata (2025-01-22): no rate limit items being reported + // {"type":"rate_limits.updated","event_id":"event_AscnhKHfFTapqAeiQfE60","rate_limits":[]} + + //Assert.That(rateLimitsUpdate.AllDetails, Has.Count.EqualTo(2)); + //Assert.That(rateLimitsUpdate.TokenDetails, Is.Not.Null); + //Assert.That(rateLimitsUpdate.TokenDetails.Name, Is.EqualTo("tokens")); + //Assert.That(rateLimitsUpdate.TokenDetails.MaximumCount, Is.GreaterThan(0)); + //Assert.That(rateLimitsUpdate.TokenDetails.RemainingCount, Is.GreaterThan(0)); + //Assert.That(rateLimitsUpdate.TokenDetails.RemainingCount, Is.LessThan(rateLimitsUpdate.TokenDetails.MaximumCount)); + //Assert.That(rateLimitsUpdate.TokenDetails.TimeUntilReset, Is.GreaterThan(TimeSpan.Zero)); + //Assert.That(rateLimitsUpdate.RequestDetails, Is.Not.Null); gotRateLimits = true; } } @@ -166,9 +191,13 @@ await session.AddItemAsync( } [Test] - public async Task ItemManipulationWorks() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task ItemManipulationWorks(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); await session.ConfigureSessionAsync( @@ -241,9 +270,13 @@ await session.AddItemAsync( } [Test] - public async Task AudioWithToolsWorks() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task AudioWithToolsWorks(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); ConversationFunctionTool getWeatherTool = new() @@ -339,9 +372,13 @@ public async Task AudioWithToolsWorks() } [Test] - public async Task CanDisableVoiceActivityDetection() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task CanDisableVoiceActivityDetection(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); await session.ConfigureSessionAsync( @@ -388,9 +425,90 @@ or ConversationResponseStartedUpdate } [Test] - public async Task BadCommandProvidesError() + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task CanUseManualVadTurnDetection(AzureOpenAIClientOptions.ServiceVersion? version) { - RealtimeConversationClient client = GetTestClient(); + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); + using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); + + await session.ConfigureSessionAsync( + new() + { + InputTranscriptionOptions = new ConversationInputTranscriptionOptions() + { + Model = "whisper-1", + }, + TurnDetectionOptions = ConversationTurnDetectionOptions.CreateServerVoiceActivityTurnDetectionOptions( + enableAutomaticResponseCreation: false), + }, + CancellationToken); + + const string folderName = "Assets"; + const string fileName = "whats_the_weather_pcm16_24khz_mono.wav"; +#if NET6_0_OR_GREATER + using Stream audioStream = File.OpenRead(Path.Join(folderName, fileName)); +#else + using Stream audioStream = File.OpenRead($"{folderName}\\{fileName}"); +#endif + await session.SendInputAudioAsync(audioStream, CancellationToken); + + bool gotInputTranscriptionCompleted = false; + bool responseExpected = false; + bool gotResponseStarted = false; + bool gotResponseFinished = false; + + await foreach (ConversationUpdate update in session.ReceiveUpdatesAsync(CancellationToken)) + { + if (update is ConversationErrorUpdate errorUpdate) + { + Assert.Fail($"Error received: {ModelReaderWriter.Write(errorUpdate)}"); + } + + if (update is ConversationInputTranscriptionFinishedUpdate inputTranscriptionFinishedUpdate) + { + Assert.That(gotInputTranscriptionCompleted, Is.False); + Assert.That(inputTranscriptionFinishedUpdate.Transcript, Is.Not.Null.And.Not.Empty); + gotInputTranscriptionCompleted = true; + await Task.Delay(TimeSpan.FromMilliseconds(500), CancellationToken); + await session.StartResponseAsync(CancellationToken); + responseExpected = true; + } + + if (update is ConversationResponseStartedUpdate responseStartedUpdate) + { + Assert.That(responseExpected, Is.True); + Assert.That(gotInputTranscriptionCompleted, Is.True); + Assert.That(gotResponseFinished, Is.False); + gotResponseStarted = true; + } + + if (update is ConversationResponseFinishedUpdate responseFinishedUpdate) + { + Assert.That(responseExpected, Is.True); + Assert.That(gotInputTranscriptionCompleted, Is.True); + Assert.That(gotResponseStarted, Is.True); + Assert.That(gotResponseFinished, Is.False); + gotResponseFinished = true; + break; + } + } + + Assert.IsTrue(gotInputTranscriptionCompleted); + Assert.IsTrue(gotResponseStarted); + Assert.IsTrue(gotResponseFinished); + } + + [Test] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] + [TestCase(null)] + public async Task BadCommandProvidesError(AzureOpenAIClientOptions.ServiceVersion? version) + { + RealtimeConversationClient client = GetTestClient(GetTestClientOptions(version)); using RealtimeConversationSession session = await client.StartConversationSessionAsync(CancellationToken); await session.SendCommandAsync( @@ -416,12 +534,5 @@ await session.SendCommandAsync( Assert.That(gotErrorUpdate, Is.True); } -#else - [Test] - [Category("Smoke")] - public void VersionNotSupportedThrows() - { - Assert.Throws(() => GetTestClient()); - } -#endif +#endif // "else" to AZURE_OPENAI_GA, !NET } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs index 710405889b3c..aefe3c2271c4 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs @@ -11,16 +11,25 @@ namespace Azure.AI.OpenAI.Tests; public class FileTests : AoaiTestBase { public FileTests(bool isAsync) : base(isAsync) - { } + { + } [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); [RecordedTest] - public async Task CanUploadAndDeleteFiles() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + //[TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CanUploadAndDeleteFiles(AzureOpenAIClientOptions.ServiceVersion? version) { - OpenAIFileClient client = GetTestClient(); + OpenAIFileClient client = GetTestClient(GetTestClientOptions(version)); OpenAIFile file = await client.UploadFileAsync( BinaryData.FromString("hello, world!"), "test_file_delete_me.txt", @@ -32,10 +41,23 @@ public async Task CanUploadAndDeleteFiles() } [RecordedTest] - public async Task CanListFiles() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CanListFiles(AzureOpenAIClientOptions.ServiceVersion? version) { - OpenAIFileClient client = GetTestClient(); + OpenAIFileClient client = GetTestClient(GetTestClientOptions(version)); OpenAIFileCollection files = await client.GetFilesAsync(); Assert.That(files, Has.Count.GreaterThan(0)); } + + private static TestClientOptions GetTestClientOptions(AzureOpenAIClientOptions.ServiceVersion? version) + { + return version is null ? new TestClientOptions() : new TestClientOptions(version.Value); + } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs index ce12b8f82498..2a99737f53f2 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs @@ -17,6 +17,8 @@ using OpenAI.FineTuning; using OpenAI.TestFramework; using OpenAI.TestFramework.Utils; +using Azure.AI.OpenAI.Files; + #if !AZURE_OPENAI_GA using Azure.AI.OpenAI.FineTuning; @@ -24,15 +26,13 @@ namespace Azure.AI.OpenAI.Tests; +#pragma warning disable CS0618 + [Category("FineTuning")] public class FineTuningTests : AoaiTestBase { public FineTuningTests(bool isAsync) : base(isAsync) { - if (Mode == RecordedTestMode.Playback) - { - Assert.Inconclusive("Playback for fine-tuning temporarily disabled"); - } } #if !AZURE_OPENAI_GA @@ -41,9 +41,56 @@ public FineTuningTests(bool isAsync) : base(isAsync) public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); [RecordedTest] - public async Task JobsFineTuning() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CanUploadFileForFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) + { + FineTuningClient ftClient = GetTestClient(GetTestClientOptions(version)); + OpenAIFileClient fileClient = GetTestClientFrom(ftClient); + + OpenAIFile newFile = await fileClient.UploadFileAsync( + BinaryData.FromString("this isn't valid input for fine tuning"), + "intentionally-bad-ft-input.jsonl", + FileUploadPurpose.FineTune); + Validate(newFile); + + // In contrast to batch, files uploaded for fine tuning will initially appear in a 'pending' state, + // transitioning into a terminal as input validation is handled. In this case, because malformed input is + // uploaded, the terminal status should be 'error'. + AzureOpenAIFileStatus azureStatus = newFile.GetAzureOpenAIFileStatus(); + Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Pending)); + + TimeSpan filePollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(5); + + for (int i = 0; i < 10 && azureStatus == AzureOpenAIFileStatus.Pending; i++) + { + await Task.Delay(filePollingInterval); + newFile = await fileClient.GetFileAsync(newFile.Id); + azureStatus = newFile.GetAzureOpenAIFileStatus(); + } + + Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Error)); + Assert.That(newFile.StatusDetails.ToLower(), Does.Contain("validation of jsonl")); + } + + [RecordedTest] +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + //[TestCase(null)] + public async Task JobsFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) { - FineTuningClient client = GetTestClient(); + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); int count = 25; @@ -63,10 +110,18 @@ public async Task JobsFineTuning() } [RecordedTest] - public async Task CheckpointsFineTuning() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CheckpointsFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) { + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); string fineTunedModel = GetFineTunedModel(); - FineTuningClient client = GetTestClient(); // Check if the model exists by searching all jobs FineTuningJob job = await EnumerateJobsAsync(client) @@ -100,10 +155,18 @@ public async Task CheckpointsFineTuning() } [RecordedTest] - public async Task EventsFineTuning() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + //[TestCase(null)] + public async Task EventsFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) { + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); string fineTunedModel = GetFineTunedModel(); - FineTuningClient client = GetTestClient(); // Check if the model exists by searching all jobs FineTuningJob job = await EnumerateJobsAsync(client) @@ -138,31 +201,23 @@ public async Task EventsFineTuning() } [RecordedTest] - public async Task CreateAndCancelFineTuning() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CreateAndCancelFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) { + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); var fineTuningFile = Assets.FineTuning; - FineTuningClient client = GetTestClient(); OpenAIFileClient fileClient = GetTestClientFrom(client); - OpenAIFile uploadedFile; - try - { - ClientResult fileResult = await fileClient.GetFileAsync("file-db5f5bfe5ea04ffcaeba89947a872828", new RequestOptions() { }); - uploadedFile = ValidateAndParse(fileResult); - } - catch (ClientResultException e) - { - if (e.Message.Contains("ResourceNotFound")) - { - // upload training data - uploadedFile = await UploadAndWaitForCompleteOrFail(fileClient, fineTuningFile.RelativePath); - } - else - { - throw; - } - } + OpenAIFile uploadedFile = await UploadAndWaitForCompleteOrFail(fileClient, fineTuningFile.RelativePath); + Validate(uploadedFile); // Create the fine tuning job using var requestContent = new FineTuningOptions() @@ -184,6 +239,7 @@ public async Task CreateAndCancelFineTuning() // Wait for some events to become available ClientResult result; ListResponse events; + TimeSpan pollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(2); int maxLoops = 10; do { @@ -201,7 +257,7 @@ public async Task CreateAndCancelFineTuning() break; } - await Task.Delay(TimeSpan.FromSeconds(2)); + await Task.Delay(pollingInterval); } while (maxLoops-- > 0); @@ -215,30 +271,20 @@ public async Task CreateAndCancelFineTuning() } [RecordedTest] - public async Task CreateAndDeleteFineTuning() +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] + public async Task CreateAndDeleteFineTuning(AzureOpenAIClientOptions.ServiceVersion? version) { + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); var fineTuningFile = Assets.FineTuning; - - FineTuningClient client = GetTestClient(); OpenAIFileClient fileClient = GetTestClientFrom(client); - OpenAIFile uploadedFile; - try - { - ClientResult fileResult = await fileClient.GetFileAsync("file-db5f5bfe5ea04ffcaeba89947a872828", new RequestOptions() { }); - uploadedFile = ValidateAndParse(fileResult); - } - catch (ClientResultException e) - { - if (e.Message.Contains("ResourceNotFound")) - { - // upload training data - uploadedFile = await UploadAndWaitForCompleteOrFail(fileClient, fineTuningFile.RelativePath); - } - else - { - throw; - } - } + OpenAIFile uploadedFile = await UploadAndWaitForCompleteOrFail(fileClient, fineTuningFile.RelativePath); // Create the fine tuning job using var requestContent = new FineTuningOptions() @@ -269,12 +315,20 @@ public async Task CreateAndDeleteFineTuning() Assert.True(deleted, "Failed to delete fine tuning model: {0}", job.FineTunedModel); } - [RecordedTest]//AutomaticRecord = false)] + [RecordedTest] +#if !AZURE_OPENAI_GA + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_12_01_Preview)] + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2025_01_01_Preview)] +#else + [TestCase(AzureOpenAIClientOptions.ServiceVersion.V2024_10_21)] +#endif + [TestCase(null)] [Category("LongRunning")] // CAUTION: This test can take around 10 to 15 *minutes* in live mode to run - public async Task DeployAndChatWithModel() + public async Task DeployAndChatWithModel(AzureOpenAIClientOptions.ServiceVersion? version) { + FineTuningClient client = GetTestClient(GetTestClientOptions(version)); string fineTunedModel = GetFineTunedModel(); - FineTuningClient client = GetTestClient(); AzureDeploymentClient deploymentClient = GetTestClientFrom(client); string? deploymentName = null; @@ -348,6 +402,11 @@ public async Task DeployAndChatWithModel() #region helper methods + private TestClientOptions GetTestClientOptions(AzureOpenAIClientOptions.ServiceVersion? version) + { + return version is null ? new TestClientOptions() : new TestClientOptions(version.Value); + } + private string GetFineTunedModel() { string? model = TestConfig.GetConfig() @@ -402,7 +461,7 @@ private async IAsyncEnumerable EnumerateAsync(Func DeleteJobAndVerifyAsync(AzureFineTuningJobOperation operation, string jobId, TimeSpan? timeBetween = null, TimeSpan? maxWaitTime = null) { var stopTime = DateTimeOffset.Now + (maxWaitTime ?? TimeSpan.FromMinutes(1)); - var sleepTime = timeBetween ?? TimeSpan.FromSeconds(2); + TimeSpan sleepTime = timeBetween ?? (Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1): TimeSpan.FromSeconds(2)); RequestOptions noThrow = new() { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs index e97480a2a4c1..9c67c1ca6825 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs @@ -68,7 +68,6 @@ public async Task CanGetContentFilterResults() GeneratedImage image = imageResult.Value; Assert.That(image, Is.Not.Null); Assert.That(image.ImageUri, Is.Not.Null); - Console.WriteLine($"RESPONSE--\n{imageResult.GetRawResponse().Content}"); RequestImageContentFilterResult promptResults = image.GetRequestContentFilterResult(); ResponseImageContentFilterResult responseResults = image.GetResponseContentFilterResult(); Assert.That(promptResults?.Sexual?.Severity, Is.EqualTo(ContentFilterSeverity.Safe)); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs index 6a3b3118e6c5..674dbfe96aff 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs @@ -641,10 +641,18 @@ protected void Cleanup() }); RequestOptions requestOptions = new() { ErrorOptions = ClientErrorBehaviors.NoThrow, }; + void WriteIfNotSuppressed(string message) + { + if (Environment.GetEnvironmentVariable("AOAI_SUPPRESS_TRAFFIC_DUMP") != "true") + { + Console.WriteLine(message); + } + } + OpenAIFileClient fileClient = topLevelCleanupClient.GetOpenAIFileClient(); foreach (string fileId in _fileIdsToDelete) { - Console.WriteLine($"Cleanup: {fileId} -> {fileClient.DeleteFile(fileId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {fileId} -> {fileClient.DeleteFile(fileId, requestOptions)?.GetRawResponse().Status}"); } _fileIdsToDelete.Clear(); @@ -659,23 +667,23 @@ protected void Cleanup() VectorStoreClient vectorStoreClient = topLevelCleanupClient.GetVectorStoreClient(); foreach ((string threadId, string messageId) in _threadIdsWithMessageIdsToDelete) { - Console.WriteLine($"Cleanup: {messageId} -> {client.DeleteMessage(threadId, messageId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {messageId} -> {client.DeleteMessage(threadId, messageId, requestOptions)?.GetRawResponse().Status}"); } foreach (string assistantId in _assistantIdsToDelete) { - Console.WriteLine($"Cleanup: {assistantId} -> {client.DeleteAssistant(assistantId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {assistantId} -> {client.DeleteAssistant(assistantId, requestOptions)?.GetRawResponse().Status}"); } foreach (string threadId in _threadIdsToDelete) { - Console.WriteLine($"Cleanup: {threadId} -> {client.DeleteThread(threadId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {threadId} -> {client.DeleteThread(threadId, requestOptions)?.GetRawResponse().Status}"); } foreach ((string vectorStoreId, string fileId) in _vectorStoreFileAssociationsToRemove) { - Console.WriteLine($"Cleanup: {vectorStoreId}<->{fileId} => {vectorStoreClient.RemoveFileFromStore(vectorStoreId, fileId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {vectorStoreId}<->{fileId} => {vectorStoreClient.RemoveFileFromStore(vectorStoreId, fileId, requestOptions)?.GetRawResponse().Status}"); } foreach (string vectorStoreId in _vectorStoreIdsToDelete) { - Console.WriteLine($"Cleanup: {vectorStoreId} => {vectorStoreClient.DeleteVectorStore(vectorStoreId, requestOptions)?.GetRawResponse().Status}"); + WriteIfNotSuppressed($"Cleanup: {vectorStoreId} => {vectorStoreClient.DeleteVectorStore(vectorStoreId, requestOptions)?.GetRawResponse().Status}"); } _threadIdsWithMessageIdsToDelete.Clear(); _assistantIdsToDelete.Clear(); @@ -756,6 +764,6 @@ public TestClientOptions() : base() public TestClientOptions(ServiceVersion version) : base(version) { } - public bool ShouldOutputRequests { get; set; } = true; - public bool ShouldOutputResponses { get; set; } = true; + public bool ShouldOutputRequests { get; set; } = Environment.GetEnvironmentVariable("AOAI_SUPPRESS_TRAFFIC_DUMP") != "true"; + public bool ShouldOutputResponses { get; set; } = Environment.GetEnvironmentVariable("AOAI_SUPPRESS_TRAFFIC_DUMP") != "true"; } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs index 15590bc9cca6..3b54e8316300 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs @@ -19,6 +19,15 @@ public Assets() RelativePath = GetPath("hello_world.m4a"), MimeType = "audio/m4a" }; + HelloWorldMp3 = new() + { + Type = AssetType.Audio, + Language = "en", + Description = "Hello world", + Name = "audio_hello_world.mp3", + RelativePath = GetPath("audio_hello_world.mp3"), + MimeType = "audio/mp3" + }; WhisperFrenchDescription = new() { Type = AssetType.Audio, @@ -47,12 +56,23 @@ public Assets() RelativePath = GetPath("fine_tuning.jsonl"), MimeType = "text/plain" }; + AudioWhatsTheWeatherPcm16 = new() + { + Type = AssetType.Audio, + Language = "en", + Description = "Fine tuning data for Open AI to generate a JSON object based on sports headlines", + Name = "whats_the_weather_pcm16_24khz_mono.wav", + RelativePath = GetPath("whats_the_weather_pcm16_24khz_mono.wav"), + MimeType = "audio/wav" + }; } public virtual AssetInfo HelloWorld { get; } + public virtual AssetInfo HelloWorldMp3 { get; } public virtual AssetInfo WhisperFrenchDescription { get; } public virtual AssetInfo DogAndCat { get; } public virtual AssetInfo FineTuning { get; } + public virtual AssetInfo AudioWhatsTheWeatherPcm16 { get; } protected virtual string GetPath(string assetName) { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs index 3443a19471fc..f38a462d53b6 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs @@ -176,7 +176,8 @@ public async Task CanAssociateFiles() Assert.True(removalResult.Removed); // Errata: removals aren't immediately reflected when requesting the list - await Task.Delay(TimeSpan.FromSeconds(5)); + TimeSpan waitTime = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(10); + await Task.Delay(waitTime); int count = 0; AsyncCollectionResult response = client.GetFileAssociationsAsync(vectorStore.Id); diff --git a/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs index 5f98e8d75507..f52e063e5d64 100644 --- a/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs +++ b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs @@ -121,7 +121,8 @@ private static bool IsRecordingPlaybackFailure(TestResult result) // 2. Check if the failure message indicates a recording playback exception. This sadly requires us to check test failure // messages which can be a little fragile but there does not seem to be a way to get the exception directly - if (result.Message?.Contains(exceptionName) == true) + if (result.Message?.Contains(exceptionName) == true + || result.Message?.Contains("ClientResultException : NotFound: Recording file path") == true) { return true; } diff --git a/sdk/personalizer/Azure.AI.Personalizer/README.md b/sdk/personalizer/Azure.AI.Personalizer/README.md index a5d5af276e7f..bb9d8124fb11 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/README.md +++ b/sdk/personalizer/Azure.AI.Personalizer/README.md @@ -35,8 +35,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpersonalizer%2FAzure.AI.Personalizer%2FREADME.png) - [nuget]: https://www.nuget.org/ [search_contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/CONTRIBUTING.md diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md index b3207c2cd167..45f55b84f438 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/README.md @@ -7,7 +7,7 @@ Ready to get started? Jump into our [quickstart guide] + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..4416e7cc32ab --- /dev/null +++ b/sdk/provisioning/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0005:DO provide protected parameterless constructor for mocking.", Justification = "", Scope = "type", Target = "~T:Azure.CloudMachine.CloudMachineClient")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Identity.DefaultAzureCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj index b852a5665256..91242880542e 100644 --- a/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj +++ b/sdk/provisioning/Azure.Provisioning.CognitiveServices/src/Azure.Provisioning.CognitiveServices.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.CognitiveServices simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj index cdaa58017eae..6e17da3eb75f 100644 --- a/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj +++ b/sdk/provisioning/Azure.Provisioning.CosmosDB/src/Azure.Provisioning.CosmosDB.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.CosmosDB simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj index 096b1d72f388..5ec83ab6638b 100644 --- a/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj +++ b/sdk/provisioning/Azure.Provisioning.EventHubs/src/Azure.Provisioning.EventHubs.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.EventHubs simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj index b8c02be4ebbe..408e5c2c7b4b 100644 --- a/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj +++ b/sdk/provisioning/Azure.Provisioning.KeyVault/src/Azure.Provisioning.KeyVault.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.KeyVault simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj index 032da5f3bbbd..70bdf63f47d0 100644 --- a/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj +++ b/sdk/provisioning/Azure.Provisioning.PostgreSql/src/Azure.Provisioning.PostgreSql.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.PostgreSql simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Redis/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj index d01d227fb3da..9bd6faec0561 100644 --- a/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj +++ b/sdk/provisioning/Azure.Provisioning.Redis/src/Azure.Provisioning.Redis.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.Redis simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Search/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj index 6bededebd801..6e0fd4a2e4d9 100644 --- a/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj +++ b/sdk/provisioning/Azure.Provisioning.Search/src/Azure.Provisioning.Search.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.Search simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj index c30a1a158710..dca1d1543229 100644 --- a/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj +++ b/sdk/provisioning/Azure.Provisioning.ServiceBus/src/Azure.Provisioning.ServiceBus.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.ServiceBus simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.SignalR/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj index 2db2ebd57e22..8bd1d853814f 100644 --- a/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj +++ b/sdk/provisioning/Azure.Provisioning.SignalR/src/Azure.Provisioning.SignalR.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.SignalR simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Sql/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj index 188cbbec59a8..a4a45da66a46 100644 --- a/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj +++ b/sdk/provisioning/Azure.Provisioning.Sql/src/Azure.Provisioning.Sql.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.Sql simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.Storage/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj index 7d15a958c978..d87bdeadd533 100644 --- a/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj +++ b/sdk/provisioning/Azure.Provisioning.Storage/src/Azure.Provisioning.Storage.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.Storage simplifies declarative resource provisioning in .NET for Azure Storage. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md index a0eb187ef440..9b1e0f0922fb 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj index 6a74d7b378b7..604f0151e1e1 100644 --- a/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj +++ b/sdk/provisioning/Azure.Provisioning.WebPubSub/src/Azure.Provisioning.WebPubSub.csproj @@ -2,7 +2,9 @@ Azure.Provisioning.WebPubSub simplifies declarative resource provisioning in .NET. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) 12 diff --git a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md index f597fdbc4c44..d441beb772d2 100644 --- a/sdk/provisioning/Azure.Provisioning/CHANGELOG.md +++ b/sdk/provisioning/Azure.Provisioning/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0 (2024-10-25) ### Features Added diff --git a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj index 33a593931459..2943d705fcd1 100644 --- a/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj +++ b/sdk/provisioning/Azure.Provisioning/src/Azure.Provisioning.csproj @@ -2,7 +2,9 @@ Contains the core functionality for defining Azure infrastructure with dotnet code. - 1.0.0 + 1.1.0-beta.1 + + 1.0.0 $(RequiredTargetFrameworks) enable 12 diff --git a/sdk/pullrequest.yml b/sdk/pullrequest.yml new file mode 100644 index 000000000000..dfaad924c321 --- /dev/null +++ b/sdk/pullrequest.yml @@ -0,0 +1,25 @@ +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - pipelinev3* + paths: + include: + - "*" + + exclude: + - eng/packages/http-client-csharp + +parameters: + - name: Service + type: string + default: auto + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: ${{ parameters.Service }} + BuildSnippets: false # setting this to false until we can handle ci.yml level parameter customizations diff --git a/sdk/purview/Azure.Analytics.Purview.Account/README.md b/sdk/purview/Azure.Analytics.Purview.Account/README.md index ab83a5f9171f..3daefd85d300 100644 --- a/sdk/purview/Azure.Analytics.Purview.Account/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Account/README.md @@ -110,5 +110,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Catalog%2FREADME.png) diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/README.md b/sdk/purview/Azure.Analytics.Purview.Administration/README.md index 6aefb85aa50f..d2fe769cd9b3 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Administration/README.md @@ -128,5 +128,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Catalog%2FREADME.png) diff --git a/sdk/purview/Azure.Analytics.Purview.Catalog/README.md b/sdk/purview/Azure.Analytics.Purview.Catalog/README.md index 8046582638ca..e0f1f0010916 100644 --- a/sdk/purview/Azure.Analytics.Purview.Catalog/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Catalog/README.md @@ -116,5 +116,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Catalog%2FREADME.png) diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/README.md b/sdk/purview/Azure.Analytics.Purview.DataMap/README.md index 55ec1a6bd3ae..a742d07f5dc3 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/README.md +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/README.md @@ -129,5 +129,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/purview/Azure.Analytics.Purview.DataMap/README.png) diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/src/Generated/Docs/Discovery.xml b/sdk/purview/Azure.Analytics.Purview.DataMap/src/Generated/Docs/Discovery.xml index d5ee2dc92033..8417ce2c247e 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/src/Generated/Docs/Discovery.xml +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/src/Generated/Docs/Discovery.xml @@ -15,26 +15,26 @@ QueryConfig body = new QueryConfig Limit = 10, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4604", + ["$id"] = "5720", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4606", + ["$id"] = "5722", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { - ["$id"] = "4599", + ["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "4600", + ["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -94,17 +94,17 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { - ["$id"] = "4684", + ["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4685", + ["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -125,36 +125,36 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { - ["$id"] = "4737", + ["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4738", + ["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { - ["$id"] = "4739", + ["$id"] = "5855", ["or"] = new object[] { new Dictionary { - ["$id"] = "4740", + ["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4741", + ["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -177,142 +177,142 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { - ["$id"] = "4795", + ["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { - ["$id"] = "4796", + ["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { - ["$id"] = "4797", + ["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { - ["$id"] = "4798", + ["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { - ["$id"] = "4799", + ["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { - ["$id"] = "4800", + ["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { - ["$id"] = "4801", + ["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { - ["$id"] = "4802", + ["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { - ["$id"] = "4803", + ["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { - ["$id"] = "4804", + ["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { - ["$id"] = "4805", + ["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { - ["$id"] = "4806", + ["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { - ["$id"] = "4807", + ["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { - ["$id"] = "4808", + ["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { - ["$id"] = "4809", + ["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { - ["$id"] = "4810", + ["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { - ["$id"] = "4811", + ["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { - ["$id"] = "4812", + ["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { - ["$id"] = "4813", + ["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { - ["$id"] = "4814", + ["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { - ["$id"] = "4815", + ["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { - ["$id"] = "4816", + ["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { - ["$id"] = "4817", + ["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { - ["$id"] = "4818", + ["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { - ["$id"] = "4819", + ["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { - ["$id"] = "4820", + ["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { - ["$id"] = "4821", + ["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -331,26 +331,26 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { - ["$id"] = "4864", + ["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4865", + ["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { - ["$id"] = "4866", + ["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -371,33 +371,33 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { - ["$id"] = "4929", + ["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { - ["$id"] = "4930", + ["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { - ["$id"] = "4931", + ["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { - ["$id"] = "4932", + ["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -418,7 +418,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }), @@ -436,7 +436,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }), }; @@ -453,7 +453,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }), Facets = {new SearchFacetItem @@ -487,12 +487,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { - ["$id"] = "5185", + ["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -512,27 +512,27 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { - ["$id"] = "5229", + ["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5230", + ["$id"] = "6346", ["or"] = new object[] { new Dictionary { - ["$id"] = "5231", + ["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { - ["$id"] = "5232", + ["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -570,12 +570,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { - ["$id"] = "5301", + ["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -594,10 +594,10 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }), @@ -615,47 +615,47 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { - ["$id"] = "5373", + ["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { - ["$id"] = "5374", + ["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { - ["$id"] = "5375", + ["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5376", + ["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { - ["$id"] = "5377", + ["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5378", + ["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { - ["$id"] = "5379", + ["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { - ["$id"] = "5380", + ["$id"] = "6496", ["objectType"] = "Tables" } } @@ -676,26 +676,26 @@ QueryConfig body = new QueryConfig ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5425", + ["$id"] = "6541", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5427", + ["$id"] = "6543", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { - ["$id"] = "5419", + ["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5420", + ["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -756,26 +756,26 @@ QueryConfig body = new QueryConfig Limit = 2, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5511", + ["$id"] = "6627", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5513", + ["$id"] = "6629", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { - ["$id"] = "5506", + ["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5507", + ["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -837,26 +837,26 @@ QueryConfig body = new QueryConfig ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5598", + ["$id"] = "6714", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5600", + ["$id"] = "6716", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { - ["$id"] = "5592", + ["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5593", + ["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -916,22 +916,22 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { - ["$id"] = "5678", + ["$id"] = "6794", ["createTime"] = new Dictionary { - ["$id"] = "5679", + ["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { - ["$id"] = "5680", + ["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -951,32 +951,32 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { - ["$id"] = "5714", + ["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5715", + ["$id"] = "6831", ["not"] = new Dictionary { - ["$id"] = "5716", + ["$id"] = "6832", ["or"] = new object[] { new Dictionary { - ["$id"] = "5717", + ["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { - ["$id"] = "5718", + ["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -986,10 +986,10 @@ QueryConfig body = new QueryConfig }, new Dictionary { - ["$id"] = "5719", + ["$id"] = "6835", ["not"] = new Dictionary { - ["$id"] = "5720", + ["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -1022,23 +1022,23 @@ QueryConfig body = new QueryConfig Limit = 3, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { - ["$id"] = "5775", + ["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { - ["$id"] = "5776", + ["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { - ["$id"] = "5777", + ["$id"] = "6893", ["termGuid"] = "" } } @@ -1057,12 +1057,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { - ["$id"] = "5811", + ["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -1086,26 +1086,26 @@ QueryConfig body = new QueryConfig Limit = 10, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4604", + ["$id"] = "5720", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4606", + ["$id"] = "5722", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { - ["$id"] = "4599", + ["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "4600", + ["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -1165,17 +1165,17 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { - ["$id"] = "4684", + ["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4685", + ["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -1196,36 +1196,36 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { - ["$id"] = "4737", + ["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4738", + ["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { - ["$id"] = "4739", + ["$id"] = "5855", ["or"] = new object[] { new Dictionary { - ["$id"] = "4740", + ["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4741", + ["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -1248,142 +1248,142 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { - ["$id"] = "4795", + ["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { - ["$id"] = "4796", + ["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { - ["$id"] = "4797", + ["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { - ["$id"] = "4798", + ["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { - ["$id"] = "4799", + ["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { - ["$id"] = "4800", + ["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { - ["$id"] = "4801", + ["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { - ["$id"] = "4802", + ["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { - ["$id"] = "4803", + ["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { - ["$id"] = "4804", + ["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { - ["$id"] = "4805", + ["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { - ["$id"] = "4806", + ["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { - ["$id"] = "4807", + ["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { - ["$id"] = "4808", + ["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { - ["$id"] = "4809", + ["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { - ["$id"] = "4810", + ["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { - ["$id"] = "4811", + ["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { - ["$id"] = "4812", + ["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { - ["$id"] = "4813", + ["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { - ["$id"] = "4814", + ["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { - ["$id"] = "4815", + ["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { - ["$id"] = "4816", + ["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { - ["$id"] = "4817", + ["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { - ["$id"] = "4818", + ["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { - ["$id"] = "4819", + ["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { - ["$id"] = "4820", + ["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { - ["$id"] = "4821", + ["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -1402,26 +1402,26 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { - ["$id"] = "4864", + ["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4865", + ["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { - ["$id"] = "4866", + ["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1442,33 +1442,33 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { - ["$id"] = "4929", + ["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { - ["$id"] = "4930", + ["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { - ["$id"] = "4931", + ["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { - ["$id"] = "4932", + ["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1489,7 +1489,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }), @@ -1507,7 +1507,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }), }; @@ -1524,7 +1524,7 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }), Facets = {new SearchFacetItem @@ -1558,12 +1558,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { - ["$id"] = "5185", + ["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -1583,27 +1583,27 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { - ["$id"] = "5229", + ["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5230", + ["$id"] = "6346", ["or"] = new object[] { new Dictionary { - ["$id"] = "5231", + ["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { - ["$id"] = "5232", + ["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -1641,12 +1641,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { - ["$id"] = "5301", + ["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -1665,10 +1665,10 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }), @@ -1686,47 +1686,47 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { - ["$id"] = "5373", + ["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { - ["$id"] = "5374", + ["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { - ["$id"] = "5375", + ["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5376", + ["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { - ["$id"] = "5377", + ["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5378", + ["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { - ["$id"] = "5379", + ["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { - ["$id"] = "5380", + ["$id"] = "6496", ["objectType"] = "Tables" } } @@ -1747,26 +1747,26 @@ QueryConfig body = new QueryConfig ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5425", + ["$id"] = "6541", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5427", + ["$id"] = "6543", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { - ["$id"] = "5419", + ["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5420", + ["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -1827,26 +1827,26 @@ QueryConfig body = new QueryConfig Limit = 2, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5511", + ["$id"] = "6627", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5513", + ["$id"] = "6629", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { - ["$id"] = "5506", + ["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5507", + ["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -1908,26 +1908,26 @@ QueryConfig body = new QueryConfig ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5598", + ["$id"] = "6714", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5600", + ["$id"] = "6716", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { - ["$id"] = "5592", + ["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5593", + ["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -1987,22 +1987,22 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { - ["$id"] = "5678", + ["$id"] = "6794", ["createTime"] = new Dictionary { - ["$id"] = "5679", + ["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { - ["$id"] = "5680", + ["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -2022,32 +2022,32 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { - ["$id"] = "5714", + ["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5715", + ["$id"] = "6831", ["not"] = new Dictionary { - ["$id"] = "5716", + ["$id"] = "6832", ["or"] = new object[] { new Dictionary { - ["$id"] = "5717", + ["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { - ["$id"] = "5718", + ["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -2057,10 +2057,10 @@ QueryConfig body = new QueryConfig }, new Dictionary { - ["$id"] = "5719", + ["$id"] = "6835", ["not"] = new Dictionary { - ["$id"] = "5720", + ["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -2093,23 +2093,23 @@ QueryConfig body = new QueryConfig Limit = 3, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { - ["$id"] = "5775", + ["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { - ["$id"] = "5776", + ["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { - ["$id"] = "5777", + ["$id"] = "6893", ["termGuid"] = "" } } @@ -2128,12 +2128,12 @@ QueryConfig body = new QueryConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { - ["$id"] = "5811", + ["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -2156,17 +2156,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { - ["$id"] = "4599", + ["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "4600", + ["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -2176,12 +2176,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "4604", + ["$id"] = "5720", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "4606", + ["$id"] = "5722", ["updateTime"] = "DESC" } }, @@ -2250,17 +2250,17 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { - ["$id"] = "4684", + ["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4685", + ["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -2284,36 +2284,36 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { - ["$id"] = "4737", + ["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4738", + ["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { - ["$id"] = "4739", + ["$id"] = "5855", ["or"] = new object[] { new Dictionary { - ["$id"] = "4740", + ["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4741", + ["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -2339,142 +2339,142 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { - ["$id"] = "4795", + ["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { - ["$id"] = "4796", + ["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { - ["$id"] = "4797", + ["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { - ["$id"] = "4798", + ["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { - ["$id"] = "4799", + ["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { - ["$id"] = "4800", + ["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { - ["$id"] = "4801", + ["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { - ["$id"] = "4802", + ["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { - ["$id"] = "4803", + ["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { - ["$id"] = "4804", + ["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { - ["$id"] = "4805", + ["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { - ["$id"] = "4806", + ["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { - ["$id"] = "4807", + ["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { - ["$id"] = "4808", + ["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { - ["$id"] = "4809", + ["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { - ["$id"] = "4810", + ["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { - ["$id"] = "4811", + ["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { - ["$id"] = "4812", + ["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { - ["$id"] = "4813", + ["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { - ["$id"] = "4814", + ["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { - ["$id"] = "4815", + ["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { - ["$id"] = "4816", + ["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { - ["$id"] = "4817", + ["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { - ["$id"] = "4818", + ["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { - ["$id"] = "4819", + ["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { - ["$id"] = "4820", + ["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { - ["$id"] = "4821", + ["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -2496,26 +2496,26 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { - ["$id"] = "4864", + ["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4865", + ["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { - ["$id"] = "4866", + ["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -2539,33 +2539,33 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { - ["$id"] = "4929", + ["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { - ["$id"] = "4930", + ["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { - ["$id"] = "4931", + ["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { - ["$id"] = "4932", + ["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -2589,7 +2589,7 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }, @@ -2610,7 +2610,7 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }, }); @@ -2629,7 +2629,7 @@ using RequestContent content = RequestContent.Create(new { filter = new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }, limit = 10, @@ -2673,12 +2673,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { - ["$id"] = "5185", + ["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -2701,27 +2701,27 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { - ["$id"] = "5229", + ["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5230", + ["$id"] = "6346", ["or"] = new object[] { new Dictionary { - ["$id"] = "5231", + ["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { - ["$id"] = "5232", + ["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -2766,12 +2766,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { - ["$id"] = "5301", + ["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -2793,10 +2793,10 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }, @@ -2817,47 +2817,47 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { - ["$id"] = "5373", + ["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { - ["$id"] = "5374", + ["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { - ["$id"] = "5375", + ["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5376", + ["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { - ["$id"] = "5377", + ["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5378", + ["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { - ["$id"] = "5379", + ["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { - ["$id"] = "5380", + ["$id"] = "6496", ["objectType"] = "Tables" } } @@ -2879,17 +2879,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { - ["$id"] = "5419", + ["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5420", + ["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -2900,12 +2900,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5425", + ["$id"] = "6541", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5427", + ["$id"] = "6543", ["updateTime"] = "DESC" } }, @@ -2974,17 +2974,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { - ["$id"] = "5506", + ["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5507", + ["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -2994,12 +2994,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5511", + ["$id"] = "6627", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5513", + ["$id"] = "6629", ["updateTime"] = "DESC" } }, @@ -3068,17 +3068,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { - ["$id"] = "5592", + ["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5593", + ["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -3089,12 +3089,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5598", + ["$id"] = "6714", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5600", + ["$id"] = "6716", ["updateTime"] = "DESC" } }, @@ -3163,22 +3163,22 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { - ["$id"] = "5678", + ["$id"] = "6794", ["createTime"] = new Dictionary { - ["$id"] = "5679", + ["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { - ["$id"] = "5680", + ["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -3200,32 +3200,32 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { - ["$id"] = "5714", + ["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5715", + ["$id"] = "6831", ["not"] = new Dictionary { - ["$id"] = "5716", + ["$id"] = "6832", ["or"] = new object[] { new Dictionary { - ["$id"] = "5717", + ["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { - ["$id"] = "5718", + ["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -3235,10 +3235,10 @@ using RequestContent content = RequestContent.Create(new }, new Dictionary { - ["$id"] = "5719", + ["$id"] = "6835", ["not"] = new Dictionary { - ["$id"] = "5720", + ["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -3278,23 +3278,23 @@ using RequestContent content = RequestContent.Create(new limit = 3, filter = new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { - ["$id"] = "5775", + ["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { - ["$id"] = "5776", + ["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { - ["$id"] = "5777", + ["$id"] = "6893", ["termGuid"] = "" } } @@ -3316,12 +3316,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { - ["$id"] = "5811", + ["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -3347,17 +3347,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { - ["$id"] = "4599", + ["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "4600", + ["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -3367,12 +3367,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "4604", + ["$id"] = "5720", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "4606", + ["$id"] = "5722", ["updateTime"] = "DESC" } }, @@ -3441,17 +3441,17 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { - ["$id"] = "4684", + ["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4685", + ["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -3475,36 +3475,36 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { - ["$id"] = "4737", + ["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { - ["$id"] = "4738", + ["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { - ["$id"] = "4739", + ["$id"] = "5855", ["or"] = new object[] { new Dictionary { - ["$id"] = "4740", + ["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4741", + ["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -3530,142 +3530,142 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { - ["$id"] = "4795", + ["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { - ["$id"] = "4796", + ["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { - ["$id"] = "4797", + ["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { - ["$id"] = "4798", + ["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { - ["$id"] = "4799", + ["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { - ["$id"] = "4800", + ["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { - ["$id"] = "4801", + ["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { - ["$id"] = "4802", + ["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { - ["$id"] = "4803", + ["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { - ["$id"] = "4804", + ["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { - ["$id"] = "4805", + ["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { - ["$id"] = "4806", + ["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { - ["$id"] = "4807", + ["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { - ["$id"] = "4808", + ["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { - ["$id"] = "4809", + ["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { - ["$id"] = "4810", + ["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { - ["$id"] = "4811", + ["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { - ["$id"] = "4812", + ["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { - ["$id"] = "4813", + ["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { - ["$id"] = "4814", + ["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { - ["$id"] = "4815", + ["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { - ["$id"] = "4816", + ["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { - ["$id"] = "4817", + ["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { - ["$id"] = "4818", + ["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { - ["$id"] = "4819", + ["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { - ["$id"] = "4820", + ["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { - ["$id"] = "4821", + ["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -3687,26 +3687,26 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { - ["$id"] = "4864", + ["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { - ["$id"] = "4865", + ["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { - ["$id"] = "4866", + ["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -3730,33 +3730,33 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { - ["$id"] = "4929", + ["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { - ["$id"] = "4930", + ["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { - ["$id"] = "4931", + ["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { - ["$id"] = "4932", + ["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -3780,7 +3780,7 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }, @@ -3801,7 +3801,7 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }, }); @@ -3820,7 +3820,7 @@ using RequestContent content = RequestContent.Create(new { filter = new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }, limit = 10, @@ -3864,12 +3864,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { - ["$id"] = "5185", + ["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -3892,27 +3892,27 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { - ["$id"] = "5229", + ["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5230", + ["$id"] = "6346", ["or"] = new object[] { new Dictionary { - ["$id"] = "5231", + ["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { - ["$id"] = "5232", + ["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -3957,12 +3957,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { - ["$id"] = "5301", + ["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -3984,10 +3984,10 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }, @@ -4008,47 +4008,47 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { - ["$id"] = "5373", + ["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { - ["$id"] = "5374", + ["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { - ["$id"] = "5375", + ["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5376", + ["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { - ["$id"] = "5377", + ["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { - ["$id"] = "5378", + ["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { - ["$id"] = "5379", + ["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { - ["$id"] = "5380", + ["$id"] = "6496", ["objectType"] = "Tables" } } @@ -4070,17 +4070,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { - ["$id"] = "5419", + ["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5420", + ["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -4091,12 +4091,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5425", + ["$id"] = "6541", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5427", + ["$id"] = "6543", ["updateTime"] = "DESC" } }, @@ -4165,17 +4165,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { - ["$id"] = "5506", + ["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5507", + ["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -4185,12 +4185,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5511", + ["$id"] = "6627", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5513", + ["$id"] = "6629", ["updateTime"] = "DESC" } }, @@ -4259,17 +4259,17 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { - ["$id"] = "5592", + ["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5593", + ["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -4280,12 +4280,12 @@ using RequestContent content = RequestContent.Create(new { new Dictionary { - ["$id"] = "5598", + ["$id"] = "6714", ["name"] = "ASC" }, new Dictionary { - ["$id"] = "5600", + ["$id"] = "6716", ["updateTime"] = "DESC" } }, @@ -4354,22 +4354,22 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { - ["$id"] = "5678", + ["$id"] = "6794", ["createTime"] = new Dictionary { - ["$id"] = "5679", + ["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { - ["$id"] = "5680", + ["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -4391,32 +4391,32 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { - ["$id"] = "5714", + ["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { - ["$id"] = "5715", + ["$id"] = "6831", ["not"] = new Dictionary { - ["$id"] = "5716", + ["$id"] = "6832", ["or"] = new object[] { new Dictionary { - ["$id"] = "5717", + ["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { - ["$id"] = "5718", + ["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -4426,10 +4426,10 @@ using RequestContent content = RequestContent.Create(new }, new Dictionary { - ["$id"] = "5719", + ["$id"] = "6835", ["not"] = new Dictionary { - ["$id"] = "5720", + ["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -4469,23 +4469,23 @@ using RequestContent content = RequestContent.Create(new limit = 3, filter = new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { - ["$id"] = "5775", + ["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { - ["$id"] = "5776", + ["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { - ["$id"] = "5777", + ["$id"] = "6893", ["termGuid"] = "" } } @@ -4507,12 +4507,12 @@ using RequestContent content = RequestContent.Create(new limit = 10, filter = new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { - ["$id"] = "5811", + ["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4539,12 +4539,12 @@ SuggestConfig body = new SuggestConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { - ["$id"] = "5868", + ["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4568,12 +4568,12 @@ SuggestConfig body = new SuggestConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { - ["$id"] = "5868", + ["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4596,12 +4596,12 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { - ["$id"] = "5868", + ["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4628,12 +4628,12 @@ using RequestContent content = RequestContent.Create(new keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { - ["$id"] = "5868", + ["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4661,12 +4661,12 @@ AutoCompleteConfig body = new AutoCompleteConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { - ["$id"] = "5923", + ["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4690,12 +4690,12 @@ AutoCompleteConfig body = new AutoCompleteConfig Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { - ["$id"] = "5923", + ["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4718,12 +4718,12 @@ using RequestContent content = RequestContent.Create(new keywords = "exa", filter = new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { - ["$id"] = "5923", + ["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4750,12 +4750,12 @@ using RequestContent content = RequestContent.Create(new keywords = "exa", filter = new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { - ["$id"] = "5923", + ["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/tests/Generated/Samples/Samples_Discovery.cs b/sdk/purview/Azure.Analytics.Purview.DataMap/tests/Generated/Samples/Samples_Discovery.cs index 2366b0149cdd..0419cee60199 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/tests/Generated/Samples/Samples_Discovery.cs +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/tests/Generated/Samples/Samples_Discovery.cs @@ -30,17 +30,17 @@ public void Example_Discovery_Query_DiscoveryQuery() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { -["$id"] = "4599", +["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "4600", +["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -50,12 +50,12 @@ public void Example_Discovery_Query_DiscoveryQuery() { new Dictionary { -["$id"] = "4604", +["$id"] = "5720", ["name"] = "ASC" }, new Dictionary { -["$id"] = "4606", +["$id"] = "5722", ["updateTime"] = "DESC" } }, @@ -127,17 +127,17 @@ public async Task Example_Discovery_Query_DiscoveryQuery_Async() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { -["$id"] = "4599", +["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "4600", +["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -147,12 +147,12 @@ public async Task Example_Discovery_Query_DiscoveryQuery_Async() { new Dictionary { -["$id"] = "4604", +["$id"] = "5720", ["name"] = "ASC" }, new Dictionary { -["$id"] = "4606", +["$id"] = "5722", ["updateTime"] = "DESC" } }, @@ -225,26 +225,26 @@ public void Example_Discovery_Query_DiscoveryQuery_Convenience() Limit = 10, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "4604", +["$id"] = "5720", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "4606", +["$id"] = "5722", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { -["$id"] = "4599", +["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "4600", +["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -308,26 +308,26 @@ public async Task Example_Discovery_Query_DiscoveryQuery_Convenience_Async() Limit = 10, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "4604", +["$id"] = "5720", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "4606", +["$id"] = "5722", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4598", + ["$id"] = "5714", ["and"] = new object[] { new Dictionary { -["$id"] = "4599", +["$id"] = "5715", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "4600", +["$id"] = "5716", ["entityType"] = "azure_blob_path" } } @@ -390,17 +390,17 @@ public void Example_Discovery_Query_DiscoveryQueryAnd() limit = 10, filter = new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { -["$id"] = "4684", +["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4685", +["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -427,17 +427,17 @@ public async Task Example_Discovery_Query_DiscoveryQueryAnd_Async() limit = 10, filter = new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { -["$id"] = "4684", +["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4685", +["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -464,17 +464,17 @@ public void Example_Discovery_Query_DiscoveryQueryAnd_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { -["$id"] = "4684", +["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4685", +["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -498,17 +498,17 @@ public async Task Example_Discovery_Query_DiscoveryQueryAnd_Convenience_Async() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4683", + ["$id"] = "5799", ["and"] = new object[] { new Dictionary { -["$id"] = "4684", +["$id"] = "5800", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4685", +["$id"] = "5801", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" @@ -532,36 +532,36 @@ public void Example_Discovery_Query_DiscoveryQueryAndOrNested() limit = 10, filter = new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { -["$id"] = "4737", +["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4738", +["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { -["$id"] = "4739", +["$id"] = "5855", ["or"] = new object[] { new Dictionary { -["$id"] = "4740", +["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4741", +["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -590,36 +590,36 @@ public async Task Example_Discovery_Query_DiscoveryQueryAndOrNested_Async() limit = 10, filter = new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { -["$id"] = "4737", +["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4738", +["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { -["$id"] = "4739", +["$id"] = "5855", ["or"] = new object[] { new Dictionary { -["$id"] = "4740", +["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4741", +["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -648,36 +648,36 @@ public void Example_Discovery_Query_DiscoveryQueryAndOrNested_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { -["$id"] = "4737", +["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4738", +["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { -["$id"] = "4739", +["$id"] = "5855", ["or"] = new object[] { new Dictionary { -["$id"] = "4740", +["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4741", +["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -703,36 +703,36 @@ public async Task Example_Discovery_Query_DiscoveryQueryAndOrNested_Convenience_ Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4736", + ["$id"] = "5852", ["and"] = new object[] { new Dictionary { -["$id"] = "4737", +["$id"] = "5853", ["entityType"] = "azure_blob_path" }, new Dictionary { -["$id"] = "4738", +["$id"] = "5854", ["attributeName"] = "qualifiedName", ["operator"] = "contains", ["attributeValue"] = ".csv" }, new Dictionary { -["$id"] = "4739", +["$id"] = "5855", ["or"] = new object[] { new Dictionary { -["$id"] = "4740", +["$id"] = "5856", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4741", +["$id"] = "5857", ["attributeName"] = "qualifiedName", ["operator"] = "prefix", ["attributeValue"] = "https://" @@ -758,142 +758,142 @@ public void Example_Discovery_Query_DiscoveryQueryAssetType() limit = 10, filter = new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { -["$id"] = "4795", +["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { -["$id"] = "4796", +["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { -["$id"] = "4797", +["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { -["$id"] = "4798", +["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { -["$id"] = "4799", +["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { -["$id"] = "4800", +["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { -["$id"] = "4801", +["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { -["$id"] = "4802", +["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { -["$id"] = "4803", +["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { -["$id"] = "4804", +["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { -["$id"] = "4805", +["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { -["$id"] = "4806", +["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { -["$id"] = "4807", +["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { -["$id"] = "4808", +["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { -["$id"] = "4809", +["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { -["$id"] = "4810", +["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { -["$id"] = "4811", +["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { -["$id"] = "4812", +["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { -["$id"] = "4813", +["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { -["$id"] = "4814", +["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { -["$id"] = "4815", +["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { -["$id"] = "4816", +["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { -["$id"] = "4817", +["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { -["$id"] = "4818", +["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { -["$id"] = "4819", +["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { -["$id"] = "4820", +["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { -["$id"] = "4821", +["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -918,142 +918,142 @@ public async Task Example_Discovery_Query_DiscoveryQueryAssetType_Async() limit = 10, filter = new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { -["$id"] = "4795", +["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { -["$id"] = "4796", +["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { -["$id"] = "4797", +["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { -["$id"] = "4798", +["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { -["$id"] = "4799", +["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { -["$id"] = "4800", +["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { -["$id"] = "4801", +["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { -["$id"] = "4802", +["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { -["$id"] = "4803", +["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { -["$id"] = "4804", +["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { -["$id"] = "4805", +["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { -["$id"] = "4806", +["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { -["$id"] = "4807", +["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { -["$id"] = "4808", +["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { -["$id"] = "4809", +["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { -["$id"] = "4810", +["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { -["$id"] = "4811", +["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { -["$id"] = "4812", +["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { -["$id"] = "4813", +["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { -["$id"] = "4814", +["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { -["$id"] = "4815", +["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { -["$id"] = "4816", +["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { -["$id"] = "4817", +["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { -["$id"] = "4818", +["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { -["$id"] = "4819", +["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { -["$id"] = "4820", +["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { -["$id"] = "4821", +["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -1078,142 +1078,142 @@ public void Example_Discovery_Query_DiscoveryQueryAssetType_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { -["$id"] = "4795", +["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { -["$id"] = "4796", +["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { -["$id"] = "4797", +["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { -["$id"] = "4798", +["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { -["$id"] = "4799", +["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { -["$id"] = "4800", +["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { -["$id"] = "4801", +["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { -["$id"] = "4802", +["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { -["$id"] = "4803", +["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { -["$id"] = "4804", +["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { -["$id"] = "4805", +["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { -["$id"] = "4806", +["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { -["$id"] = "4807", +["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { -["$id"] = "4808", +["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { -["$id"] = "4809", +["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { -["$id"] = "4810", +["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { -["$id"] = "4811", +["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { -["$id"] = "4812", +["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { -["$id"] = "4813", +["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { -["$id"] = "4814", +["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { -["$id"] = "4815", +["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { -["$id"] = "4816", +["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { -["$id"] = "4817", +["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { -["$id"] = "4818", +["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { -["$id"] = "4819", +["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { -["$id"] = "4820", +["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { -["$id"] = "4821", +["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -1235,142 +1235,142 @@ public async Task Example_Discovery_Query_DiscoveryQueryAssetType_Convenience_As Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4794", + ["$id"] = "5910", ["or"] = new object[] { new Dictionary { -["$id"] = "4795", +["$id"] = "5911", ["assetType"] = "SQL Server" }, new Dictionary { -["$id"] = "4796", +["$id"] = "5912", ["assetType"] = "Azure SQL Server" }, new Dictionary { -["$id"] = "4797", +["$id"] = "5913", ["assetType"] = "Azure SQL Database" }, new Dictionary { -["$id"] = "4798", +["$id"] = "5914", ["assetType"] = "Azure SQL Data Warehouse" }, new Dictionary { -["$id"] = "4799", +["$id"] = "5915", ["assetType"] = "Azure SQL Managed Instance" }, new Dictionary { -["$id"] = "4800", +["$id"] = "5916", ["assetType"] = "Azure Storage Account" }, new Dictionary { -["$id"] = "4801", +["$id"] = "5917", ["assetType"] = "Azure Blob Storage" }, new Dictionary { -["$id"] = "4802", +["$id"] = "5918", ["assetType"] = "Azure Files" }, new Dictionary { -["$id"] = "4803", +["$id"] = "5919", ["assetType"] = "Azure Table Storage" }, new Dictionary { -["$id"] = "4804", +["$id"] = "5920", ["assetType"] = "Azure Data Lake Storage Gen1" }, new Dictionary { -["$id"] = "4805", +["$id"] = "5921", ["assetType"] = "Azure Data Lake Storage Gen2" }, new Dictionary { -["$id"] = "4806", +["$id"] = "5922", ["assetType"] = "Azure Cosmos DB" }, new Dictionary { -["$id"] = "4807", +["$id"] = "5923", ["assetType"] = "Azure Data Factory" }, new Dictionary { -["$id"] = "4808", +["$id"] = "5924", ["assetType"] = "Azure Cognitive Search" }, new Dictionary { -["$id"] = "4809", +["$id"] = "5925", ["assetType"] = "Power BI" }, new Dictionary { -["$id"] = "4810", +["$id"] = "5926", ["assetType"] = "Azure Data Explorer" }, new Dictionary { -["$id"] = "4811", +["$id"] = "5927", ["assetType"] = "Amazon S3" }, new Dictionary { -["$id"] = "4812", +["$id"] = "5928", ["assetType"] = "Azure Data Share" }, new Dictionary { -["$id"] = "4813", +["$id"] = "5929", ["assetType"] = "Teradata" }, new Dictionary { -["$id"] = "4814", +["$id"] = "5930", ["assetType"] = "SAP S4HANA" }, new Dictionary { -["$id"] = "4815", +["$id"] = "5931", ["assetType"] = "SAP ECC" }, new Dictionary { -["$id"] = "4816", +["$id"] = "5932", ["assetType"] = "SQL Server Integration Services" }, new Dictionary { -["$id"] = "4817", +["$id"] = "5933", ["assetType"] = "hive" }, new Dictionary { -["$id"] = "4818", +["$id"] = "5934", ["assetType"] = "Azure Database for MySQL" }, new Dictionary { -["$id"] = "4819", +["$id"] = "5935", ["assetType"] = "Azure Database for MariaDB" }, new Dictionary { -["$id"] = "4820", +["$id"] = "5936", ["assetType"] = "Azure Database for PostgreSQL" }, new Dictionary { -["$id"] = "4821", +["$id"] = "5937", ["assetType"] = "Azure Synapse Analytics" } } @@ -1392,26 +1392,26 @@ public void Example_Discovery_Query_DiscoveryQueryAttribute() limit = 10, filter = new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { -["$id"] = "4864", +["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4865", +["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { -["$id"] = "4866", +["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1438,26 +1438,26 @@ public async Task Example_Discovery_Query_DiscoveryQueryAttribute_Async() limit = 10, filter = new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { -["$id"] = "4864", +["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4865", +["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { -["$id"] = "4866", +["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1484,26 +1484,26 @@ public void Example_Discovery_Query_DiscoveryQueryAttribute_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { -["$id"] = "4864", +["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4865", +["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { -["$id"] = "4866", +["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1527,26 +1527,26 @@ public async Task Example_Discovery_Query_DiscoveryQueryAttribute_Convenience_As Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4863", + ["$id"] = "5979", ["or"] = new object[] { new Dictionary { -["$id"] = "4864", +["$id"] = "5980", ["attributeName"] = "name", ["operator"] = "eq", ["attributeValue"] = "exampledata.csv" }, new Dictionary { -["$id"] = "4865", +["$id"] = "5981", ["attributeName"] = "createTime", ["operator"] = "ge", ["attributeValue"] = 1545580800000L }, new Dictionary { -["$id"] = "4866", +["$id"] = "5982", ["attributeName"] = "modifiedTime", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1570,33 +1570,33 @@ public void Example_Discovery_Query_DiscoveryQueryBusinessMetadataAttribute() limit = 10, filter = new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { -["$id"] = "4929", +["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { -["$id"] = "4930", +["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { -["$id"] = "4931", +["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { -["$id"] = "4932", +["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1623,33 +1623,33 @@ public async Task Example_Discovery_Query_DiscoveryQueryBusinessMetadataAttribut limit = 10, filter = new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { -["$id"] = "4929", +["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { -["$id"] = "4930", +["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { -["$id"] = "4931", +["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { -["$id"] = "4932", +["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1676,33 +1676,33 @@ public void Example_Discovery_Query_DiscoveryQueryBusinessMetadataAttribute_Conv Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { -["$id"] = "4929", +["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { -["$id"] = "4930", +["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { -["$id"] = "4931", +["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { -["$id"] = "4932", +["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1726,33 +1726,33 @@ public async Task Example_Discovery_Query_DiscoveryQueryBusinessMetadataAttribut Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4928", + ["$id"] = "6044", ["or"] = new object[] { new Dictionary { -["$id"] = "4929", +["$id"] = "6045", ["attributeName"] = ".", ["operator"] = "eq|ne|contains|prefix", ["attributeValue"] = "string value" }, new Dictionary { -["$id"] = "4930", +["$id"] = "6046", ["attributeName"] = ".", ["operator"] = "eq|ne|gt|ge|lt|le", ["attributeValue"] = 123 }, new Dictionary { -["$id"] = "4931", +["$id"] = "6047", ["attributeName"] = ".", ["operator"] = "eq|ne", ["attributeValue"] = true }, new Dictionary { -["$id"] = "4932", +["$id"] = "6048", ["attributeName"] = ".", ["operator"] = "timerange", ["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" @@ -1776,7 +1776,7 @@ public void Example_Discovery_Query_DiscoveryQueryClassification() limit = 10, filter = new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }, @@ -1800,7 +1800,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryClassification_Async() limit = 10, filter = new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }, @@ -1824,7 +1824,7 @@ public void Example_Discovery_Query_DiscoveryQueryClassification_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }), @@ -1845,7 +1845,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryClassification_Convenien Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "4955", + ["$id"] = "6071", ["classification"] = "MICROSOFT.PERSONAL.EMAIL", ["includeSubClassifications"] = true }), @@ -1866,7 +1866,7 @@ public void Example_Discovery_Query_DiscoveryQueryCollection() limit = 10, filter = new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }, }); @@ -1889,7 +1889,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryCollection_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }, }); @@ -1912,7 +1912,7 @@ public void Example_Discovery_Query_DiscoveryQueryCollection_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }), }; @@ -1932,7 +1932,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryCollection_Convenience_A Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5005", + ["$id"] = "6121", ["collectionId"] = "collectionName" }), }; @@ -1951,7 +1951,7 @@ public void Example_Discovery_Query_DiscoveryQueryFacet() { filter = new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }, limit = 10, @@ -1997,7 +1997,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryFacet_Async() { filter = new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }, limit = 10, @@ -2044,7 +2044,7 @@ public void Example_Discovery_Query_DiscoveryQueryFacet_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }), Facets = {new SearchFacetItem @@ -2081,7 +2081,7 @@ public async Task Example_Discovery_Query_DiscoveryQueryFacet_Convenience_Async( Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5054", + ["$id"] = "6170", ["objectType"] = "Tables" }), Facets = {new SearchFacetItem @@ -2118,12 +2118,12 @@ public void Example_Discovery_Query_DiscoveryQueryFileExtension() limit = 10, filter = new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { -["$id"] = "5185", +["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -2148,12 +2148,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryFileExtension_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { -["$id"] = "5185", +["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -2178,12 +2178,12 @@ public void Example_Discovery_Query_DiscoveryQueryFileExtension_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { -["$id"] = "5185", +["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -2205,12 +2205,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryFileExtension_Convenienc Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5184", + ["$id"] = "6300", ["and"] = new object[] { new Dictionary { -["$id"] = "5185", +["$id"] = "6301", ["fileExtension"] = "txt" } } @@ -2233,27 +2233,27 @@ public void Example_Discovery_Query_DiscoveryQueryGlossaryTerm() limit = 10, filter = new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { -["$id"] = "5229", +["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5230", +["$id"] = "6346", ["or"] = new object[] { new Dictionary { -["$id"] = "5231", +["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { -["$id"] = "5232", +["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -2302,27 +2302,27 @@ public async Task Example_Discovery_Query_DiscoveryQueryGlossaryTerm_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { -["$id"] = "5229", +["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5230", +["$id"] = "6346", ["or"] = new object[] { new Dictionary { -["$id"] = "5231", +["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { -["$id"] = "5232", +["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -2371,27 +2371,27 @@ public void Example_Discovery_Query_DiscoveryQueryGlossaryTerm_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { -["$id"] = "5229", +["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5230", +["$id"] = "6346", ["or"] = new object[] { new Dictionary { -["$id"] = "5231", +["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { -["$id"] = "5232", +["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -2433,27 +2433,27 @@ public async Task Example_Discovery_Query_DiscoveryQueryGlossaryTerm_Convenience Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5228", + ["$id"] = "6344", ["and"] = new object[] { new Dictionary { -["$id"] = "5229", +["$id"] = "6345", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5230", +["$id"] = "6346", ["or"] = new object[] { new Dictionary { -["$id"] = "5231", +["$id"] = "6347", ["glossaryType"] = "AtlasGlossary" }, new Dictionary { -["$id"] = "5232", +["$id"] = "6348", ["glossaryType"] = "AtlasGlossaryTerm" } } @@ -2494,12 +2494,12 @@ public void Example_Discovery_Query_DiscoveryQueryId() limit = 10, filter = new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { -["$id"] = "5301", +["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -2524,12 +2524,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryId_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { -["$id"] = "5301", +["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -2554,12 +2554,12 @@ public void Example_Discovery_Query_DiscoveryQueryId_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { -["$id"] = "5301", +["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -2581,12 +2581,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryId_Convenience_Async() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5300", + ["$id"] = "6416", ["and"] = new object[] { new Dictionary { -["$id"] = "5301", +["$id"] = "6417", ["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9" } } @@ -2608,10 +2608,10 @@ public void Example_Discovery_Query_DiscoveryQueryNot() limit = 10, filter = new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }, @@ -2635,10 +2635,10 @@ public async Task Example_Discovery_Query_DiscoveryQueryNot_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }, @@ -2662,10 +2662,10 @@ public void Example_Discovery_Query_DiscoveryQueryNot_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }), @@ -2686,10 +2686,10 @@ public async Task Example_Discovery_Query_DiscoveryQueryNot_Convenience_Async() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5329", + ["$id"] = "6445", ["not"] = new Dictionary { - ["$id"] = "5330", + ["$id"] = "6446", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } }), @@ -2710,47 +2710,47 @@ public void Example_Discovery_Query_DiscoveryQueryObjectType() limit = 10, filter = new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { -["$id"] = "5373", +["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { -["$id"] = "5374", +["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { -["$id"] = "5375", +["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5376", +["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { -["$id"] = "5377", +["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5378", +["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { -["$id"] = "5379", +["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { -["$id"] = "5380", +["$id"] = "6496", ["objectType"] = "Tables" } } @@ -2775,47 +2775,47 @@ public async Task Example_Discovery_Query_DiscoveryQueryObjectType_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { -["$id"] = "5373", +["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { -["$id"] = "5374", +["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { -["$id"] = "5375", +["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5376", +["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { -["$id"] = "5377", +["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5378", +["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { -["$id"] = "5379", +["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { -["$id"] = "5380", +["$id"] = "6496", ["objectType"] = "Tables" } } @@ -2840,47 +2840,47 @@ public void Example_Discovery_Query_DiscoveryQueryObjectType_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { -["$id"] = "5373", +["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { -["$id"] = "5374", +["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { -["$id"] = "5375", +["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5376", +["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { -["$id"] = "5377", +["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5378", +["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { -["$id"] = "5379", +["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { -["$id"] = "5380", +["$id"] = "6496", ["objectType"] = "Tables" } } @@ -2902,47 +2902,47 @@ public async Task Example_Discovery_Query_DiscoveryQueryObjectType_Convenience_A Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5372", + ["$id"] = "6488", ["or"] = new object[] { new Dictionary { -["$id"] = "5373", +["$id"] = "6489", ["objectType"] = "Dashboards" }, new Dictionary { -["$id"] = "5374", +["$id"] = "6490", ["objectType"] = "Data pipelines" }, new Dictionary { -["$id"] = "5375", +["$id"] = "6491", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5376", +["$id"] = "6492", ["objectType"] = "Folders" }, new Dictionary { -["$id"] = "5377", +["$id"] = "6493", ["objectType"] = "Glossary terms" }, new Dictionary { -["$id"] = "5378", +["$id"] = "6494", ["objectType"] = "Reports" }, new Dictionary { -["$id"] = "5379", +["$id"] = "6495", ["objectType"] = "Stored procedures" }, new Dictionary { -["$id"] = "5380", +["$id"] = "6496", ["objectType"] = "Tables" } } @@ -2964,17 +2964,17 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationContinuationPage() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { -["$id"] = "5419", +["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5420", +["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -2985,12 +2985,12 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationContinuationPage() { new Dictionary { -["$id"] = "5425", +["$id"] = "6541", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5427", +["$id"] = "6543", ["updateTime"] = "DESC" } }, @@ -3062,17 +3062,17 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationContinuationPa keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { -["$id"] = "5419", +["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5420", +["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -3083,12 +3083,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationContinuationPa { new Dictionary { -["$id"] = "5425", +["$id"] = "6541", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5427", +["$id"] = "6543", ["updateTime"] = "DESC" } }, @@ -3162,26 +3162,26 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationContinuationPage_Con ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5425", +["$id"] = "6541", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5427", +["$id"] = "6543", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { -["$id"] = "5419", +["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5420", +["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -3246,26 +3246,26 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationContinuationPa ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5425", +["$id"] = "6541", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5427", +["$id"] = "6543", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5418", + ["$id"] = "6534", ["and"] = new object[] { new Dictionary { -["$id"] = "5419", +["$id"] = "6535", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5420", +["$id"] = "6536", ["entityType"] = "azure_blob_path" } } @@ -3328,17 +3328,17 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationFirstPage() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { -["$id"] = "5506", +["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5507", +["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -3348,12 +3348,12 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationFirstPage() { new Dictionary { -["$id"] = "5511", +["$id"] = "6627", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5513", +["$id"] = "6629", ["updateTime"] = "DESC" } }, @@ -3425,17 +3425,17 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationFirstPage_Asyn keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { -["$id"] = "5506", +["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5507", +["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -3445,12 +3445,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationFirstPage_Asyn { new Dictionary { -["$id"] = "5511", +["$id"] = "6627", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5513", +["$id"] = "6629", ["updateTime"] = "DESC" } }, @@ -3523,26 +3523,26 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationFirstPage_Convenienc Limit = 2, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5511", +["$id"] = "6627", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5513", +["$id"] = "6629", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { -["$id"] = "5506", +["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5507", +["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -3606,26 +3606,26 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationFirstPage_Conv Limit = 2, Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5511", +["$id"] = "6627", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5513", +["$id"] = "6629", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5505", + ["$id"] = "6621", ["and"] = new object[] { new Dictionary { -["$id"] = "5506", +["$id"] = "6622", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5507", +["$id"] = "6623", ["entityType"] = "azure_blob_path" } } @@ -3688,17 +3688,17 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationLastPage() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { -["$id"] = "5592", +["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5593", +["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -3709,12 +3709,12 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationLastPage() { new Dictionary { -["$id"] = "5598", +["$id"] = "6714", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5600", +["$id"] = "6716", ["updateTime"] = "DESC" } }, @@ -3786,17 +3786,17 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationLastPage_Async keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { -["$id"] = "5592", +["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5593", +["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -3807,12 +3807,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationLastPage_Async { new Dictionary { -["$id"] = "5598", +["$id"] = "6714", ["name"] = "ASC" }, new Dictionary { -["$id"] = "5600", +["$id"] = "6716", ["updateTime"] = "DESC" } }, @@ -3886,26 +3886,26 @@ public void Example_Discovery_Query_DiscoveryQueryPaginationLastPage_Convenience ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5598", +["$id"] = "6714", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5600", +["$id"] = "6716", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { -["$id"] = "5592", +["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5593", +["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -3970,26 +3970,26 @@ public async Task Example_Discovery_Query_DiscoveryQueryPaginationLastPage_Conve ContinuationToken = "", Orderby = {BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5598", +["$id"] = "6714", ["name"] = "ASC" }), BinaryData.FromObjectAsJson(new Dictionary { -["$id"] = "5600", +["$id"] = "6716", ["updateTime"] = "DESC" })}, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5591", + ["$id"] = "6707", ["and"] = new object[] { new Dictionary { -["$id"] = "5592", +["$id"] = "6708", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5593", +["$id"] = "6709", ["entityType"] = "azure_blob_path" } } @@ -4052,22 +4052,22 @@ public void Example_Discovery_Query_DiscoveryQuerySystemTime() limit = 10, filter = new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { -["$id"] = "5678", +["$id"] = "6794", ["createTime"] = new Dictionary { -["$id"] = "5679", +["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { -["$id"] = "5680", +["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -4092,22 +4092,22 @@ public async Task Example_Discovery_Query_DiscoveryQuerySystemTime_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { -["$id"] = "5678", +["$id"] = "6794", ["createTime"] = new Dictionary { -["$id"] = "5679", +["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { -["$id"] = "5680", +["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -4132,22 +4132,22 @@ public void Example_Discovery_Query_DiscoveryQuerySystemTime_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { -["$id"] = "5678", +["$id"] = "6794", ["createTime"] = new Dictionary { -["$id"] = "5679", +["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { -["$id"] = "5680", +["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -4169,22 +4169,22 @@ public async Task Example_Discovery_Query_DiscoveryQuerySystemTime_Convenience_A Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5677", + ["$id"] = "6793", ["or"] = new object[] { new Dictionary { -["$id"] = "5678", +["$id"] = "6794", ["createTime"] = new Dictionary { -["$id"] = "5679", +["$id"] = "6795", ["operator"] = "lt", ["timeThreshold"] = 1545580800000L } }, new Dictionary { -["$id"] = "5680", +["$id"] = "6796", ["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D" } } @@ -4206,32 +4206,32 @@ public void Example_Discovery_Query_DiscoveryQueryTaxonomy() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { -["$id"] = "5714", +["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5715", +["$id"] = "6831", ["not"] = new Dictionary { -["$id"] = "5716", +["$id"] = "6832", ["or"] = new object[] { new Dictionary { -["$id"] = "5717", +["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { -["$id"] = "5718", +["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -4241,10 +4241,10 @@ public void Example_Discovery_Query_DiscoveryQueryTaxonomy() }, new Dictionary { -["$id"] = "5719", +["$id"] = "6835", ["not"] = new Dictionary { -["$id"] = "5720", +["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -4286,32 +4286,32 @@ public async Task Example_Discovery_Query_DiscoveryQueryTaxonomy_Async() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { -["$id"] = "5714", +["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5715", +["$id"] = "6831", ["not"] = new Dictionary { -["$id"] = "5716", +["$id"] = "6832", ["or"] = new object[] { new Dictionary { -["$id"] = "5717", +["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { -["$id"] = "5718", +["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -4321,10 +4321,10 @@ public async Task Example_Discovery_Query_DiscoveryQueryTaxonomy_Async() }, new Dictionary { -["$id"] = "5719", +["$id"] = "6835", ["not"] = new Dictionary { -["$id"] = "5720", +["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -4367,32 +4367,32 @@ public void Example_Discovery_Query_DiscoveryQueryTaxonomy_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { -["$id"] = "5714", +["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5715", +["$id"] = "6831", ["not"] = new Dictionary { -["$id"] = "5716", +["$id"] = "6832", ["or"] = new object[] { new Dictionary { -["$id"] = "5717", +["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { -["$id"] = "5718", +["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -4402,10 +4402,10 @@ public void Example_Discovery_Query_DiscoveryQueryTaxonomy_Convenience() }, new Dictionary { -["$id"] = "5719", +["$id"] = "6835", ["not"] = new Dictionary { -["$id"] = "5720", +["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -4441,32 +4441,32 @@ public async Task Example_Discovery_Query_DiscoveryQueryTaxonomy_Convenience_Asy Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5713", + ["$id"] = "6829", ["and"] = new object[] { new Dictionary { -["$id"] = "5714", +["$id"] = "6830", ["objectType"] = "Files" }, new Dictionary { -["$id"] = "5715", +["$id"] = "6831", ["not"] = new Dictionary { -["$id"] = "5716", +["$id"] = "6832", ["or"] = new object[] { new Dictionary { -["$id"] = "5717", +["$id"] = "6833", ["attributeName"] = "size", ["operator"] = "eq", ["attributeValue"] = 0 }, new Dictionary { -["$id"] = "5718", +["$id"] = "6834", ["attributeName"] = "fileSize", ["operator"] = "eq", ["attributeValue"] = 0 @@ -4476,10 +4476,10 @@ public async Task Example_Discovery_Query_DiscoveryQueryTaxonomy_Convenience_Asy }, new Dictionary { -["$id"] = "5719", +["$id"] = "6835", ["not"] = new Dictionary { -["$id"] = "5720", +["$id"] = "6836", ["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE" } } @@ -4515,23 +4515,23 @@ public void Example_Discovery_Query_DiscoveryQueryTermAssignment() limit = 3, filter = new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { -["$id"] = "5775", +["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { -["$id"] = "5776", +["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { -["$id"] = "5777", +["$id"] = "6893", ["termGuid"] = "" } } @@ -4557,23 +4557,23 @@ public async Task Example_Discovery_Query_DiscoveryQueryTermAssignment_Async() limit = 3, filter = new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { -["$id"] = "5775", +["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { -["$id"] = "5776", +["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { -["$id"] = "5777", +["$id"] = "6893", ["termGuid"] = "" } } @@ -4599,23 +4599,23 @@ public void Example_Discovery_Query_DiscoveryQueryTermAssignment_Convenience() Limit = 3, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { -["$id"] = "5775", +["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { -["$id"] = "5776", +["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { -["$id"] = "5777", +["$id"] = "6893", ["termGuid"] = "" } } @@ -4638,23 +4638,23 @@ public async Task Example_Discovery_Query_DiscoveryQueryTermAssignment_Convenien Limit = 3, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5774", + ["$id"] = "6890", ["or"] = new object[] { new Dictionary { -["$id"] = "5775", +["$id"] = "6891", ["term"] = "ExampleTerm" }, new Dictionary { -["$id"] = "5776", +["$id"] = "6892", ["term"] = "ExampleTerm", ["glossary"] = "GlossaryName" }, new Dictionary { -["$id"] = "5777", +["$id"] = "6893", ["termGuid"] = "" } } @@ -4676,12 +4676,12 @@ public void Example_Discovery_Query_DiscoveryQueryType() limit = 10, filter = new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { -["$id"] = "5811", +["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4707,12 +4707,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryType_Async() limit = 10, filter = new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { -["$id"] = "5811", +["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4738,12 +4738,12 @@ public void Example_Discovery_Query_DiscoveryQueryType_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { -["$id"] = "5811", +["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4766,12 +4766,12 @@ public async Task Example_Discovery_Query_DiscoveryQueryType_Convenience_Async() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5810", + ["$id"] = "6926", ["and"] = new object[] { new Dictionary { -["$id"] = "5811", +["$id"] = "6927", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4794,12 +4794,12 @@ public void Example_Discovery_Suggest_DiscoverySuggest() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { -["$id"] = "5868", +["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4826,12 +4826,12 @@ public async Task Example_Discovery_Suggest_DiscoverySuggest_Async() keywords = "exampledata", filter = new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { -["$id"] = "5868", +["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4859,12 +4859,12 @@ public void Example_Discovery_Suggest_DiscoverySuggest_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { -["$id"] = "5868", +["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4888,12 +4888,12 @@ public async Task Example_Discovery_Suggest_DiscoverySuggest_Convenience_Async() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5867", + ["$id"] = "6983", ["and"] = new object[] { new Dictionary { -["$id"] = "5868", +["$id"] = "6984", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4916,12 +4916,12 @@ public void Example_Discovery_AutoComplete_DiscoveryAutoComplete() keywords = "exa", filter = new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { -["$id"] = "5923", +["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4948,12 +4948,12 @@ public async Task Example_Discovery_AutoComplete_DiscoveryAutoComplete_Async() keywords = "exa", filter = new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { -["$id"] = "5923", +["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -4981,12 +4981,12 @@ public void Example_Discovery_AutoComplete_DiscoveryAutoComplete_Convenience() Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { -["$id"] = "5923", +["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } @@ -5010,12 +5010,12 @@ public async Task Example_Discovery_AutoComplete_DiscoveryAutoComplete_Convenien Limit = 10, Filter = BinaryData.FromObjectAsJson(new Dictionary { - ["$id"] = "5922", + ["$id"] = "7038", ["and"] = new object[] { new Dictionary { -["$id"] = "5923", +["$id"] = "7039", ["entityType"] = "azure_blob_path", ["includeSubTypes"] = false } diff --git a/sdk/purview/Azure.Analytics.Purview.Scanning/README.md b/sdk/purview/Azure.Analytics.Purview.Scanning/README.md index 3de1ca0a2b6f..7a848e60ae46 100644 --- a/sdk/purview/Azure.Analytics.Purview.Scanning/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Scanning/README.md @@ -116,5 +116,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Scanning%2FREADME.png) diff --git a/sdk/purview/Azure.Analytics.Purview.Sharing/README.md b/sdk/purview/Azure.Analytics.Purview.Sharing/README.md index 28b5ac7db9c6..f38ab42a5f8d 100644 --- a/sdk/purview/Azure.Analytics.Purview.Sharing/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Sharing/README.md @@ -392,5 +392,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fpurview%2FAzure.Analytics.Purview.Sharing%2FREADME.png) diff --git a/sdk/quantum/Azure.Quantum.Jobs/README.md b/sdk/quantum/Azure.Quantum.Jobs/README.md index f987ae9114a1..f94a42cbf280 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/README.md +++ b/sdk/quantum/Azure.Quantum.Jobs/README.md @@ -232,5 +232,3 @@ additional questions or comments. [credentials]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme#credentials [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fquantum%2FAzure.Quantum.Jobs%2FREADME.png) diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributes.Serialization.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributes.Serialization.cs new file mode 100644 index 000000000000..3d8cca2b1d21 --- /dev/null +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributes.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Quota.Models +{ + public partial class GroupQuotaAdditionalAttributes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("groupId"u8); + writer.WriteObjectValue(GroupId, options); + if (Optional.IsDefined(Environment)) + { + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupQuotaAdditionalAttributes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupQuotaAdditionalAttributes(document.RootElement, options); + } + + internal static GroupQuotaAdditionalAttributes DeserializeGroupQuotaAdditionalAttributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GroupQuotaGroupingId groupId = default; + GroupQuotaEnvironmentType? environment = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = GroupQuotaGroupingId.DeserializeGroupQuotaGroupingId(property.Value, options); + continue; + } + if (property.NameEquals("environment"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + environment = new GroupQuotaEnvironmentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupQuotaAdditionalAttributes(groupId, environment, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GroupId)) + { + builder.Append(" groupId: "); + BicepSerializationHelpers.AppendChildObject(builder, GroupId, options, 2, false, " groupId: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Environment), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" environment: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Environment)) + { + builder.Append(" environment: "); + builder.AppendLine($"'{Environment.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributes)} does not support writing '{options.Format}' format."); + } + } + + GroupQuotaAdditionalAttributes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGroupQuotaAdditionalAttributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributesPatch.Serialization.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributesPatch.Serialization.cs new file mode 100644 index 000000000000..d26c8dfd2dbe --- /dev/null +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/GroupQuotaAdditionalAttributesPatch.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Quota.Models +{ + public partial class GroupQuotaAdditionalAttributesPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributesPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteObjectValue(GroupId, options); + } + if (Optional.IsDefined(Environment)) + { + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupQuotaAdditionalAttributesPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributesPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupQuotaAdditionalAttributesPatch(document.RootElement, options); + } + + internal static GroupQuotaAdditionalAttributesPatch DeserializeGroupQuotaAdditionalAttributesPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GroupQuotaGroupingId groupId = default; + GroupQuotaEnvironmentType? environment = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupId = GroupQuotaGroupingId.DeserializeGroupQuotaGroupingId(property.Value, options); + continue; + } + if (property.NameEquals("environment"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + environment = new GroupQuotaEnvironmentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupQuotaAdditionalAttributesPatch(groupId, environment, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GroupId)) + { + builder.Append(" groupId: "); + BicepSerializationHelpers.AppendChildObject(builder, GroupId, options, 2, false, " groupId: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Environment), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" environment: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Environment)) + { + builder.Append(" environment: "); + builder.AppendLine($"'{Environment.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributesPatch)} does not support writing '{options.Format}' format."); + } + } + + GroupQuotaAdditionalAttributesPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGroupQuotaAdditionalAttributesPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupQuotaAdditionalAttributesPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/ResourceUsageList.Serialization.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/ResourceUsageList.Serialization.cs new file mode 100644 index 000000000000..34662e7b98cd --- /dev/null +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Models/ResourceUsageList.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Quota.Models +{ + internal partial class ResourceUsageList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceUsageList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceUsageList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceUsageList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceUsageList(document.RootElement, options); + } + + internal static ResourceUsageList DeserializeResourceUsageList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GroupQuotaResourceUsages.DeserializeGroupQuotaResourceUsages(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceUsageList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ResourceUsageList)} does not support writing '{options.Format}' format."); + } + } + + ResourceUsageList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceUsageList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceUsageList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Custom/ArmRecoveryServicesBackupModelFactory.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Custom/ArmRecoveryServicesBackupModelFactory.cs deleted file mode 100644 index f14e41bf6e7e..000000000000 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Custom/ArmRecoveryServicesBackupModelFactory.cs +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.RecoveryServicesBackup; - -namespace Azure.ResourceManager.RecoveryServicesBackup.Models -{ - /// Model factory for models. - public static partial class ArmRecoveryServicesBackupModelFactory - { - /// Initializes a new instance of . - /// backup item type. - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackupGenericProtectedItem BackupGenericProtectedItem(string protectedItemType, BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays) - => BackupGenericProtectedItem(protectedItemType, backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests , isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null); - - /// Initializes a new instance of . - /// Specifies whether the container is registered or not. - /// Specifies the arm resource id of the vault. - /// Specifies the fabric name - Azure or AD. - /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - /// ErrorCode in case of intent failed. - /// ErrorMessage in case of intent failed. - /// Specifies the policy name which is used for protection. - /// Container registration status. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static BackupStatusResult BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceIdentifier vaultId, BackupFabricName? fabricName, string containerName, string protectedItemName, string errorCode, string errorMessage, string policyName, string registrationStatus) - => BackupStatusResult(protectionStatus, vaultId, fabricName, containerName, protectedItemName, errorCode, errorMessage, policyName, registrationStatus, null, null); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the managed item. - /// Backup Management server protecting this backup item. - /// Protection state of the backup engine. - /// Extended info of the backup item. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static DpmProtectedItem DpmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string backupEngineName, ProtectedItemState? protectionState, DpmProtectedItemExtendedInfo extendedInfo) - => DpmProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, backupEngineName, protectionState, extendedInfo); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the fileshare represented by this backup item. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Health details of different KPIs. - /// Additional information with this backup item. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static FileshareProtectedItem FileshareProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string protectionStatus, BackupProtectionState? protectionState, string lastBackupStatus, DateTimeOffset? lastBackupOn, IDictionary kpisHealths, FileshareProtectedItemExtendedInfo extendedInfo) - => FileshareProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, kpisHealths, extendedInfo); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the container. - /// Indicates consistency of policy object and policy applied to this backup item. - /// Backup state of this backup item. - /// Data Plane Service ID of the protected item. - /// Loosely coupled (type, value) associations (example - parent of a protected item). - /// Name of this backup item's fabric. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static GenericProtectedItem GenericProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string policyState, BackupProtectionState? protectionState, long? protectedItemId, IDictionary sourceAssociations, string fabricName) - => GenericProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, policyState, protectionState, protectedItemId, sourceAssociations, fabricName); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the VM represented by this backup item. - /// Fully qualified ARM ID of the virtual machine represented by this item. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Health status of protected item. - /// Health details on this backup item. - /// Health details of different KPIs. - /// Last backup operation status. - /// Timestamp of the last backup operation on this backup item. - /// Data ID of the protected item. - /// Additional information for this backup item. - /// Extended Properties for Azure IaasVM Backup. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static IaasClassicComputeVmProtectedItem IaasClassicComputeVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) - => IaasClassicComputeVmProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupOn, protectedItemDataId, extendedInfo, extendedProperties); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the VM represented by this backup item. - /// Fully qualified ARM ID of the virtual machine represented by this item. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Health status of protected item. - /// Health details on this backup item. - /// Health details of different KPIs. - /// Last backup operation status. - /// Timestamp of the last backup operation on this backup item. - /// Data ID of the protected item. - /// Additional information for this backup item. - /// Extended Properties for Azure IaasVM Backup. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static IaasComputeVmProtectedItem IaasComputeVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) - => IaasComputeVmProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupOn, protectedItemDataId, extendedInfo, extendedProperties); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the VM represented by this backup item. - /// Fully qualified ARM ID of the virtual machine represented by this item. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Health status of protected item. - /// Health details on this backup item. - /// Health details of different KPIs. - /// Last backup operation status. - /// Timestamp of the last backup operation on this backup item. - /// Data ID of the protected item. - /// Additional information for this backup item. - /// Extended Properties for Azure IaasVM Backup. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static IaasVmProtectedItem IaasVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) - => IaasVmProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupOn, protectedItemDataId, extendedInfo, extendedProperties); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of this backup item. - /// Name of the computer associated with this backup item. - /// Status of last backup operation. - /// Timestamp of the last backup operation on this backup item. - /// Protected, ProtectionStopped, IRPending or ProtectionError. - /// Sync time for deferred deletion in UTC. - /// Additional information with this backup item. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static MabFileFolderProtectedItem MabFileFolderProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string computerName, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectionState, long? deferredDeleteSyncTimeInUTC, MabFileFolderProtectedItemExtendedInfo extendedInfo) - => MabFileFolderProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, computerName, lastBackupStatus, lastBackupOn, protectionState, deferredDeleteSyncTimeInUTC, extendedInfo); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - /// Backup state of the backed up item. - /// Additional information for this backup item. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static SqlProtectedItem SqlProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string protectedItemDataId, ProtectedItemState? protectionState, SqlProtectedItemExtendedInfo extendedInfo) - => SqlProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, protectedItemDataId, protectionState, extendedInfo); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the DB represented by this backup item. - /// Host/Cluster Name for instance or AG. - /// Parent name of the DB such as Instance or Availability Group. - /// Parent type of protected item, example: for a DB, standalone server or distributed. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Error details in last backup. - /// Data ID of the protected item. - /// Health status of the backup item, evaluated based on last heartbeat received. - /// Additional information for this backup item. - /// Health details of different KPIs. - /// List of the nodes in case of distributed container. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VmWorkloadProtectedItem VmWorkloadProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) - => VmWorkloadProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the DB represented by this backup item. - /// Host/Cluster Name for instance or AG. - /// Parent name of the DB such as Instance or Availability Group. - /// Parent type of protected item, example: for a DB, standalone server or distributed. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Error details in last backup. - /// Data ID of the protected item. - /// Health status of the backup item, evaluated based on last heartbeat received. - /// Additional information for this backup item. - /// Health details of different KPIs. - /// List of the nodes in case of distributed container. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VmWorkloadSapAseDatabaseProtectedItem VmWorkloadSapAseDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) - => VmWorkloadSapAseDatabaseProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the DB represented by this backup item. - /// Host/Cluster Name for instance or AG. - /// Parent name of the DB such as Instance or Availability Group. - /// Parent type of protected item, example: for a DB, standalone server or distributed. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Error details in last backup. - /// Data ID of the protected item. - /// Health status of the backup item, evaluated based on last heartbeat received. - /// Additional information for this backup item. - /// Health details of different KPIs. - /// List of the nodes in case of distributed container. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VmWorkloadSapHanaDatabaseProtectedItem VmWorkloadSapHanaDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) - => VmWorkloadSapHanaDatabaseProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the DB represented by this backup item. - /// Host/Cluster Name for instance or AG. - /// Parent name of the DB such as Instance or Availability Group. - /// Parent type of protected item, example: for a DB, standalone server or distributed. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Error details in last backup. - /// Data ID of the protected item. - /// Health status of the backup item, evaluated based on last heartbeat received. - /// Additional information for this backup item. - /// Health details of different KPIs. - /// List of the nodes in case of distributed container. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VmWorkloadSapHanaDBInstanceProtectedItem VmWorkloadSapHanaDBInstanceProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) - => VmWorkloadSapHanaDBInstanceProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList); - - /// Initializes a new instance of . - /// Type of backup management for the backed up item. - /// Type of workload this item represents. - /// Unique name of container. - /// ARM ID of the resource to be backed up. - /// ID of the backup policy with which this item is backed up. - /// Timestamp when the last (latest) backup copy was created for this backup item. - /// Name of the backup set the backup item belongs to. - /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - /// Time for deferred deletion in UTC. - /// Flag to identify whether the DS is scheduled for deferred delete. - /// Time remaining before the DS marked for deferred delete is permanently deleted. - /// Flag to identify whether the deferred deleted DS is to be purged soon. - /// Flag to identify that deferred deleted DS is to be moved into Pause state. - /// ResourceGuardOperationRequests on which LAC check will be performed. - /// Flag to identify whether datasource is protected in archive. - /// Name of the policy used for protection. - /// Soft delete retention period in days. - /// Friendly name of the DB represented by this backup item. - /// Host/Cluster Name for instance or AG. - /// Parent name of the DB such as Instance or Availability Group. - /// Parent type of protected item, example: for a DB, standalone server or distributed. - /// Backup status of this backup item. - /// Backup state of this backup item. - /// Last backup operation status. Possible values: Healthy, Unhealthy. - /// Timestamp of the last backup operation on this backup item. - /// Error details in last backup. - /// Data ID of the protected item. - /// Health status of the backup item, evaluated based on last heartbeat received. - /// Additional information for this backup item. - /// Health details of different KPIs. - /// List of the nodes in case of distributed container. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VmWorkloadSqlDatabaseProtectedItem VmWorkloadSqlDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) - => VmWorkloadSqlDatabaseProtectedItem(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoverOn, backupSetName, createMode, deferredDeletedOn, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, null, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupOn, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList); - } -} \ No newline at end of file diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs index f4d0f20ab6fd..a62d480dd80c 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs @@ -1842,5 +1842,506 @@ public static FetchTieringCostSavingsInfoForVaultContent FetchTieringCostSavings { return new FetchTieringCostSavingsInfoForVaultContent(sourceTierType, targetTierType, "FetchTieringCostSavingsInfoForVaultRequest", serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// backup item type. + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupGenericProtectedItem BackupGenericProtectedItem(string protectedItemType, BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays) + { + return BackupGenericProtectedItem(protectedItemType: protectedItemType, backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default); + } + + /// Initializes a new instance of . + /// Specifies whether the container is registered or not. + /// Specifies the arm resource id of the vault. + /// Specifies the fabric name - Azure or AD. + /// Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + /// Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + /// ErrorCode in case of intent failed. + /// ErrorMessage in case of intent failed. + /// Specifies the policy name which is used for protection. + /// Container registration status. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BackupStatusResult BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceIdentifier vaultId, BackupFabricName? fabricName, string containerName, string protectedItemName, string errorCode, string errorMessage, string policyName, string registrationStatus) + { + return BackupStatusResult(protectionStatus: protectionStatus, vaultId: vaultId, fabricName: fabricName, containerName: containerName, protectedItemName: protectedItemName, errorCode: errorCode, errorMessage: errorMessage, policyName: policyName, registrationStatus: registrationStatus, protectedItemsCount: default, acquireStorageAccountLock: default); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the managed item. + /// Backup Management server protecting this backup item. + /// Protection state of the backup engine. + /// Extended info of the backup item. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DpmProtectedItem DpmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string backupEngineName, ProtectedItemState? protectionState, DpmProtectedItemExtendedInfo extendedInfo) + { + return DpmProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, backupEngineName: backupEngineName, protectionState: protectionState, extendedInfo: extendedInfo); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the fileshare represented by this backup item. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Health details of different KPIs. + /// Additional information with this backup item. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static FileshareProtectedItem FileshareProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string protectionStatus, BackupProtectionState? protectionState, string lastBackupStatus, DateTimeOffset? lastBackupOn, IDictionary kpisHealths, FileshareProtectedItemExtendedInfo extendedInfo) + { + return FileshareProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, kpisHealths: kpisHealths, extendedInfo: extendedInfo); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the container. + /// Indicates consistency of policy object and policy applied to this backup item. + /// Backup state of this backup item. + /// Data Plane Service ID of the protected item. + /// Loosely coupled (type, value) associations (example - parent of a protected item). + /// Name of this backup item's fabric. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static GenericProtectedItem GenericProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string policyState, BackupProtectionState? protectionState, long? protectedItemId, IDictionary sourceAssociations, string fabricName) + { + return GenericProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, policyState: policyState, protectionState: protectionState, protectedItemId: protectedItemId, sourceAssociations: sourceAssociations, fabricName: fabricName); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the VM represented by this backup item. + /// Fully qualified ARM ID of the virtual machine represented by this item. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Health status of protected item. + /// Health details on this backup item. + /// Health details of different KPIs. + /// Last backup operation status. + /// Timestamp of the last backup operation on this backup item. + /// Data ID of the protected item. + /// Additional information for this backup item. + /// Extended Properties for Azure IaasVM Backup. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static IaasClassicComputeVmProtectedItem IaasClassicComputeVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) + { + return IaasClassicComputeVmProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, virtualMachineId: virtualMachineId, protectionStatus: protectionStatus, protectionState: protectionState, healthStatus: healthStatus, healthDetails: healthDetails, kpisHealths: kpisHealths, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, protectedItemDataId: protectedItemDataId, extendedInfo: extendedInfo, extendedProperties: extendedProperties); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the VM represented by this backup item. + /// Fully qualified ARM ID of the virtual machine represented by this item. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Health status of protected item. + /// Health details on this backup item. + /// Health details of different KPIs. + /// Last backup operation status. + /// Timestamp of the last backup operation on this backup item. + /// Data ID of the protected item. + /// Additional information for this backup item. + /// Extended Properties for Azure IaasVM Backup. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static IaasComputeVmProtectedItem IaasComputeVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) + { + return IaasComputeVmProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, virtualMachineId: virtualMachineId, protectionStatus: protectionStatus, protectionState: protectionState, healthStatus: healthStatus, healthDetails: healthDetails, kpisHealths: kpisHealths, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, protectedItemDataId: protectedItemDataId, extendedInfo: extendedInfo, extendedProperties: extendedProperties); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the VM represented by this backup item. + /// Fully qualified ARM ID of the virtual machine represented by this item. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Health status of protected item. + /// Health details on this backup item. + /// Health details of different KPIs. + /// Last backup operation status. + /// Timestamp of the last backup operation on this backup item. + /// Data ID of the protected item. + /// Additional information for this backup item. + /// Extended Properties for Azure IaasVM Backup. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static IaasVmProtectedItem IaasVmProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, ResourceIdentifier virtualMachineId, string protectionStatus, BackupProtectionState? protectionState, IaasVmProtectedItemHealthStatus? healthStatus, IEnumerable healthDetails, IDictionary kpisHealths, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectedItemDataId, IaasVmProtectedItemExtendedInfo extendedInfo, IaasVmBackupExtendedProperties extendedProperties) + { + return IaasVmProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, virtualMachineId: virtualMachineId, protectionStatus: protectionStatus, protectionState: protectionState, healthStatus: healthStatus, healthDetails: healthDetails, kpisHealths: kpisHealths, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, protectedItemDataId: protectedItemDataId, extendedInfo: extendedInfo, extendedProperties: extendedProperties); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of this backup item. + /// Name of the computer associated with this backup item. + /// Status of last backup operation. + /// Timestamp of the last backup operation on this backup item. + /// Protected, ProtectionStopped, IRPending or ProtectionError. + /// Sync time for deferred deletion in UTC. + /// Additional information with this backup item. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static MabFileFolderProtectedItem MabFileFolderProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string computerName, string lastBackupStatus, DateTimeOffset? lastBackupOn, string protectionState, long? deferredDeleteSyncTimeInUTC, MabFileFolderProtectedItemExtendedInfo extendedInfo) + { + return MabFileFolderProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, computerName: computerName, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, protectionState: protectionState, deferredDeleteSyncTimeInUTC: deferredDeleteSyncTimeInUTC, extendedInfo: extendedInfo); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + /// Backup state of the backed up item. + /// Additional information for this backup item. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SqlProtectedItem SqlProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string protectedItemDataId, ProtectedItemState? protectionState, SqlProtectedItemExtendedInfo extendedInfo) + { + return SqlProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, protectedItemDataId: protectedItemDataId, protectionState: protectionState, extendedInfo: extendedInfo); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the DB represented by this backup item. + /// Host/Cluster Name for instance or AG. + /// Parent name of the DB such as Instance or Availability Group. + /// Parent type of protected item, example: for a DB, standalone server or distributed. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Error details in last backup. + /// Data ID of the protected item. + /// Health status of the backup item, evaluated based on last heartbeat received. + /// Additional information for this backup item. + /// Health details of different KPIs. + /// List of the nodes in case of distributed container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VmWorkloadProtectedItem VmWorkloadProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) + { + return VmWorkloadProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, serverName: serverName, parentName: parentName, parentType: parentType, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, lastBackupErrorDetail: lastBackupErrorDetail, protectedItemDataSourceId: protectedItemDataSourceId, protectedItemHealthStatus: protectedItemHealthStatus, extendedInfo: extendedInfo, kpisHealths: kpisHealths, nodesList: nodesList); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the DB represented by this backup item. + /// Host/Cluster Name for instance or AG. + /// Parent name of the DB such as Instance or Availability Group. + /// Parent type of protected item, example: for a DB, standalone server or distributed. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Error details in last backup. + /// Data ID of the protected item. + /// Health status of the backup item, evaluated based on last heartbeat received. + /// Additional information for this backup item. + /// Health details of different KPIs. + /// List of the nodes in case of distributed container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VmWorkloadSapAseDatabaseProtectedItem VmWorkloadSapAseDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) + { + return VmWorkloadSapAseDatabaseProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, serverName: serverName, parentName: parentName, parentType: parentType, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, lastBackupErrorDetail: lastBackupErrorDetail, protectedItemDataSourceId: protectedItemDataSourceId, protectedItemHealthStatus: protectedItemHealthStatus, extendedInfo: extendedInfo, kpisHealths: kpisHealths, nodesList: nodesList); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the DB represented by this backup item. + /// Host/Cluster Name for instance or AG. + /// Parent name of the DB such as Instance or Availability Group. + /// Parent type of protected item, example: for a DB, standalone server or distributed. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Error details in last backup. + /// Data ID of the protected item. + /// Health status of the backup item, evaluated based on last heartbeat received. + /// Additional information for this backup item. + /// Health details of different KPIs. + /// List of the nodes in case of distributed container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VmWorkloadSapHanaDatabaseProtectedItem VmWorkloadSapHanaDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) + { + return VmWorkloadSapHanaDatabaseProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, serverName: serverName, parentName: parentName, parentType: parentType, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, lastBackupErrorDetail: lastBackupErrorDetail, protectedItemDataSourceId: protectedItemDataSourceId, protectedItemHealthStatus: protectedItemHealthStatus, extendedInfo: extendedInfo, kpisHealths: kpisHealths, nodesList: nodesList); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the DB represented by this backup item. + /// Host/Cluster Name for instance or AG. + /// Parent name of the DB such as Instance or Availability Group. + /// Parent type of protected item, example: for a DB, standalone server or distributed. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Error details in last backup. + /// Data ID of the protected item. + /// Health status of the backup item, evaluated based on last heartbeat received. + /// Additional information for this backup item. + /// Health details of different KPIs. + /// List of the nodes in case of distributed container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VmWorkloadSapHanaDBInstanceProtectedItem VmWorkloadSapHanaDBInstanceProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) + { + return VmWorkloadSapHanaDBInstanceProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, serverName: serverName, parentName: parentName, parentType: parentType, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, lastBackupErrorDetail: lastBackupErrorDetail, protectedItemDataSourceId: protectedItemDataSourceId, protectedItemHealthStatus: protectedItemHealthStatus, extendedInfo: extendedInfo, kpisHealths: kpisHealths, nodesList: nodesList); + } + + /// Initializes a new instance of . + /// Type of backup management for the backed up item. + /// Type of workload this item represents. + /// Unique name of container. + /// ARM ID of the resource to be backed up. + /// ID of the backup policy with which this item is backed up. + /// Timestamp when the last (latest) backup copy was created for this backup item. + /// Name of the backup set the backup item belongs to. + /// Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + /// Time for deferred deletion in UTC. + /// Flag to identify whether the DS is scheduled for deferred delete. + /// Time remaining before the DS marked for deferred delete is permanently deleted. + /// Flag to identify whether the deferred deleted DS is to be purged soon. + /// Flag to identify that deferred deleted DS is to be moved into Pause state. + /// ResourceGuardOperationRequests on which LAC check will be performed. + /// Flag to identify whether datasource is protected in archive. + /// Name of the policy used for protection. + /// Soft delete retention period in days. + /// Friendly name of the DB represented by this backup item. + /// Host/Cluster Name for instance or AG. + /// Parent name of the DB such as Instance or Availability Group. + /// Parent type of protected item, example: for a DB, standalone server or distributed. + /// Backup status of this backup item. + /// Backup state of this backup item. + /// Last backup operation status. Possible values: Healthy, Unhealthy. + /// Timestamp of the last backup operation on this backup item. + /// Error details in last backup. + /// Data ID of the protected item. + /// Health status of the backup item, evaluated based on last heartbeat received. + /// Additional information for this backup item. + /// Health details of different KPIs. + /// List of the nodes in case of distributed container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VmWorkloadSqlDatabaseProtectedItem VmWorkloadSqlDatabaseProtectedItem(BackupManagementType? backupManagementType, BackupDataSourceType? workloadType, string containerName, ResourceIdentifier sourceResourceId, ResourceIdentifier policyId, DateTimeOffset? lastRecoverOn, string backupSetName, BackupCreateMode? createMode, DateTimeOffset? deferredDeletedOn, bool? isScheduledForDeferredDelete, string deferredDeleteTimeRemaining, bool? isDeferredDeleteScheduleUpcoming, bool? isRehydrate, IEnumerable resourceGuardOperationRequests, bool? isArchiveEnabled, string policyName, int? softDeleteRetentionPeriodInDays, string friendlyName, string serverName, string parentName, string parentType, string protectionStatus, BackupProtectionState? protectionState, LastBackupStatus? lastBackupStatus, DateTimeOffset? lastBackupOn, BackupErrorDetail lastBackupErrorDetail, string protectedItemDataSourceId, VmWorkloadProtectedItemHealthStatus? protectedItemHealthStatus, VmWorkloadProtectedItemExtendedInfo extendedInfo, IDictionary kpisHealths, IEnumerable nodesList) + { + return VmWorkloadSqlDatabaseProtectedItem(backupManagementType: backupManagementType, workloadType: workloadType, containerName: containerName, sourceResourceId: sourceResourceId, policyId: policyId, lastRecoverOn: lastRecoverOn, backupSetName: backupSetName, createMode: createMode, deferredDeletedOn: deferredDeletedOn, isScheduledForDeferredDelete: isScheduledForDeferredDelete, deferredDeleteTimeRemaining: deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming: isDeferredDeleteScheduleUpcoming, isRehydrate: isRehydrate, resourceGuardOperationRequests: resourceGuardOperationRequests, isArchiveEnabled: isArchiveEnabled, policyName: policyName, softDeleteRetentionPeriodInDays: softDeleteRetentionPeriodInDays, vaultId: default, friendlyName: friendlyName, serverName: serverName, parentName: parentName, parentType: parentType, protectionStatus: protectionStatus, protectionState: protectionState, lastBackupStatus: lastBackupStatus, lastBackupOn: lastBackupOn, lastBackupErrorDetail: lastBackupErrorDetail, protectedItemDataSourceId: protectedItemDataSourceId, protectedItemHealthStatus: protectedItemHealthStatus, extendedInfo: extendedInfo, kpisHealths: kpisHealths, nodesList: nodesList); + } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Customization/ArmRecoveryServicesSiteRecoveryModelFactory.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Customization/ArmRecoveryServicesSiteRecoveryModelFactory.cs deleted file mode 100644 index b3494f92f744..000000000000 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Customization/ArmRecoveryServicesSiteRecoveryModelFactory.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.RecoveryServicesSiteRecovery; - -namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models -{ - /// Model factory for models. - public static partial class ArmRecoveryServicesSiteRecoveryModelFactory - { - /// Initializes a new instance of A2AReplicationDetails. - /// The fabric specific object Id of the virtual machine. - /// The initial primary availability zone. - /// The initial primary fabric location. - /// The initial recovery availability zone. - /// The initial primary extended location. - /// The initial recovery extended location. - /// The initial recovery fabric location. - /// The multi vm group Id. - /// The multi vm group name. - /// Whether Multi VM group is auto created or specified by user. - /// The management Id. - /// The list of protected disks. - /// The list of unprotected disks. - /// The list of protected managed disks. - /// The recovery boot diagnostic storage account Arm Id. - /// Primary fabric location. - /// The recovery fabric location. - /// The type of operating system. - /// The size of recovery virtual machine. - /// The name of recovery virtual machine. - /// The recovery resource group. - /// The recovery cloud service. - /// The recovery availability set. - /// The recovery virtual network. - /// The test failover virtual network. - /// The virtual machine nic details. - /// The synced configuration details. - /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - /// The last heartbeat received from the source server. - /// The agent version. - /// Agent expiry date. - /// A value indicating whether replication agent update is required. - /// Agent certificate expiry date. - /// A value indicating whether agent certificate update is required. - /// The recovery fabric object Id. - /// The protection state for the vm. - /// The protection state description for the vm. - /// An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. - /// The test failover fabric object Id. - /// The last RPO value in seconds. - /// The time (in UTC) when the last RPO value was calculated by Protection Service. - /// The primary availability zone. - /// The recovery availability zone. - /// The primary Extended Location. - /// The recovery Extended Location. - /// The encryption type of the VM. - /// The test failover vm name. - /// The recovery azure generation. - /// The recovery proximity placement group Id. - /// A value indicating whether the auto protection is enabled. - /// The recovery virtual machine scale set id. - /// The recovery capacity reservation group Id. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, IEnumerable protectedDisks, IEnumerable unprotectedDisks, IEnumerable protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IEnumerable vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId) - => A2AReplicationDetails(fabricObjectId, initialPrimaryZone, initialPrimaryFabricLocation, initialRecoveryZone, initialPrimaryExtendedLocation, initialRecoveryExtendedLocation, initialRecoveryFabricLocation, multiVmGroupId, multiVmGroupName, multiVmGroupCreateOption, managementId, protectedDisks, unprotectedDisks, protectedManagedDisks, recoveryBootDiagStorageAccountId, primaryFabricLocation, recoveryFabricLocation, osType, recoveryAzureVmSize, recoveryAzureVmName, recoveryAzureResourceGroupId, recoveryCloudService, recoveryAvailabilitySet, selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId, vmNics, vmSyncedConfigDetails, monitoringPercentageCompletion, monitoringJobType, lastHeartbeat, agentVersion, agentExpireOn, isReplicationAgentUpdateRequired, agentCertificateExpireOn, isReplicationAgentCertificateUpdateRequired, recoveryFabricObjectId, vmProtectionState, vmProtectionStateDescription, lifecycleId, testFailoverRecoveryFabricObjectId, rpoInSeconds, lastRpoCalculatedOn, primaryAvailabilityZone, recoveryAvailabilityZone, primaryExtendedLocation, recoveryExtendedLocation, vmEncryptionType, tfoAzureVmName, recoveryAzureGeneration, recoveryProximityPlacementGroupId, autoProtectionOfDataDisk, recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId, null); - - /// Initializes a new instance of HyperVReplicaAzureReplicationDetails. - /// Azure VM Disk details. - /// Recovery Azure given name. - /// The Recovery Azure VM size. - /// The recovery Azure storage account. - /// The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. - /// The Last replication time. - /// Last RPO value. - /// The last RPO calculated time. - /// The virtual machine Id. - /// The protection state for the vm. - /// The protection state description for the vm. - /// Initial replication details. - /// The PE Network details. - /// The selected recovery azure network Id. - /// The selected source nic Id which will be used as the primary nic during failover. - /// The encryption info. - /// The operating system info. - /// The RAM size of the VM on the primary side. - /// The CPU count of the VM on the primary side. - /// The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - /// The target resource group Id. - /// The recovery availability set Id. - /// The target availability zone. - /// The target proximity placement group Id. - /// A value indicating whether managed disks should be used during failover. - /// License Type of the VM to be used. - /// The SQL Server license type. - /// The last recovery point received time. - /// The target VM tags. - /// The tags for the seed managed disks. - /// The tags for the target managed disks. - /// The tags for the target NICs. - /// The list of protected managed disks. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable protectedManagedDisks) - => HyperVReplicaAzureReplicationDetails(azureVmDiskDetails, recoveryAzureVmName, recoveryAzureVmSize, recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId, lastReplicatedOn, rpoInSeconds, lastRpoCalculatedOn, vmId, vmProtectionState, vmProtectionStateDescription, initialReplicationDetails, vmNics, selectedRecoveryAzureNetworkId, selectedSourceNicId, encryption, osDetails, sourceVmRamSizeInMB, sourceVmCpuCount, enableRdpOnTargetOption, recoveryAzureResourceGroupId, recoveryAvailabilitySetId, targetAvailabilityZone, targetProximityPlacementGroupId, useManagedDisks, licenseType, sqlServerLicenseType, lastRecoveryPointReceived, targetVmTags, seedManagedDiskTags, targetManagedDiskTags, targetNicTags, protectedManagedDisks, null); - - /// Initializes a new instance of InMageAzureV2ReplicationDetails. - /// The infrastructure VM Id. - /// The vCenter infrastructure Id. - /// The protection stage. - /// The virtual machine Id. - /// The protection state for the vm. - /// The protection state description for the vm. - /// The resync progress percentage. - /// The RPO in seconds. - /// The compressed data change rate in MB. - /// The uncompressed data change rate in MB. - /// The source IP address. - /// The agent version. - /// Agent expiry date. - /// A value indicating whether installed agent needs to be updated. - /// A value indicating whether the source server requires a restart after update. - /// The last heartbeat received from the source server. - /// The process server Id. - /// The process server name. - /// The multi vm group Id. - /// The multi vm group name. - /// A value indicating whether multi vm sync is enabled or disabled. - /// The list of protected disks. - /// A value indicating whether any disk is resized for this VM. - /// The master target Id. - /// The CPU count of the VM on the primary side. - /// The RAM size of the VM on the primary side. - /// The type of the OS on the VM. - /// The OS disk VHD name. - /// The id of the disk containing the OS. - /// Azure VM Disk details. - /// Recovery Azure given name. - /// The Recovery Azure VM size. - /// The recovery Azure storage account. - /// The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. - /// The PE Network details. - /// The selected recovery azure network Id. - /// The test failover virtual network. - /// The selected source nic Id which will be used as the primary nic during failover. - /// A value indicating the discovery type of the machine. Value can be vCenter or physical. - /// The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - /// The datastores of the on-premise machine. Value can be list of strings that contain datastore names. - /// The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. - /// The target resource group Id. - /// The recovery availability set Id. - /// The target availability zone. - /// The target proximity placement group Id. - /// A value indicating whether managed disks should be used during failover. - /// License Type of the VM to be used. - /// The SQL Server license type. - /// The validation errors of the on-premise machine Value can be list of validation errors. - /// The last RPO calculated time. - /// The last update time received from on-prem components. - /// The replica id of the protected item. - /// The OS Version of the protected item. - /// The list of protected managed disks. - /// The last recovery point received time. - /// The firmware type of this protected item. - /// The target generation for this protected item. - /// A value indicating whether additional IR stats are available or not. - /// The total transferred data in bytes. - /// The progress health. - /// The target VM tags. - /// The tags for the seed managed disks. - /// The tags for the target managed disks. - /// The tags for the target NICs. - /// The switch provider blocking error information. - /// The switch provider blocking error information. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static InMageAzureV2ReplicationDetails InMageAzureV2ReplicationDetails(string infrastructureVmId, string vCenterInfrastructureId, string protectionStage, string vmId, string vmProtectionState, string vmProtectionStateDescription, int? resyncProgressPercentage, long? rpoInSeconds, double? compressedDataRateInMB, double? uncompressedDataRateInMB, IPAddress ipAddress, string agentVersion, DateTimeOffset? agentExpireOn, string isAgentUpdateRequired, string isRebootAfterUpdateRequired, DateTimeOffset? lastHeartbeat, Guid? processServerId, string processServerName, string multiVmGroupId, string multiVmGroupName, string multiVmSyncStatus, IEnumerable protectedDisks, string diskResized, string masterTargetId, int? sourceVmCpuCount, int? sourceVmRamSizeInMB, string osType, string vhdName, string osDiskId, IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, string selectedSourceNicId, string discoveryType, string enableRdpOnTargetOption, IEnumerable datastores, string targetVmId, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, IEnumerable validationErrors, DateTimeOffset? lastRpoCalculatedOn, DateTimeOffset? lastUpdateReceivedOn, string replicaId, string osVersion, IEnumerable protectedManagedDisks, DateTimeOffset? lastRecoveryPointReceived, string firmwareType, string azureVmGeneration, bool? isAdditionalStatsAvailable, long? totalDataTransferred, string totalProgressHealth, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable switchProviderBlockingErrorDetails, InMageAzureV2SwitchProviderDetails switchProviderDetails) - => InMageAzureV2ReplicationDetails(infrastructureVmId, vCenterInfrastructureId, protectionStage, vmId, vmProtectionState, vmProtectionStateDescription, resyncProgressPercentage, rpoInSeconds, compressedDataRateInMB, uncompressedDataRateInMB, ipAddress, agentVersion, agentExpireOn, isAgentUpdateRequired, isRebootAfterUpdateRequired, lastHeartbeat, processServerId, processServerName, multiVmGroupId, multiVmGroupName, multiVmSyncStatus, protectedDisks, diskResized, masterTargetId, sourceVmCpuCount, sourceVmRamSizeInMB, osType, vhdName, osDiskId, azureVmDiskDetails, recoveryAzureVmName, recoveryAzureVmSize, recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId, vmNics, selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId, selectedSourceNicId, discoveryType, enableRdpOnTargetOption, datastores, targetVmId, recoveryAzureResourceGroupId, recoveryAvailabilitySetId, targetAvailabilityZone, targetProximityPlacementGroupId, useManagedDisks, licenseType, sqlServerLicenseType, validationErrors, lastRpoCalculatedOn, lastUpdateReceivedOn, replicaId, osVersion, protectedManagedDisks, lastRecoveryPointReceived, firmwareType, azureVmGeneration, isAdditionalStatsAvailable, totalDataTransferred, totalProgressHealth, targetVmTags, seedManagedDiskTags, targetManagedDiskTags, targetNicTags, switchProviderBlockingErrorDetails, switchProviderDetails, null, null, null); - - /// Initializes a new instance of VMwareCbtMigrationDetails. - /// The ARM Id of the VM discovered in VMware. - /// The type of the OS on the VM. - /// The name of the OS on the VM. - /// The firmware type. - /// The target generation. - /// License Type of the VM to be used. - /// The SQL Server license type. - /// The data mover run as account Id. - /// The snapshot run as account Id. - /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. - /// Target VM name. - /// The target VM size. - /// The target location. - /// The target resource group Id. - /// The target availability set Id. - /// The target availability zone. - /// The target proximity placement group Id. - /// The confidential VM key vault Id for ADE installation. - /// The target VM security profile. - /// The target boot diagnostics storage account ARM Id. - /// The target VM tags. - /// The list of protected disks. - /// The target network Id. - /// The test network Id. - /// The network details. - /// The tags for the target NICs. - /// The recovery point Id to which the VM was migrated. - /// The last recovery point received time. - /// The last recovery point Id. - /// The initial seeding progress percentage. - /// The migration progress percentage. - /// The resync progress percentage. - /// The resume progress percentage. - /// The initial seeding retry count. - /// The resync retry count. - /// The resume retry count. - /// A value indicating whether resync is required. - /// The resync state. - /// A value indicating whether auto resync is to be done. - /// The tags for the seed disks. - /// The tags for the target disks. - /// List of supported inplace OS Upgrade versions. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IEnumerable protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IEnumerable vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IEnumerable supportedOSVersions) - => VMwareCbtMigrationDetails(vmwareMachineId, osType, osName, firmwareType, targetGeneration, licenseType, sqlServerLicenseType, dataMoverRunAsAccountId, snapshotRunAsAccountId, storageAccountId, targetVmName, targetVmSize, targetLocation, targetResourceGroupId, targetAvailabilitySetId, targetAvailabilityZone, targetProximityPlacementGroupId, confidentialVmKeyVaultId, targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId, targetVmTags, protectedDisks, targetNetworkId, testNetworkId, vmNics, targetNicTags, migrationRecoveryPointId, lastRecoveryPointReceived, lastRecoveryPointId, initialSeedingProgressPercentage, migrationProgressPercentage, resyncProgressPercentage, resumeProgressPercentage, null, null, initialSeedingRetryCount, resyncRetryCount, resumeRetryCount, null, resyncRequired, resyncState, performAutoResync, seedDiskTags, targetDiskTags, supportedOSVersions, null, null, null); - - /// Initializes a new instance of VMwareCbtProtectedDiskDetails. - /// The disk id. - /// The disk name. - /// The disk type. - /// The disk path. - /// A value indicating whether the disk is the OS disk. - /// The disk capacity in bytes. - /// The log storage account ARM Id. - /// The key vault secret name of the log storage account. - /// The DiskEncryptionSet ARM Id. - /// The ARM Id of the seed managed disk. - /// The uri of the seed blob. - /// The ARM Id of the target managed disk. - /// The uri of the target blob. - /// The name for the target managed disk. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName) - => VMwareCbtProtectedDiskDetails(diskId, diskName, diskType, diskPath, isOSDisk, capacityInBytes, logStorageAccountId, logStorageAccountSasSecretName, diskEncryptionSetId, seedManagedDiskId, seedBlobUri, targetManagedDiskId, targetBlobUri, targetDiskName, null); - } -} \ No newline at end of file diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs index 73fead392dbc..f9fce4c5c09f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs @@ -6018,5 +6018,254 @@ public static VMwareVmDetails VMwareVmDetails(string agentGeneratedId = null, st diskDetails?.ToList(), validationErrors?.ToList()); } + + /// Initializes a new instance of A2AReplicationDetails. + /// The fabric specific object Id of the virtual machine. + /// The initial primary availability zone. + /// The initial primary fabric location. + /// The initial recovery availability zone. + /// The initial primary extended location. + /// The initial recovery extended location. + /// The initial recovery fabric location. + /// The multi vm group Id. + /// The multi vm group name. + /// Whether Multi VM group is auto created or specified by user. + /// The management Id. + /// The list of protected disks. + /// The list of unprotected disks. + /// The list of protected managed disks. + /// The recovery boot diagnostic storage account Arm Id. + /// Primary fabric location. + /// The recovery fabric location. + /// The type of operating system. + /// The size of recovery virtual machine. + /// The name of recovery virtual machine. + /// The recovery resource group. + /// The recovery cloud service. + /// The recovery availability set. + /// The recovery virtual network. + /// The test failover virtual network. + /// The virtual machine nic details. + /// The synced configuration details. + /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + /// The last heartbeat received from the source server. + /// The agent version. + /// Agent expiry date. + /// A value indicating whether replication agent update is required. + /// Agent certificate expiry date. + /// A value indicating whether agent certificate update is required. + /// The recovery fabric object Id. + /// The protection state for the vm. + /// The protection state description for the vm. + /// An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. + /// The test failover fabric object Id. + /// The last RPO value in seconds. + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + /// The primary availability zone. + /// The recovery availability zone. + /// The primary Extended Location. + /// The recovery Extended Location. + /// The encryption type of the VM. + /// The test failover vm name. + /// The recovery azure generation. + /// The recovery proximity placement group Id. + /// A value indicating whether the auto protection is enabled. + /// The recovery virtual machine scale set id. + /// The recovery capacity reservation group Id. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, IEnumerable protectedDisks, IEnumerable unprotectedDisks, IEnumerable protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IEnumerable vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId) + { + return A2AReplicationDetails(fabricObjectId: fabricObjectId, initialPrimaryZone: initialPrimaryZone, initialPrimaryFabricLocation: initialPrimaryFabricLocation, initialRecoveryZone: initialRecoveryZone, initialPrimaryExtendedLocation: initialPrimaryExtendedLocation, initialRecoveryExtendedLocation: initialRecoveryExtendedLocation, initialRecoveryFabricLocation: initialRecoveryFabricLocation, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName, multiVmGroupCreateOption: multiVmGroupCreateOption, managementId: managementId, protectedDisks: protectedDisks, unprotectedDisks: unprotectedDisks, protectedManagedDisks: protectedManagedDisks, recoveryBootDiagStorageAccountId: recoveryBootDiagStorageAccountId, primaryFabricLocation: primaryFabricLocation, recoveryFabricLocation: recoveryFabricLocation, osType: osType, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryCloudService: recoveryCloudService, recoveryAvailabilitySet: recoveryAvailabilitySet, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId: selectedTfoAzureNetworkId, vmNics: vmNics, vmSyncedConfigDetails: vmSyncedConfigDetails, monitoringPercentageCompletion: monitoringPercentageCompletion, monitoringJobType: monitoringJobType, lastHeartbeat: lastHeartbeat, agentVersion: agentVersion, agentExpireOn: agentExpireOn, isReplicationAgentUpdateRequired: isReplicationAgentUpdateRequired, agentCertificateExpireOn: agentCertificateExpireOn, isReplicationAgentCertificateUpdateRequired: isReplicationAgentCertificateUpdateRequired, recoveryFabricObjectId: recoveryFabricObjectId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, lifecycleId: lifecycleId, testFailoverRecoveryFabricObjectId: testFailoverRecoveryFabricObjectId, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, primaryAvailabilityZone: primaryAvailabilityZone, recoveryAvailabilityZone: recoveryAvailabilityZone, primaryExtendedLocation: primaryExtendedLocation, recoveryExtendedLocation: recoveryExtendedLocation, vmEncryptionType: vmEncryptionType, tfoAzureVmName: tfoAzureVmName, recoveryAzureGeneration: recoveryAzureGeneration, recoveryProximityPlacementGroupId: recoveryProximityPlacementGroupId, autoProtectionOfDataDisk: autoProtectionOfDataDisk, recoveryVirtualMachineScaleSetId: recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId: recoveryCapacityReservationGroupId, churnOptionSelected: default); + } + + /// Initializes a new instance of HyperVReplicaAzureReplicationDetails. + /// Azure VM Disk details. + /// Recovery Azure given name. + /// The Recovery Azure VM size. + /// The recovery Azure storage account. + /// The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + /// The Last replication time. + /// Last RPO value. + /// The last RPO calculated time. + /// The virtual machine Id. + /// The protection state for the vm. + /// The protection state description for the vm. + /// Initial replication details. + /// The PE Network details. + /// The selected recovery azure network Id. + /// The selected source nic Id which will be used as the primary nic during failover. + /// The encryption info. + /// The operating system info. + /// The RAM size of the VM on the primary side. + /// The CPU count of the VM on the primary side. + /// The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + /// The target resource group Id. + /// The recovery availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// A value indicating whether managed disks should be used during failover. + /// License Type of the VM to be used. + /// The SQL Server license type. + /// The last recovery point received time. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The list of protected managed disks. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable protectedManagedDisks) + { + return HyperVReplicaAzureReplicationDetails(azureVmDiskDetails: azureVmDiskDetails, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureStorageAccount: recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId: recoveryAzureLogStorageAccountId, lastReplicatedOn: lastReplicatedOn, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, vmId: vmId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, initialReplicationDetails: initialReplicationDetails, vmNics: vmNics, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedSourceNicId: selectedSourceNicId, encryption: encryption, osDetails: osDetails, sourceVmRamSizeInMB: sourceVmRamSizeInMB, sourceVmCpuCount: sourceVmCpuCount, enableRdpOnTargetOption: enableRdpOnTargetOption, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, useManagedDisks: useManagedDisks, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, lastRecoveryPointReceived: lastRecoveryPointReceived, targetVmTags: targetVmTags, seedManagedDiskTags: seedManagedDiskTags, targetManagedDiskTags: targetManagedDiskTags, targetNicTags: targetNicTags, protectedManagedDisks: protectedManagedDisks, allAvailableOSUpgradeConfigurations: default); + } + + /// Initializes a new instance of InMageAzureV2ReplicationDetails. + /// The infrastructure VM Id. + /// The vCenter infrastructure Id. + /// The protection stage. + /// The virtual machine Id. + /// The protection state for the vm. + /// The protection state description for the vm. + /// The resync progress percentage. + /// The RPO in seconds. + /// The compressed data change rate in MB. + /// The uncompressed data change rate in MB. + /// The source IP address. + /// The agent version. + /// Agent expiry date. + /// A value indicating whether installed agent needs to be updated. + /// A value indicating whether the source server requires a restart after update. + /// The last heartbeat received from the source server. + /// The process server Id. + /// The process server name. + /// The multi vm group Id. + /// The multi vm group name. + /// A value indicating whether multi vm sync is enabled or disabled. + /// The list of protected disks. + /// A value indicating whether any disk is resized for this VM. + /// The master target Id. + /// The CPU count of the VM on the primary side. + /// The RAM size of the VM on the primary side. + /// The type of the OS on the VM. + /// The OS disk VHD name. + /// The id of the disk containing the OS. + /// Azure VM Disk details. + /// Recovery Azure given name. + /// The Recovery Azure VM size. + /// The recovery Azure storage account. + /// The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + /// The PE Network details. + /// The selected recovery azure network Id. + /// The test failover virtual network. + /// The selected source nic Id which will be used as the primary nic during failover. + /// A value indicating the discovery type of the machine. Value can be vCenter or physical. + /// The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + /// The datastores of the on-premise machine. Value can be list of strings that contain datastore names. + /// The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + /// The target resource group Id. + /// The recovery availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// A value indicating whether managed disks should be used during failover. + /// License Type of the VM to be used. + /// The SQL Server license type. + /// The validation errors of the on-premise machine Value can be list of validation errors. + /// The last RPO calculated time. + /// The last update time received from on-prem components. + /// The replica id of the protected item. + /// The OS Version of the protected item. + /// The list of protected managed disks. + /// The last recovery point received time. + /// The firmware type of this protected item. + /// The target generation for this protected item. + /// A value indicating whether additional IR stats are available or not. + /// The total transferred data in bytes. + /// The progress health. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The switch provider blocking error information. + /// The switch provider blocking error information. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageAzureV2ReplicationDetails InMageAzureV2ReplicationDetails(string infrastructureVmId, string vCenterInfrastructureId, string protectionStage, string vmId, string vmProtectionState, string vmProtectionStateDescription, int? resyncProgressPercentage, long? rpoInSeconds, double? compressedDataRateInMB, double? uncompressedDataRateInMB, IPAddress ipAddress, string agentVersion, DateTimeOffset? agentExpireOn, string isAgentUpdateRequired, string isRebootAfterUpdateRequired, DateTimeOffset? lastHeartbeat, Guid? processServerId, string processServerName, string multiVmGroupId, string multiVmGroupName, string multiVmSyncStatus, IEnumerable protectedDisks, string diskResized, string masterTargetId, int? sourceVmCpuCount, int? sourceVmRamSizeInMB, string osType, string vhdName, string osDiskId, IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, string selectedSourceNicId, string discoveryType, string enableRdpOnTargetOption, IEnumerable datastores, string targetVmId, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, IEnumerable validationErrors, DateTimeOffset? lastRpoCalculatedOn, DateTimeOffset? lastUpdateReceivedOn, string replicaId, string osVersion, IEnumerable protectedManagedDisks, DateTimeOffset? lastRecoveryPointReceived, string firmwareType, string azureVmGeneration, bool? isAdditionalStatsAvailable, long? totalDataTransferred, string totalProgressHealth, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable switchProviderBlockingErrorDetails, InMageAzureV2SwitchProviderDetails switchProviderDetails) + { + return InMageAzureV2ReplicationDetails(infrastructureVmId: infrastructureVmId, vCenterInfrastructureId: vCenterInfrastructureId, protectionStage: protectionStage, vmId: vmId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, resyncProgressPercentage: resyncProgressPercentage, rpoInSeconds: rpoInSeconds, compressedDataRateInMB: compressedDataRateInMB, uncompressedDataRateInMB: uncompressedDataRateInMB, ipAddress: ipAddress, agentVersion: agentVersion, agentExpireOn: agentExpireOn, isAgentUpdateRequired: isAgentUpdateRequired, isRebootAfterUpdateRequired: isRebootAfterUpdateRequired, lastHeartbeat: lastHeartbeat, processServerId: processServerId, processServerName: processServerName, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName, multiVmSyncStatus: multiVmSyncStatus, protectedDisks: protectedDisks, diskResized: diskResized, masterTargetId: masterTargetId, sourceVmCpuCount: sourceVmCpuCount, sourceVmRamSizeInMB: sourceVmRamSizeInMB, osType: osType, vhdName: vhdName, osDiskId: osDiskId, azureVmDiskDetails: azureVmDiskDetails, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureStorageAccount: recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId: recoveryAzureLogStorageAccountId, vmNics: vmNics, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId: selectedTfoAzureNetworkId, selectedSourceNicId: selectedSourceNicId, discoveryType: discoveryType, enableRdpOnTargetOption: enableRdpOnTargetOption, datastores: datastores, targetVmId: targetVmId, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, useManagedDisks: useManagedDisks, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, validationErrors: validationErrors, lastRpoCalculatedOn: lastRpoCalculatedOn, lastUpdateReceivedOn: lastUpdateReceivedOn, replicaId: replicaId, osVersion: osVersion, protectedManagedDisks: protectedManagedDisks, lastRecoveryPointReceived: lastRecoveryPointReceived, firmwareType: firmwareType, azureVmGeneration: azureVmGeneration, isAdditionalStatsAvailable: isAdditionalStatsAvailable, totalDataTransferred: totalDataTransferred, totalProgressHealth: totalProgressHealth, targetVmTags: targetVmTags, seedManagedDiskTags: seedManagedDiskTags, targetManagedDiskTags: targetManagedDiskTags, targetNicTags: targetNicTags, switchProviderBlockingErrorDetails: switchProviderBlockingErrorDetails, switchProviderDetails: switchProviderDetails, supportedOSVersions: default, allAvailableOSUpgradeConfigurations: default, osName: default); + } + + /// Initializes a new instance of VMwareCbtMigrationDetails. + /// The ARM Id of the VM discovered in VMware. + /// The type of the OS on the VM. + /// The name of the OS on the VM. + /// The firmware type. + /// The target generation. + /// License Type of the VM to be used. + /// The SQL Server license type. + /// The data mover run as account Id. + /// The snapshot run as account Id. + /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + /// Target VM name. + /// The target VM size. + /// The target location. + /// The target resource group Id. + /// The target availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// The confidential VM key vault Id for ADE installation. + /// The target VM security profile. + /// The target boot diagnostics storage account ARM Id. + /// The target VM tags. + /// The list of protected disks. + /// The target network Id. + /// The test network Id. + /// The network details. + /// The tags for the target NICs. + /// The recovery point Id to which the VM was migrated. + /// The last recovery point received time. + /// The last recovery point Id. + /// The initial seeding progress percentage. + /// The migration progress percentage. + /// The resync progress percentage. + /// The resume progress percentage. + /// The initial seeding retry count. + /// The resync retry count. + /// The resume retry count. + /// A value indicating whether resync is required. + /// The resync state. + /// A value indicating whether auto resync is to be done. + /// The tags for the seed disks. + /// The tags for the target disks. + /// List of supported inplace OS Upgrade versions. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IEnumerable protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IEnumerable vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IEnumerable supportedOSVersions) + { + return VMwareCbtMigrationDetails(vmwareMachineId: vmwareMachineId, osType: osType, osName: osName, firmwareType: firmwareType, targetGeneration: targetGeneration, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, dataMoverRunAsAccountId: dataMoverRunAsAccountId, snapshotRunAsAccountId: snapshotRunAsAccountId, storageAccountId: storageAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetLocation: targetLocation, targetResourceGroupId: targetResourceGroupId, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, confidentialVmKeyVaultId: confidentialVmKeyVaultId, targetVmSecurityProfile: targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, targetVmTags: targetVmTags, protectedDisks: protectedDisks, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, vmNics: vmNics, targetNicTags: targetNicTags, migrationRecoveryPointId: migrationRecoveryPointId, lastRecoveryPointReceived: lastRecoveryPointReceived, lastRecoveryPointId: lastRecoveryPointId, initialSeedingProgressPercentage: initialSeedingProgressPercentage, migrationProgressPercentage: migrationProgressPercentage, resyncProgressPercentage: resyncProgressPercentage, resumeProgressPercentage: resumeProgressPercentage, deltaSyncProgressPercentage: default, isCheckSumResyncCycle: default, initialSeedingRetryCount: initialSeedingRetryCount, resyncRetryCount: resyncRetryCount, resumeRetryCount: resumeRetryCount, deltaSyncRetryCount: default, resyncRequired: resyncRequired, resyncState: resyncState, performAutoResync: performAutoResync, seedDiskTags: seedDiskTags, targetDiskTags: targetDiskTags, supportedOSVersions: supportedOSVersions, applianceMonitoringDetails: default, gatewayOperationDetails: default, operationName: default); + } + + /// Initializes a new instance of VMwareCbtProtectedDiskDetails. + /// The disk id. + /// The disk name. + /// The disk type. + /// The disk path. + /// A value indicating whether the disk is the OS disk. + /// The disk capacity in bytes. + /// The log storage account ARM Id. + /// The key vault secret name of the log storage account. + /// The DiskEncryptionSet ARM Id. + /// The ARM Id of the seed managed disk. + /// The uri of the seed blob. + /// The ARM Id of the target managed disk. + /// The uri of the target blob. + /// The name for the target managed disk. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName) + { + return VMwareCbtProtectedDiskDetails(diskId: diskId, diskName: diskName, diskType: diskType, diskPath: diskPath, isOSDisk: isOSDisk, capacityInBytes: capacityInBytes, logStorageAccountId: logStorageAccountId, logStorageAccountSasSecretName: logStorageAccountSasSecretName, diskEncryptionSetId: diskEncryptionSetId, seedManagedDiskId: seedManagedDiskId, seedBlobUri: seedBlobUri, targetManagedDiskId: targetManagedDiskId, targetBlobUri: targetBlobUri, targetDiskName: targetDiskName, gatewayOperationDetails: default); + } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs index 8af39ce52546..d2dcd10522ef 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs @@ -535,7 +535,7 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentData RedisCacheAccessPolicyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState?), System.Guid? objectId = default(System.Guid?), string objectIdAlias = null, string accessPolicyName = null) { throw null; } public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyData RedisCacheAccessPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState?), Azure.ResourceManager.Redis.Models.AccessPolicyType? typePropertiesType = default(Azure.ResourceManager.Redis.Models.AccessPolicyType?), string permissions = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled, string rdbBackupFrequency, int? rdbBackupMaxSnapshotCount, string rdbStorageConnectionString, bool? isAofBackupEnabled, string aofStorageConnectionString0, string aofStorageConnectionString1, string maxFragmentationMemoryReserved, string maxMemoryPolicy, string maxMemoryReserved, string maxMemoryDelta, string maxClients, string preferredDataArchiveAuthMethod, string preferredDataPersistenceAuthMethod, string zonalConfiguration, string authNotRequired, string storageSubscriptionId, System.Collections.Generic.IDictionary additionalProperties) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled, string rdbBackupFrequency, int? rdbBackupMaxSnapshotCount, string rdbStorageConnectionString, bool? isAofBackupEnabled, string aofStorageConnectionString0, string aofStorageConnectionString1, string maxFragmentationMemoryReserved, string maxMemoryPolicy, string maxMemoryReserved, string maxMemoryDelta, string maxClients, string preferredDataArchiveAuthMethod, string preferredDataPersistenceAuthMethod, string zonalConfiguration, string authNotRequired, string storageSubscriptionId, string isAadEnabled, System.Collections.Generic.IDictionary additionalProperties) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string notifyKeyspaceEvents = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, string isAadEnabled = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } @@ -545,7 +545,7 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs index 8af39ce52546..d2dcd10522ef 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs @@ -535,7 +535,7 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentData RedisCacheAccessPolicyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState?), System.Guid? objectId = default(System.Guid?), string objectIdAlias = null, string accessPolicyName = null) { throw null; } public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyData RedisCacheAccessPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState?), Azure.ResourceManager.Redis.Models.AccessPolicyType? typePropertiesType = default(Azure.ResourceManager.Redis.Models.AccessPolicyType?), string permissions = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled, string rdbBackupFrequency, int? rdbBackupMaxSnapshotCount, string rdbStorageConnectionString, bool? isAofBackupEnabled, string aofStorageConnectionString0, string aofStorageConnectionString1, string maxFragmentationMemoryReserved, string maxMemoryPolicy, string maxMemoryReserved, string maxMemoryDelta, string maxClients, string preferredDataArchiveAuthMethod, string preferredDataPersistenceAuthMethod, string zonalConfiguration, string authNotRequired, string storageSubscriptionId, System.Collections.Generic.IDictionary additionalProperties) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled, string rdbBackupFrequency, int? rdbBackupMaxSnapshotCount, string rdbStorageConnectionString, bool? isAofBackupEnabled, string aofStorageConnectionString0, string aofStorageConnectionString1, string maxFragmentationMemoryReserved, string maxMemoryPolicy, string maxMemoryReserved, string maxMemoryDelta, string maxClients, string preferredDataArchiveAuthMethod, string preferredDataPersistenceAuthMethod, string zonalConfiguration, string authNotRequired, string storageSubscriptionId, string isAadEnabled, System.Collections.Generic.IDictionary additionalProperties) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string notifyKeyspaceEvents = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, string isAadEnabled = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } @@ -545,7 +545,7 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Customization/ArmRedisModelFactory.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Customization/ArmRedisModelFactory.cs deleted file mode 100644 index 813c6195e52a..000000000000 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Customization/ArmRedisModelFactory.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Redis; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.Redis.Models -{ - /// Model factory for models. - public static partial class ArmRedisModelFactory - { - /// Initializes a new instance of RedisCommonConfiguration. - /// Specifies whether the rdb backup is enabled. - /// Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440). - /// Specifies the maximum number of snapshots for rdb backup. - /// The storage account connection string for storing rdb file. - /// Specifies whether the aof backup is enabled. - /// First storage account connection string. - /// Second storage account connection string. - /// Value in megabytes reserved for fragmentation per shard. - /// The eviction strategy used when your data won't fit within its memory limit. - /// Value in megabytes reserved for non-cache usage per shard e.g. failover. - /// Value in megabytes reserved for non-cache usage per shard e.g. failover. - /// The max clients config. - /// Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS. - /// Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS. - /// Zonal Configuration. - /// Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view. - /// SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity. - /// Additional Properties. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = null, string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = null, string rdbStorageConnectionString = null, bool? isAofBackupEnabled = null, string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, IDictionary additionalProperties = null) - => RedisCommonConfiguration(isRdbBackupEnabled: isRdbBackupEnabled, rdbBackupFrequency: rdbBackupFrequency, rdbBackupMaxSnapshotCount: rdbBackupMaxSnapshotCount, rdbStorageConnectionString: rdbStorageConnectionString, isAofBackupEnabled: isAofBackupEnabled, aofStorageConnectionString0: aofStorageConnectionString0, aofStorageConnectionString1: aofStorageConnectionString1, maxFragmentationMemoryReserved: maxFragmentationMemoryReserved, maxMemoryPolicy: maxMemoryPolicy, maxMemoryReserved: maxMemoryReserved, maxMemoryDelta: maxMemoryDelta, maxClients: maxClients, preferredDataArchiveAuthMethod: preferredDataArchiveAuthMethod, preferredDataPersistenceAuthMethod: preferredDataPersistenceAuthMethod, zonalConfiguration: zonalConfiguration, authNotRequired: authNotRequired, storageSubscriptionId: storageSubscriptionId, additionalProperties: additionalProperties); - - /// Initializes a new instance of RedisData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A list of availability zones denoting where the resource needs to come from. - /// The identity of the resource. - /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. - /// Specifies whether the non-ssl Redis server port (6379) is enabled. - /// The number of replicas to be created per primary. - /// The number of replicas to be created per primary. - /// A dictionary of tenant settings. - /// The number of shards to be created on a Premium Cluster Cache. - /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). - /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. - /// The SKU of the Redis cache to deploy. - /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. - /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. - /// Redis instance provisioning status. - /// Redis host name. - /// Redis non-SSL port. - /// Redis SSL port. - /// The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache. - /// List of the linked servers associated with the cache. - /// List of the Redis instances associated with the cache. - /// List of private endpoint connection associated with the specified redis cache. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisData RedisData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null, RedisProvisioningState? provisioningState = null, string hostName = null, int? port = null, int? sslPort = null, RedisAccessKeys accessKeys = null, IEnumerable linkedServers = null, IEnumerable instances = null, IEnumerable privateEndpointConnections = null) - => RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones?.ToList(), identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers?.ToList(), instances: instances?.ToList(), privateEndpointConnections: privateEndpointConnections?.ToList()); - } -} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs index 6eee442a43e2..32f35321de02 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs @@ -472,6 +472,132 @@ public static RedisCacheAccessPolicyAssignmentData RedisCacheAccessPolicyAssignm serializedAdditionalRawData: null); } + /// Initializes a new instance of RedisCommonConfiguration. + /// Specifies whether the rdb backup is enabled. + /// Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440). + /// Specifies the maximum number of snapshots for rdb backup. + /// The storage account connection string for storing rdb file. + /// Specifies whether the aof backup is enabled. + /// First storage account connection string. + /// Second storage account connection string. + /// Value in megabytes reserved for fragmentation per shard. + /// The eviction strategy used when your data won't fit within its memory limit. + /// Value in megabytes reserved for non-cache usage per shard e.g. failover. + /// Value in megabytes reserved for non-cache usage per shard e.g. failover. + /// The max clients config. + /// Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS. + /// Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS. + /// Zonal Configuration. + /// Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view. + /// SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity. + /// Additional Properties. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled, string rdbBackupFrequency, int? rdbBackupMaxSnapshotCount, string rdbStorageConnectionString, bool? isAofBackupEnabled, string aofStorageConnectionString0, string aofStorageConnectionString1, string maxFragmentationMemoryReserved, string maxMemoryPolicy, string maxMemoryReserved, string maxMemoryDelta, string maxClients, string preferredDataArchiveAuthMethod, string preferredDataPersistenceAuthMethod, string zonalConfiguration, string authNotRequired, string storageSubscriptionId, IDictionary additionalProperties) + { + return RedisCommonConfiguration(isRdbBackupEnabled: isRdbBackupEnabled, rdbBackupFrequency: rdbBackupFrequency, rdbBackupMaxSnapshotCount: rdbBackupMaxSnapshotCount, rdbStorageConnectionString: rdbStorageConnectionString, isAofBackupEnabled: isAofBackupEnabled, aofStorageConnectionString0: aofStorageConnectionString0, aofStorageConnectionString1: aofStorageConnectionString1, maxFragmentationMemoryReserved: maxFragmentationMemoryReserved, maxMemoryPolicy: maxMemoryPolicy, maxMemoryReserved: maxMemoryReserved, maxMemoryDelta: maxMemoryDelta, maxClients: maxClients, notifyKeyspaceEvents: default, preferredDataArchiveAuthMethod: preferredDataArchiveAuthMethod, preferredDataPersistenceAuthMethod: preferredDataPersistenceAuthMethod, zonalConfiguration: zonalConfiguration, authNotRequired: authNotRequired, storageSubscriptionId: storageSubscriptionId, isAadEnabled: default, additionalProperties: additionalProperties); + } + + /// Initializes a new instance of RedisData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A list of availability zones denoting where the resource needs to come from. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// Redis instance provisioning status. + /// Redis host name. + /// Redis non-SSL port. + /// Redis SSL port. + /// The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache. + /// List of the linked servers associated with the cache. + /// List of the Redis instances associated with the cache. + /// List of private endpoint connection associated with the specified redis cache. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisData RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IEnumerable linkedServers, IEnumerable instances, IEnumerable privateEndpointConnections) + { + return RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: default, isAccessKeyAuthenticationDisabled: default, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers, instances: instances, privateEndpointConnections: privateEndpointConnections); + } + + /// Initializes a new instance of . + /// A list of availability zones denoting where the resource needs to come from. + /// The geo-location where the resource lives. + /// Resource tags. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. + /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable zones, AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP) + { + return RedisCreateOrUpdateContent(zones: zones, location: location, tags: tags, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: isAccessKeyAuthenticationDisabled, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A list of availability zones denoting where the resource needs to come from. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. + /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// Redis instance provisioning status. + /// Redis host name. + /// Redis non-SSL port. + /// Redis SSL port. + /// The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache. + /// List of the linked servers associated with the cache. + /// List of the Redis instances associated with the cache. + /// List of private endpoint connection associated with the specified redis cache. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisData RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IEnumerable linkedServers, IEnumerable instances, IEnumerable privateEndpointConnections) + { + return RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: isAccessKeyAuthenticationDisabled, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers, instances: instances, privateEndpointConnections: privateEndpointConnections); + } + /// Initializes a new instance of . /// A list of availability zones denoting where the resource needs to come from. /// The geo-location where the resource lives. diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 960151044171..d8bf790b5988 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -79,6 +79,7 @@ trigger: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -284,6 +285,7 @@ pr: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.net8.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.net8.0.cs index bc5a4ad8e823..91c96c7cf040 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.net8.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.net8.0.cs @@ -1193,6 +1193,7 @@ public ArmDeploymentProperties(Azure.ResourceManager.Resources.Models.ArmDeploym public Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink ParametersLink { get { throw null; } set { } } public System.BinaryData Template { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink TemplateLink { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.ValidationLevel? ValidationLevel { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1206,6 +1207,7 @@ internal ArmDeploymentPropertiesExtended() { } public string CorrelationId { get { throw null; } } public string DebugSettingDetailLevel { get { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] set { } } public System.Collections.Generic.IReadOnlyList Dependencies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } public System.TimeSpan? Duration { get { throw null; } } public Azure.ResponseError Error { get { throw null; } } public Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeployment { get { throw null; } } @@ -1220,6 +1222,7 @@ internal ArmDeploymentPropertiesExtended() { } public Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink TemplateLink { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValidatedResources { get { throw null; } } + public Azure.ResourceManager.Resources.Models.ValidationLevel? ValidationLevel { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1283,12 +1286,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ArmDeploymentValidateResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ArmDeploymentValidateResult : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ArmDeploymentValidateResult() { } public Azure.ResponseError Error { get { throw null; } } public Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended Properties { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1336,14 +1339,22 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.ArmDeploymentExportResult ArmDeploymentExportResult(System.BinaryData template = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentOperation ArmDeploymentOperation(string id = null, string operationId = null, Azure.ResourceManager.Resources.Models.ArmDeploymentOperationProperties properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentOperationProperties ArmDeploymentOperationProperties(Azure.ResourceManager.Resources.Models.ProvisioningOperationKind? provisioningOperation = default(Azure.ResourceManager.Resources.Models.ProvisioningOperationKind?), string provisioningState = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), string serviceRequestId = null, string statusCode = null, Azure.ResourceManager.Resources.Models.StatusMessage statusMessage = null, Azure.ResourceManager.Resources.Models.TargetResource targetResource = null, System.BinaryData requestContent = null, System.BinaryData responseContent = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?)) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), string correlationId = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), System.BinaryData outputs = null, System.Collections.Generic.IEnumerable providers = null, System.Collections.Generic.IEnumerable dependencies = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode = default(Azure.ResourceManager.Resources.Models.ArmDeploymentMode?), string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment = null, string templateHash = null, System.Collections.Generic.IEnumerable outputResources = null, System.Collections.Generic.IEnumerable validatedResources = null, Azure.ResponseError error = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState, string correlationId, System.DateTimeOffset? timestamp, System.TimeSpan? duration, System.BinaryData outputs, System.Collections.Generic.IEnumerable providers, System.Collections.Generic.IEnumerable dependencies, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment, string templateHash, System.Collections.Generic.IEnumerable outputResources, System.Collections.Generic.IEnumerable validatedResources, Azure.ResponseError error) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), string correlationId = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), System.BinaryData outputs = null, System.Collections.Generic.IEnumerable providers = null, System.Collections.Generic.IEnumerable dependencies = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode = default(Azure.ResourceManager.Resources.Models.ArmDeploymentMode?), string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment = null, string templateHash = null, System.Collections.Generic.IEnumerable outputResources = null, System.Collections.Generic.IEnumerable validatedResources = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable diagnostics = null, Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?)) { throw null; } public static Azure.ResourceManager.Resources.ArmDeploymentScriptData ArmDeploymentScriptData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string kind = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity ArmDeploymentScriptManagedIdentity(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType? identityType = default(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch ArmDeploymentScriptPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties properties = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope, Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat) { throw null; } public static Azure.ResourceManager.Resources.Models.AzureCliScript AzureCliScript(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string containerGroupName = null, Azure.ResourceManager.Resources.Models.ScriptStorageConfiguration storageAccountSettings = null, Azure.ResourceManager.Resources.Models.ScriptCleanupOptions? cleanupPreference = default(Azure.ResourceManager.Resources.Models.ScriptCleanupOptions?), Azure.ResourceManager.Resources.Models.ScriptProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ScriptProvisioningState?), Azure.ResourceManager.Resources.Models.ScriptStatus status = null, System.BinaryData outputs = null, System.Uri primaryScriptUri = null, System.Collections.Generic.IEnumerable supportingScriptUris = null, string scriptContent = null, string arguments = null, System.Collections.Generic.IEnumerable environmentVariables = null, string forceUpdateTag = null, System.TimeSpan retentionInterval = default(System.TimeSpan), System.TimeSpan? timeout = default(System.TimeSpan?), string azCliVersion = null) { throw null; } public static Azure.ResourceManager.Resources.Models.AzurePowerShellScript AzurePowerShellScript(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string containerGroupName = null, Azure.ResourceManager.Resources.Models.ScriptStorageConfiguration storageAccountSettings = null, Azure.ResourceManager.Resources.Models.ScriptCleanupOptions? cleanupPreference = default(Azure.ResourceManager.Resources.Models.ScriptCleanupOptions?), Azure.ResourceManager.Resources.Models.ScriptProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ScriptProvisioningState?), Azure.ResourceManager.Resources.Models.ScriptStatus status = null, System.BinaryData outputs = null, System.Uri primaryScriptUri = null, System.Collections.Generic.IEnumerable supportingScriptUris = null, string scriptContent = null, string arguments = null, System.Collections.Generic.IEnumerable environmentVariables = null, string forceUpdateTag = null, System.TimeSpan retentionInterval = default(System.TimeSpan), System.TimeSpan? timeout = default(System.TimeSpan?), string azPowerShellVersion = null) { throw null; } public static Azure.ResourceManager.Resources.Models.BasicArmDependency BasicArmDependency(string id = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null) { throw null; } @@ -1351,9 +1362,11 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.DataBoundaryProperties DataBoundaryProperties(Azure.ResourceManager.Resources.Models.DataBoundaryRegion? dataBoundary = default(Azure.ResourceManager.Resources.Models.DataBoundaryRegion?), Azure.ResourceManager.Resources.Models.DataBoundaryProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DataBoundaryProvisioningState?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition DeploymentDiagnosticsDefinition(Azure.ResourceManager.Resources.Models.Level level = default(Azure.ResourceManager.Resources.Models.Level), string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable additionalInfo = null) { throw null; } public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo ErrorAdditionalInfo(string errorAdditionalInfoType = null, System.BinaryData info = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } public static Azure.ResourceManager.Resources.JitRequestData JitRequestData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string applicationResourceId = null, System.Guid? publisherTenantId = default(System.Guid?), System.Collections.Generic.IEnumerable jitAuthorizationPolicies = null, Azure.ResourceManager.Resources.Models.JitSchedulingPolicy jitSchedulingPolicy = null, Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), Azure.ResourceManager.Resources.Models.JitRequestState? jitRequestState = default(Azure.ResourceManager.Resources.Models.JitRequestState?), Azure.ResourceManager.Resources.Models.ArmApplicationDetails createdBy = null, Azure.ResourceManager.Resources.Models.ArmApplicationDetails updatedBy = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ManagedResourceReference ManagedResourceReference(string id = null, Azure.ResourceManager.Resources.Models.ResourceStatusMode? status = default(Azure.ResourceManager.Resources.Models.ResourceStatusMode?), Azure.ResourceManager.Resources.Models.DenyStatusMode? denyStatus = default(Azure.ResourceManager.Resources.Models.DenyStatusMode?)) { throw null; } @@ -1369,8 +1382,12 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.TemplateSpecVersionData TemplateSpecVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string description = null, System.Collections.Generic.IEnumerable linkedTemplates = null, System.BinaryData metadata = null, System.BinaryData mainTemplate = null, System.BinaryData uiFormDefinition = null) { throw null; } public static Azure.ResourceManager.Resources.Models.TemplateSpecVersionInfo TemplateSpecVersionInfo(string description = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), System.DateTimeOffset? timeModified = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Resources.Models.TemplateSpecVersionPatch TemplateSpecVersionPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId = null, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType = Azure.ResourceManager.Resources.Models.WhatIfChangeType.Create, string unsupportedReason = null, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable delta = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable changes = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType, string unsupportedReason, System.BinaryData before, System.BinaryData after, System.Collections.Generic.IEnumerable delta) { throw null; } + public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId = null, string deploymentId = null, string symbolicName = null, System.BinaryData identifiers = null, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType = Azure.ResourceManager.Resources.Models.WhatIfChangeType.Create, string unsupportedReason = null, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable delta = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status, Azure.ResponseError error, System.Collections.Generic.IEnumerable changes) { throw null; } + public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable changes = null, System.Collections.Generic.IEnumerable potentialChanges = null, System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.Resources.Models.WhatIfPropertyChange WhatIfPropertyChange(string path = null, Azure.ResourceManager.Resources.Models.WhatIfPropertyChangeType propertyChangeType = Azure.ResourceManager.Resources.Models.WhatIfPropertyChangeType.Create, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable children = null) { throw null; } } public partial class AzureCliScript : Azure.ResourceManager.Resources.ArmDeploymentScriptData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -1597,6 +1614,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Resources.Models.DenyStatusMode left, Azure.ResourceManager.Resources.Models.DenyStatusMode right) { throw null; } public override string ToString() { throw null; } } + public partial class DeploymentDiagnosticsDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDiagnosticsDefinition() { } + public System.Collections.Generic.IReadOnlyList AdditionalInfo { get { throw null; } } + public string Code { get { throw null; } } + public Azure.ResourceManager.Resources.Models.Level Level { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeploymentParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeploymentParameter() { } @@ -1724,6 +1756,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ErrorAdditionalInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ErrorAdditionalInfo() { } + public string ErrorAdditionalInfoType { get { throw null; } } + public System.BinaryData Info { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ErrorDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ErrorDeployment() { } @@ -1915,6 +1959,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Level : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Level(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.Level Error { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.Level Info { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.Level Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.Level other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Resources.Models.Level left, Azure.ResourceManager.Resources.Models.Level right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.Level (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.Level left, Azure.ResourceManager.Resources.Models.Level right) { throw null; } + public override string ToString() { throw null; } + } public partial class LinkedTemplateArtifact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LinkedTemplateArtifact(string path, System.BinaryData template) { } @@ -2248,6 +2311,25 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ValidationLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ValidationLevel(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.ValidationLevel Provider { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ValidationLevel ProviderNoRbac { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ValidationLevel Template { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.ValidationLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Resources.Models.ValidationLevel left, Azure.ResourceManager.Resources.Models.ValidationLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.ValidationLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.ValidationLevel left, Azure.ResourceManager.Resources.Models.ValidationLevel right) { throw null; } + public override string ToString() { throw null; } + } public partial class WhatIfChange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WhatIfChange() { } @@ -2255,7 +2337,10 @@ internal WhatIfChange() { } public System.BinaryData Before { get { throw null; } } public Azure.ResourceManager.Resources.Models.WhatIfChangeType ChangeType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Delta { get { throw null; } } + public string DeploymentId { get { throw null; } } + public System.BinaryData Identifiers { get { throw null; } } public string ResourceId { get { throw null; } } + public string SymbolicName { get { throw null; } } public string UnsupportedReason { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.WhatIfChange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2278,7 +2363,9 @@ public partial class WhatIfOperationResult : System.ClientModel.Primitives.IJson { internal WhatIfOperationResult() { } public System.Collections.Generic.IReadOnlyList Changes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } public Azure.ResponseError Error { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PotentialChanges { get { throw null; } } public string Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.WhatIfOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index bc5a4ad8e823..91c96c7cf040 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -1193,6 +1193,7 @@ public ArmDeploymentProperties(Azure.ResourceManager.Resources.Models.ArmDeploym public Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink ParametersLink { get { throw null; } set { } } public System.BinaryData Template { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink TemplateLink { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.ValidationLevel? ValidationLevel { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1206,6 +1207,7 @@ internal ArmDeploymentPropertiesExtended() { } public string CorrelationId { get { throw null; } } public string DebugSettingDetailLevel { get { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] set { } } public System.Collections.Generic.IReadOnlyList Dependencies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } public System.TimeSpan? Duration { get { throw null; } } public Azure.ResponseError Error { get { throw null; } } public Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeployment { get { throw null; } } @@ -1220,6 +1222,7 @@ internal ArmDeploymentPropertiesExtended() { } public Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink TemplateLink { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValidatedResources { get { throw null; } } + public Azure.ResourceManager.Resources.Models.ValidationLevel? ValidationLevel { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1283,12 +1286,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ArmDeploymentValidateResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ArmDeploymentValidateResult : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ArmDeploymentValidateResult() { } public Azure.ResponseError Error { get { throw null; } } public Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended Properties { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1336,14 +1339,22 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.ArmDeploymentExportResult ArmDeploymentExportResult(System.BinaryData template = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentOperation ArmDeploymentOperation(string id = null, string operationId = null, Azure.ResourceManager.Resources.Models.ArmDeploymentOperationProperties properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentOperationProperties ArmDeploymentOperationProperties(Azure.ResourceManager.Resources.Models.ProvisioningOperationKind? provisioningOperation = default(Azure.ResourceManager.Resources.Models.ProvisioningOperationKind?), string provisioningState = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), string serviceRequestId = null, string statusCode = null, Azure.ResourceManager.Resources.Models.StatusMessage statusMessage = null, Azure.ResourceManager.Resources.Models.TargetResource targetResource = null, System.BinaryData requestContent = null, System.BinaryData responseContent = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?)) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), string correlationId = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), System.BinaryData outputs = null, System.Collections.Generic.IEnumerable providers = null, System.Collections.Generic.IEnumerable dependencies = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode = default(Azure.ResourceManager.Resources.Models.ArmDeploymentMode?), string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment = null, string templateHash = null, System.Collections.Generic.IEnumerable outputResources = null, System.Collections.Generic.IEnumerable validatedResources = null, Azure.ResponseError error = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentProperties ArmDeploymentProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState, string correlationId, System.DateTimeOffset? timestamp, System.TimeSpan? duration, System.BinaryData outputs, System.Collections.Generic.IEnumerable providers, System.Collections.Generic.IEnumerable dependencies, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment, string templateHash, System.Collections.Generic.IEnumerable outputResources, System.Collections.Generic.IEnumerable validatedResources, Azure.ResponseError error) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), string correlationId = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), System.TimeSpan? duration = default(System.TimeSpan?), System.BinaryData outputs = null, System.Collections.Generic.IEnumerable providers = null, System.Collections.Generic.IEnumerable dependencies = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode? mode = default(Azure.ResourceManager.Resources.Models.ArmDeploymentMode?), string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended errorDeployment = null, string templateHash = null, System.Collections.Generic.IEnumerable outputResources = null, System.Collections.Generic.IEnumerable validatedResources = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable diagnostics = null, Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?)) { throw null; } public static Azure.ResourceManager.Resources.ArmDeploymentScriptData ArmDeploymentScriptData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string kind = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity ArmDeploymentScriptManagedIdentity(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType? identityType = default(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch ArmDeploymentScriptPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties properties = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } + public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.ValidationLevel? validationLevel = default(Azure.ResourceManager.Resources.Models.ValidationLevel?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink, System.BinaryData parameters, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode, string debugSettingDetailLevel, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope, Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat) { throw null; } public static Azure.ResourceManager.Resources.Models.AzureCliScript AzureCliScript(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string containerGroupName = null, Azure.ResourceManager.Resources.Models.ScriptStorageConfiguration storageAccountSettings = null, Azure.ResourceManager.Resources.Models.ScriptCleanupOptions? cleanupPreference = default(Azure.ResourceManager.Resources.Models.ScriptCleanupOptions?), Azure.ResourceManager.Resources.Models.ScriptProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ScriptProvisioningState?), Azure.ResourceManager.Resources.Models.ScriptStatus status = null, System.BinaryData outputs = null, System.Uri primaryScriptUri = null, System.Collections.Generic.IEnumerable supportingScriptUris = null, string scriptContent = null, string arguments = null, System.Collections.Generic.IEnumerable environmentVariables = null, string forceUpdateTag = null, System.TimeSpan retentionInterval = default(System.TimeSpan), System.TimeSpan? timeout = default(System.TimeSpan?), string azCliVersion = null) { throw null; } public static Azure.ResourceManager.Resources.Models.AzurePowerShellScript AzurePowerShellScript(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string containerGroupName = null, Azure.ResourceManager.Resources.Models.ScriptStorageConfiguration storageAccountSettings = null, Azure.ResourceManager.Resources.Models.ScriptCleanupOptions? cleanupPreference = default(Azure.ResourceManager.Resources.Models.ScriptCleanupOptions?), Azure.ResourceManager.Resources.Models.ScriptProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ScriptProvisioningState?), Azure.ResourceManager.Resources.Models.ScriptStatus status = null, System.BinaryData outputs = null, System.Uri primaryScriptUri = null, System.Collections.Generic.IEnumerable supportingScriptUris = null, string scriptContent = null, string arguments = null, System.Collections.Generic.IEnumerable environmentVariables = null, string forceUpdateTag = null, System.TimeSpan retentionInterval = default(System.TimeSpan), System.TimeSpan? timeout = default(System.TimeSpan?), string azPowerShellVersion = null) { throw null; } public static Azure.ResourceManager.Resources.Models.BasicArmDependency BasicArmDependency(string id = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null) { throw null; } @@ -1351,9 +1362,11 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.DataBoundaryProperties DataBoundaryProperties(Azure.ResourceManager.Resources.Models.DataBoundaryRegion? dataBoundary = default(Azure.ResourceManager.Resources.Models.DataBoundaryRegion?), Azure.ResourceManager.Resources.Models.DataBoundaryProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DataBoundaryProvisioningState?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition DeploymentDiagnosticsDefinition(Azure.ResourceManager.Resources.Models.Level level = default(Azure.ResourceManager.Resources.Models.Level), string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable additionalInfo = null) { throw null; } public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo ErrorAdditionalInfo(string errorAdditionalInfoType = null, System.BinaryData info = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } public static Azure.ResourceManager.Resources.JitRequestData JitRequestData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string applicationResourceId = null, System.Guid? publisherTenantId = default(System.Guid?), System.Collections.Generic.IEnumerable jitAuthorizationPolicies = null, Azure.ResourceManager.Resources.Models.JitSchedulingPolicy jitSchedulingPolicy = null, Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), Azure.ResourceManager.Resources.Models.JitRequestState? jitRequestState = default(Azure.ResourceManager.Resources.Models.JitRequestState?), Azure.ResourceManager.Resources.Models.ArmApplicationDetails createdBy = null, Azure.ResourceManager.Resources.Models.ArmApplicationDetails updatedBy = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ManagedResourceReference ManagedResourceReference(string id = null, Azure.ResourceManager.Resources.Models.ResourceStatusMode? status = default(Azure.ResourceManager.Resources.Models.ResourceStatusMode?), Azure.ResourceManager.Resources.Models.DenyStatusMode? denyStatus = default(Azure.ResourceManager.Resources.Models.DenyStatusMode?)) { throw null; } @@ -1369,8 +1382,12 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.TemplateSpecVersionData TemplateSpecVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string description = null, System.Collections.Generic.IEnumerable linkedTemplates = null, System.BinaryData metadata = null, System.BinaryData mainTemplate = null, System.BinaryData uiFormDefinition = null) { throw null; } public static Azure.ResourceManager.Resources.Models.TemplateSpecVersionInfo TemplateSpecVersionInfo(string description = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), System.DateTimeOffset? timeModified = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Resources.Models.TemplateSpecVersionPatch TemplateSpecVersionPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId = null, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType = Azure.ResourceManager.Resources.Models.WhatIfChangeType.Create, string unsupportedReason = null, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable delta = null) { throw null; } - public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable changes = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType, string unsupportedReason, System.BinaryData before, System.BinaryData after, System.Collections.Generic.IEnumerable delta) { throw null; } + public static Azure.ResourceManager.Resources.Models.WhatIfChange WhatIfChange(string resourceId = null, string deploymentId = null, string symbolicName = null, System.BinaryData identifiers = null, Azure.ResourceManager.Resources.Models.WhatIfChangeType changeType = Azure.ResourceManager.Resources.Models.WhatIfChangeType.Create, string unsupportedReason = null, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable delta = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status, Azure.ResponseError error, System.Collections.Generic.IEnumerable changes) { throw null; } + public static Azure.ResourceManager.Resources.Models.WhatIfOperationResult WhatIfOperationResult(string status = null, Azure.ResponseError error = null, System.Collections.Generic.IEnumerable changes = null, System.Collections.Generic.IEnumerable potentialChanges = null, System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.Resources.Models.WhatIfPropertyChange WhatIfPropertyChange(string path = null, Azure.ResourceManager.Resources.Models.WhatIfPropertyChangeType propertyChangeType = Azure.ResourceManager.Resources.Models.WhatIfPropertyChangeType.Create, System.BinaryData before = null, System.BinaryData after = null, System.Collections.Generic.IEnumerable children = null) { throw null; } } public partial class AzureCliScript : Azure.ResourceManager.Resources.ArmDeploymentScriptData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -1597,6 +1614,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Resources.Models.DenyStatusMode left, Azure.ResourceManager.Resources.Models.DenyStatusMode right) { throw null; } public override string ToString() { throw null; } } + public partial class DeploymentDiagnosticsDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDiagnosticsDefinition() { } + public System.Collections.Generic.IReadOnlyList AdditionalInfo { get { throw null; } } + public string Code { get { throw null; } } + public Azure.ResourceManager.Resources.Models.Level Level { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentDiagnosticsDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeploymentParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeploymentParameter() { } @@ -1724,6 +1756,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ErrorAdditionalInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ErrorAdditionalInfo() { } + public string ErrorAdditionalInfoType { get { throw null; } } + public System.BinaryData Info { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ErrorAdditionalInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ErrorDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ErrorDeployment() { } @@ -1915,6 +1959,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Level : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Level(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.Level Error { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.Level Info { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.Level Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.Level other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Resources.Models.Level left, Azure.ResourceManager.Resources.Models.Level right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.Level (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.Level left, Azure.ResourceManager.Resources.Models.Level right) { throw null; } + public override string ToString() { throw null; } + } public partial class LinkedTemplateArtifact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LinkedTemplateArtifact(string path, System.BinaryData template) { } @@ -2248,6 +2311,25 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ValidationLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ValidationLevel(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.ValidationLevel Provider { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ValidationLevel ProviderNoRbac { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ValidationLevel Template { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.ValidationLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Resources.Models.ValidationLevel left, Azure.ResourceManager.Resources.Models.ValidationLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.ValidationLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.ValidationLevel left, Azure.ResourceManager.Resources.Models.ValidationLevel right) { throw null; } + public override string ToString() { throw null; } + } public partial class WhatIfChange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WhatIfChange() { } @@ -2255,7 +2337,10 @@ internal WhatIfChange() { } public System.BinaryData Before { get { throw null; } } public Azure.ResourceManager.Resources.Models.WhatIfChangeType ChangeType { get { throw null; } } public System.Collections.Generic.IReadOnlyList Delta { get { throw null; } } + public string DeploymentId { get { throw null; } } + public System.BinaryData Identifiers { get { throw null; } } public string ResourceId { get { throw null; } } + public string SymbolicName { get { throw null; } } public string UnsupportedReason { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.WhatIfChange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2278,7 +2363,9 @@ public partial class WhatIfOperationResult : System.ClientModel.Primitives.IJson { internal WhatIfOperationResult() { } public System.Collections.Generic.IReadOnlyList Changes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } public Azure.ResponseError Error { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PotentialChanges { get { throw null; } } public string Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.WhatIfOperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs index 246ee4707c5b..93e681a78d79 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ArmDeploymentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateDeploymentAtAGivenScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PutDeploymentAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PutDeploymentAtScope.json // this example is just showing the usage of "Deployments_CreateOrUpdateAtScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs index 099a7337d38c..3a04e7353aaf 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ArmDeploymentResource [Ignore("Only validating compilation of examples")] public async Task Update_CreateDeploymentAtAGivenScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PutDeploymentAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PutDeploymentAtScope.json // this example is just showing the usage of "Deployments_CreateOrUpdateAtScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,9 +64,44 @@ public async Task Update_CreateDeploymentAtAGivenScope() [Test] [Ignore("Only validating compilation of examples")] - public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() + public async Task Validate_ValidatesATemplateAtScope() + { + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnScope.json + // this example is just showing the usage of "Deployments_ValidateAtScope" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ArmDeploymentResource created on azure + // for more information of creating ArmDeploymentResource, please refer to the document of ArmDeploymentResource + string scope = "subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group"; + string deploymentName = "my-deployment"; + ResourceIdentifier armDeploymentResourceId = ArmDeploymentResource.CreateResourceIdentifier(scope, deploymentName); + ArmDeploymentResource armDeployment = client.GetArmDeploymentResource(armDeploymentResourceId); + + // invoke the operation + ArmDeploymentContent content = new ArmDeploymentContent(new ArmDeploymentProperties(ArmDeploymentMode.Incremental) + { + TemplateLink = new ArmDeploymentTemplateLink + { + Uri = new Uri("https://example.com/exampleTemplate.json"), + QueryString = "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d", + }, + Parameters = BinaryData.FromObjectAsJson(new object()), + }); + ArmOperation lro = await armDeployment.ValidateAsync(WaitUntil.Completed, content); + ArmDeploymentValidateResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task WhatIf_PredictTemplateChangesAtTenantScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnTenant.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentWhatIfOnTenant.json // this example is just showing the usage of "Deployments_WhatIfAtTenantScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -103,7 +138,7 @@ public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() [Ignore("Only validating compilation of examples")] public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnManagementGroup.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentWhatIfOnManagementGroup.json // this example is just showing the usage of "Deployments_WhatIfAtManagementGroupScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +176,7 @@ public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() [Ignore("Only validating compilation of examples")] public async Task WhatIf_PredictTemplateChangesAtSubscriptionScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnSubscription.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentWhatIfOnSubscription.json // this example is just showing the usage of "Deployments_WhatIfAtSubscriptionScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +214,7 @@ public async Task WhatIf_PredictTemplateChangesAtSubscriptionScope() [Ignore("Only validating compilation of examples")] public async Task WhatIf_PredictTemplateChangesAtResourceGroupScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnResourceGroup.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentWhatIfOnResourceGroup.json // this example is just showing the usage of "Deployments_WhatIf" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_TenantResourceExtensions.cs index 1792b4ccb096..b2400ef16ded 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_TenantResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CalculateDeploymentTemplateHash_CalculateTemplateHash() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/CalculateTemplateHash.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/CalculateTemplateHash.json // this example is just showing the usage of "Deployments_CalculateTemplateHash" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs index a52edf858929..d4107b23aadc 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs @@ -56,7 +56,7 @@ internal ArmDeploymentCollection(ArmClient client, ResourceIdentifier id) : base /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -199,7 +199,7 @@ public virtual async Task> GetAsync(string deplo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual Response Get(string deploymentName, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual AsyncPageable GetAllAsync(string filter = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Pageable GetAll(string filter = null, int? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -394,7 +394,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -439,7 +439,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs index d9a707ff1fd5..36d6d5d62892 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs @@ -107,7 +107,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, A /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task CancelAsync(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -439,7 +439,7 @@ public virtual Response Cancel(CancellationToken cancellationToken = default) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual async Task> ValidateAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -531,7 +531,7 @@ public virtual ArmOperation Validate(WaitUntil wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -569,7 +569,7 @@ public virtual async Task> ExportTemplateAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -607,7 +607,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -623,7 +623,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -655,7 +655,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -732,7 +732,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -748,7 +748,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -764,7 +764,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -780,7 +780,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -857,7 +857,7 @@ public virtual ArmOperation WhatIf(WaitUntil waitUntil, A /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -896,7 +896,7 @@ public virtual async Task> GetDeploymentOperati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -935,7 +935,7 @@ public virtual Response GetDeploymentOperation(string op /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -962,7 +962,7 @@ public virtual AsyncPageable GetDeploymentOperationsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -989,7 +989,7 @@ public virtual Pageable GetDeploymentOperations(int? top /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1027,7 +1027,7 @@ public virtual async Task CheckExistenceAsync(CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1065,7 +1065,7 @@ public virtual Response CheckExistence(CancellationToken cancellationToken = def /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1127,7 +1127,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1189,7 +1189,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1246,7 +1246,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1303,7 +1303,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1363,7 +1363,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index b4c9204172da..018aca95458c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -57,6 +58,15 @@ public static TemplateSpecVersionInfo TemplateSpecVersionInfo(string description return new TemplateSpecVersionInfo(description, timeCreated, timeModified, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The additional info type. + /// The additional info. + /// A new instance for mocking. + public static ErrorAdditionalInfo ErrorAdditionalInfo(string errorAdditionalInfoType = null, BinaryData info = null) + { + return new ErrorAdditionalInfo(errorAdditionalInfoType, info, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -227,8 +237,9 @@ public static ArmDeploymentContent ArmDeploymentContent(AzureLocation? location /// The debug setting of the deployment. /// The deployment on error behavior. /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// The validation level of the deployment. /// A new instance for mocking. - public static ArmDeploymentProperties ArmDeploymentProperties(BinaryData template = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode mode = default, string debugSettingDetailLevel = null, ErrorDeployment errorDeployment = null, ExpressionEvaluationScope? expressionEvaluationScope = null) + public static ArmDeploymentProperties ArmDeploymentProperties(BinaryData template = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode mode = default, string debugSettingDetailLevel = null, ErrorDeployment errorDeployment = null, ExpressionEvaluationScope? expressionEvaluationScope = null, ValidationLevel? validationLevel = null) { return new ArmDeploymentProperties( template, @@ -239,6 +250,7 @@ public static ArmDeploymentProperties ArmDeploymentProperties(BinaryData templat debugSettingDetailLevel != null ? new DebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, errorDeployment, expressionEvaluationScope != null ? new ExpressionEvaluationOptions(expressionEvaluationScope, serializedAdditionalRawData: null) : null, + validationLevel, serializedAdditionalRawData: null); } @@ -284,13 +296,16 @@ public static ArmDeploymentData ArmDeploymentData(ResourceIdentifier id = null, /// Array of provisioned resources. /// Array of validated resources. /// The deployment error. + /// Contains diagnostic information collected during validation process. + /// The validation level of the deployment. /// A new instance for mocking. - public static ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisioningState = null, string correlationId = null, DateTimeOffset? timestamp = null, TimeSpan? duration = null, BinaryData outputs = null, IEnumerable providers = null, IEnumerable dependencies = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode? mode = null, string debugSettingDetailLevel = null, ErrorDeploymentExtended errorDeployment = null, string templateHash = null, IEnumerable outputResources = null, IEnumerable validatedResources = null, ResponseError error = null) + public static ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisioningState = null, string correlationId = null, DateTimeOffset? timestamp = null, TimeSpan? duration = null, BinaryData outputs = null, IEnumerable providers = null, IEnumerable dependencies = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode? mode = null, string debugSettingDetailLevel = null, ErrorDeploymentExtended errorDeployment = null, string templateHash = null, IEnumerable outputResources = null, IEnumerable validatedResources = null, ResponseError error = null, IEnumerable diagnostics = null, ValidationLevel? validationLevel = null) { providers ??= new List(); dependencies ??= new List(); outputResources ??= new List(); validatedResources ??= new List(); + diagnostics ??= new List(); return new ArmDeploymentPropertiesExtended( provisioningState, @@ -310,6 +325,8 @@ public static ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(Re outputResources?.ToList(), validatedResources?.ToList(), error, + diagnostics?.ToList(), + validationLevel, serializedAdditionalRawData: null); } @@ -346,13 +363,44 @@ public static ErrorDeploymentExtended ErrorDeploymentExtended(string provisionin return new ErrorDeploymentExtended(provisioningState, deploymentType, deploymentName, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Denotes the additional response level. + /// The error code. + /// The error message. + /// The error target. + /// The error additional info. + /// A new instance for mocking. + public static DeploymentDiagnosticsDefinition DeploymentDiagnosticsDefinition(Level level = default, string code = null, string message = null, string target = null, IEnumerable additionalInfo = null) + { + additionalInfo ??= new List(); + + return new DeploymentDiagnosticsDefinition( + level, + code, + message, + target, + additionalInfo?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. /// The deployment validation error. /// The template deployment properties. /// A new instance for mocking. - public static ArmDeploymentValidateResult ArmDeploymentValidateResult(ResponseError error = null, ArmDeploymentPropertiesExtended properties = null) + public static ArmDeploymentValidateResult ArmDeploymentValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResponseError error = null, ArmDeploymentPropertiesExtended properties = null) { - return new ArmDeploymentValidateResult(error, properties, serializedAdditionalRawData: null); + return new ArmDeploymentValidateResult( + id, + name, + resourceType, + systemData, + error, + properties, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -381,9 +429,10 @@ public static ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(AzureLocatio /// The debug setting of the deployment. /// The deployment on error behavior. /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// The validation level of the deployment. /// Optional What-If operation settings. /// A new instance for mocking. - public static ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(BinaryData template = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode mode = default, string debugSettingDetailLevel = null, ErrorDeployment errorDeployment = null, ExpressionEvaluationScope? expressionEvaluationScope = null, WhatIfResultFormat? whatIfResultFormat = null) + public static ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(BinaryData template = null, ArmDeploymentTemplateLink templateLink = null, BinaryData parameters = null, ArmDeploymentParametersLink parametersLink = null, ArmDeploymentMode mode = default, string debugSettingDetailLevel = null, ErrorDeployment errorDeployment = null, ExpressionEvaluationScope? expressionEvaluationScope = null, ValidationLevel? validationLevel = null, WhatIfResultFormat? whatIfResultFormat = null) { return new ArmDeploymentWhatIfProperties( template, @@ -394,6 +443,7 @@ public static ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(Binary debugSettingDetailLevel != null ? new DebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, errorDeployment, expressionEvaluationScope != null ? new ExpressionEvaluationOptions(expressionEvaluationScope, serializedAdditionalRawData: null) : null, + validationLevel, serializedAdditionalRawData: null, whatIfResultFormat != null ? new ArmDeploymentWhatIfSettings(whatIfResultFormat, serializedAdditionalRawData: null) : null); } @@ -402,28 +452,44 @@ public static ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(Binary /// Status of the What-If operation. /// Error when What-If operation fails. /// List of resource changes predicted by What-If operation. + /// List of resource changes predicted by What-If operation. + /// List of resource diagnostics detected by What-If operation. /// A new instance for mocking. - public static WhatIfOperationResult WhatIfOperationResult(string status = null, ResponseError error = null, IEnumerable changes = null) + public static WhatIfOperationResult WhatIfOperationResult(string status = null, ResponseError error = null, IEnumerable changes = null, IEnumerable potentialChanges = null, IEnumerable diagnostics = null) { changes ??= new List(); + potentialChanges ??= new List(); + diagnostics ??= new List(); - return new WhatIfOperationResult(status, error, changes?.ToList(), serializedAdditionalRawData: null); + return new WhatIfOperationResult( + status, + error, + changes?.ToList(), + potentialChanges?.ToList(), + diagnostics?.ToList(), + serializedAdditionalRawData: null); } /// Initializes a new instance of . /// Resource ID. + /// The resource id of the Deployment responsible for this change. + /// The symbolic name of the resource responsible for this change. + /// A subset of properties that uniquely identify a Bicep extensible resource because it lacks a resource id like an Azure resource has. /// Type of change that will be made to the resource when the deployment is executed. /// The explanation about why the resource is unsupported by What-If. /// The snapshot of the resource before the deployment is executed. /// The predicted snapshot of the resource after the deployment is executed. /// The predicted changes to resource properties. /// A new instance for mocking. - public static WhatIfChange WhatIfChange(string resourceId = null, WhatIfChangeType changeType = default, string unsupportedReason = null, BinaryData before = null, BinaryData after = null, IEnumerable delta = null) + public static WhatIfChange WhatIfChange(string resourceId = null, string deploymentId = null, string symbolicName = null, BinaryData identifiers = null, WhatIfChangeType changeType = default, string unsupportedReason = null, BinaryData before = null, BinaryData after = null, IEnumerable delta = null) { delta ??= new List(); return new WhatIfChange( resourceId, + deploymentId, + symbolicName, + identifiers, changeType, unsupportedReason, before, @@ -1133,5 +1199,98 @@ public static AzureCliScript AzureCliScript(ResourceIdentifier id = null, string timeout, azCliVersion); } + + /// Initializes a new instance of . + /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. + /// The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. + /// The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. + /// The debug setting of the deployment. + /// The deployment on error behavior. + /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ArmDeploymentProperties ArmDeploymentProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, string debugSettingDetailLevel, ErrorDeployment errorDeployment, ExpressionEvaluationScope? expressionEvaluationScope) + { + return ArmDeploymentProperties(template: template, templateLink: templateLink, parameters: parameters, parametersLink: parametersLink, mode: mode, debugSettingDetailLevel: debugSettingDetailLevel, errorDeployment: errorDeployment, expressionEvaluationScope: expressionEvaluationScope, validationLevel: default); + } + + /// Initializes a new instance of . + /// Denotes the state of provisioning. + /// The correlation ID of the deployment. + /// The timestamp of the template deployment. + /// The duration of the template deployment. + /// Key/value pairs that represent deployment output. + /// The list of resource providers needed for the deployment. + /// The list of deployment dependencies. + /// The URI referencing the template. + /// Deployment parameters. + /// The URI referencing the parameters. + /// The deployment mode. Possible values are Incremental and Complete. + /// The debug setting of the deployment. + /// The deployment on error behavior. + /// The hash produced for the template. + /// Array of provisioned resources. + /// Array of validated resources. + /// The deployment error. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ArmDeploymentPropertiesExtended ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisioningState, string correlationId, DateTimeOffset? timestamp, TimeSpan? duration, BinaryData outputs, IEnumerable providers, IEnumerable dependencies, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode? mode, string debugSettingDetailLevel, ErrorDeploymentExtended errorDeployment, string templateHash, IEnumerable outputResources, IEnumerable validatedResources, ResponseError error) + { + return ArmDeploymentPropertiesExtended(provisioningState: provisioningState, correlationId: correlationId, timestamp: timestamp, duration: duration, outputs: outputs, providers: providers, dependencies: dependencies, templateLink: templateLink, parameters: parameters, parametersLink: parametersLink, mode: mode, debugSettingDetailLevel: debugSettingDetailLevel, errorDeployment: errorDeployment, templateHash: templateHash, outputResources: outputResources, validatedResources: validatedResources, error: error, diagnostics: default, validationLevel: default); + } + + /// Initializes a new instance of . + /// The deployment validation error. + /// The template deployment properties. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ArmDeploymentValidateResult ArmDeploymentValidateResult(ResponseError error, ArmDeploymentPropertiesExtended properties) + { + return ArmDeploymentValidateResult(id: default, name: default, resourceType: default, systemData: default, error: error, properties: properties); + } + + /// Initializes a new instance of . + /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. + /// The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. + /// The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. + /// The debug setting of the deployment. + /// The deployment on error behavior. + /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// Optional What-If operation settings. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, string debugSettingDetailLevel, ErrorDeployment errorDeployment, ExpressionEvaluationScope? expressionEvaluationScope, WhatIfResultFormat? whatIfResultFormat) + { + return ArmDeploymentWhatIfProperties(template: template, templateLink: templateLink, parameters: parameters, parametersLink: parametersLink, mode: mode, debugSettingDetailLevel: debugSettingDetailLevel, errorDeployment: errorDeployment, expressionEvaluationScope: expressionEvaluationScope, validationLevel: default, whatIfResultFormat: whatIfResultFormat); + } + + /// Initializes a new instance of . + /// Status of the What-If operation. + /// Error when What-If operation fails. + /// List of resource changes predicted by What-If operation. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static WhatIfOperationResult WhatIfOperationResult(string status, ResponseError error, IEnumerable changes) + { + return WhatIfOperationResult(status: status, error: error, changes: changes, potentialChanges: default, diagnostics: default); + } + + /// Initializes a new instance of . + /// Resource ID. + /// Type of change that will be made to the resource when the deployment is executed. + /// The explanation about why the resource is unsupported by What-If. + /// The snapshot of the resource before the deployment is executed. + /// The predicted snapshot of the resource after the deployment is executed. + /// The predicted changes to resource properties. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static WhatIfChange WhatIfChange(string resourceId, WhatIfChangeType changeType, string unsupportedReason, BinaryData before, BinaryData after, IEnumerable delta) + { + return WhatIfChange(resourceId: resourceId, deploymentId: default, symbolicName: default, identifiers: default, changeType: changeType, unsupportedReason: unsupportedReason, before: before, after: after, delta: delta); + } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index db346608464c..bbb38fc8e158 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -53,7 +53,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index 6bdcc9a0735a..40b283141160 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -194,7 +194,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index ea1f959ac617..5c82343fe0be 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -78,7 +78,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs index 5f5a6ace281f..b9e0a04809bd 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs @@ -61,7 +61,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -92,7 +92,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual Response GetTenantDataBoundary(DataBo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> CalculateDeploymentTempl /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index 5332954a480c..5f3c914d9768 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -376,7 +376,7 @@ public static ArmDeploymentCollection GetArmDeployments(this ManagementGroupReso /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -414,7 +414,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -750,7 +750,7 @@ public static ArmDeploymentCollection GetArmDeployments(this ResourceGroupResour /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -788,7 +788,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1215,7 +1215,7 @@ public static ArmDeploymentCollection GetArmDeployments(this SubscriptionResourc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1253,7 +1253,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1755,7 +1755,7 @@ public static ArmDeploymentCollection GetArmDeployments(this TenantResource tena /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1793,7 +1793,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1922,7 +1922,7 @@ public static Response GetTenantDataBoundary(this Te /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1958,7 +1958,7 @@ public static async Task> CalculateDeploymentTempla /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.Serialization.cs index 78a291d0efb3..311d4dabfc3f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.Serialization.cs @@ -85,6 +85,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("expressionEvaluationOptions"u8); writer.WriteObjectValue(ExpressionEvaluation, options); } + if (Optional.IsDefined(ValidationLevel)) + { + writer.WritePropertyName("validationLevel"u8); + writer.WriteStringValue(ValidationLevel.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -130,6 +135,7 @@ internal static ArmDeploymentProperties DeserializeArmDeploymentProperties(JsonE DebugSetting debugSetting = default; ErrorDeployment onErrorDeployment = default; ExpressionEvaluationOptions expressionEvaluationOptions = default; + ValidationLevel? validationLevel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -202,6 +208,15 @@ internal static ArmDeploymentProperties DeserializeArmDeploymentProperties(JsonE expressionEvaluationOptions = ExpressionEvaluationOptions.DeserializeExpressionEvaluationOptions(property.Value, options); continue; } + if (property.NameEquals("validationLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationLevel = new ValidationLevel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -217,6 +232,7 @@ internal static ArmDeploymentProperties DeserializeArmDeploymentProperties(JsonE debugSetting, onErrorDeployment, expressionEvaluationOptions, + validationLevel, serializedAdditionalRawData); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.cs index 2a3851d4dca0..1be409440b2c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentProperties.cs @@ -61,8 +61,9 @@ public ArmDeploymentProperties(ArmDeploymentMode mode) /// The debug setting of the deployment. /// The deployment on error behavior. /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// The validation level of the deployment. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, DebugSetting debugSetting, ErrorDeployment errorDeployment, ExpressionEvaluationOptions expressionEvaluation, IDictionary serializedAdditionalRawData) + internal ArmDeploymentProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, DebugSetting debugSetting, ErrorDeployment errorDeployment, ExpressionEvaluationOptions expressionEvaluation, ValidationLevel? validationLevel, IDictionary serializedAdditionalRawData) { Template = template; TemplateLink = templateLink; @@ -72,6 +73,7 @@ internal ArmDeploymentProperties(BinaryData template, ArmDeploymentTemplateLink DebugSetting = debugSetting; ErrorDeployment = errorDeployment; ExpressionEvaluation = expressionEvaluation; + ValidationLevel = validationLevel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -185,5 +187,9 @@ public ExpressionEvaluationScope? ExpressionEvaluationScope ExpressionEvaluation.Scope = value; } } + + /// The validation level of the deployment. + [WirePath("validationLevel")] + public ValidationLevel? ValidationLevel { get; set; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.Serialization.cs index 2d783a305559..c622780d094d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.Serialization.cs @@ -155,6 +155,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("error"u8); JsonSerializer.Serialize(writer, Error); } + if (options.Format != "W" && Optional.IsCollectionDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteStartArray(); + foreach (var item in Diagnostics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ValidationLevel)) + { + writer.WritePropertyName("validationLevel"u8); + writer.WriteStringValue(ValidationLevel.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -209,6 +224,8 @@ internal static ArmDeploymentPropertiesExtended DeserializeArmDeploymentProperti IReadOnlyList outputResources = default; IReadOnlyList validatedResources = default; ResponseError error = default; + IReadOnlyList diagnostics = default; + ValidationLevel? validationLevel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -378,6 +395,29 @@ internal static ArmDeploymentPropertiesExtended DeserializeArmDeploymentProperti error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("diagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentDiagnosticsDefinition.DeserializeDeploymentDiagnosticsDefinition(item, options)); + } + diagnostics = array; + continue; + } + if (property.NameEquals("validationLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationLevel = new ValidationLevel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -402,6 +442,8 @@ internal static ArmDeploymentPropertiesExtended DeserializeArmDeploymentProperti outputResources ?? new ChangeTrackingList(), validatedResources ?? new ChangeTrackingList(), error, + diagnostics ?? new ChangeTrackingList(), + validationLevel, serializedAdditionalRawData); } @@ -724,6 +766,44 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Diagnostics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diagnostics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Diagnostics)) + { + if (Diagnostics.Any()) + { + builder.Append(" diagnostics: "); + builder.AppendLine("["); + foreach (var item in Diagnostics) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " diagnostics: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ValidationLevel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" validationLevel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ValidationLevel)) + { + builder.Append(" validationLevel: "); + builder.AppendLine($"'{ValidationLevel.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.cs index 344946df24a2..aaee041010b7 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentPropertiesExtended.cs @@ -52,6 +52,7 @@ internal ArmDeploymentPropertiesExtended() Dependencies = new ChangeTrackingList(); OutputResources = new ChangeTrackingList(); ValidatedResources = new ChangeTrackingList(); + Diagnostics = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -72,8 +73,10 @@ internal ArmDeploymentPropertiesExtended() /// Array of provisioned resources. /// Array of validated resources. /// The deployment error. + /// Contains diagnostic information collected during validation process. + /// The validation level of the deployment. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisioningState, string correlationId, DateTimeOffset? timestamp, TimeSpan? duration, BinaryData outputs, IReadOnlyList providers, IReadOnlyList dependencies, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode? mode, DebugSetting debugSetting, ErrorDeploymentExtended errorDeployment, string templateHash, IReadOnlyList outputResources, IReadOnlyList validatedResources, ResponseError error, IDictionary serializedAdditionalRawData) + internal ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisioningState, string correlationId, DateTimeOffset? timestamp, TimeSpan? duration, BinaryData outputs, IReadOnlyList providers, IReadOnlyList dependencies, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode? mode, DebugSetting debugSetting, ErrorDeploymentExtended errorDeployment, string templateHash, IReadOnlyList outputResources, IReadOnlyList validatedResources, ResponseError error, IReadOnlyList diagnostics, ValidationLevel? validationLevel, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; CorrelationId = correlationId; @@ -92,6 +95,8 @@ internal ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisionin OutputResources = outputResources; ValidatedResources = validatedResources; Error = error; + Diagnostics = diagnostics; + ValidationLevel = validationLevel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -204,5 +209,11 @@ internal ArmDeploymentPropertiesExtended(ResourcesProvisioningState? provisionin /// The deployment error. [WirePath("error")] public ResponseError Error { get; } + /// Contains diagnostic information collected during validation process. + [WirePath("diagnostics")] + public IReadOnlyList Diagnostics { get; } + /// The validation level of the deployment. + [WirePath("validationLevel")] + public ValidationLevel? ValidationLevel { get; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.Serialization.cs index fee0ac367da9..a64e67bb63a7 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.Serialization.cs @@ -11,6 +11,7 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Resources.Models { @@ -27,7 +28,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The JSON writer. /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -35,6 +36,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArmDeploymentValidateResult)} does not support writing '{format}' format."); } + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); @@ -45,21 +47,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } } ArmDeploymentValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -84,6 +71,10 @@ internal static ArmDeploymentValidateResult DeserializeArmDeploymentValidateResu } ResponseError error = default; ArmDeploymentPropertiesExtended properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -106,13 +97,44 @@ internal static ArmDeploymentValidateResult DeserializeArmDeploymentValidateResu properties = ArmDeploymentPropertiesExtended.DeserializeArmDeploymentPropertiesExtended(property.Value, options); continue; } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentValidateResult(error, properties, serializedAdditionalRawData); + return new ArmDeploymentValidateResult( + id, + name, + type, + systemData, + error, + properties, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -126,6 +148,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); if (hasPropertyOverride) { @@ -156,6 +201,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.cs index 276f36259f15..90a50bfe82cb 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentValidateResult.cs @@ -7,11 +7,13 @@ using System; using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Resources.Models { /// Information from validate template deployment response. - public partial class ArmDeploymentValidateResult + public partial class ArmDeploymentValidateResult : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,10 +53,14 @@ internal ArmDeploymentValidateResult() } /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. /// The deployment validation error. /// The template deployment properties. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentValidateResult(ResponseError error, ArmDeploymentPropertiesExtended properties, IDictionary serializedAdditionalRawData) + internal ArmDeploymentValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResponseError error, ArmDeploymentPropertiesExtended properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Error = error; Properties = properties; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.Serialization.cs index 6563e71baffa..ca5a7c94f58e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.Serialization.cs @@ -71,6 +71,7 @@ internal static ArmDeploymentWhatIfProperties DeserializeArmDeploymentWhatIfProp DebugSetting debugSetting = default; ErrorDeployment onErrorDeployment = default; ExpressionEvaluationOptions expressionEvaluationOptions = default; + ValidationLevel? validationLevel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -152,6 +153,15 @@ internal static ArmDeploymentWhatIfProperties DeserializeArmDeploymentWhatIfProp expressionEvaluationOptions = ExpressionEvaluationOptions.DeserializeExpressionEvaluationOptions(property.Value, options); continue; } + if (property.NameEquals("validationLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationLevel = new ValidationLevel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -167,6 +177,7 @@ internal static ArmDeploymentWhatIfProperties DeserializeArmDeploymentWhatIfProp debugSetting, onErrorDeployment, expressionEvaluationOptions, + validationLevel, serializedAdditionalRawData, whatIfSettings); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.cs index 9edb569f0ef7..c9b27a220ba3 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentWhatIfProperties.cs @@ -28,9 +28,10 @@ public ArmDeploymentWhatIfProperties(ArmDeploymentMode mode) : base(mode) /// The debug setting of the deployment. /// The deployment on error behavior. /// Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable to nested templates. If not specified, default value is outer. + /// The validation level of the deployment. /// Keeps track of any properties unknown to the library. /// Optional What-If operation settings. - internal ArmDeploymentWhatIfProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, DebugSetting debugSetting, ErrorDeployment errorDeployment, ExpressionEvaluationOptions expressionEvaluation, IDictionary serializedAdditionalRawData, ArmDeploymentWhatIfSettings whatIfSettings) : base(template, templateLink, parameters, parametersLink, mode, debugSetting, errorDeployment, expressionEvaluation, serializedAdditionalRawData) + internal ArmDeploymentWhatIfProperties(BinaryData template, ArmDeploymentTemplateLink templateLink, BinaryData parameters, ArmDeploymentParametersLink parametersLink, ArmDeploymentMode mode, DebugSetting debugSetting, ErrorDeployment errorDeployment, ExpressionEvaluationOptions expressionEvaluation, ValidationLevel? validationLevel, IDictionary serializedAdditionalRawData, ArmDeploymentWhatIfSettings whatIfSettings) : base(template, templateLink, parameters, parametersLink, mode, debugSetting, errorDeployment, expressionEvaluation, validationLevel, serializedAdditionalRawData) { WhatIfSettings = whatIfSettings; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.Serialization.cs new file mode 100644 index 000000000000..431343ab74c0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.Serialization.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentDiagnosticsDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDiagnosticsDefinition)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W") + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AdditionalInfo)) + { + writer.WritePropertyName("additionalInfo"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalInfo) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentDiagnosticsDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDiagnosticsDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentDiagnosticsDefinition(document.RootElement, options); + } + + internal static DeploymentDiagnosticsDefinition DeserializeDeploymentDiagnosticsDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Level level = default; + string code = default; + string message = default; + string target = default; + IReadOnlyList additionalInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level"u8)) + { + level = new Level(property.Value.GetString()); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorAdditionalInfo.DeserializeErrorAdditionalInfo(item, options)); + } + additionalInfo = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentDiagnosticsDefinition( + level, + code, + message, + target, + additionalInfo ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Level), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" level: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" level: "); + builder.AppendLine($"'{Level.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" code: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Code)) + { + builder.Append(" code: "); + if (Code.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Code}'''"); + } + else + { + builder.AppendLine($"'{Code}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" message: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Message)) + { + builder.Append(" message: "); + if (Message.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Message}'''"); + } + else + { + builder.AppendLine($"'{Message}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AdditionalInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" additionalInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AdditionalInfo)) + { + if (AdditionalInfo.Any()) + { + builder.Append(" additionalInfo: "); + builder.AppendLine("["); + foreach (var item in AdditionalInfo) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " additionalInfo: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentDiagnosticsDefinition)} does not support writing '{options.Format}' format."); + } + } + + DeploymentDiagnosticsDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentDiagnosticsDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentDiagnosticsDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.cs new file mode 100644 index 000000000000..9bd5378bd8c9 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentDiagnosticsDefinition.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The DeploymentDiagnosticsDefinition. + public partial class DeploymentDiagnosticsDefinition + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Denotes the additional response level. + /// The error code. + /// The error message. + internal DeploymentDiagnosticsDefinition(Level level, string code, string message) + { + Level = level; + Code = code; + Message = message; + AdditionalInfo = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Denotes the additional response level. + /// The error code. + /// The error message. + /// The error target. + /// The error additional info. + /// Keeps track of any properties unknown to the library. + internal DeploymentDiagnosticsDefinition(Level level, string code, string message, string target, IReadOnlyList additionalInfo, IDictionary serializedAdditionalRawData) + { + Level = level; + Code = code; + Message = message; + Target = target; + AdditionalInfo = additionalInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentDiagnosticsDefinition() + { + } + + /// Denotes the additional response level. + [WirePath("level")] + public Level Level { get; } + /// The error code. + [WirePath("code")] + public string Code { get; } + /// The error message. + [WirePath("message")] + public string Message { get; } + /// The error target. + [WirePath("target")] + public string Target { get; } + /// The error additional info. + [WirePath("additionalInfo")] + public IReadOnlyList AdditionalInfo { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs new file mode 100644 index 000000000000..eab4e71e3062 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class ErrorAdditionalInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorAdditionalInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ErrorAdditionalInfoType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ErrorAdditionalInfoType); + } + if (options.Format != "W" && Optional.IsDefined(Info)) + { + writer.WritePropertyName("info"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Info); +#else + using (JsonDocument document = JsonDocument.Parse(Info)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorAdditionalInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorAdditionalInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorAdditionalInfo(document.RootElement, options); + } + + internal static ErrorAdditionalInfo DeserializeErrorAdditionalInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + BinaryData info = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("info"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + info = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorAdditionalInfo(type, info, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorAdditionalInfoType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorAdditionalInfoType)) + { + builder.Append(" type: "); + if (ErrorAdditionalInfoType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ErrorAdditionalInfoType}'''"); + } + else + { + builder.AppendLine($"'{ErrorAdditionalInfoType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Info), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" info: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Info)) + { + builder.Append(" info: "); + builder.AppendLine($"'{Info.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ErrorAdditionalInfo)} does not support writing '{options.Format}' format."); + } + } + + ErrorAdditionalInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeErrorAdditionalInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorAdditionalInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..5de596fb051a --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ErrorAdditionalInfo() + { + } + + /// Initializes a new instance of . + /// The additional info type. + /// The additional info. + /// Keeps track of any properties unknown to the library. + internal ErrorAdditionalInfo(string errorAdditionalInfoType, BinaryData info, IDictionary serializedAdditionalRawData) + { + ErrorAdditionalInfoType = errorAdditionalInfoType; + Info = info; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The additional info type. + [WirePath("type")] + public string ErrorAdditionalInfoType { get; } + /// + /// The additional info. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("info")] + public BinaryData Info { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/Level.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/Level.cs new file mode 100644 index 000000000000..56ae22011fc6 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/Level.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Denotes the additional response level. + public readonly partial struct Level : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Level(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WarningValue = "Warning"; + private const string InfoValue = "Info"; + private const string ErrorValue = "Error"; + + /// Warning. + public static Level Warning { get; } = new Level(WarningValue); + /// Info. + public static Level Info { get; } = new Level(InfoValue); + /// Error. + public static Level Error { get; } = new Level(ErrorValue); + /// Determines if two values are the same. + public static bool operator ==(Level left, Level right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Level left, Level right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Level(string value) => new Level(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Level other && Equals(other); + /// + public bool Equals(Level other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ValidationLevel.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ValidationLevel.cs new file mode 100644 index 000000000000..6eac8e89c96d --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ValidationLevel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The level of validation performed on the deployment. + public readonly partial struct ValidationLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ValidationLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TemplateValue = "Template"; + private const string ProviderValue = "Provider"; + private const string ProviderNoRbacValue = "ProviderNoRbac"; + + /// Static analysis of the template is performed. + public static ValidationLevel Template { get; } = new ValidationLevel(TemplateValue); + /// Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. + public static ValidationLevel Provider { get; } = new ValidationLevel(ProviderValue); + /// Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. + public static ValidationLevel ProviderNoRbac { get; } = new ValidationLevel(ProviderNoRbacValue); + /// Determines if two values are the same. + public static bool operator ==(ValidationLevel left, ValidationLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidationLevel left, ValidationLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ValidationLevel(string value) => new ValidationLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidationLevel other && Equals(other); + /// + public bool Equals(ValidationLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.Serialization.cs index 40244dfb9e82..51d0c99f06b2 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.Serialization.cs @@ -38,6 +38,28 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); + if (Optional.IsDefined(DeploymentId)) + { + writer.WritePropertyName("deploymentId"u8); + writer.WriteStringValue(DeploymentId); + } + if (Optional.IsDefined(SymbolicName)) + { + writer.WritePropertyName("symbolicName"u8); + writer.WriteStringValue(SymbolicName); + } + if (Optional.IsDefined(Identifiers)) + { + writer.WritePropertyName("identifiers"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Identifiers); +#else + using (JsonDocument document = JsonDocument.Parse(Identifiers)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } writer.WritePropertyName("changeType"u8); writer.WriteStringValue(ChangeType.ToSerialString()); if (Optional.IsDefined(UnsupportedReason)) @@ -117,6 +139,9 @@ internal static WhatIfChange DeserializeWhatIfChange(JsonElement element, ModelR return null; } string resourceId = default; + string deploymentId = default; + string symbolicName = default; + BinaryData identifiers = default; WhatIfChangeType changeType = default; string unsupportedReason = default; BinaryData before = default; @@ -131,6 +156,25 @@ internal static WhatIfChange DeserializeWhatIfChange(JsonElement element, ModelR resourceId = property.Value.GetString(); continue; } + if (property.NameEquals("deploymentId"u8)) + { + deploymentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("symbolicName"u8)) + { + symbolicName = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifiers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identifiers = BinaryData.FromString(property.Value.GetRawText()); + continue; + } if (property.NameEquals("changeType"u8)) { changeType = property.Value.GetString().ToWhatIfChangeType(); @@ -181,6 +225,9 @@ internal static WhatIfChange DeserializeWhatIfChange(JsonElement element, ModelR serializedAdditionalRawData = rawDataDictionary; return new WhatIfChange( resourceId, + deploymentId, + symbolicName, + identifiers, changeType, unsupportedReason, before, @@ -223,6 +270,67 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentId)) + { + builder.Append(" deploymentId: "); + if (DeploymentId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentId}'''"); + } + else + { + builder.AppendLine($"'{DeploymentId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SymbolicName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" symbolicName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SymbolicName)) + { + builder.Append(" symbolicName: "); + if (SymbolicName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SymbolicName}'''"); + } + else + { + builder.AppendLine($"'{SymbolicName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identifiers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identifiers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identifiers)) + { + builder.Append(" identifiers: "); + builder.AppendLine($"'{Identifiers.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ChangeType), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.cs index e5927cae0f62..5b12fce886a2 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfChange.cs @@ -60,15 +60,21 @@ internal WhatIfChange(string resourceId, WhatIfChangeType changeType) /// Initializes a new instance of . /// Resource ID. + /// The resource id of the Deployment responsible for this change. + /// The symbolic name of the resource responsible for this change. + /// A subset of properties that uniquely identify a Bicep extensible resource because it lacks a resource id like an Azure resource has. /// Type of change that will be made to the resource when the deployment is executed. /// The explanation about why the resource is unsupported by What-If. /// The snapshot of the resource before the deployment is executed. /// The predicted snapshot of the resource after the deployment is executed. /// The predicted changes to resource properties. /// Keeps track of any properties unknown to the library. - internal WhatIfChange(string resourceId, WhatIfChangeType changeType, string unsupportedReason, BinaryData before, BinaryData after, IReadOnlyList delta, IDictionary serializedAdditionalRawData) + internal WhatIfChange(string resourceId, string deploymentId, string symbolicName, BinaryData identifiers, WhatIfChangeType changeType, string unsupportedReason, BinaryData before, BinaryData after, IReadOnlyList delta, IDictionary serializedAdditionalRawData) { ResourceId = resourceId; + DeploymentId = deploymentId; + SymbolicName = symbolicName; + Identifiers = identifiers; ChangeType = changeType; UnsupportedReason = unsupportedReason; Before = before; @@ -85,6 +91,44 @@ internal WhatIfChange() /// Resource ID. [WirePath("resourceId")] public string ResourceId { get; } + /// The resource id of the Deployment responsible for this change. + [WirePath("deploymentId")] + public string DeploymentId { get; } + /// The symbolic name of the resource responsible for this change. + [WirePath("symbolicName")] + public string SymbolicName { get; } + /// + /// A subset of properties that uniquely identify a Bicep extensible resource because it lacks a resource id like an Azure resource has. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("identifiers")] + public BinaryData Identifiers { get; } /// Type of change that will be made to the resource when the deployment is executed. [WirePath("changeType")] public WhatIfChangeType ChangeType { get; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.Serialization.cs index 75a83db98ac1..0a8a0be04999 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.Serialization.cs @@ -58,6 +58,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(PotentialChanges)) + { + writer.WritePropertyName("potentialChanges"u8); + writer.WriteStartArray(); + foreach (var item in PotentialChanges) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteStartArray(); + foreach (var item in Diagnostics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -99,6 +119,8 @@ internal static WhatIfOperationResult DeserializeWhatIfOperationResult(JsonEleme string status = default; ResponseError error = default; IReadOnlyList changes = default; + IReadOnlyList potentialChanges = default; + IReadOnlyList diagnostics = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -140,6 +162,34 @@ internal static WhatIfOperationResult DeserializeWhatIfOperationResult(JsonEleme changes = array; continue; } + if (property0.NameEquals("potentialChanges"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(WhatIfChange.DeserializeWhatIfChange(item, options)); + } + potentialChanges = array; + continue; + } + if (property0.NameEquals("diagnostics"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DeploymentDiagnosticsDefinition.DeserializeDeploymentDiagnosticsDefinition(item, options)); + } + diagnostics = array; + continue; + } } continue; } @@ -149,7 +199,13 @@ internal static WhatIfOperationResult DeserializeWhatIfOperationResult(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new WhatIfOperationResult(status, error, changes ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new WhatIfOperationResult( + status, + error, + changes ?? new ChangeTrackingList(), + potentialChanges ?? new ChangeTrackingList(), + diagnostics ?? new ChangeTrackingList(), + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -226,6 +282,52 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PotentialChanges), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" potentialChanges: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PotentialChanges)) + { + if (PotentialChanges.Any()) + { + builder.Append(" potentialChanges: "); + builder.AppendLine("["); + foreach (var item in PotentialChanges) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " potentialChanges: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Diagnostics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diagnostics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Diagnostics)) + { + if (Diagnostics.Any()) + { + builder.Append(" diagnostics: "); + builder.AppendLine("["); + foreach (var item in Diagnostics) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " diagnostics: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.cs index c23ad4349169..3063cb24eeef 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/WhatIfOperationResult.cs @@ -49,18 +49,24 @@ public partial class WhatIfOperationResult internal WhatIfOperationResult() { Changes = new ChangeTrackingList(); + PotentialChanges = new ChangeTrackingList(); + Diagnostics = new ChangeTrackingList(); } /// Initializes a new instance of . /// Status of the What-If operation. /// Error when What-If operation fails. /// List of resource changes predicted by What-If operation. + /// List of resource changes predicted by What-If operation. + /// List of resource diagnostics detected by What-If operation. /// Keeps track of any properties unknown to the library. - internal WhatIfOperationResult(string status, ResponseError error, IReadOnlyList changes, IDictionary serializedAdditionalRawData) + internal WhatIfOperationResult(string status, ResponseError error, IReadOnlyList changes, IReadOnlyList potentialChanges, IReadOnlyList diagnostics, IDictionary serializedAdditionalRawData) { Status = status; Error = error; Changes = changes; + PotentialChanges = potentialChanges; + Diagnostics = diagnostics; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -73,5 +79,11 @@ internal WhatIfOperationResult(string status, ResponseError error, IReadOnlyList /// List of resource changes predicted by What-If operation. [WirePath("properties.changes")] public IReadOnlyList Changes { get; } + /// List of resource changes predicted by What-If operation. + [WirePath("properties.potentialChanges")] + public IReadOnlyList PotentialChanges { get; } + /// List of resource diagnostics detected by What-If operation. + [WirePath("properties.diagnostics")] + public IReadOnlyList Diagnostics { get; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs index 643b64516655..2d38eafd7058 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs @@ -32,7 +32,7 @@ public DeploymentRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs index 64052ef2763d..b78e022940a1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public DeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 463515317ff0..07733e3f4250 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -394,6 +394,14 @@ directive: where: $.definitions transform: > $.DeploymentStackProperties.properties.duration['format'] = 'duration'; + - from: resources.json + where: $.paths['/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf'].post + transform: > + $['x-ms-examples'] = { + "Predict template changes at tenant scope": { + "$ref": "./examples/PostDeploymentWhatIfOnTenant.json" + } + } # Add scope operations - from: deploymentStacks.json where: $.paths @@ -407,7 +415,7 @@ directive: "description": "Exports the template used to create the Deployment stack.", "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "#/parameters/DeploymentStackNameParameter" @@ -445,7 +453,7 @@ directive: }, "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "#/parameters/DeploymentStackNameParameter" @@ -507,7 +515,7 @@ directive: "description": "Lists all the Deployment stacks within the specified scope.", "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -545,7 +553,7 @@ directive: "description": "Creates or updates a Deployment stack at specific scope.", "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "#/parameters/DeploymentStackNameParameter" @@ -592,7 +600,7 @@ directive: "description": "Gets a Deployment stack with a given name at specific scope.", "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "#/parameters/DeploymentStackNameParameter" @@ -628,7 +636,7 @@ directive: }, "parameters": [ { - "$ref": "./resources.json#/parameters/ScopeParameter" + "$ref": "../2024-11-01/resources.json#/parameters/ScopeParameter" }, { "$ref": "#/parameters/DeploymentStackNameParameter" @@ -682,11 +690,11 @@ These settings apply only when `--tag=package-resources-2022-04` is specified on ```yaml $(tag) == 'package-resources-2022-04' input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/resources.json - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2023-11-01/bicepClient.json# - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/deploymentStacks.json - - https://github.com/Azure/azure-rest-api-specs/blob/a6074b7654c388dec49c9969d0136cfeb03575c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/dataBoundaries.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/resources.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2023-11-01/bicepClient.json# + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/deploymentStacks.json + - https://github.com/Azure/azure-rest-api-specs/blob/5e5d8196f6ba69545a9c4882ab4769d108b513c9/specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/dataBoundaries.json ``` diff --git a/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md b/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md index a71384177287..d16d0dbdf769 100644 --- a/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md +++ b/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md @@ -167,8 +167,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) - [nuget]: https://www.nuget.org/ [event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about diff --git a/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md b/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md index 49d98ac5c0cf..e6cbdbb23073 100644 --- a/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md +++ b/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md @@ -148,7 +148,7 @@ var serializer = new SchemaRegistrySerializer(client, new SampleJsonValidator(), ## Troubleshooting -If you encounter errors when communicating with the Schema Registry service, these errors will be thrown as a [RequestFailedException][request_failed_exception]. The serializer will only communicate with the service the first time it encounters a schema (when serializing) or a schema Id (when deserializing). Any errors related to invalid Content-Types will be thrown as a `FormatException`. +If you encounter errors when communicating with the Schema Registry service, these errors will be thrown as a [RequestFailedException][request_failed_exception]. The serializer will only communicate with the service the first time it encounters a schema (when serializing) or a schema Id (when deserializing). Any errors related to invalid Content-Types will be thrown as a `FormatException`. Errors related to invalid schemas will be thrown as an `Exception`, and the `InnerException` property will contain the underlying exception that was thrown from your implemented methods in the `SchemaRegistryJsonSchemaGenerator`. This type of error would typically be caught during testing and should not be handled in code. @@ -164,8 +164,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fschemaregistry%2FMicrosoft.Azure.Data.SchemaRegistry.JsonSchema%2FREADME.png) - [nuget]: https://www.nuget.org/ [event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about diff --git a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md index 95789f4032fb..e363b4257a7e 100644 --- a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md +++ b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md @@ -168,8 +168,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact [opencode@microsoft.com][email_opencode] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) - [nuget]: https://www.nuget.org/ [event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about diff --git a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/perf/README.md b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/perf/README.md index 83d6422d4479..2a4749f185aa 100644 --- a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/perf/README.md +++ b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/perf/README.md @@ -16,5 +16,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FAzure.Messaging.ServiceBus.Perf%2FREADME.png) \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents/README.md b/sdk/search/Azure.Search.Documents/README.md index f3d98c45f559..2365b910a4bf 100644 --- a/sdk/search/Azure.Search.Documents/README.md +++ b/sdk/search/Azure.Search.Documents/README.md @@ -20,7 +20,7 @@ The Azure AI Search service is well suited for the following application scenari Use the Azure.Search.Documents client library to: * Submit queries using vector, keyword, and hybrid query forms. -* Implement filtered queries for metadata, geospatial search, faceted navigation, +* Implement filtered queries for metadata, geospatial search, faceted navigation, or to narrow results based on filter criteria. * Create and manage search indexes. * Upload and update documents in the search index. @@ -554,8 +554,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FAzure.Search.Documents%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Azure.Search.Documents/src [package]: https://www.nuget.org/packages/Azure.Search.Documents/ diff --git a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs index 36813d9980e5..347f8527bfbe 100644 --- a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs +++ b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.net8.0.cs @@ -370,6 +370,28 @@ public VectorSearchFieldAttribute() { } } namespace Azure.Search.Documents.Indexes.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AIFoundryModelCatalogName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AIFoundryModelCatalogName(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName CohereEmbedV3English { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName CohereEmbedV3Multilingual { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName right) { throw null; } + public override string ToString() { throw null; } + } public partial class AIServicesAccountIdentity : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount { public AIServicesAccountIdentity(Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity identity, string subdomainUrl) { } @@ -395,28 +417,6 @@ public partial class AIServicesVisionVectorizer : Azure.Search.Documents.Indexes public AIServicesVisionVectorizer(string vectorizerName) : base (default(string)) { } public Azure.Search.Documents.Indexes.Models.AIServicesVisionParameters AIServicesVisionParameters { get { throw null; } set { } } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AIStudioModelCatalogName : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AIStudioModelCatalogName(string value) { throw null; } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName CohereEmbedV3English { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName CohereEmbedV3Multilingual { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get { throw null; } } - public bool Equals(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName right) { throw null; } - public static implicit operator Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName (string value) { throw null; } - public static bool operator !=(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName right) { throw null; } - public override string ToString() { throw null; } - } public partial class AnalyzedTokenInfo { internal AnalyzedTokenInfo() { } @@ -447,7 +447,7 @@ public partial class AzureMachineLearningParameters { public AzureMachineLearningParameters(System.Uri scoringUri) { } public string AuthenticationKey { get { throw null; } set { } } - public Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName? ModelName { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName? ModelName { get { throw null; } set { } } public string Region { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } public System.Uri ScoringUri { get { throw null; } set { } } diff --git a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs index 36813d9980e5..347f8527bfbe 100644 --- a/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs +++ b/sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs @@ -370,6 +370,28 @@ public VectorSearchFieldAttribute() { } } namespace Azure.Search.Documents.Indexes.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AIFoundryModelCatalogName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AIFoundryModelCatalogName(string value) { throw null; } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName CohereEmbedV3English { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName CohereEmbedV3Multilingual { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get { throw null; } } + public static Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get { throw null; } } + public bool Equals(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName right) { throw null; } + public static implicit operator Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName (string value) { throw null; } + public static bool operator !=(Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName right) { throw null; } + public override string ToString() { throw null; } + } public partial class AIServicesAccountIdentity : Azure.Search.Documents.Indexes.Models.CognitiveServicesAccount { public AIServicesAccountIdentity(Azure.Search.Documents.Indexes.Models.SearchIndexerDataIdentity identity, string subdomainUrl) { } @@ -395,28 +417,6 @@ public partial class AIServicesVisionVectorizer : Azure.Search.Documents.Indexes public AIServicesVisionVectorizer(string vectorizerName) : base (default(string)) { } public Azure.Search.Documents.Indexes.Models.AIServicesVisionParameters AIServicesVisionParameters { get { throw null; } set { } } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AIStudioModelCatalogName : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AIStudioModelCatalogName(string value) { throw null; } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName CohereEmbedV3English { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName CohereEmbedV3Multilingual { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get { throw null; } } - public static Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get { throw null; } } - public bool Equals(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName right) { throw null; } - public static implicit operator Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName (string value) { throw null; } - public static bool operator !=(Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName left, Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName right) { throw null; } - public override string ToString() { throw null; } - } public partial class AnalyzedTokenInfo { internal AnalyzedTokenInfo() { } @@ -447,7 +447,7 @@ public partial class AzureMachineLearningParameters { public AzureMachineLearningParameters(System.Uri scoringUri) { } public string AuthenticationKey { get { throw null; } set { } } - public Azure.Search.Documents.Indexes.Models.AIStudioModelCatalogName? ModelName { get { throw null; } set { } } + public Azure.Search.Documents.Indexes.Models.AIFoundryModelCatalogName? ModelName { get { throw null; } set { } } public string Region { get { throw null; } set { } } public string ResourceId { get { throw null; } set { } } public System.Uri ScoringUri { get { throw null; } set { } } diff --git a/sdk/search/Azure.Search.Documents/perf/README.md b/sdk/search/Azure.Search.Documents/perf/README.md index a57fe0ba3a4f..8f0f6fd1a1ec 100644 --- a/sdk/search/Azure.Search.Documents/perf/README.md +++ b/sdk/search/Azure.Search.Documents/perf/README.md @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FAzure.Search.Documents.Perf%2FREADME.png) diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs similarity index 51% rename from sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs rename to sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs index 0d246bf5fa6e..d65745f5b56d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs @@ -11,13 +11,13 @@ namespace Azure.Search.Documents.Indexes.Models { /// The name of the embedding model from the Azure AI Studio Catalog that will be called. - public readonly partial struct AIStudioModelCatalogName : IEquatable + public readonly partial struct AIFoundryModelCatalogName : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public AIStudioModelCatalogName(string value) + public AIFoundryModelCatalogName(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -30,29 +30,29 @@ public AIStudioModelCatalogName(string value) private const string CohereEmbedV3MultilingualValue = "Cohere-embed-v3-multilingual"; /// OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32. - public static AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get; } = new AIStudioModelCatalogName(OpenAIClipImageTextEmbeddingsVitBasePatch32Value); + public static AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get; } = new AIFoundryModelCatalogName(OpenAIClipImageTextEmbeddingsVitBasePatch32Value); /// OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336. - public static AIStudioModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get; } = new AIStudioModelCatalogName(OpenAIClipImageTextEmbeddingsViTLargePatch14336Value); + public static AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsViTLargePatch14336 { get; } = new AIFoundryModelCatalogName(OpenAIClipImageTextEmbeddingsViTLargePatch14336Value); /// Facebook-DinoV2-Image-Embeddings-ViT-Base. - public static AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get; } = new AIStudioModelCatalogName(FacebookDinoV2ImageEmbeddingsViTBaseValue); + public static AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTBase { get; } = new AIFoundryModelCatalogName(FacebookDinoV2ImageEmbeddingsViTBaseValue); /// Facebook-DinoV2-Image-Embeddings-ViT-Giant. - public static AIStudioModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get; } = new AIStudioModelCatalogName(FacebookDinoV2ImageEmbeddingsViTGiantValue); + public static AIFoundryModelCatalogName FacebookDinoV2ImageEmbeddingsViTGiant { get; } = new AIFoundryModelCatalogName(FacebookDinoV2ImageEmbeddingsViTGiantValue); /// Cohere-embed-v3-english. - public static AIStudioModelCatalogName CohereEmbedV3English { get; } = new AIStudioModelCatalogName(CohereEmbedV3EnglishValue); + public static AIFoundryModelCatalogName CohereEmbedV3English { get; } = new AIFoundryModelCatalogName(CohereEmbedV3EnglishValue); /// Cohere-embed-v3-multilingual. - public static AIStudioModelCatalogName CohereEmbedV3Multilingual { get; } = new AIStudioModelCatalogName(CohereEmbedV3MultilingualValue); - /// Determines if two values are the same. - public static bool operator ==(AIStudioModelCatalogName left, AIStudioModelCatalogName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AIStudioModelCatalogName left, AIStudioModelCatalogName right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator AIStudioModelCatalogName(string value) => new AIStudioModelCatalogName(value); + public static AIFoundryModelCatalogName CohereEmbedV3Multilingual { get; } = new AIFoundryModelCatalogName(CohereEmbedV3MultilingualValue); + /// Determines if two values are the same. + public static bool operator ==(AIFoundryModelCatalogName left, AIFoundryModelCatalogName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AIFoundryModelCatalogName left, AIFoundryModelCatalogName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AIFoundryModelCatalogName(string value) => new AIFoundryModelCatalogName(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AIStudioModelCatalogName other && Equals(other); + public override bool Equals(object obj) => obj is AIFoundryModelCatalogName other && Equals(other); /// - public bool Equals(AIStudioModelCatalogName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(AIFoundryModelCatalogName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.Serialization.cs index 90e61a6cdd1a..c49454a92f01 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.Serialization.cs @@ -92,7 +92,7 @@ internal static AzureMachineLearningParameters DeserializeAzureMachineLearningPa string resourceId = default; TimeSpan? timeout = default; string region = default; - AIStudioModelCatalogName? modelName = default; + AIFoundryModelCatalogName? modelName = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("uri"u8)) @@ -151,7 +151,7 @@ internal static AzureMachineLearningParameters DeserializeAzureMachineLearningPa { continue; } - modelName = new AIStudioModelCatalogName(property.Value.GetString()); + modelName = new AIFoundryModelCatalogName(property.Value.GetString()); continue; } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs index 98d1b67d46ae..933ce5586932 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs @@ -26,7 +26,7 @@ public AzureMachineLearningParameters(Uri scoringUri) /// (Optional) When specified, indicates the timeout for the http client making the API call. /// (Optional for token authentication). The region the AML service is deployed in. /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint. - internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey, string resourceId, TimeSpan? timeout, string region, AIStudioModelCatalogName? modelName) + internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey, string resourceId, TimeSpan? timeout, string region, AIFoundryModelCatalogName? modelName) { ScoringUri = scoringUri; AuthenticationKey = authenticationKey; @@ -47,6 +47,6 @@ internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey /// (Optional for token authentication). The region the AML service is deployed in. public string Region { get; set; } /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint. - public AIStudioModelCatalogName? ModelName { get; set; } + public AIFoundryModelCatalogName? ModelName { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index a0b16fa58568..794d15c138df 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -58,6 +58,15 @@ directive: $["discriminator"] = "@odata.type"; ``` +## Renaming models after the AI Studio rebrand to AI Foundry +These should eventually be fixed in the swagger files. +```yaml +directive: +- from: "searchservice.json" + where: $.definitions.AIStudioModelCatalogName + transform: $["x-ms-enum"].name = "AIFoundryModelCatalogName"; +``` + ### Mark definitions as objects The modeler warns about models without an explicit type. ``` yaml diff --git a/sdk/search/CONTRIBUTING.md b/sdk/search/CONTRIBUTING.md index f443f71362cb..483c2734035f 100644 --- a/sdk/search/CONTRIBUTING.md +++ b/sdk/search/CONTRIBUTING.md @@ -80,7 +80,5 @@ Our samples are structured as unit tests so we can easily verify they're up to date and working correctly. These tests make minimal use of test infrastructure to keep them easy to read. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FCONTRIBUTING.png) - [core_tests]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core.TestFramework \ No newline at end of file diff --git a/sdk/search/README.md b/sdk/search/README.md index 94f649d2e23a..35bd73547b58 100644 --- a/sdk/search/README.md +++ b/sdk/search/README.md @@ -39,5 +39,3 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FREADME.png) diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.net8.0.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.net8.0.cs index 9758d646aea5..8f295f5d7430 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.net8.0.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.net8.0.cs @@ -282,8 +282,6 @@ public static partial class ArmSelfHelpModelFactory public static Azure.ResourceManager.SelfHelp.Models.RestartTroubleshooterResult RestartTroubleshooterResult(string troubleshooterResourceName = null) { throw null; } public static Azure.ResourceManager.SelfHelp.SelfHelpDiagnosticData SelfHelpDiagnosticData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary globalParameters = null, System.Collections.Generic.IEnumerable insights = null, System.DateTimeOffset? acceptedOn = default(System.DateTimeOffset?), Azure.ResourceManager.SelfHelp.Models.SelfHelpProvisioningState? provisioningState = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpProvisioningState?), System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticInfo SelfHelpDiagnosticInfo(string solutionId = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticStatus? status = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticStatus?), System.Collections.Generic.IEnumerable insights = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpError error = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This function is obsolete and will be removed in a future release.", false)] public static Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticInsight SelfHelpDiagnosticInsight(string id = null, string title = null, string results = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpImportanceLevel? insightImportanceLevel = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpImportanceLevel?)) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpError SelfHelpError(string code = null, string errorType = null, string message = null, System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpFilter SelfHelpFilter(string name = null, string values = null, string @operator = null) { throw null; } diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.netstandard2.0.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.netstandard2.0.cs index 9758d646aea5..8f295f5d7430 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.netstandard2.0.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/api/Azure.ResourceManager.SelfHelp.netstandard2.0.cs @@ -282,8 +282,6 @@ public static partial class ArmSelfHelpModelFactory public static Azure.ResourceManager.SelfHelp.Models.RestartTroubleshooterResult RestartTroubleshooterResult(string troubleshooterResourceName = null) { throw null; } public static Azure.ResourceManager.SelfHelp.SelfHelpDiagnosticData SelfHelpDiagnosticData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary globalParameters = null, System.Collections.Generic.IEnumerable insights = null, System.DateTimeOffset? acceptedOn = default(System.DateTimeOffset?), Azure.ResourceManager.SelfHelp.Models.SelfHelpProvisioningState? provisioningState = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpProvisioningState?), System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticInfo SelfHelpDiagnosticInfo(string solutionId = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticStatus? status = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticStatus?), System.Collections.Generic.IEnumerable insights = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpError error = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This function is obsolete and will be removed in a future release.", false)] public static Azure.ResourceManager.SelfHelp.Models.SelfHelpDiagnosticInsight SelfHelpDiagnosticInsight(string id = null, string title = null, string results = null, Azure.ResourceManager.SelfHelp.Models.SelfHelpImportanceLevel? insightImportanceLevel = default(Azure.ResourceManager.SelfHelp.Models.SelfHelpImportanceLevel?)) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpError SelfHelpError(string code = null, string errorType = null, string message = null, System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.ResourceManager.SelfHelp.Models.SelfHelpFilter SelfHelpFilter(string name = null, string values = null, string @operator = null) { throw null; } diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Custom/ArmSelfHelpModelFactory.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Custom/ArmSelfHelpModelFactory.cs index b17b32608a71..5e655cf300fd 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Custom/ArmSelfHelpModelFactory.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Custom/ArmSelfHelpModelFactory.cs @@ -11,31 +11,6 @@ namespace Azure.ResourceManager.SelfHelp.Models { public static partial class ArmSelfHelpModelFactory { - /// Initializes a new instance of SelfHelpDiagnosticInsight. - /// - /// Article id. - /// Serialized Name: Insight.id - /// - /// - /// This insight's title. - /// Serialized Name: Insight.title - /// - /// - /// Detailed result content. - /// Serialized Name: Insight.results - /// - /// - /// Importance level of the insight. - /// Serialized Name: Insight.importanceLevel - /// - /// A new instance for mocking. - [Obsolete("This function is obsolete and will be removed in a future release.", false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public static SelfHelpDiagnosticInsight SelfHelpDiagnosticInsight(string id = null, string title = null, string results = null, SelfHelpImportanceLevel? insightImportanceLevel = null) - { - return new SelfHelpDiagnosticInsight(id, title, results, insightImportanceLevel, serializedAdditionalRawData: null); - } - /// Initializes a new instance of SelfHelpSolutionMetadata. /// The id. /// The name. diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/ArmSelfHelpModelFactory.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/ArmSelfHelpModelFactory.cs index ff4387f413db..0c8f411bbe86 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/ArmSelfHelpModelFactory.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/ArmSelfHelpModelFactory.cs @@ -69,6 +69,17 @@ public static SelfHelpDiagnosticInfo SelfHelpDiagnosticInfo(string solutionId = return new SelfHelpDiagnosticInfo(solutionId, status, insights?.ToList(), error, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Article id. + /// This insight's title. + /// Detailed result content. + /// Importance level of the insight. + /// A new instance for mocking. + public static SelfHelpDiagnosticInsight SelfHelpDiagnosticInsight(string id = null, string title = null, string results = null, SelfHelpImportanceLevel? insightImportanceLevel = null) + { + return new SelfHelpDiagnosticInsight(id, title, results, insightImportanceLevel, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Service specific error code which serves as the substatus for the HTTP error code. /// Service specific error type which serves as additional context for the error herein. diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md index 55a6141ca95b..02e4d0c643eb 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md @@ -10,6 +10,14 @@ ### Other Changes +## 7.18.4 (2025-02-11) + +### Bugs Fixed + +- Fixed an issue with the `AmqpReceiver` class where a drain failure during a `ReceiveMessagesAsync` operation would cause message ordering to be violated. ([#47822](https://github.com/Azure/azure-sdk-for-net/issues/47822)) + +- Fixed an issue where an error response from the Service Bus administration service without a body was incorrectly parsed, resulting in a null argument exception obscuring the actual failure response. ([#47517](https://github.com/Azure/azure-sdk-for-net/issues/47517)) + ## 7.18.3 (2025-01-17) ### Bugs Fixed diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/README.md b/sdk/servicebus/Azure.Messaging.ServiceBus/README.md index 91c35c45cbdf..6817a8cdb2d0 100755 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/README.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/README.md @@ -525,5 +525,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FAzure.Messaging.ServiceBus%2FREADME.png) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/perf/README.md b/sdk/servicebus/Azure.Messaging.ServiceBus/perf/README.md index bc13f39bc587..10e47d59d965 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/perf/README.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/perf/README.md @@ -6,8 +6,8 @@ The assets in this area comprise a set of performance tests for the [Azure Servi The Service Bus client library performance tests are run via a console app. In order to run, specify either via command line or within IDE build arguments the test and set of arguments to use. For example, to run the `SendMessages` test, you can add `SendMessages` to the Application arguments within Visual Studio. The performance tests rely on the same set of environment variables used by the Service Bus client library's test suite. Full details can be found in the [Running tests](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/CONTRIBUTING.md#running-tests) section of the contributing guide. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -16,5 +16,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FAzure.Messaging.ServiceBus.Perf%2FREADME.png) \ No newline at end of file diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusRequestFailedDetailsParser.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusRequestFailedDetailsParser.cs index 4307cd4fbffb..32c8954fc1c7 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusRequestFailedDetailsParser.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusRequestFailedDetailsParser.cs @@ -15,7 +15,7 @@ internal sealed class ServiceBusRequestFailedDetailsParser : RequestFailedDetail public override bool TryParse(Response response, out ResponseError? error, out IDictionary? data) { data = default; - if (response.ContentStream is { CanSeek: true }) + if (response.ContentStream is { CanSeek: true, Length: > 0}) { var position = response.ContentStream.Position; try diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpConnectionScope.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpConnectionScope.cs index 398ae47ee7bd..4b085ffa7199 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpConnectionScope.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpConnectionScope.cs @@ -1436,22 +1436,26 @@ private static void ValidateTransport(ServiceBusTransportType transport) } } - internal void CloseLink(AmqpLink link) + internal void CloseLink(AmqpLink link, string identifier = default) { + ServiceBusEventSource.Log.CloseLinkStart(identifier); if (!_useSingleSession) { link.Session?.SafeClose(); } link.SafeClose(); + ServiceBusEventSource.Log.CloseLinkComplete(identifier); } - internal void CloseLink(RequestResponseAmqpLink link) + internal void CloseLink(RequestResponseAmqpLink link, string identifier = default) { + ServiceBusEventSource.Log.CloseLinkStart(identifier); if (!_useSingleSession) { link.Session?.SafeClose(); } link.SafeClose(); + ServiceBusEventSource.Log.CloseLinkComplete(identifier); } } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpReceiver.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpReceiver.cs index 8330bdcdbb8f..3582bdb83aeb 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpReceiver.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpReceiver.cs @@ -199,11 +199,11 @@ public AmqpReceiver( // it is okay to register the user provided cancellationToken from the AcceptNextSessionAsync call in // the fault tolerant object because session receivers are never reconnected. cancellationToken: cancellationToken), - link => _connectionScope.CloseLink(link)); + link => _connectionScope.CloseLink(link, Identifier)); _managementLink = new FaultTolerantAmqpObject( timeout => OpenManagementLinkAsync(timeout), - link => _connectionScope.CloseLink(link)); + link => _connectionScope.CloseLink(link, Identifier)); _messageConverter = messageConverter; } @@ -373,7 +373,7 @@ private async Task> ReceiveMessagesAsyn // The session won't be closed in the case that MaxConcurrentCallsPerSession > 1, but with concurrency, it is not possible to guarantee ordering. if (_isSessionReceiver && (!_isProcessor || SessionId != null) && messageList.Count < maxMessages) { - await link.DrainAsyc(cancellationToken).ConfigureAwait(false); + await SafeDrainLinkAsync(link, cancellationToken).ConfigureAwait(false); // These workarounds are necessary in order to resume prefetching after the link has been drained // https://github.com/Azure/azure-amqp/issues/252#issuecomment-1942734342 @@ -420,6 +420,34 @@ private async Task> ReceiveMessagesAsyn } } + /// + /// Drains an AMQP link. When drain failure happens we make sure to close the link to ensure ordering. + /// + /// The AMPQ link to drain. + /// An optional instance to signal the request to cancel the operation. + /// A task to be resolved on when the operation has completed. + public async Task SafeDrainLinkAsync(ReceivingAmqpLink link, CancellationToken cancellationToken) + { + try + { + ServiceBusEventSource.Log.DrainLinkStart(Identifier); + await link.DrainAsyc(cancellationToken).ConfigureAwait(false); + ServiceBusEventSource.Log.DrainLinkComplete(Identifier); + } + catch (Exception ex) + { + ServiceBusEventSource.Log.DrainLinkException(Identifier, ex.ToString()); + + // Drain failure that does not fault AMQP link will cause ordering to be violated. Force close + // AMQP link to ensure ordering is maintained. + // Detailed explanation as to why ordering is violated: https://github.com/Azure/azure-sdk-for-net/issues/47822 + if (_prefetchCount > 0) + { + _connectionScope.CloseLink(link, Identifier); + } + } + } + /// /// Completes a . This will delete the message from the service. /// diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpRuleManager.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpRuleManager.cs index 462550cfa051..e5d9fa4dbbc0 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpRuleManager.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpRuleManager.cs @@ -92,7 +92,7 @@ public AmqpRuleManager( identifier, timeout, CancellationToken.None), - link => _connectionScope.CloseLink(link)); + link => _connectionScope.CloseLink(link, identifier)); } /// diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs index ec56ccb2fa0f..e0e618da85df 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs @@ -148,11 +148,11 @@ public AmqpSender( _sendLink = new FaultTolerantAmqpObject( timeout => CreateLinkAndEnsureSenderStateAsync(timeout, CancellationToken.None), - link => _connectionScope.CloseLink(link)); + link => _connectionScope.CloseLink(link, Identifier)); _managementLink = new FaultTolerantAmqpObject( timeout => OpenManagementLinkAsync(timeout), - link => _connectionScope.CloseLink(link)); + link => _connectionScope.CloseLink(link, Identifier)); _messageConverter = messageConverter; } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj index 0eff05c3f51c..387ef96892cd 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Azure.Messaging.ServiceBus.csproj @@ -3,7 +3,7 @@ Azure Service Bus is a fully managed enterprise integration message broker. Service Bus can decouple applications and services. Service Bus offers a reliable and secure platform for asynchronous transfer of data and state. This client library allows for both sending and receiving messages using Azure Service Bus. For more information about Service Bus, see https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview 7.19.0-beta.1 - 7.18.3 + 7.18.4 Azure;Service Bus;ServiceBus;.NET;AMQP;$(PackageCommonTags) $(RequiredTargetFrameworks) false diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Diagnostics/ServiceBusEventSource.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Diagnostics/ServiceBusEventSource.cs index f43f2011d6bd..04c588acf37c 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Diagnostics/ServiceBusEventSource.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Diagnostics/ServiceBusEventSource.cs @@ -208,6 +208,12 @@ protected ServiceBusEventSource() : base(EventSourceName) internal const int ReceiverAcceptSessionTimeoutEvent = 122; internal const int ReceiverAcceptSessionCanceledEvent = 123; + internal const int DrainLinkStartEvent = 124; + internal const int DrainLinkCompleteEvent = 125; + internal const int DrainLinkExceptionEvent = 126; + internal const int CloseLinkStartEvent = 127; + internal const int CloseLinkCompleteEvent = 128; + #endregion // add new event numbers here incrementing from previous @@ -1542,6 +1548,51 @@ public virtual void RequestAuthorizationException(string identifier, string endp WriteEvent(RequestAuthorizationExceptionEvent, identifier, endpoint, exception); } } + + [Event(DrainLinkStartEvent, Level = EventLevel.Verbose, Message = "{0}: Starting drain operation.")] + public void DrainLinkStart(string identifier) + { + if (IsEnabled()) + { + WriteEvent(DrainLinkStartEvent, identifier ?? string.Empty); + } + } + + [Event(DrainLinkCompleteEvent, Level = EventLevel.Verbose, Message = "{0}: Drain operation completed.")] + public void DrainLinkComplete(string identifier) + { + if (IsEnabled()) + { + WriteEvent(DrainLinkCompleteEvent, identifier ?? string.Empty); + } + } + + [Event(DrainLinkExceptionEvent, Level = EventLevel.Error, Message = "{0}: Drain operation failed with exception: {1}")] + public void DrainLinkException(string identifier, string exception) + { + if (IsEnabled()) + { + WriteEvent(DrainLinkExceptionEvent, identifier ?? string.Empty, exception); + } + } + + [Event(CloseLinkStartEvent, Level = EventLevel.Verbose, Message = "{0}: Starting closure of AMQP link.")] + public void CloseLinkStart(string identifier) + { + if (IsEnabled()) + { + WriteEvent(CloseLinkStartEvent, identifier ?? string.Empty); + } + } + + [Event(CloseLinkCompleteEvent, Level = EventLevel.Verbose, Message = "{0}: Closing AMQP link completed.")] + public void CloseLinkComplete(string identifier) + { + if (IsEnabled()) + { + WriteEvent(CloseLinkCompleteEvent, identifier ?? string.Empty); + } + } #endregion #region Retries diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusReceivedMessage.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusReceivedMessage.cs index bf57b852dc63..d6ec66cf6028 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusReceivedMessage.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusReceivedMessage.cs @@ -195,7 +195,7 @@ public static ServiceBusReceivedMessage FromAmqpMessage(AmqpAnnotatedMessage mes public string ReplyTo => AmqpMessage.Properties.ReplyTo?.ToString(); /// - /// Gets or sets the date and time, in UTC, at which the message should be made available to receivers. This property does not control when a message is sent by the + /// Gets the date and time, in UTC, at which the message should be made available to receivers. This property does not control when a message is sent by the /// client. Sending happens immediately when `SendAsync` is called. Service Bus will hide the message from receivers until the the requested time. /// /// diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/stress/README.md b/sdk/servicebus/Azure.Messaging.ServiceBus/stress/README.md index 3d282e229161..8479aebe2228 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/stress/README.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/stress/README.md @@ -58,7 +58,7 @@ See the `Metrics.cs` file for more information about individual metrics and what ### Deploying a stress test In order to deploy stress tests to be run in kubernetes clusters, run: -```cmd +```cmd (env) /eng/common/scripts/stress-testing/deploy-stress-tests.ps1 ` >> -Login ` >> -PushImages @@ -73,7 +73,7 @@ This command requires Azure login credentials. ### Deploying a stress test In order to deploy stress tests to be run in kubernetes clusters, run: -```cmd +```cmd (env) /eng/common/scripts/stress-testing/deploy-stress-tests.ps1 ` >> -Login ` >> -PushImages @@ -89,5 +89,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs%2Fstress%2FREADME.png) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Administration/ServiceBusRequestFailedDetailsParserTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Administration/ServiceBusRequestFailedDetailsParserTests.cs new file mode 100644 index 000000000000..c40b63839b92 --- /dev/null +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Administration/ServiceBusRequestFailedDetailsParserTests.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using Moq; +using NUnit.Framework; + +namespace Azure.Messaging.ServiceBus.Tests.Administration +{ + [TestFixture] + public class ServiceBusRequestFailedDetailsParserTests + { + [Test] + public void ZeroLengthStreamReturnsDefaultErrorDetails() + { + var response = new MockResponse(401); + response.SetIsError(true); + response.SetContent(Array.Empty()); + + var parser = new ServiceBusRequestFailedDetailsParser(); + parser.TryParse(response, out var error, out var data); + + Assert.AreSame(default(ResponseError), error); + } + + [Test] + public void NonSeekingStreamReturnsDefaultErrorDetails() + { + var mockStream = new Mock(); + var response = new MockResponse(401) { ContentStream = mockStream.Object }; + + mockStream + .Setup(stream => stream.CanSeek) + .Returns(false); + + mockStream + .Setup(stream => stream.Length) + .Returns(1); + + response.SetIsError(true); + + var parser = new ServiceBusRequestFailedDetailsParser(); + parser.TryParse(response, out var error, out var data); + + Assert.AreSame(default(ResponseError), error); + } + + [Test] + public void XmlBodyReturnsErrorDetails() + { + var subcCode = "40100"; + var message = $"SubCode={subcCode}. Failed to authenticate"; + + var errorContent = + @$" + + 401 + {message} + "; + + var response = new MockResponse(401); + response.SetIsError(true); + response.SetContent(errorContent); + + var parser = new ServiceBusRequestFailedDetailsParser(); + parser.TryParse(response, out var error, out var data); + + Assert.NotNull(error); + Assert.AreNotSame(error, default(ResponseError)); + Assert.AreEqual(subcCode, error.Code); + Assert.AreEqual(message, error.Message); + } + } +} diff --git a/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md b/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md old mode 100755 new mode 100644 index 8eb237bc69b5..658195be3049 --- a/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md +++ b/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md @@ -79,5 +79,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope - [Azure Service Bus General Documentation](https://learn.microsoft.com/azure/service-bus-messaging/) - [Azure Service Bus REST API Reference](https://learn.microsoft.com/rest/api/servicebus/) - [Azure Service Bus SDK for .NET Documentation](https://learn.microsoft.com/dotnet/api/overview/azure/service-bus?view=azure-dotnet) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FMicrosoft.Azure.ServiceBus%2FREADME.png) diff --git a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md index 0aad238aa956..b829fa375f8d 100644 --- a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md +++ b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md @@ -302,8 +302,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FMicrosoft.Azure.WebJobs.Extensions.ServiceBus%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/ diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md index e09598546a04..a310a2154f48 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md @@ -1,18 +1,24 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.2 (Unreleased) ### Features Added -- Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed ### Other Changes +## 1.1.0-beta.1 (2025-02-06) + +### Features Added + +- Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. +- Exposed `JsonModelWriteCore` for model serialization procedure. +- Added CRUD Operations for Application Gateway for Containers (AGC) Security Policy +- Bumped api-version to `2025-01-01` + ## 1.0.1 (2023-11-30) ### Features Added diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.net8.0.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.net8.0.cs index 4de4f36c27f9..e1e40e5566db 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.net8.0.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.net8.0.cs @@ -1,5 +1,60 @@ namespace Azure.ResourceManager.ServiceNetworking { + public partial class ApplicationGatewayForContainersSecurityPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ApplicationGatewayForContainersSecurityPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string securityPolicyName, Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string securityPolicyName, Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ApplicationGatewayForContainersSecurityPolicyData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationGatewayForContainersSecurityPolicyData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ServiceNetworking.Models.PolicyType? PolicyType { get { throw null; } } + public Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier WafPolicyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ApplicationGatewayForContainersSecurityPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ApplicationGatewayForContainersSecurityPolicyResource() { } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class AssociationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected AssociationCollection() { } @@ -111,6 +166,7 @@ protected FrontendResource() { } } public static partial class ServiceNetworkingExtensions { + public static Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ServiceNetworking.AssociationResource GetAssociationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ServiceNetworking.FrontendResource GetFrontendResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetTrafficController(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string trafficControllerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -144,6 +200,8 @@ public TrafficControllerData(Azure.Core.AzureLocation location) { } public System.Collections.Generic.IReadOnlyList ConfigurationEndpoints { get { throw null; } } public System.Collections.Generic.IReadOnlyList Frontends { get { throw null; } } public Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SecurityPolicies { get { throw null; } } + public Azure.Core.ResourceIdentifier WafSecurityPolicyId { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceNetworking.TrafficControllerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -163,6 +221,9 @@ protected TrafficControllerResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyCollection GetApplicationGatewayForContainersSecurityPolicies() { throw null; } + public virtual Azure.Response GetApplicationGatewayForContainersSecurityPolicy(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetApplicationGatewayForContainersSecurityPolicyAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAssociation(string associationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAssociationAsync(string associationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.AssociationCollection GetAssociations() { throw null; } @@ -188,6 +249,7 @@ namespace Azure.ResourceManager.ServiceNetworking.Mocking public partial class MockableServiceNetworkingArmClient : Azure.ResourceManager.ArmResource { protected MockableServiceNetworkingArmClient() { } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.AssociationResource GetAssociationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.FrontendResource GetFrontendResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.TrafficControllerResource GetTrafficControllerResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -208,11 +270,26 @@ protected MockableServiceNetworkingSubscriptionResource() { } } namespace Azure.ResourceManager.ServiceNetworking.Models { + public partial class ApplicationGatewayForContainersSecurityPolicyPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationGatewayForContainersSecurityPolicyPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.Core.ResourceIdentifier WafPolicyId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmServiceNetworkingModelFactory { + public static Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData ApplicationGatewayForContainersSecurityPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ServiceNetworking.Models.PolicyType? policyType = default(Azure.ResourceManager.ServiceNetworking.Models.PolicyType?), Azure.Core.ResourceIdentifier wafPolicyId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } public static Azure.ResourceManager.ServiceNetworking.AssociationData AssociationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ServiceNetworking.Models.AssociationType? associationType = default(Azure.ResourceManager.ServiceNetworking.Models.AssociationType?), Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } public static Azure.ResourceManager.ServiceNetworking.FrontendData FrontendData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string fqdn = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable configurationEndpoints = null, System.Collections.Generic.IEnumerable frontends = null, System.Collections.Generic.IEnumerable associations = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable configurationEndpoints = null, System.Collections.Generic.IEnumerable frontends = null, System.Collections.Generic.IEnumerable associations = null, System.Collections.Generic.IEnumerable securityPolicies = null, Azure.Core.ResourceIdentifier wafSecurityPolicyId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable configurationEndpoints, System.Collections.Generic.IEnumerable frontends, System.Collections.Generic.IEnumerable associations, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState) { throw null; } } public partial class AssociationPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -256,6 +333,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PolicyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PolicyType(string value) { throw null; } + public static Azure.ResourceManager.ServiceNetworking.Models.PolicyType WAF { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceNetworking.Models.PolicyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ServiceNetworking.Models.PolicyType left, Azure.ResourceManager.ServiceNetworking.Models.PolicyType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceNetworking.Models.PolicyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceNetworking.Models.PolicyType left, Azure.ResourceManager.ServiceNetworking.Models.PolicyType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ProvisioningState : System.IEquatable { private readonly object _dummy; @@ -282,6 +376,7 @@ public partial class TrafficControllerPatch : System.ClientModel.Primitives.IJso { public TrafficControllerPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.Core.ResourceIdentifier WafSecurityPolicyId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceNetworking.Models.TrafficControllerPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.netstandard2.0.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.netstandard2.0.cs index 4de4f36c27f9..e1e40e5566db 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.netstandard2.0.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/api/Azure.ResourceManager.ServiceNetworking.netstandard2.0.cs @@ -1,5 +1,60 @@ namespace Azure.ResourceManager.ServiceNetworking { + public partial class ApplicationGatewayForContainersSecurityPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ApplicationGatewayForContainersSecurityPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string securityPolicyName, Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string securityPolicyName, Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ApplicationGatewayForContainersSecurityPolicyData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationGatewayForContainersSecurityPolicyData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ServiceNetworking.Models.PolicyType? PolicyType { get { throw null; } } + public Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier WafPolicyId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ApplicationGatewayForContainersSecurityPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ApplicationGatewayForContainersSecurityPolicyResource() { } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class AssociationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected AssociationCollection() { } @@ -111,6 +166,7 @@ protected FrontendResource() { } } public static partial class ServiceNetworkingExtensions { + public static Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ServiceNetworking.AssociationResource GetAssociationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ServiceNetworking.FrontendResource GetFrontendResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetTrafficController(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string trafficControllerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -144,6 +200,8 @@ public TrafficControllerData(Azure.Core.AzureLocation location) { } public System.Collections.Generic.IReadOnlyList ConfigurationEndpoints { get { throw null; } } public System.Collections.Generic.IReadOnlyList Frontends { get { throw null; } } public Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SecurityPolicies { get { throw null; } } + public Azure.Core.ResourceIdentifier WafSecurityPolicyId { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceNetworking.TrafficControllerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -163,6 +221,9 @@ protected TrafficControllerResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyCollection GetApplicationGatewayForContainersSecurityPolicies() { throw null; } + public virtual Azure.Response GetApplicationGatewayForContainersSecurityPolicy(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetApplicationGatewayForContainersSecurityPolicyAsync(string securityPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAssociation(string associationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAssociationAsync(string associationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.AssociationCollection GetAssociations() { throw null; } @@ -188,6 +249,7 @@ namespace Azure.ResourceManager.ServiceNetworking.Mocking public partial class MockableServiceNetworkingArmClient : Azure.ResourceManager.ArmResource { protected MockableServiceNetworkingArmClient() { } + public virtual Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.AssociationResource GetAssociationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.FrontendResource GetFrontendResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ServiceNetworking.TrafficControllerResource GetTrafficControllerResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -208,11 +270,26 @@ protected MockableServiceNetworkingSubscriptionResource() { } } namespace Azure.ResourceManager.ServiceNetworking.Models { + public partial class ApplicationGatewayForContainersSecurityPolicyPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationGatewayForContainersSecurityPolicyPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.Core.ResourceIdentifier WafPolicyId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ServiceNetworking.Models.ApplicationGatewayForContainersSecurityPolicyPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmServiceNetworkingModelFactory { + public static Azure.ResourceManager.ServiceNetworking.ApplicationGatewayForContainersSecurityPolicyData ApplicationGatewayForContainersSecurityPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ServiceNetworking.Models.PolicyType? policyType = default(Azure.ResourceManager.ServiceNetworking.Models.PolicyType?), Azure.Core.ResourceIdentifier wafPolicyId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } public static Azure.ResourceManager.ServiceNetworking.AssociationData AssociationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ServiceNetworking.Models.AssociationType? associationType = default(Azure.ResourceManager.ServiceNetworking.Models.AssociationType?), Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } public static Azure.ResourceManager.ServiceNetworking.FrontendData FrontendData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string fqdn = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } - public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable configurationEndpoints = null, System.Collections.Generic.IEnumerable frontends = null, System.Collections.Generic.IEnumerable associations = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable configurationEndpoints = null, System.Collections.Generic.IEnumerable frontends = null, System.Collections.Generic.IEnumerable associations = null, System.Collections.Generic.IEnumerable securityPolicies = null, Azure.Core.ResourceIdentifier wafSecurityPolicyId = null, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ServiceNetworking.TrafficControllerData TrafficControllerData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable configurationEndpoints, System.Collections.Generic.IEnumerable frontends, System.Collections.Generic.IEnumerable associations, Azure.ResourceManager.ServiceNetworking.Models.ProvisioningState? provisioningState) { throw null; } } public partial class AssociationPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -256,6 +333,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PolicyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PolicyType(string value) { throw null; } + public static Azure.ResourceManager.ServiceNetworking.Models.PolicyType WAF { get { throw null; } } + public bool Equals(Azure.ResourceManager.ServiceNetworking.Models.PolicyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ServiceNetworking.Models.PolicyType left, Azure.ResourceManager.ServiceNetworking.Models.PolicyType right) { throw null; } + public static implicit operator Azure.ResourceManager.ServiceNetworking.Models.PolicyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ServiceNetworking.Models.PolicyType left, Azure.ResourceManager.ServiceNetworking.Models.PolicyType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ProvisioningState : System.IEquatable { private readonly object _dummy; @@ -282,6 +376,7 @@ public partial class TrafficControllerPatch : System.ClientModel.Primitives.IJso { public TrafficControllerPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.Core.ResourceIdentifier WafSecurityPolicyId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ServiceNetworking.Models.TrafficControllerPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyCollection.cs new file mode 100644 index 000000000000..7bbd9b160211 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyCollection.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceNetworking.Samples +{ + public partial class Sample_ApplicationGatewayForContainersSecurityPolicyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyPut.json + // this example is just showing the usage of "SecurityPoliciesInterface_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this TrafficControllerResource created on azure + // for more information of creating TrafficControllerResource, please refer to the document of TrafficControllerResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + ResourceIdentifier trafficControllerResourceId = TrafficControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName); + TrafficControllerResource trafficController = client.GetTrafficControllerResource(trafficControllerResourceId); + + // get the collection of this ApplicationGatewayForContainersSecurityPolicyResource + ApplicationGatewayForContainersSecurityPolicyCollection collection = trafficController.GetApplicationGatewayForContainersSecurityPolicies(); + + // invoke the operation + string securityPolicyName = "sp1"; + ApplicationGatewayForContainersSecurityPolicyData data = new ApplicationGatewayForContainersSecurityPolicyData(new AzureLocation("NorthCentralUS")) + { + WafPolicyId = new ResourceIdentifier("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, securityPolicyName, data); + ApplicationGatewayForContainersSecurityPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyGet.json + // this example is just showing the usage of "SecurityPoliciesInterface_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this TrafficControllerResource created on azure + // for more information of creating TrafficControllerResource, please refer to the document of TrafficControllerResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + ResourceIdentifier trafficControllerResourceId = TrafficControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName); + TrafficControllerResource trafficController = client.GetTrafficControllerResource(trafficControllerResourceId); + + // get the collection of this ApplicationGatewayForContainersSecurityPolicyResource + ApplicationGatewayForContainersSecurityPolicyCollection collection = trafficController.GetApplicationGatewayForContainersSecurityPolicies(); + + // invoke the operation + string securityPolicyName = "sp1"; + ApplicationGatewayForContainersSecurityPolicyResource result = await collection.GetAsync(securityPolicyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GetSecurityPolicies() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPoliciesGetList.json + // this example is just showing the usage of "SecurityPoliciesInterface_ListByTrafficController" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this TrafficControllerResource created on azure + // for more information of creating TrafficControllerResource, please refer to the document of TrafficControllerResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + ResourceIdentifier trafficControllerResourceId = TrafficControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName); + TrafficControllerResource trafficController = client.GetTrafficControllerResource(trafficControllerResourceId); + + // get the collection of this ApplicationGatewayForContainersSecurityPolicyResource + ApplicationGatewayForContainersSecurityPolicyCollection collection = trafficController.GetApplicationGatewayForContainersSecurityPolicies(); + + // invoke the operation and iterate over the result + await foreach (ApplicationGatewayForContainersSecurityPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyGet.json + // this example is just showing the usage of "SecurityPoliciesInterface_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this TrafficControllerResource created on azure + // for more information of creating TrafficControllerResource, please refer to the document of TrafficControllerResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + ResourceIdentifier trafficControllerResourceId = TrafficControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName); + TrafficControllerResource trafficController = client.GetTrafficControllerResource(trafficControllerResourceId); + + // get the collection of this ApplicationGatewayForContainersSecurityPolicyResource + ApplicationGatewayForContainersSecurityPolicyCollection collection = trafficController.GetApplicationGatewayForContainersSecurityPolicies(); + + // invoke the operation + string securityPolicyName = "sp1"; + bool result = await collection.ExistsAsync(securityPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyGet.json + // this example is just showing the usage of "SecurityPoliciesInterface_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this TrafficControllerResource created on azure + // for more information of creating TrafficControllerResource, please refer to the document of TrafficControllerResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + ResourceIdentifier trafficControllerResourceId = TrafficControllerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName); + TrafficControllerResource trafficController = client.GetTrafficControllerResource(trafficControllerResourceId); + + // get the collection of this ApplicationGatewayForContainersSecurityPolicyResource + ApplicationGatewayForContainersSecurityPolicyCollection collection = trafficController.GetApplicationGatewayForContainersSecurityPolicies(); + + // invoke the operation + string securityPolicyName = "sp1"; + NullableResponse response = await collection.GetIfExistsAsync(securityPolicyName); + ApplicationGatewayForContainersSecurityPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyResource.cs new file mode 100644 index 000000000000..275d6163d596 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_ApplicationGatewayForContainersSecurityPolicyResource.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ServiceNetworking.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceNetworking.Samples +{ + public partial class Sample_ApplicationGatewayForContainersSecurityPolicyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyGet.json + // this example is just showing the usage of "SecurityPoliciesInterface_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ApplicationGatewayForContainersSecurityPolicyResource created on azure + // for more information of creating ApplicationGatewayForContainersSecurityPolicyResource, please refer to the document of ApplicationGatewayForContainersSecurityPolicyResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + string securityPolicyName = "sp1"; + ResourceIdentifier applicationGatewayForContainersSecurityPolicyResourceId = ApplicationGatewayForContainersSecurityPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + ApplicationGatewayForContainersSecurityPolicyResource applicationGatewayForContainersSecurityPolicy = client.GetApplicationGatewayForContainersSecurityPolicyResource(applicationGatewayForContainersSecurityPolicyResourceId); + + // invoke the operation + ApplicationGatewayForContainersSecurityPolicyResource result = await applicationGatewayForContainersSecurityPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyDelete.json + // this example is just showing the usage of "SecurityPoliciesInterface_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ApplicationGatewayForContainersSecurityPolicyResource created on azure + // for more information of creating ApplicationGatewayForContainersSecurityPolicyResource, please refer to the document of ApplicationGatewayForContainersSecurityPolicyResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + string securityPolicyName = "sp1"; + ResourceIdentifier applicationGatewayForContainersSecurityPolicyResourceId = ApplicationGatewayForContainersSecurityPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + ApplicationGatewayForContainersSecurityPolicyResource applicationGatewayForContainersSecurityPolicy = client.GetApplicationGatewayForContainersSecurityPolicyResource(applicationGatewayForContainersSecurityPolicyResourceId); + + // invoke the operation + await applicationGatewayForContainersSecurityPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateSecurityPolicy() + { + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/SecurityPolicyPatch.json + // this example is just showing the usage of "SecurityPoliciesInterface_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ApplicationGatewayForContainersSecurityPolicyResource created on azure + // for more information of creating ApplicationGatewayForContainersSecurityPolicyResource, please refer to the document of ApplicationGatewayForContainersSecurityPolicyResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string trafficControllerName = "tc1"; + string securityPolicyName = "sp1"; + ResourceIdentifier applicationGatewayForContainersSecurityPolicyResourceId = ApplicationGatewayForContainersSecurityPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + ApplicationGatewayForContainersSecurityPolicyResource applicationGatewayForContainersSecurityPolicy = client.GetApplicationGatewayForContainersSecurityPolicyResource(applicationGatewayForContainersSecurityPolicyResourceId); + + // invoke the operation + ApplicationGatewayForContainersSecurityPolicyPatch patch = new ApplicationGatewayForContainersSecurityPolicyPatch + { + WafPolicyId = new ResourceIdentifier("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0"), + }; + ApplicationGatewayForContainersSecurityPolicyResource result = await applicationGatewayForContainersSecurityPolicy.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ApplicationGatewayForContainersSecurityPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationCollection.cs index 6752a0010009..944f01a8cdf7 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AssociationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationPut.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationPut.json // this example is just showing the usage of "AssociationsInterface_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_PutAssociation() [Ignore("Only validating compilation of examples")] public async Task Get_GetAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationGet.json // this example is just showing the usage of "AssociationsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAssociation() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAssociations() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationsGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationsGet.json // this example is just showing the usage of "AssociationsInterface_ListByTrafficController" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_GetAssociations() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationGet.json // this example is just showing the usage of "AssociationsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_GetAssociation() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationGet.json // this example is just showing the usage of "AssociationsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationResource.cs index 93705874bcd9..1a22f973377f 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_AssociationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AssociationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationGet.json // this example is just showing the usage of "AssociationsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetAssociation() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationDelete.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationDelete.json // this example is just showing the usage of "AssociationsInterface_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteAssociation() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAssociation() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/AssociationPatch.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/AssociationPatch.json // this example is just showing the usage of "AssociationsInterface_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendCollection.cs index a380ca94425c..cb090a1337b0 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_FrontendCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendPut.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendPut.json // this example is just showing the usage of "FrontendsInterface_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task CreateOrUpdate_PutFrontend() [Ignore("Only validating compilation of examples")] public async Task Get_GetFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendGet.json // this example is just showing the usage of "FrontendsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Get_GetFrontend() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetFrontends() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendsGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendsGet.json // this example is just showing the usage of "FrontendsInterface_ListByTrafficController" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task GetAll_GetFrontends() [Ignore("Only validating compilation of examples")] public async Task Exists_GetFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendGet.json // this example is just showing the usage of "FrontendsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task Exists_GetFrontend() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendGet.json // this example is just showing the usage of "FrontendsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendResource.cs index c290fcb3070d..d94037bcb332 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_FrontendResource.cs @@ -20,7 +20,7 @@ public partial class Sample_FrontendResource [Ignore("Only validating compilation of examples")] public async Task Get_GetFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendGet.json // this example is just showing the usage of "FrontendsInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetFrontend() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendDelete.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendDelete.json // this example is just showing the usage of "FrontendsInterface_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteFrontend() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateFrontend() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/FrontendPatch.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/FrontendPatch.json // this example is just showing the usage of "FrontendsInterface_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 88a9299c98e2..af4ed6e016de 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetTrafficControllers_GetTrafficControllersList() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllersGetList.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllersGetList.json // this example is just showing the usage of "TrafficControllerInterface_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerCollection.cs index aab64700d88f..18758e4ffd35 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_TrafficControllerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerPut.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerPut.json // this example is just showing the usage of "TrafficControllerInterface_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task CreateOrUpdate_PutTrafficController() [Ignore("Only validating compilation of examples")] public async Task Get_GetTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerGet.json // this example is just showing the usage of "TrafficControllerInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetTrafficController() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetTrafficControllers() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllersGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllersGet.json // this example is just showing the usage of "TrafficControllerInterface_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_GetTrafficControllers() [Ignore("Only validating compilation of examples")] public async Task Exists_GetTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerGet.json // this example is just showing the usage of "TrafficControllerInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +158,7 @@ public async Task Exists_GetTrafficController() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerGet.json // this example is just showing the usage of "TrafficControllerInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerResource.cs index ecafeaa320b7..82f3d8489d50 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/samples/Generated/Samples/Sample_TrafficControllerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_TrafficControllerResource [Ignore("Only validating compilation of examples")] public async Task Get_GetTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerGet.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerGet.json // this example is just showing the usage of "TrafficControllerInterface_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetTrafficController() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerDelete.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerDelete.json // this example is just showing the usage of "TrafficControllerInterface_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteTrafficController() [Ignore("Only validating compilation of examples")] public async Task Update_PatchTrafficController() { - // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2023-11-01/examples/TrafficControllerPatch.json + // Generated from example definition: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/stable/2025-01-01/examples/TrafficControllerPatch.json // this example is just showing the usage of "TrafficControllerInterface_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Azure.ResourceManager.ServiceNetworking.csproj b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Azure.ResourceManager.ServiceNetworking.csproj index 49ef42395bab..caa67260a8ed 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Azure.ResourceManager.ServiceNetworking.csproj +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Azure.ResourceManager.ServiceNetworking.csproj @@ -1,6 +1,6 @@ - 1.1.0-beta.1 + 1.1.0-beta.2 1.0.1 Azure.ResourceManager.ServiceNetworking diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyCollection.cs new file mode 100644 index 000000000000..f556f9a69c29 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ServiceNetworking +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetApplicationGatewayForContainersSecurityPolicies method from an instance of . + /// + public partial class ApplicationGatewayForContainersSecurityPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics; + private readonly SecurityPoliciesInterfaceRestOperations _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected ApplicationGatewayForContainersSecurityPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ApplicationGatewayForContainersSecurityPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceNetworking", ApplicationGatewayForContainersSecurityPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ApplicationGatewayForContainersSecurityPolicyResource.ResourceType, out string applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceApiVersion); + _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient = new SecurityPoliciesInterfaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != TrafficControllerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, TrafficControllerResource.ResourceType), nameof(id)); + } + + /// + /// Create a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SecurityPolicy. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new ServiceNetworkingArmOperation(new ApplicationGatewayForContainersSecurityPolicyOperationSource(Client), _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SecurityPolicy. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, data, cancellationToken); + var operation = new ServiceNetworkingArmOperation(new ApplicationGatewayForContainersSecurityPolicyOperationSource(Client), _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.Get"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SecurityPolicy resources by TrafficController + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_ListByTrafficController + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateListByTrafficControllerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateListByTrafficControllerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayForContainersSecurityPolicyResource(Client, ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(e)), _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, "ApplicationGatewayForContainersSecurityPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SecurityPolicy resources by TrafficController + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_ListByTrafficController + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateListByTrafficControllerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateListByTrafficControllerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayForContainersSecurityPolicyResource(Client, ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(e)), _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, "ApplicationGatewayForContainersSecurityPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, securityPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.Serialization.cs new file mode 100644 index 000000000000..845b51517c14 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.ServiceNetworking.Models; + +namespace Azure.ResourceManager.ServiceNetworking +{ + public partial class ApplicationGatewayForContainersSecurityPolicyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(PolicyType)) + { + writer.WritePropertyName("policyType"u8); + writer.WriteStringValue(PolicyType.Value.ToString()); + } + if (Optional.IsDefined(WafPolicy)) + { + writer.WritePropertyName("wafPolicy"u8); + JsonSerializer.Serialize(writer, WafPolicy); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + ApplicationGatewayForContainersSecurityPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement, options); + } + + internal static ApplicationGatewayForContainersSecurityPolicyData DeserializeApplicationGatewayForContainersSecurityPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + Models.PolicyType? policyType = default; + WritableSubResource wafPolicy = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("policyType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policyType = new Models.PolicyType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("wafPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wafPolicy = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationGatewayForContainersSecurityPolicyData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + policyType, + wafPolicy, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyData)} does not support writing '{options.Format}' format."); + } + } + + ApplicationGatewayForContainersSecurityPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.cs new file mode 100644 index 000000000000..88531c7ded4a --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyData.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.ServiceNetworking.Models; + +namespace Azure.ResourceManager.ServiceNetworking +{ + /// + /// A class representing the ApplicationGatewayForContainersSecurityPolicy data model. + /// SecurityPolicy Subresource of Traffic Controller. + /// + public partial class ApplicationGatewayForContainersSecurityPolicyData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public ApplicationGatewayForContainersSecurityPolicyData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Type of the Traffic Controller Security Policy. + /// Web Application Firewall Policy of the Traffic Controller Security Policy. + /// Provisioning State of Traffic Controller SecurityPolicy Resource. + /// Keeps track of any properties unknown to the library. + internal ApplicationGatewayForContainersSecurityPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, Models.PolicyType? policyType, WritableSubResource wafPolicy, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + PolicyType = policyType; + WafPolicy = wafPolicy; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplicationGatewayForContainersSecurityPolicyData() + { + } + + /// Type of the Traffic Controller Security Policy. + public Models.PolicyType? PolicyType { get; } + /// Web Application Firewall Policy of the Traffic Controller Security Policy. + internal WritableSubResource WafPolicy { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafPolicyId + { + get => WafPolicy is null ? default : WafPolicy.Id; + set + { + if (WafPolicy is null) + WafPolicy = new WritableSubResource(); + WafPolicy.Id = value; + } + } + + /// Provisioning State of Traffic Controller SecurityPolicy Resource. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.Serialization.cs new file mode 100644 index 000000000000..51c1db534202 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ServiceNetworking +{ + public partial class ApplicationGatewayForContainersSecurityPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ApplicationGatewayForContainersSecurityPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ApplicationGatewayForContainersSecurityPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.cs new file mode 100644 index 000000000000..79fe4fceda02 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ApplicationGatewayForContainersSecurityPolicyResource.cs @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceNetworking.Models; + +namespace Azure.ResourceManager.ServiceNetworking +{ + /// + /// A Class representing an ApplicationGatewayForContainersSecurityPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetApplicationGatewayForContainersSecurityPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetApplicationGatewayForContainersSecurityPolicy method. + /// + public partial class ApplicationGatewayForContainersSecurityPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The trafficControllerName. + /// The securityPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics; + private readonly SecurityPoliciesInterfaceRestOperations _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient; + private readonly ApplicationGatewayForContainersSecurityPolicyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ServiceNetworking/trafficControllers/securityPolicies"; + + /// Initializes a new instance of the class for mocking. + protected ApplicationGatewayForContainersSecurityPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ApplicationGatewayForContainersSecurityPolicyResource(ArmClient client, ApplicationGatewayForContainersSecurityPolicyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ApplicationGatewayForContainersSecurityPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceNetworking", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceApiVersion); + _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient = new SecurityPoliciesInterfaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ApplicationGatewayForContainersSecurityPolicyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Get"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Get"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Delete + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ServiceNetworkingArmOperation(_applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Delete + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Delete"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ServiceNetworkingArmOperation(_applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics, Pipeline, _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Update + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ApplicationGatewayForContainersSecurityPolicyPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Update"); + scope.Start(); + try + { + var response = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Update + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ApplicationGatewayForContainersSecurityPolicyPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.Update"); + scope.Start(); + try + { + var response = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceClientDiagnostics.CreateScope("ApplicationGatewayForContainersSecurityPolicyResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _applicationGatewayForContainersSecurityPolicySecurityPoliciesInterfaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ApplicationGatewayForContainersSecurityPolicyResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ApplicationGatewayForContainersSecurityPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ArmServiceNetworkingModelFactory.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ArmServiceNetworkingModelFactory.cs index 427d121078b4..3e9fdb4c622a 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ArmServiceNetworkingModelFactory.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/ArmServiceNetworkingModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -27,14 +28,17 @@ public static partial class ArmServiceNetworkingModelFactory /// Configuration Endpoints. /// Frontends References List. /// Associations References List. + /// Security Policies References List. + /// Security Policy Configuration. /// The status of the last operation. /// A new instance for mocking. - public static TrafficControllerData TrafficControllerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable configurationEndpoints = null, IEnumerable frontends = null, IEnumerable associations = null, ProvisioningState? provisioningState = null) + public static TrafficControllerData TrafficControllerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable configurationEndpoints = null, IEnumerable frontends = null, IEnumerable associations = null, IEnumerable securityPolicies = null, ResourceIdentifier wafSecurityPolicyId = null, ProvisioningState? provisioningState = null) { tags ??= new Dictionary(); configurationEndpoints ??= new List(); frontends ??= new List(); associations ??= new List(); + securityPolicies ??= new List(); return new TrafficControllerData( id, @@ -46,6 +50,8 @@ public static TrafficControllerData TrafficControllerData(ResourceIdentifier id configurationEndpoints?.ToList(), frontends?.ToList(), associations?.ToList(), + securityPolicies?.ToList(), + wafSecurityPolicyId != null ? new SecurityPolicyConfigurations(ResourceManagerModelFactory.WritableSubResource(wafSecurityPolicyId), serializedAdditionalRawData: null) : null, provisioningState, serializedAdditionalRawData: null); } @@ -103,5 +109,51 @@ public static FrontendData FrontendData(ResourceIdentifier id = null, string nam provisioningState, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Type of the Traffic Controller Security Policy. + /// Web Application Firewall Policy of the Traffic Controller Security Policy. + /// Provisioning State of Traffic Controller SecurityPolicy Resource. + /// A new instance for mocking. + public static ApplicationGatewayForContainersSecurityPolicyData ApplicationGatewayForContainersSecurityPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PolicyType? policyType = null, ResourceIdentifier wafPolicyId = null, ProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + + return new ApplicationGatewayForContainersSecurityPolicyData( + id, + name, + resourceType, + systemData, + tags, + location, + policyType, + wafPolicyId != null ? ResourceManagerModelFactory.WritableSubResource(wafPolicyId) : null, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Configuration Endpoints. + /// Frontends References List. + /// Associations References List. + /// The status of the last operation. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static TrafficControllerData TrafficControllerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable configurationEndpoints, IEnumerable frontends, IEnumerable associations, ProvisioningState? provisioningState) + { + return TrafficControllerData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, configurationEndpoints: configurationEndpoints, frontends: frontends, associations: associations, securityPolicies: default, wafSecurityPolicyId: default, provisioningState: provisioningState); + } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationCollection.cs index 54fae7233d4d..7c0c390cdd28 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string associa /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string associationName, Cancell /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string associationName, Ca /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string associationName, CancellationToken c /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationResource.cs index 8bbdea700fd6..ec8f05070eb6 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/AssociationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -309,7 +309,7 @@ public virtual async Task> UpdateAsync(Association /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual Response Update(AssociationPatch patch, Canc /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -475,7 +475,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingArmClient.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingArmClient.cs index 19f030b2663c..f3a193402876 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingArmClient.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingArmClient.cs @@ -69,5 +69,17 @@ public virtual FrontendResource GetFrontendResource(ResourceIdentifier id) FrontendResource.ValidateResourceId(id); return new FrontendResource(Client, id); } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(ResourceIdentifier id) + { + ApplicationGatewayForContainersSecurityPolicyResource.ValidateResourceId(id); + return new ApplicationGatewayForContainersSecurityPolicyResource(Client, id); + } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingResourceGroupResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingResourceGroupResource.cs index 31fb43fb3501..251cba2a2b0b 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingResourceGroupResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual TrafficControllerCollection GetTrafficControllers() /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetTrafficControl /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingSubscriptionResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingSubscriptionResource.cs index d3e03010566b..4b12e1327198 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingSubscriptionResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/MockableServiceNetworkingSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetTrafficControllersAsy /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs index 9babf8bc40e2..5fd73b1fb305 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs @@ -89,6 +89,25 @@ public static FrontendResource GetFrontendResource(this ArmClient client, Resour return GetMockableServiceNetworkingArmClient(client).GetFrontendResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ApplicationGatewayForContainersSecurityPolicyResource GetApplicationGatewayForContainersSecurityPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableServiceNetworkingArmClient(client).GetApplicationGatewayForContainersSecurityPolicyResource(id); + } + /// /// Gets a collection of TrafficControllerResources in the ResourceGroupResource. /// @@ -119,7 +138,7 @@ public static TrafficControllerCollection GetTrafficControllers(this ResourceGro /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -157,7 +176,7 @@ public static async Task> GetTrafficControll /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -195,7 +214,7 @@ public static Response GetTrafficController(this Reso /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -231,7 +250,7 @@ public static AsyncPageable GetTrafficControllersAsyn /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendCollection.cs index b9d43d3af9e5..06bd5e25ccbf 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string frontendNa /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string frontendName, CancellationT /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string frontendName, Cance /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string frontendName, CancellationToken canc /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendData.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendData.cs index f822baf1af1a..56714ace59f7 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendData.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.ServiceNetworking { /// /// A class representing the Frontend data model. - /// Frontend Subresource of Traffic Controller. + /// Frontend Sub Resource of Traffic Controller. /// public partial class FrontendData : TrackedResourceData { diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendResource.cs index 16edcccc9080..b6051a9b2360 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/FrontendResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -309,7 +309,7 @@ public virtual async Task> UpdateAsync(FrontendPatch /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual Response Update(FrontendPatch patch, Cancellati /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -475,7 +475,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/LongRunningOperation/ApplicationGatewayForContainersSecurityPolicyOperationSource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/LongRunningOperation/ApplicationGatewayForContainersSecurityPolicyOperationSource.cs new file mode 100644 index 000000000000..0d8afa77d867 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/LongRunningOperation/ApplicationGatewayForContainersSecurityPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceNetworking +{ + internal class ApplicationGatewayForContainersSecurityPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ApplicationGatewayForContainersSecurityPolicyOperationSource(ArmClient client) + { + _client = client; + } + + ApplicationGatewayForContainersSecurityPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return new ApplicationGatewayForContainersSecurityPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return new ApplicationGatewayForContainersSecurityPolicyResource(_client, data); + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.Serialization.cs new file mode 100644 index 000000000000..d5723b478bbf --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + public partial class ApplicationGatewayForContainersSecurityPolicyPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(WafPolicy)) + { + writer.WritePropertyName("wafPolicy"u8); + JsonSerializer.Serialize(writer, WafPolicy); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationGatewayForContainersSecurityPolicyPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationGatewayForContainersSecurityPolicyPatch(document.RootElement, options); + } + + internal static ApplicationGatewayForContainersSecurityPolicyPatch DeserializeApplicationGatewayForContainersSecurityPolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + WritableSubResource wafPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("wafPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wafPolicy = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationGatewayForContainersSecurityPolicyPatch(tags ?? new ChangeTrackingDictionary(), wafPolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + ApplicationGatewayForContainersSecurityPolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeApplicationGatewayForContainersSecurityPolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationGatewayForContainersSecurityPolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.cs new file mode 100644 index 000000000000..6ad5a102c7aa --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ApplicationGatewayForContainersSecurityPolicyPatch.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + /// The type used for update operations of the SecurityPolicy. + public partial class ApplicationGatewayForContainersSecurityPolicyPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ApplicationGatewayForContainersSecurityPolicyPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Web Application Firewall Policy of the Traffic Controller Security Policy. + /// Keeps track of any properties unknown to the library. + internal ApplicationGatewayForContainersSecurityPolicyPatch(IDictionary tags, WritableSubResource wafPolicy, IDictionary serializedAdditionalRawData) + { + Tags = tags; + WafPolicy = wafPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Web Application Firewall Policy of the Traffic Controller Security Policy. + internal WritableSubResource WafPolicy { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafPolicyId + { + get => WafPolicy is null ? default : WafPolicy.Id; + set + { + if (WafPolicy is null) + WafPolicy = new WritableSubResource(); + WafPolicy.Id = value; + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/AssociationType.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/AssociationType.cs index 418a1f4196d9..f2bf822ad050 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/AssociationType.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/AssociationType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceNetworking.Models { - /// The AssociationType. + /// Association Type Enum. public readonly partial struct AssociationType : IEquatable { private readonly string _value; @@ -24,7 +24,7 @@ public AssociationType(string value) private const string SubnetsValue = "subnets"; - /// subnets. + /// Association of Type Subnet. public static AssociationType Subnets { get; } = new AssociationType(SubnetsValue); /// Determines if two values are the same. public static bool operator ==(AssociationType left, AssociationType right) => left.Equals(right); diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/PolicyType.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/PolicyType.cs new file mode 100644 index 000000000000..a239f0d32d34 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/PolicyType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + /// Policy Type of the Security Policy. + public readonly partial struct PolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WAFValue = "waf"; + + /// Policy of Type WAF. + public static PolicyType WAF { get; } = new PolicyType(WAFValue); + /// Determines if two values are the same. + public static bool operator ==(PolicyType left, PolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PolicyType left, PolicyType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PolicyType(string value) => new PolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PolicyType other && Equals(other); + /// + public bool Equals(PolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ProvisioningState.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ProvisioningState.cs index 213730909aae..20a310027a04 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ProvisioningState.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/ProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceNetworking.Models { - /// The ProvisioningState. + /// Resource Provisioning State Enum. public readonly partial struct ProvisioningState : IEquatable { private readonly string _value; @@ -30,19 +30,19 @@ public ProvisioningState(string value) private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; - /// Provisioning. + /// Resource in Provisioning State. public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); - /// Updating. + /// Resource in Updating State. public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); - /// Deleting. + /// Resource in Deleting State. public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); - /// Accepted. + /// Resource in Accepted State. public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); - /// Succeeded. + /// Resource in Succeeded State. public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); - /// Failed. + /// Resource in Failed State. public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); - /// Canceled. + /// Resource in Canceled State. public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); /// Determines if two values are the same. public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs new file mode 100644 index 000000000000..1277e6ff8e46 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + public partial class ElasticExternalUserCreationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +======== + internal partial class SecurityPolicyConfigurations : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticExternalUserCreationResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(IsCreated)) + { + writer.WritePropertyName("created"u8); + writer.WriteBooleanValue(IsCreated.Value); +======== + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyConfigurations)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WafSecurityPolicy)) + { + writer.WritePropertyName("wafSecurityPolicy"u8); + JsonSerializer.Serialize(writer, WafSecurityPolicy); +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + ElasticExternalUserCreationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticExternalUserCreationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticExternalUserCreationResult(document.RootElement, options); + } + + internal static ElasticExternalUserCreationResult DeserializeElasticExternalUserCreationResult(JsonElement element, ModelReaderWriterOptions options = null) +======== + SecurityPolicyConfigurations IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyConfigurations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityPolicyConfigurations(document.RootElement, options); + } + + internal static SecurityPolicyConfigurations DeserializeSecurityPolicyConfigurations(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource wafSecurityPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("wafSecurityPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wafSecurityPolicy = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + return new ElasticExternalUserCreationResult(created, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new SecurityPolicyConfigurations(wafSecurityPolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + throw new FormatException($"The model {nameof(ElasticExternalUserCreationResult)} does not support writing '{options.Format}' format."); + } + } + + ElasticExternalUserCreationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(SecurityPolicyConfigurations)} does not support writing '{options.Format}' format."); + } + } + + SecurityPolicyConfigurations IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Models/ElasticExternalUserCreationResult.Serialization.cs + return DeserializeElasticExternalUserCreationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticExternalUserCreationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeSecurityPolicyConfigurations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityPolicyConfigurations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> main:sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.Serialization.cs + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.cs new file mode 100644 index 000000000000..6d5cbab6f8ed --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurations.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + /// SecurityPolicyConfigurations Subresource of Traffic Controller. + internal partial class SecurityPolicyConfigurations + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecurityPolicyConfigurations() + { + } + + /// Initializes a new instance of . + /// Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + /// Keeps track of any properties unknown to the library. + internal SecurityPolicyConfigurations(WritableSubResource wafSecurityPolicy, IDictionary serializedAdditionalRawData) + { + WafSecurityPolicy = wafSecurityPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + internal WritableSubResource WafSecurityPolicy { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafSecurityPolicyId + { + get => WafSecurityPolicy is null ? default : WafSecurityPolicy.Id; + set + { + if (WafSecurityPolicy is null) + WafSecurityPolicy = new WritableSubResource(); + WafSecurityPolicy.Id = value; + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.Serialization.cs new file mode 100644 index 000000000000..d0e9e3649a7a --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + internal partial class SecurityPolicyConfigurationsUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyConfigurationsUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WafSecurityPolicy)) + { + writer.WritePropertyName("wafSecurityPolicy"u8); + JsonSerializer.Serialize(writer, WafSecurityPolicy); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityPolicyConfigurationsUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyConfigurationsUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityPolicyConfigurationsUpdate(document.RootElement, options); + } + + internal static SecurityPolicyConfigurationsUpdate DeserializeSecurityPolicyConfigurationsUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource wafSecurityPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("wafSecurityPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wafSecurityPolicy = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityPolicyConfigurationsUpdate(wafSecurityPolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecurityPolicyConfigurationsUpdate)} does not support writing '{options.Format}' format."); + } + } + + SecurityPolicyConfigurationsUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityPolicyConfigurationsUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityPolicyConfigurationsUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.cs new file mode 100644 index 000000000000..f61f0a5dcb4b --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyConfigurationsUpdate.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + /// SecurityPolicyConfigurations Subresource of Traffic Controller. + internal partial class SecurityPolicyConfigurationsUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecurityPolicyConfigurationsUpdate() + { + } + + /// Initializes a new instance of . + /// Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + /// Keeps track of any properties unknown to the library. + internal SecurityPolicyConfigurationsUpdate(WritableSubResource wafSecurityPolicy, IDictionary serializedAdditionalRawData) + { + WafSecurityPolicy = wafSecurityPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + internal WritableSubResource WafSecurityPolicy { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafSecurityPolicyId + { + get => WafSecurityPolicy is null ? default : WafSecurityPolicy.Id; + set + { + if (WafSecurityPolicy is null) + WafSecurityPolicy = new WritableSubResource(); + WafSecurityPolicy.Id = value; + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.Serialization.cs new file mode 100644 index 000000000000..82f9b49972f7 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + internal partial class SecurityPolicyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityPolicyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPolicyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityPolicyListResult(document.RootElement, options); + } + + internal static SecurityPolicyListResult DeserializeSecurityPolicyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityPolicyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecurityPolicyListResult)} does not support writing '{options.Format}' format."); + } + } + + SecurityPolicyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityPolicyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityPolicyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.cs new file mode 100644 index 000000000000..ff071a13744f --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/SecurityPolicyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ServiceNetworking.Models +{ + /// The response of a SecurityPolicy list operation. + internal partial class SecurityPolicyListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SecurityPolicy items on this page. + /// is null. + internal SecurityPolicyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SecurityPolicy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SecurityPolicyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SecurityPolicyListResult() + { + } + + /// The SecurityPolicy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.Serialization.cs index b094902691fb..25cd3e0b952e 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.Serialization.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.Serialization.cs @@ -45,6 +45,14 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SecurityPolicyConfigurations)) + { + writer.WritePropertyName("securityPolicyConfigurations"u8); + writer.WriteObjectValue(SecurityPolicyConfigurations, options); + } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,6 +91,7 @@ internal static TrafficControllerPatch DeserializeTrafficControllerPatch(JsonEle return null; } IDictionary tags = default; + SecurityPolicyConfigurationsUpdate securityPolicyConfigurations = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -101,13 +110,34 @@ internal static TrafficControllerPatch DeserializeTrafficControllerPatch(JsonEle tags = dictionary; continue; } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("securityPolicyConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPolicyConfigurations = SecurityPolicyConfigurationsUpdate.DeserializeSecurityPolicyConfigurationsUpdate(property0.Value, options); + continue; + } + } + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new TrafficControllerPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new TrafficControllerPatch(tags ?? new ChangeTrackingDictionary(), securityPolicyConfigurations, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.cs index 8dd9226528d7..6d38ce13f0b7 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Models/TrafficControllerPatch.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ServiceNetworking.Models { @@ -53,14 +54,29 @@ public TrafficControllerPatch() /// Initializes a new instance of . /// Resource tags. + /// Security Policy Configuration. /// Keeps track of any properties unknown to the library. - internal TrafficControllerPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + internal TrafficControllerPatch(IDictionary tags, SecurityPolicyConfigurationsUpdate securityPolicyConfigurations, IDictionary serializedAdditionalRawData) { Tags = tags; + SecurityPolicyConfigurations = securityPolicyConfigurations; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } + /// Security Policy Configuration. + internal SecurityPolicyConfigurationsUpdate SecurityPolicyConfigurations { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafSecurityPolicyId + { + get => SecurityPolicyConfigurations is null ? default : SecurityPolicyConfigurations.WafSecurityPolicyId; + set + { + if (SecurityPolicyConfigurations is null) + SecurityPolicyConfigurations = new SecurityPolicyConfigurationsUpdate(); + SecurityPolicyConfigurations.WafSecurityPolicyId = value; + } + } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/AssociationsInterfaceRestOperations.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/AssociationsInterfaceRestOperations.cs index 8b1d332769c1..5865b385dcd2 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/AssociationsInterfaceRestOperations.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/AssociationsInterfaceRestOperations.cs @@ -32,7 +32,7 @@ public AssociationsInterfaceRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -499,7 +499,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -527,7 +526,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string t _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/FrontendsInterfaceRestOperations.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/FrontendsInterfaceRestOperations.cs index 22ee051c5a85..2e957f12294d 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/FrontendsInterfaceRestOperations.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/FrontendsInterfaceRestOperations.cs @@ -32,7 +32,7 @@ public FrontendsInterfaceRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -499,7 +499,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -527,7 +526,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string t _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/SecurityPoliciesInterfaceRestOperations.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/SecurityPoliciesInterfaceRestOperations.cs new file mode 100644 index 000000000000..a2ab05948017 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/SecurityPoliciesInterfaceRestOperations.cs @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceNetworking.Models; + +namespace Azure.ResourceManager.ServiceNetworking +{ + internal partial class SecurityPoliciesInterfaceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SecurityPoliciesInterfaceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SecurityPoliciesInterfaceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-01-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByTrafficControllerRequestUri(string subscriptionId, string resourceGroupName, string trafficControllerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByTrafficControllerRequest(string subscriptionId, string resourceGroupName, string trafficControllerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SecurityPolicy resources by TrafficController. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByTrafficControllerAsync(string subscriptionId, string resourceGroupName, string trafficControllerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + + using var message = CreateListByTrafficControllerRequest(subscriptionId, resourceGroupName, trafficControllerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecurityPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecurityPolicyListResult.DeserializeSecurityPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SecurityPolicy resources by TrafficController. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByTrafficController(string subscriptionId, string resourceGroupName, string trafficControllerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + + using var message = CreateListByTrafficControllerRequest(subscriptionId, resourceGroupName, trafficControllerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecurityPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecurityPolicyListResult.DeserializeSecurityPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGatewayForContainersSecurityPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ApplicationGatewayForContainersSecurityPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGatewayForContainersSecurityPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ApplicationGatewayForContainersSecurityPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGatewayForContainersSecurityPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, ApplicationGatewayForContainersSecurityPolicyPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGatewayForContainersSecurityPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGatewayForContainersSecurityPolicyData.DeserializeApplicationGatewayForContainersSecurityPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceNetworking/trafficControllers/", false); + uri.AppendPath(trafficControllerName, true); + uri.AppendPath("/securityPolicies/", false); + uri.AppendPath(securityPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SecurityPolicy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// SecurityPolicy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string trafficControllerName, string securityPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + Argument.AssertNotNullOrEmpty(securityPolicyName, nameof(securityPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, trafficControllerName, securityPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByTrafficControllerNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string trafficControllerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByTrafficControllerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string trafficControllerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SecurityPolicy resources by TrafficController. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByTrafficControllerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string trafficControllerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + + using var message = CreateListByTrafficControllerNextPageRequest(nextLink, subscriptionId, resourceGroupName, trafficControllerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SecurityPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SecurityPolicyListResult.DeserializeSecurityPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SecurityPolicy resources by TrafficController. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// traffic controller name for path. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByTrafficControllerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string trafficControllerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(trafficControllerName, nameof(trafficControllerName)); + + using var message = CreateListByTrafficControllerNextPageRequest(nextLink, subscriptionId, resourceGroupName, trafficControllerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SecurityPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SecurityPolicyListResult.DeserializeSecurityPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/TrafficControllerInterfaceRestOperations.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/TrafficControllerInterfaceRestOperations.cs index 22d656c62436..59882657901a 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/TrafficControllerInterfaceRestOperations.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/RestOperations/TrafficControllerInterfaceRestOperations.cs @@ -32,7 +32,7 @@ public TrafficControllerInterfaceRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-11-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -539,7 +539,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -565,7 +564,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string t _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerCollection.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerCollection.cs index 3ddc344ee17a..9a4fe99fbdd8 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerCollection.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string t /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string trafficControllerN /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string trafficControllerNa /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string trafficControllerName, CancellationT /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.Serialization.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.Serialization.cs index 97340eea2aa0..9766fbf7ef40 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.Serialization.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.Serialization.cs @@ -70,6 +70,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsCollectionDefined(SecurityPolicies)) + { + writer.WritePropertyName("securityPolicies"u8); + writer.WriteStartArray(); + foreach (var item in SecurityPolicies) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SecurityPolicyConfigurations)) + { + writer.WritePropertyName("securityPolicyConfigurations"u8); + writer.WriteObjectValue(SecurityPolicyConfigurations, options); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -107,6 +122,8 @@ internal static TrafficControllerData DeserializeTrafficControllerData(JsonEleme IReadOnlyList configurationEndpoints = default; IReadOnlyList frontends = default; IReadOnlyList associations = default; + IReadOnlyList securityPolicies = default; + SecurityPolicyConfigurations securityPolicyConfigurations = default; ProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -206,6 +223,29 @@ internal static TrafficControllerData DeserializeTrafficControllerData(JsonEleme associations = array; continue; } + if (property0.NameEquals("securityPolicies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + securityPolicies = array; + continue; + } + if (property0.NameEquals("securityPolicyConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPolicyConfigurations = SecurityPolicyConfigurations.DeserializeSecurityPolicyConfigurations(property0.Value, options); + continue; + } if (property0.NameEquals("provisioningState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -234,6 +274,8 @@ internal static TrafficControllerData DeserializeTrafficControllerData(JsonEleme configurationEndpoints ?? new ChangeTrackingList(), frontends ?? new ChangeTrackingList(), associations ?? new ChangeTrackingList(), + securityPolicies ?? new ChangeTrackingList(), + securityPolicyConfigurations, provisioningState, serializedAdditionalRawData); } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.cs index 344d538d9d5b..46cc228ea8a9 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerData.cs @@ -59,6 +59,7 @@ public TrafficControllerData(AzureLocation location) : base(location) ConfigurationEndpoints = new ChangeTrackingList(); Frontends = new ChangeTrackingList(); Associations = new ChangeTrackingList(); + SecurityPolicies = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -71,13 +72,17 @@ public TrafficControllerData(AzureLocation location) : base(location) /// Configuration Endpoints. /// Frontends References List. /// Associations References List. + /// Security Policies References List. + /// Security Policy Configuration. /// The status of the last operation. /// Keeps track of any properties unknown to the library. - internal TrafficControllerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList configurationEndpoints, IReadOnlyList frontends, IReadOnlyList associations, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal TrafficControllerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList configurationEndpoints, IReadOnlyList frontends, IReadOnlyList associations, IReadOnlyList securityPolicies, SecurityPolicyConfigurations securityPolicyConfigurations, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ConfigurationEndpoints = configurationEndpoints; Frontends = frontends; Associations = associations; + SecurityPolicies = securityPolicies; + SecurityPolicyConfigurations = securityPolicyConfigurations; ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -93,6 +98,22 @@ internal TrafficControllerData() public IReadOnlyList Frontends { get; } /// Associations References List. public IReadOnlyList Associations { get; } + /// Security Policies References List. + public IReadOnlyList SecurityPolicies { get; } + /// Security Policy Configuration. + internal SecurityPolicyConfigurations SecurityPolicyConfigurations { get; set; } + /// Gets or sets Id. + public ResourceIdentifier WafSecurityPolicyId + { + get => SecurityPolicyConfigurations is null ? default : SecurityPolicyConfigurations.WafSecurityPolicyId; + set + { + if (SecurityPolicyConfigurations is null) + SecurityPolicyConfigurations = new SecurityPolicyConfigurations(); + SecurityPolicyConfigurations.WafSecurityPolicyId = value; + } + } + /// The status of the last operation. public ProvisioningState? ProvisioningState { get; } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs index 40853b6b613e..3a705cc693b8 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs @@ -110,7 +110,7 @@ public virtual AssociationCollection GetAssociations() /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAssociationAsync(str /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual FrontendCollection GetFrontends() /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetFrontendAsync(string fr /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -228,6 +228,75 @@ public virtual Response GetFrontend(string frontendName, Cance return GetFrontends().Get(frontendName, cancellationToken); } + /// Gets a collection of ApplicationGatewayForContainersSecurityPolicyResources in the TrafficController. + /// An object representing collection of ApplicationGatewayForContainersSecurityPolicyResources and their operations over a ApplicationGatewayForContainersSecurityPolicyResource. + public virtual ApplicationGatewayForContainersSecurityPolicyCollection GetApplicationGatewayForContainersSecurityPolicies() + { + return GetCachedClient(client => new ApplicationGatewayForContainersSecurityPolicyCollection(client, Id)); + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApplicationGatewayForContainersSecurityPolicyAsync(string securityPolicyName, CancellationToken cancellationToken = default) + { + return await GetApplicationGatewayForContainersSecurityPolicies().GetAsync(securityPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SecurityPolicy + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName} + /// + /// + /// Operation Id + /// SecurityPoliciesInterface_Get + /// + /// + /// Default Api Version + /// 2025-01-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SecurityPolicy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApplicationGatewayForContainersSecurityPolicy(string securityPolicyName, CancellationToken cancellationToken = default) + { + return GetApplicationGatewayForContainersSecurityPolicies().Get(securityPolicyName, cancellationToken); + } + /// /// Get a TrafficController /// @@ -241,7 +310,7 @@ public virtual Response GetFrontend(string frontendName, Cance /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -281,7 +350,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -321,7 +390,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -363,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -405,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -447,7 +516,7 @@ public virtual async Task> UpdateAsync(Traff /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -489,7 +558,7 @@ public virtual Response Update(TrafficControllerPatch /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -551,7 +620,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -613,7 +682,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -670,7 +739,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -727,7 +796,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource @@ -787,7 +856,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2023-11-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/autorest.md b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/autorest.md index 76d0b187f614..761e1e9905c8 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/autorest.md +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: ServiceNetworking namespace: Azure.ResourceManager.ServiceNetworking -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/9837baba3ca259b4f2a3f736593311f445c35c63/specification/servicenetworking/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/b3d637043bcd1484f0f4c63ca6051407b6a329d1/specification/servicenetworking/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -17,6 +17,8 @@ skip-csproj: true modelerfour: flatten-payloads: false use-model-reader-writer: true +rename-mapping: + SecurityPolicy: ApplicationGatewayForContainersSecurityPolicy diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md index 3b77c7ef44fb..d993daeb7ce8 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md @@ -227,8 +227,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsignalr%2FMicrosoft.Azure.WebJobs.Extensions.SignalRService%2FREADME.png) - [nuget]: https://www.nuget.org/ diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj index 5675fb4626f1..43e9be25dc81 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/src/Microsoft.Azure.WebJobs.Extensions.SignalRService.csproj @@ -19,6 +19,17 @@ + + + + + + + diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index f6bcf9e2b44f..1eca8664354d 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 12.21.0-beta.1 (Unreleased) +## 12.21.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 12.21.0-beta.1 (2025-02-11) ### Features Added - Added support for service version 2025-05-05. diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/README.md b/sdk/storage/Azure.Storage.Blobs.Batch/README.md index 532f5970e04b..e85875c4adcc 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/README.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/README.md @@ -204,8 +204,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Blobs.Batch%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs.Batch/src [package]: https://www.nuget.org/packages/Azure.Storage.Blobs.Batch/ diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj index 34d48c6d7aa9..46275ad98d11 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/Azure.Storage.Blobs.Batch.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.Batch client library - 12.21.0-beta.1 + 12.21.0-beta.2 12.20.0 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index af2ef51643b1..92761910e66b 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 12.0.0-preview.53 (Unreleased) +## 12.0.0-preview.54 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 12.0.0-preview.53 (2025-02-11) ### Features Added - Added support for service version 2025-05-05. diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj index af66b098ff88..22073b447cbe 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs.ChangeFeed client library - 12.0.0-preview.53 + 12.0.0-preview.54 ChangeFeedSDK;$(DefineConstants) Microsoft Azure Change Feed;Microsoft;Azure;Storage;StorageScalable;$(PackageCommonTags) diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index 3070cac9a9a6..35a3c73e7cb0 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -1,6 +1,17 @@ # Release History -## 12.24.0-beta.1 (Unreleased) +## 12.24.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed +- Fixed ContentRange is null in BlobDownloadDetails when calling DownloadStreamingAsync with HttpRange "0-" #47882 + +### Other Changes + +## 12.24.0-beta.1 (2025-02-11) ### Features Added - Added support for service version 2025-05-05. diff --git a/sdk/storage/Azure.Storage.Blobs/README.md b/sdk/storage/Azure.Storage.Blobs/README.md index c42092555272..46863383a743 100644 --- a/sdk/storage/Azure.Storage.Blobs/README.md +++ b/sdk/storage/Azure.Storage.Blobs/README.md @@ -212,11 +212,11 @@ BlobContainerClientTransferOptions options = new BlobContainerClientTransferOpti { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -245,11 +245,11 @@ BlobContainerClientTransferOptions options = new BlobContainerClientTransferOpti { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -273,8 +273,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Blobs%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs/src [package]: https://www.nuget.org/packages/Azure.Storage.Blobs/ diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index c2eab78fe079..847b6ded635e 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_f174db6035" + "Tag": "net/storage/Azure.Storage.Blobs_11b2adbc87" } diff --git a/sdk/storage/Azure.Storage.Blobs/perf/README.md b/sdk/storage/Azure.Storage.Blobs/perf/README.md index 2dcf58f53020..1d7cd864889a 100644 --- a/sdk/storage/Azure.Storage.Blobs/perf/README.md +++ b/sdk/storage/Azure.Storage.Blobs/perf/README.md @@ -1,8 +1,8 @@ # Azure Storage Blobs performance tests The assets in this area comprise a set of performance tests for the [Azure Storage Blobs client library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs) and its associated ecosystem. The artifacts in this library are intended to be used primarily with the Azure SDK engineering system's testing infrastructure, but may also be run as stand-alone applications from the command line. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Blobs.Perf%2FREADME.png) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj index 79c36fd3da84..141240666133 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj +++ b/sdk/storage/Azure.Storage.Blobs/src/Azure.Storage.Blobs.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Blobs client library - 12.24.0-beta.1 + 12.24.0-beta.2 12.23.0 BlobSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 5186b550b74e..719e3d0a057d 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -1007,6 +1007,7 @@ private async Task> DownloadInternal( { Response response = await DownloadStreamingDirect( range, + range != default, conditions, rangeGetContentHash.ToValidationOptions(), progressHandler: default, @@ -1240,6 +1241,7 @@ public virtual Response DownloadStreaming( { return DownloadStreamingDirect( range, + true, conditions, rangeGetContentHash.ToValidationOptions(), progressHandler, @@ -1316,6 +1318,7 @@ public virtual async Task> DownloadStreami { return await DownloadStreamingDirect( range, + true, conditions, rangeGetContentHash.ToValidationOptions(), progressHandler, @@ -1369,6 +1372,7 @@ public virtual Response DownloadStreaming( { return DownloadStreamingDirect( options?.Range ?? default, + options?._isRangeSet ?? false, options?.Conditions, options?.TransferValidation, options?.ProgressHandler, @@ -1416,6 +1420,7 @@ public virtual async Task> DownloadStreami { return await DownloadStreamingDirect( options?.Range ?? default, + options?._isRangeSet ?? false, options?.Conditions, options?.TransferValidation, options?.ProgressHandler, @@ -1430,6 +1435,7 @@ public virtual async Task> DownloadStreami /// Implementation for public DownloadStreaming/DownloadContent methods to call into. /// /// + /// /// /// /// @@ -1439,6 +1445,7 @@ public virtual async Task> DownloadStreami /// private async ValueTask> DownloadStreamingDirect( HttpRange range, + bool isRangeSet, BlobRequestConditions conditions, DownloadTransferValidationOptions transferValidationOverride, IProgress progressHandler, @@ -1455,7 +1462,7 @@ private async ValueTask> DownloadStreaming } } - var response = await DownloadStreamingInternal(range, conditions, transferValidationOverride, progressHandler, operationName, async, cancellationToken).ConfigureAwait(false); + var response = await DownloadStreamingInternal(range, isRangeSet, conditions, transferValidationOverride, progressHandler, operationName, async, cancellationToken).ConfigureAwait(false); // if using clientside encryption, wrap the auto-retry stream in a decryptor // we already return a nonseekable stream; returning a crypto stream is fine @@ -1481,6 +1488,9 @@ private async ValueTask> DownloadStreaming /// /// Optionally specified range. /// + /// + /// If range has been set + /// /// /// Access conditions. /// @@ -1502,6 +1512,7 @@ private async ValueTask> DownloadStreaming /// internal virtual async ValueTask> DownloadStreamingInternal( HttpRange range, + bool isRangeSet, BlobRequestConditions conditions, DownloadTransferValidationOptions transferValidationOverride, IProgress progressHandler, @@ -1529,6 +1540,7 @@ internal virtual async ValueTask> Download // Start downloading the blob Response response = await StartDownloadAsync( range, + isRangeSet, conditions, validationOptions, async: async, @@ -1552,6 +1564,7 @@ internal virtual async ValueTask> Download startOffset => StartDownloadAsync( range, + isRangeSet, conditionsWithEtag, validationOptions, startOffset, @@ -1562,6 +1575,7 @@ internal virtual async ValueTask> Download async startOffset => (await StartDownloadAsync( range, + isRangeSet, conditionsWithEtag, validationOptions, startOffset, @@ -1629,6 +1643,9 @@ await ContentHasher.AssertResponseHashMatchInternal( /// If provided, only download the bytes of the blob in the specified /// range. If not provided, download the entire blob. /// + /// + /// Whether range has been set. + /// /// /// Optional to add conditions on /// downloading this blob. @@ -1659,6 +1676,7 @@ await ContentHasher.AssertResponseHashMatchInternal( /// private async ValueTask> StartDownloadAsync( HttpRange range, + bool isRangeSet, BlobRequestConditions conditions, DownloadTransferValidationOptions validationOptions, long startOffset = 0, @@ -1666,7 +1684,7 @@ private async ValueTask> StartDownloadAsyn CancellationToken cancellationToken = default) { HttpRange? pageRange = null; - if (range != default(HttpRange)) // we want to check between non-nullable ranges + if (isRangeSet) // we want to check if the range has been manually set { pageRange = new HttpRange( range.Offset + startOffset, @@ -1943,6 +1961,7 @@ public virtual Response DownloadContent( conditions, progressHandler: default, range: default, + isRangeSet: false, transferValidationOverride: default, false, // async cancellationToken) @@ -1999,6 +2018,7 @@ await DownloadContentInternal( conditions, progressHandler: default, range: default, + isRangeSet: false, transferValidationOverride: default, true, // async cancellationToken) @@ -2064,6 +2084,7 @@ public virtual Response DownloadContent( conditions, progressHandler, range, + true, transferValidationOverride: default, false, // async cancellationToken) @@ -2129,6 +2150,7 @@ await DownloadContentInternal( conditions, progressHandler, range, + true, transferValidationOverride: default, true, // async cancellationToken) @@ -2181,6 +2203,7 @@ public virtual Response DownloadContent( options?.Conditions, options?.ProgressHandler, options?.Range ?? default, + options?._isRangeSet ?? false, options?.TransferValidation, async: false, cancellationToken).EnsureCompleted(); @@ -2232,6 +2255,7 @@ await DownloadContentInternal( options?.Conditions, options?.ProgressHandler, options?.Range ?? default, + options?._isRangeSet ?? false, options?.TransferValidation, async: true, cancellationToken).ConfigureAwait(false); @@ -2240,12 +2264,14 @@ private async Task> DownloadContentInternal( BlobRequestConditions conditions, IProgress progressHandler, HttpRange range, + bool isRangeSet, DownloadTransferValidationOptions transferValidationOverride, bool async, CancellationToken cancellationToken) { Response response = await DownloadStreamingDirect( range, + isRangeSet, conditions, transferValidationOverride: transferValidationOverride, progressHandler, @@ -3186,6 +3212,7 @@ internal async Task OpenReadInternal( } Response response = await DownloadStreamingInternal( range, + true, readConditions, transferValidationOverride: downloadValidationOptions, progressHandler: default, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index c91a776426f0..20293b951a92 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -1711,10 +1711,12 @@ internal async Task> StagedUploadInternal( #region OpenWrite /// - /// Opens a stream for writing to the blob. + /// Opens a stream for writing to the blob. If the blob exists, + /// it will be overwritten. /// /// /// Whether an existing blob should be deleted and recreated. + /// The only valid value for this operation is true. /// /// /// Optional parameters. @@ -1744,11 +1746,12 @@ public virtual Stream OpenWrite( cancellationToken).EnsureCompleted(); /// - /// Opens a stream for writing to the blob. If the blob exists, + /// Opens a stream for writing to the blob. If the blob exists, /// it will be overwritten. /// /// /// Whether an existing blob should be deleted and recreated. + /// The only valid value for this operation is true. /// /// /// Optional parameters. diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index f9269ce6cb89..5eec56580803 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -1829,9 +1829,12 @@ private async Task> StageBlockFromUriInternal( /// this by specifying whether to commit a block from the committed /// block list or from the uncommitted block list, or to commit the /// most recently uploaded version of the block, whichever list it - /// may belong to. Any blocks not specified in the block list and + /// may belong to. Any blocks not specified in the block list are /// permanently deleted. /// + /// Note: Uncommitted blocks will expire and be permanently deleted after 7 days. + /// Blocks that are committed to a blob do not expire. + /// /// For more information, see /// /// Put Block List. @@ -1886,9 +1889,12 @@ public virtual Response CommitBlockList( /// this by specifying whether to commit a block from the committed /// block list or from the uncommitted block list, or to commit the /// most recently uploaded version of the block, whichever list it - /// may belong to. Any blocks not specified in the block list and + /// may belong to. Any blocks not specified in the block list are /// permanently deleted. /// + /// Note: Uncommitted blocks will expire and be permanently deleted after 7 days. + /// Blocks that are committed to a blob do not expire. + /// /// For more information, see /// /// Put Block List. @@ -1959,9 +1965,12 @@ public virtual Response CommitBlockList( /// this by specifying whether to commit a block from the committed /// block list or from the uncommitted block list, or to commit the /// most recently uploaded version of the block, whichever list it - /// may belong to. Any blocks not specified in the block list and + /// may belong to. Any blocks not specified in the block list are /// permanently deleted. /// + /// Note: Uncommitted blocks will expire and be permanently deleted after 7 days. + /// Blocks that are committed to a blob do not expire. + /// /// For more information, see /// /// Put Block List. @@ -2016,9 +2025,12 @@ await CommitBlockListInternal( /// this by specifying whether to commit a block from the committed /// block list or from the uncommitted block list, or to commit the /// most recently uploaded version of the block, whichever list it - /// may belong to. Any blocks not specified in the block list and + /// may belong to. Any blocks not specified in the block list are /// permanently deleted. /// + /// Note: Uncommitted blocks will expire and be permanently deleted after 7 days. + /// Blocks that are committed to a blob do not expire. + /// /// For more information, see /// /// Put Block List. @@ -2089,9 +2101,12 @@ await CommitBlockListInternal( /// this by specifying whether to commit a block from the committed /// block list or from the uncommitted block list, or to commit the /// most recently uploaded version of the block, whichever list it - /// may belong to. Any blocks not specified in the block list and + /// may belong to. Any blocks not specified in the block list are /// permanently deleted. /// + /// Note: Uncommitted blocks will expire and be permanently deleted after 7 days. + /// Blocks that are committed to a blob do not expire. + /// /// For more information, see /// /// Put Block List. diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobDownloadOptions.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobDownloadOptions.cs index 9f0caa7bef49..4e8949480b00 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobDownloadOptions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobDownloadOptions.cs @@ -11,11 +11,22 @@ namespace Azure.Storage.Blobs.Models /// public class BlobDownloadOptions { + private HttpRange _range; + internal bool _isRangeSet; + /// /// If provided, only download the bytes of the blob in the specified /// range. If not provided, download the entire blob. /// - public HttpRange Range { get; set; } + public HttpRange Range + { + get => _range; + set + { + _range = value; + _isRangeSet = true; + } + } /// /// Optional to add conditions on diff --git a/sdk/storage/Azure.Storage.Blobs/src/PartitionedDownloader.cs b/sdk/storage/Azure.Storage.Blobs/src/PartitionedDownloader.cs index 361594561ed7..8f68d302c10a 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/PartitionedDownloader.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/PartitionedDownloader.cs @@ -161,6 +161,7 @@ public async Task DownloadToInternal( { initialResponse = await _client.DownloadStreamingInternal( initialRange, + true, conditions, ValidationOptions, _progress, @@ -172,6 +173,7 @@ public async Task DownloadToInternal( { initialResponse = await _client.DownloadStreamingInternal( range: default, + false, conditions, ValidationOptions, _progress, @@ -230,8 +232,8 @@ await HandleOneShotDownload(initialResponse, destination, async, cancellationTok BlobRequestConditions conditionsWithEtag = conditions?.WithIfMatch(etag) ?? new BlobRequestConditions { IfMatch = etag }; #pragma warning disable AZC0110 // DO NOT use await keyword in possibly synchronous scope. - // Rule checker cannot understand this section, but this - // massively reduces code duplication. + // Rule checker cannot understand this section, but this + // massively reduces code duplication. int effectiveWorkerCount = async ? _maxWorkerCount : 1; if (effectiveWorkerCount > 1) { @@ -260,6 +262,7 @@ await HandleOneShotDownload(initialResponse, destination, async, cancellationTok ValueTask> responseValueTask = _client .DownloadStreamingInternal( httpRange, + true, conditionsWithEtag, ValidationOptions, _progress, @@ -338,13 +341,13 @@ await CopyToInternal( async, cancellationToken) .ConfigureAwait(false); - if (UseMasterCrc) - { - StorageCrc64Composer.Compose( - (composedCrc.ToArray(), 0L), - (partitionChecksum.ToArray(), response.Value.Details.ContentLength) - ).CopyTo(composedCrc); - } + if (UseMasterCrc) + { + StorageCrc64Composer.Compose( + (composedCrc.ToArray(), 0L), + (partitionChecksum.ToArray(), response.Value.Details.ContentLength) + ).CopyTo(composedCrc); + } } } } diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index d0ef9cabe003..ed6a0b2da231 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -980,7 +980,7 @@ public async Task DownloadAsync_WithUnreliableConnection_Streaming_And_Concurren RequestFailedException ex = Assert.CatchAsync(async () => { BlobDownloadStreamingResult result = await blob.DownloadStreamingAsync(); await result.Content.CopyToAsync(Stream.Null); - }); + }); // Assert Assert.IsTrue(ex.ErrorCode == BlobErrorCode.ConditionNotMet); @@ -1082,6 +1082,120 @@ public async Task DownloadAsync_Range_Streaming() TestHelper.AssertSequenceEqual(data.Skip(offset).Take(count), actual.ToArray()); } + [RecordedTest] + public async Task DownloadStreamingAsync_RangeNotSet_AssertContentRange() + { + await using DisposingContainer test = await GetTestContainerAsync(); + + // Arrange + int size = Constants.KB; + BlockBlobClient blob1 = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(GetRandomBuffer(size))) + { + await blob1.UploadAsync(stream); + } + BlockBlobClient blob2 = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(GetRandomBuffer(size))) + { + await blob2.UploadAsync(stream); + } + + // Act + Response response1 = await blob1.DownloadStreamingAsync(); + Response response2 = await blob2.DownloadStreamingAsync(new BlobDownloadOptions()); + + // Assert + Assert.IsNull(response1.Value.Details.ContentRange); + Assert.IsNull(response2.Value.Details.ContentRange); + } + + [RecordedTest] + [TestCase(0)] + [TestCase(1)] + public async Task DownloadStreamingAsync_RangeSet_AssertContentRange(long offset) + { + await using DisposingContainer test = await GetTestContainerAsync(); + + // Arrange + int size = Constants.KB; + var data = GetRandomBuffer(size); + BlockBlobClient blob = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(data)) + { + await blob.UploadAsync(stream); + } + + BlobDownloadOptions blobDownloadOptions = new BlobDownloadOptions + { + Range = new HttpRange(offset) + }; + + // Act + Response response = await blob.DownloadStreamingAsync(blobDownloadOptions); + + // Assert + Assert.NotNull(response.Value.Details.ContentRange); + string expectedContentRange = $"bytes {offset}-{size - 1}/{size}"; + Assert.AreEqual(expectedContentRange, response.Value.Details.ContentRange); + } + + [RecordedTest] + public async Task DownloadContentAsync_RangeNotSet_AssertContentRange() + { + await using DisposingContainer test = await GetTestContainerAsync(); + + // Arrange + int size = Constants.KB; + BlockBlobClient blob1 = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(GetRandomBuffer(size))) + { + await blob1.UploadAsync(stream); + } + BlockBlobClient blob2 = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(GetRandomBuffer(size))) + { + await blob2.UploadAsync(stream); + } + + // Act + Response response1 = await blob1.DownloadContentAsync(); + Response response2 = await blob2.DownloadContentAsync(new BlobDownloadOptions()); + + // Assert + Assert.IsNull(response1.Value.Details.ContentRange); + Assert.IsNull(response2.Value.Details.ContentRange); + } + + [RecordedTest] + [TestCase(0)] + [TestCase(1)] + public async Task DownloadContentAsync_RangeSet_AssertContentRange(long offset) + { + await using DisposingContainer test = await GetTestContainerAsync(); + + // Arrange + int size = Constants.KB; + var data = GetRandomBuffer(size); + BlockBlobClient blob = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName())); + using (var stream = new MemoryStream(data)) + { + await blob.UploadAsync(stream); + } + + BlobDownloadOptions blobDownloadOptions = new BlobDownloadOptions + { + Range = new HttpRange(offset) + }; + + // Act + Response response = await blob.DownloadContentAsync(blobDownloadOptions); + + // Assert + Assert.NotNull(response.Value.Details.ContentRange); + string expectedContentRange = $"bytes {offset}-{size - 1}/{size}"; + Assert.AreEqual(expectedContentRange, response.Value.Details.ContentRange); + } + [RecordedTest] public async Task DownloadAsync_AccessConditions() { @@ -2620,7 +2734,7 @@ public async Task StartCopyFromUriAsync_OperationAbort() await operation.WaitForCompletionAsync(); // Assert - Assert.AreEqual(operation.Value,0); + Assert.AreEqual(operation.Value, 0); Assert.True(operation.HasCompleted); Assert.IsNotNull(operation.GetRawResponse()); } diff --git a/sdk/storage/Azure.Storage.Blobs/tests/PartitionedDownloaderTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/PartitionedDownloaderTests.cs index d8d4756a510c..bbf2b2f1f774 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/PartitionedDownloaderTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/PartitionedDownloaderTests.cs @@ -181,6 +181,7 @@ public void SurfacesDownloadExceptions() blockClient.SetupGet(c => c.UsingClientSideEncryption).Returns(false); blockClient.Setup(c => c.DownloadStreamingInternal( It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>(), @@ -190,7 +191,7 @@ public void SurfacesDownloadExceptions() PartitionedDownloader downloader = new PartitionedDownloader( blockClient.Object, - new StorageTransferOptions() { MaximumTransferLength = 10}, + new StorageTransferOptions() { MaximumTransferLength = 10 }, transferValidation: s_validationOptions); Exception thrown = Assert.ThrowsAsync(async () => await InvokeDownloadToAsync(downloader, stream)); @@ -214,6 +215,7 @@ private void SetupDownload(Mock blockClient, MockDataSource data blockClient.SetupGet(c => c.UsingClientSideEncryption).Returns(false); blockClient.Setup(c => c.DownloadStreamingInternal( It.IsAny(), + It.IsAny(), It.IsAny(), It.Is(options => options != null && options != s_validationOptions && !options.AutoValidateChecksum), @@ -221,8 +223,8 @@ private void SetupDownload(Mock blockClient, MockDataSource data $"{nameof(BlobBaseClient)}.{nameof(BlobBaseClient.DownloadStreaming)}", _async, s_cancellationToken) - ).Returns, string, bool, CancellationToken>( - (range, conditions, validation, progress, operationName, async, cancellation) => async + ).Returns, string, bool, CancellationToken>( + (range, isRangeSet, conditions, validation, progress, operationName, async, cancellation) => async ? dataSource.GetStreamAsync(range, conditions, validation, progress: progress, cancellation) : new ValueTask>(dataSource.GetStream(range, conditions, validation, progress: progress, cancellation))); } diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index dc1764d16bc6..e839008c493b 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -1,6 +1,17 @@ # Release History -## 12.23.0-beta.1 (Unreleased) +## 12.23.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed +- Fixed bug where in rare cases, a `NullReferenceException` could be thrown when parsing an error response from the service. + +### Other Changes + +## 12.23.0-beta.1 (2025-02-11) ### Features Added - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Azure.Storage.Common/README.md b/sdk/storage/Azure.Storage.Common/README.md index ac0953830a9b..5f42b8c99fb3 100644 --- a/sdk/storage/Azure.Storage.Common/README.md +++ b/sdk/storage/Azure.Storage.Common/README.md @@ -85,8 +85,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Common%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ diff --git a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj index cd441947de8f..300c43cea5d3 100644 --- a/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj +++ b/sdk/storage/Azure.Storage.Common/src/Azure.Storage.Common.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Common client library - 12.23.0-beta.1 + 12.23.0-beta.2 12.22.0 CommonSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs index c16ed90ead55..70cd7e5ed439 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs @@ -105,7 +105,9 @@ internal static class Constants public const string TrueName = "true"; public const string ErrorCode = "Code"; + public const string ErrorCodeLower = "code"; public const string ErrorMessage = "Message"; + public const string ErrorMessageLower = "message"; public const string CommaString = ","; public const char CommaChar = ','; diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageRequestFailedDetailsParser.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageRequestFailedDetailsParser.cs index 4ec640bf3e8e..67d5da1dde4d 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageRequestFailedDetailsParser.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageRequestFailedDetailsParser.cs @@ -27,10 +27,12 @@ public override bool TryParse(Response response, out ResponseError? error, out I if (response.Headers.ContentType.Contains(Constants.ContentTypeApplicationXml)) { XDocument xml = XDocument.Load(contentStream); - var errorCode = xml.Root!.Element(Constants.ErrorCode)!.Value; - var message = xml.Root.Element(Constants.ErrorMessage)!.Value; - data = new Dictionary(); + var errorCode = xml.Root!.Element(Constants.ErrorCode)?.Value ?? + xml.Root.Element(Constants.ErrorCodeLower)?.Value; + var message = xml.Root.Element(Constants.ErrorMessage)?.Value ?? + xml.Root.Element(Constants.ErrorMessageLower)?.Value; + data = new Dictionary(); foreach (XElement element in xml.Root.Elements()) { switch (element.Name.LocalName) diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/CHANGELOG.md index 8be762b2b01a..1af1a62ec583 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/CHANGELOG.md @@ -1,8 +1,6 @@ # Release History -## 12.0.0-beta.7 (Unreleased) - -### Features Added +## 12.0.0 (2025-02-11) ### Breaking Changes - Changed `BlobStorageResourceContainerOptions.BlobType` type from `DataTransferProperty` to `BlobType` @@ -13,12 +11,16 @@ - `BlobStorageResourceOptions.ContentEncoding` - `BlobStorageResourceOptions.ContentDisposition` - `BlobStorageResourceOptions.CacheControl` +- Renamed `BlobStorageResourceContainerOptions.BlobDirectoryPrefix` to `BlobPrefix` - Changed `BlobContainerClient.StartUploadDirectoryAsync` to `BlobContainerClient.UploadDirectoryAsync` and added a required `waitUntil` parameter. - Changed `BlobContainerClient.StartDownloadToDirectoryAsync` to `BlobContainerClient.DownloadToDirectoryAsync` and added a required `waitUntil` parameter. - -### Bugs Fixed - -### Other Changes +- Several refactors to `BlobsStorageResourceProvider`: + - Removed nested delegates `GetStorageSharedKeyCredential`, `GetTokenCredential`, and `GetAzureSasCredential`. + - Removed default constructor. + - Removed constructor overload for `GetTokenCredential` entirely. + - Changed constructor overloads for `GetStorageSharedKeyCredential` and `GetAzureSasCredential` to use `Func`. These callbacks are also now async, returning a `ValueTask`, and the `readOnly` parameter was removed. + - Changed `FromBlob` and `FromContainer` to async, returning a `ValueTask`, and renamed to `FromBlobAsync` and `FromContainerAsync` respectively. + - Changed `FromClient` methods to `static` methods. ## 12.0.0-beta.6 (2024-10-14) diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md index a063bcbc1f63..17298ccf792f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md @@ -1,11 +1,5 @@ # Azure Storage Data Movement Blobs client library for .NET -## Project Status: Beta - -This product is in beta. Some features will be missing or have significant bugs. Please see [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. - ---- - Azure Storage is a Microsoft-managed service providing cloud storage that is highly available, secure, durable, scalable, and redundant. @@ -21,12 +15,10 @@ Azure Storage client libraries. ### Install the package -Install the Azure Storage client library for .NET you'd like to use with -[NuGet][nuget] and the `Azure.Storage.DataMovement.Blobs` client library will be included: +Install the Azure Storage Data Movement Blobs client library for .NET with [NuGet][nuget]: ```dotnetcli -dotnet add package Azure.Storage.DataMovement --prerelease -dotnet add package Azure.Storage.DataMovement.Blobs --prerelease +dotnet add package Azure.Storage.DataMovement.Blobs ``` ### Prerequisites @@ -95,17 +87,17 @@ BlobsStorageResourceProvider blobs = new(tokenCredential); To create a blob `StorageResource`, use the methods `FromBlob` or `FromContainer`. ```C# Snippet:ResourceConstruction_Blobs -StorageResource container = blobs.FromContainer( +StorageResource container = await blobs.FromContainerAsync( new Uri("https://myaccount.blob.core.windows.net/container")); // Block blobs are the default if no options are specified -StorageResource blockBlob = blobs.FromBlob( +StorageResource blockBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-block"), new BlockBlobStorageResourceOptions()); -StorageResource pageBlob = blobs.FromBlob( +StorageResource pageBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-page"), new PageBlobStorageResourceOptions()); -StorageResource appendBlob = blobs.FromBlob( +StorageResource appendBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-append"), new AppendBlobStorageResourceOptions()); ``` @@ -113,11 +105,10 @@ StorageResource appendBlob = blobs.FromBlob( Storage resources can also be initialized with the appropriate client object from Azure.Storage.Blobs. Since these resources will use the credential already present in the client object, no credential is required in the provider when using `FromClient()`. **However**, a `BlobsStorageResourceProvider` must still have a credential if it is to be used in `TransferManagerOptions` for resuming a transfer. ```C# Snippet:ResourceConstruction_FromClients_Blobs -BlobsStorageResourceProvider blobs = new(); -StorageResource containerResource = blobs.FromClient(blobContainerClient); -StorageResource blockBlobResource = blobs.FromClient(blockBlobClient); -StorageResource pageBlobResource = blobs.FromClient(pageBlobClient); -StorageResource appendBlobResource = blobs.FromClient(appendBlobClient); +StorageResource containerResource = BlobsStorageResourceProvider.FromClient(blobContainerClient); +StorageResource blockBlobResource = BlobsStorageResourceProvider.FromClient(blockBlobClient); +StorageResource pageBlobResource = BlobsStorageResourceProvider.FromClient(pageBlobClient); +StorageResource appendBlobResource = BlobsStorageResourceProvider.FromClient(appendBlobClient); ``` There are more options which can be used when creating a blob storage resource. Below are some examples. @@ -125,10 +116,10 @@ There are more options which can be used when creating a blob storage resource. ```C# Snippet:ResourceConstruction_Blobs_WithOptions_VirtualDirectory BlobStorageResourceContainerOptions virtualDirectoryOptions = new() { - BlobDirectoryPrefix = "blob/directory/prefix" + BlobPrefix = "blob/directory/prefix" }; -StorageResource virtualDirectoryResource = blobs.FromClient( +StorageResource virtualDirectoryResource = BlobsStorageResourceProvider.FromClient( blobContainerClient, virtualDirectoryOptions); ``` @@ -141,7 +132,7 @@ BlockBlobStorageResourceOptions resourceOptions = new() { "key", "value" } } }; -StorageResource leasedBlockBlobResource = blobs.FromClient( +StorageResource leasedBlockBlobResource = BlobsStorageResourceProvider.FromClient( blockBlobClient, resourceOptions); ``` @@ -154,8 +145,8 @@ Upload a block blob. ```C# Snippet:SimpleBlobUpload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalPath), - destinationResource: blobs.FromBlob(destinationBlobUri)); + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalPath), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri)); await transferOperation.WaitForCompletionAsync(); ``` @@ -163,14 +154,14 @@ Upload a directory as a specific blob type. ```C# Snippet:SimpleDirectoryUpload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: files.FromDirectory(sourcePath), - destinationResource: blobs.FromContainer( + sourceResource: LocalFilesStorageResourceProvider.FromDirectory(sourcePath), + destinationResource: await blobs.FromContainerAsync( blobContainerUri, new BlobStorageResourceContainerOptions() { // Block blobs are the default if not specified BlobType = BlobType.Block, - BlobDirectoryPrefix = optionalDestinationPrefix, + BlobPrefix = optionalDestinationPrefix, })); ``` @@ -182,8 +173,8 @@ Download a blob. ```C# Snippet:SimpleBlockBlobDownload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromBlob(sourceBlobUri), - destinationResource: files.FromFile(downloadPath)); + sourceResource: await blobs.FromBlobAsync(sourceBlobUri), + destinationResource: LocalFilesStorageResourceProvider.FromFile(downloadPath)); await transferOperation.WaitForCompletionAsync(); ``` @@ -191,13 +182,13 @@ Download a container which may contain a mix of blob types. ```C# Snippet:SimpleDirectoryDownload_Blob TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromContainer( + sourceResource: await blobs.FromContainerAsync( blobContainerUri, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = optionalSourcePrefix + BlobPrefix = optionalSourcePrefix }), - destinationResource: files.FromDirectory(downloadPath)); + destinationResource: LocalFilesStorageResourceProvider.FromDirectory(downloadPath)); await transferOperation.WaitForCompletionAsync(); ``` @@ -209,8 +200,8 @@ Copy a single blob. Note the destination blob is an append blob, regardless of t ```C# Snippet:s2sCopyBlob TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromBlob(sourceBlobUri), - destinationResource: blobs.FromBlob(destinationBlobUri, new AppendBlobStorageResourceOptions())); + sourceResource: await blobs.FromBlobAsync(sourceBlobUri), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri, new AppendBlobStorageResourceOptions())); await transferOperation.WaitForCompletionAsync(); ``` @@ -218,24 +209,48 @@ Copy a blob container. ```C# Snippet:s2sCopyBlobContainer TransferOperation transferOperation = await transferManager.StartTransferAsync( -sourceResource: blobs.FromContainer( +sourceResource: await blobs.FromContainerAsync( sourceContainerUri, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = sourceDirectoryName + BlobPrefix = sourceDirectoryName }), -destinationResource: blobs.FromContainer( +destinationResource: await blobs.FromContainerAsync( destinationContainerUri, new BlobStorageResourceContainerOptions() { // all source blobs will be copied as a single type of destination blob // defaults to block blobs if unspecified BlobType = BlobType.Block, - BlobDirectoryPrefix = downloadPath + BlobPrefix = downloadPath })); await transferOperation.WaitForCompletionAsync(); ``` +### Resume using ShareFilesStorageResourceProvider + +To resume a transfer with Blob(s), valid credentials must be provided. See the sample below. + +```C# Snippet:TransferManagerResumeTransfers +TokenCredential tokenCredential = new DefaultAzureCredential(); +BlobsStorageResourceProvider blobs = new(tokenCredential); +TransferManager transferManager = new TransferManager(new TransferManagerOptions() +{ + ProvidersForResuming = new List() { blobs } +}); +// Get resumable transfers from transfer manager +await foreach (TransferProperties properties in transferManager.GetResumableTransfersAsync()) +{ + // Resume the transfer + if (properties.SourceUri.AbsoluteUri == "https://storageaccount.blob.core.windows.net/containername/blobpath") + { + await transferManager.ResumeTransferAsync(properties.TransferId); + } +} +``` + +For more information regarding pause, resume, and/or checkpointing, see [Pause and Resume Checkpointing](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md). + ### Extensions on `BlobContainerClient` For applications with preexisting code using Azure.Storage.Blobs, this package provides extension methods for `BlobContainerClient` to get some of the benefits of the `TransferManager` with minimal extra code. @@ -267,11 +282,11 @@ BlobContainerClientTransferOptions options = new BlobContainerClientTransferOpti { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -300,11 +315,11 @@ BlobContainerClientTransferOptions options = new BlobContainerClientTransferOpti { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -317,6 +332,8 @@ await transfer.WaitForCompletionAsync(); See [Handling Failed Transfers](#handling-failed-transfers) and [Enabling Logging](https://learn.microsoft.com/dotnet/azure/sdk/logging) to assist with any troubleshooting. +See [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. + ## Next steps Get started with our [Share Files Samples][share_samples]. @@ -338,8 +355,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Common%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net6.0.cs index 0c333307597d..cd7c8ddb23d1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net6.0.cs @@ -24,31 +24,28 @@ public BlobContainerClientTransferOptions() { } } public partial class BlobsStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public BlobsStorageResourceProvider() { } public BlobsStorageResourceProvider(Azure.AzureSasCredential credential) { } public BlobsStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public BlobsStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public BlobsStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public BlobsStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromBlob(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromContainer(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public System.Threading.Tasks.ValueTask FromBlobAsync(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } + public System.Threading.Tasks.ValueTask FromContainerAsync(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class BlobStorageResourceContainerOptions { public BlobStorageResourceContainerOptions() { } - public string BlobDirectoryPrefix { get { throw null; } set { } } public Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions BlobOptions { get { throw null; } set { } } + public string BlobPrefix { get { throw null; } set { } } public Azure.Storage.Blobs.Models.BlobType? BlobType { get { throw null; } set { } } } public partial class BlobStorageResourceOptions diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net8.0.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net8.0.cs index 0c333307597d..cd7c8ddb23d1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net8.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.net8.0.cs @@ -24,31 +24,28 @@ public BlobContainerClientTransferOptions() { } } public partial class BlobsStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public BlobsStorageResourceProvider() { } public BlobsStorageResourceProvider(Azure.AzureSasCredential credential) { } public BlobsStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public BlobsStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public BlobsStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public BlobsStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromBlob(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromContainer(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public System.Threading.Tasks.ValueTask FromBlobAsync(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } + public System.Threading.Tasks.ValueTask FromContainerAsync(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class BlobStorageResourceContainerOptions { public BlobStorageResourceContainerOptions() { } - public string BlobDirectoryPrefix { get { throw null; } set { } } public Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions BlobOptions { get { throw null; } set { } } + public string BlobPrefix { get { throw null; } set { } } public Azure.Storage.Blobs.Models.BlobType? BlobType { get { throw null; } set { } } } public partial class BlobStorageResourceOptions diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.netstandard2.0.cs index 0c333307597d..cd7c8ddb23d1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/api/Azure.Storage.DataMovement.Blobs.netstandard2.0.cs @@ -24,31 +24,28 @@ public BlobContainerClientTransferOptions() { } } public partial class BlobsStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public BlobsStorageResourceProvider() { } public BlobsStorageResourceProvider(Azure.AzureSasCredential credential) { } public BlobsStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public BlobsStorageResourceProvider(Azure.Storage.DataMovement.Blobs.BlobsStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public BlobsStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public BlobsStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public BlobsStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromBlob(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromContainer(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public System.Threading.Tasks.ValueTask FromBlobAsync(System.Uri blobUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.BlobContainerClient client, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.AppendBlobClient client, Azure.Storage.DataMovement.Blobs.AppendBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.BlockBlobClient client, Azure.Storage.DataMovement.Blobs.BlockBlobStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Blobs.Specialized.PageBlobClient client, Azure.Storage.DataMovement.Blobs.PageBlobStorageResourceOptions options = null) { throw null; } + public System.Threading.Tasks.ValueTask FromContainerAsync(System.Uri containerUri, Azure.Storage.DataMovement.Blobs.BlobStorageResourceContainerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class BlobStorageResourceContainerOptions { public BlobStorageResourceContainerOptions() { } - public string BlobDirectoryPrefix { get { throw null; } set { } } public Azure.Storage.DataMovement.Blobs.BlobStorageResourceOptions BlobOptions { get { throw null; } set { } } + public string BlobPrefix { get { throw null; } set { } } public Azure.Storage.Blobs.Models.BlobType? BlobType { get { throw null; } set { } } } public partial class BlobStorageResourceOptions diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json b/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json index 061ff49ef126..181df66a78d5 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.DataMovement.Blobs", - "Tag": "net/storage/Azure.Storage.DataMovement.Blobs_ce7e1f61c3" + "Tag": "net/storage/Azure.Storage.DataMovement.Blobs_214325a4f9" } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs index fb7d7d685f3d..e4171485e7a8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Infrastructure/DirectoryTransferTest.cs @@ -14,7 +14,6 @@ namespace Azure.Storage.DataMovement.Blobs.Perf public abstract class DirectoryTransferTest : PerfTest where TOptions : DirectoryTransferOptions { protected BlobServiceClient BlobServiceClient { get; } - protected LocalFilesStorageResourceProvider LocalFileResourceProvider { get; } protected BlobsStorageResourceProvider BlobResourceProvider { get; } private TransferManager _transferManager; @@ -23,7 +22,6 @@ public abstract class DirectoryTransferTest : PerfTest where public DirectoryTransferTest(TOptions options) : base(options) { BlobServiceClient = new BlobServiceClient(PerfTestEnvironment.Instance.StorageEndpoint, PerfTestEnvironment.Instance.Credential); - LocalFileResourceProvider = new LocalFilesStorageResourceProvider(); BlobResourceProvider = new BlobsStorageResourceProvider(PerfTestEnvironment.Instance.Credential); _transferTimeout = TimeSpan.FromSeconds(Options.Duration); @@ -85,7 +83,7 @@ protected async Task RunAndVerifyTransferAsync( { TransferOptions options = new() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, InitialTransferSize = Options.InitialTransferSize, MaximumTransferChunkSize = Options.ChunkSize, }; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs index 0d232cc91007..74d9f10bfb7e 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/CopyDirectory.cs @@ -44,8 +44,8 @@ public override void Run(CancellationToken cancellationToken) public override async Task RunAsync(CancellationToken cancellationToken) { - StorageResource source = BlobResourceProvider.FromContainer(_sourceContainer.Uri); - StorageResource destination = BlobResourceProvider.FromContainer(_destinationContainer.Uri); + StorageResource source = await BlobResourceProvider.FromContainerAsync(_sourceContainer.Uri); + StorageResource destination = await BlobResourceProvider.FromContainerAsync(_destinationContainer.Uri); await RunAndVerifyTransferAsync(source, destination, cancellationToken); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs index d60181a712da..97a048c1008d 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/DownloadDirectory.cs @@ -45,8 +45,8 @@ public override void Run(CancellationToken cancellationToken) public override async Task RunAsync(CancellationToken cancellationToken) { - StorageResource source = BlobResourceProvider.FromContainer(_sourceContainer.Uri); - StorageResource destination = LocalFileResourceProvider.FromDirectory(_destinationDirectory); + StorageResource source = await BlobResourceProvider.FromContainerAsync(_sourceContainer.Uri); + StorageResource destination = LocalFilesStorageResourceProvider.FromDirectory(_destinationDirectory); await RunAndVerifyTransferAsync(source, destination, cancellationToken); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs index 017832fb7edf..715e47cfcc8f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/Azure.Storage.DataMovement.Blobs.Perf/Scenarios/UploadDirectory.cs @@ -45,8 +45,8 @@ public override void Run(CancellationToken cancellationToken) public override async Task RunAsync(CancellationToken cancellationToken) { - StorageResource source = LocalFileResourceProvider.FromDirectory(_sourceDirectory); - StorageResource destination = BlobResourceProvider.FromContainer(_destinationContainer.Uri); + StorageResource source = LocalFilesStorageResourceProvider.FromDirectory(_sourceDirectory); + StorageResource destination = await BlobResourceProvider.FromContainerAsync(_destinationContainer.Uri); await RunAndVerifyTransferAsync(source, destination, cancellationToken); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md index e8f5111803a6..ce14ceb80d66 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/perf/README.md @@ -1,7 +1,7 @@ # Azure Storage DataMovement Blobs performance tests The assets in this area comprise a set of performance tests for the [Azure Storage Blobs Data Movement library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs) and its associated ecosystem. The artifacts in this library are intended to be used primarily with the Azure SDK engineering system's testing infrastructure, but may also be run as stand-alone applications from the command line. - + ## Running tests locally There are two perf test projects: - Track2 (default): sdk\storage\Azure.Storage.DataMovement.Blobs\perf\Azure.Storage.DataMovement.Blobs.Perf\Azure.Storage.DataMovement.Blobs.Perf.csproj @@ -36,8 +36,8 @@ Current test options (non-exahustive list): ### Running in Visual Studio You can also run these tests directly through Visual Studio which can be helpful for debugging or profiling. You just need to setup the run profile for either project to include the command line arguments `(UploadDirectory|DownloadDirectory|CopyDirectory) ` and the enviorment variables. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -46,5 +46,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Blobs.Perf%2FREADME.png) diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs index 82dbece335ee..b9051b5f72bb 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs @@ -12,6 +12,7 @@ using Azure.Storage.Blobs.Models; using Azure.Storage.Blobs; using System.Collections.Generic; +using System.Threading; namespace Azure.Storage.DataMovement.Blobs.Samples { @@ -40,9 +41,6 @@ public async Task ResourceConstructionDemonstration() TransferManager transferManager = new TransferManager(); - // Get local filesystem provider - LocalFilesStorageResourceProvider files = new(); - // Get blobs provider with credential #region Snippet:MakeProvider_TokenCredential BlobsStorageResourceProvider blobs = new(tokenCredential); @@ -55,17 +53,17 @@ public async Task ResourceConstructionDemonstration() // Construct simple blob resources for data movement #region Snippet:ResourceConstruction_Blobs - StorageResource container = blobs.FromContainer( + StorageResource container = await blobs.FromContainerAsync( new Uri("https://myaccount.blob.core.windows.net/container")); // Block blobs are the default if no options are specified - StorageResource blockBlob = blobs.FromBlob( + StorageResource blockBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-block"), new BlockBlobStorageResourceOptions()); - StorageResource pageBlob = blobs.FromBlob( + StorageResource pageBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-page"), new PageBlobStorageResourceOptions()); - StorageResource appendBlob = blobs.FromBlob( + StorageResource appendBlob = await blobs.FromBlobAsync( new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-append"), new AppendBlobStorageResourceOptions()); #endregion @@ -73,7 +71,7 @@ public async Task ResourceConstructionDemonstration() { StorageSharedKeyCredential sharedKeyCredential = new(StorageAccountName, StorageAccountKey); // Get blobs provider with credential - AzureSasCredential GenerateSas(Uri uri, bool readOnly) + ValueTask GenerateSas(Uri uri, CancellationToken cancellationToken) { // Construct your SAS according to your needs BlobUriBuilder blobUri = new(uri); @@ -82,7 +80,7 @@ AzureSasCredential GenerateSas(Uri uri, bool readOnly) BlobContainerName = blobUri.BlobContainerName, BlobName = blobUri.BlobName, }; - return new AzureSasCredential(sas.ToSasQueryParameters(sharedKeyCredential).ToString()); + return new ValueTask(new AzureSasCredential(sas.ToSasQueryParameters(sharedKeyCredential).ToString())); } BlobsStorageResourceProvider blobs = new(GenerateSas); } @@ -112,8 +110,7 @@ public async Task ConstructFromClientsDemonstration() TransferManager transferManager = new TransferManager(); // Get a reference to a source local file - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(sourceLocalPath); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(sourceLocalPath); // Get a reference to a destination blobs BlockBlobClient blockBlobClient = blobContainerClient.GetBlockBlobClient("sample-blob-block"); @@ -125,21 +122,20 @@ public async Task ConstructFromClientsDemonstration() // Construct simple blob resources for data movement #region Snippet:ResourceConstruction_FromClients_Blobs - BlobsStorageResourceProvider blobs = new(); - StorageResource containerResource = blobs.FromClient(blobContainerClient); - StorageResource blockBlobResource = blobs.FromClient(blockBlobClient); - StorageResource pageBlobResource = blobs.FromClient(pageBlobClient); - StorageResource appendBlobResource = blobs.FromClient(appendBlobClient); + StorageResource containerResource = BlobsStorageResourceProvider.FromClient(blobContainerClient); + StorageResource blockBlobResource = BlobsStorageResourceProvider.FromClient(blockBlobClient); + StorageResource pageBlobResource = BlobsStorageResourceProvider.FromClient(pageBlobClient); + StorageResource appendBlobResource = BlobsStorageResourceProvider.FromClient(appendBlobClient); #endregion // Construct a blob container resource that is scoped to a blob prefix (virtual directory). #region Snippet:ResourceConstruction_Blobs_WithOptions_VirtualDirectory BlobStorageResourceContainerOptions virtualDirectoryOptions = new() { - BlobDirectoryPrefix = "blob/directory/prefix" + BlobPrefix = "blob/directory/prefix" }; - StorageResource virtualDirectoryResource = blobs.FromClient( + StorageResource virtualDirectoryResource = BlobsStorageResourceProvider.FromClient( blobContainerClient, virtualDirectoryOptions); #endregion @@ -153,7 +149,7 @@ public async Task ConstructFromClientsDemonstration() { "key", "value" } } }; - StorageResource leasedBlockBlobResource = blobs.FromClient( + StorageResource leasedBlockBlobResource = BlobsStorageResourceProvider.FromClient( blockBlobClient, resourceOptions); #endregion @@ -198,15 +194,17 @@ public async Task UploadSingle_ConnectionStringAsync() // Get a reference to a destination blobs Uri destinationBlobUri = container.GetBlockBlobClient("sample-blob").Uri; + // Should be the same token credential as above, but for demonstration/sample purposes + // we include how we would get the token credential. #region Snippet:SimpleBlobUpload_BasePackage - LocalFilesStorageResourceProvider files = new(); - BlobsStorageResourceProvider blobs = new(tokenCredential); + TokenCredential defaultTokenCredential = new DefaultAzureCredential(); + BlobsStorageResourceProvider blobs = new BlobsStorageResourceProvider(defaultTokenCredential); // Create simple transfer single blob upload job #region Snippet:SimpleBlobUpload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalPath), - destinationResource: blobs.FromBlob(destinationBlobUri)); + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalPath), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri)); await transferOperation.WaitForCompletionAsync(); #endregion #endregion @@ -246,6 +244,7 @@ public async Task DownloadSingle_SharedKeyAuthAsync() string containerName = Randomize("sample-container"); // Create a SharedKeyCredential that we can use to authenticate + TokenCredential tokenCredential = new DefaultAzureCredential(); StorageSharedKeyCredential credential = new StorageSharedKeyCredential(accountName, accountKey); // Create a client that can authenticate with a SharedKeyCredential @@ -273,26 +272,25 @@ public async Task DownloadSingle_SharedKeyAuthAsync() ErrorMode = TransferErrorMode.ContinueOnFailure }; TransferManager transferManager = new TransferManager(options); - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); + BlobsStorageResourceProvider blobs = new(tokenCredential); // Simple Download Single Blob Job #region Snippet:SimpleBlockBlobDownload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromBlob(sourceBlobUri), - destinationResource: files.FromFile(downloadPath)); + sourceResource: await blobs.FromBlobAsync(sourceBlobUri), + destinationResource: LocalFilesStorageResourceProvider.FromFile(downloadPath)); await transferOperation.WaitForCompletionAsync(); #endregion - StorageResource sourceResource2 = blobs.FromClient(sourceBlobClient); - StorageResource destinationResource2 = files.FromFile(downloadPath2); + StorageResource sourceResource2 = BlobsStorageResourceProvider.FromClient(sourceBlobClient); + StorageResource destinationResource2 = LocalFilesStorageResourceProvider.FromFile(downloadPath2); await transferManager.StartTransferAsync( - sourceResource: blobs.FromClient(sourceBlobClient, new BlockBlobStorageResourceOptions() + sourceResource: BlobsStorageResourceProvider.FromClient(sourceBlobClient, new BlockBlobStorageResourceOptions() { DestinationConditions = new BlobRequestConditions(){ LeaseId = "xyz" } }), - destinationResource: files.FromFile(downloadPath2)); + destinationResource: LocalFilesStorageResourceProvider.FromFile(downloadPath2)); } finally { @@ -360,14 +358,13 @@ public async Task UploadDirectory_SasAsync() try { BlobsStorageResourceProvider blobs = new(new StorageSharedKeyCredential(StorageAccountName, StorageAccountKey)); - LocalFilesStorageResourceProvider files = new(); // Create BlobTransferManager with event handler in Options bag TransferManagerOptions transferManagerOptions = new TransferManagerOptions(); TransferOptions options = new TransferOptions() { MaximumTransferChunkSize = 4 * Constants.MB, - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; TransferManager transferManager = new TransferManager(transferManagerOptions); @@ -375,14 +372,14 @@ public async Task UploadDirectory_SasAsync() string optionalDestinationPrefix = "sample-directory2"; #region Snippet:SimpleDirectoryUpload TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: files.FromDirectory(sourcePath), - destinationResource: blobs.FromContainer( + sourceResource: LocalFilesStorageResourceProvider.FromDirectory(sourcePath), + destinationResource: await blobs.FromContainerAsync( blobContainerUri, new BlobStorageResourceContainerOptions() { // Block blobs are the default if not specified BlobType = BlobType.Block, - BlobDirectoryPrefix = optionalDestinationPrefix, + BlobPrefix = optionalDestinationPrefix, })); #endregion } @@ -453,8 +450,6 @@ public async Task UploadDirectory_CompletedEventHandler() // Prepare for upload try { - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); // Create BlobTransferManager with event handler in Options bag TransferManagerOptions options = new TransferManagerOptions(); TransferOptions transferOptions = new TransferOptions(); @@ -470,10 +465,10 @@ public async Task UploadDirectory_CompletedEventHandler() // Create simple transfer directory upload job which uploads the directory and the contents of that directory TransferOperation uploadDirectoryJobId = await transferManager.StartTransferAsync( - files.FromDirectory(sourcePath), - blobs.FromClient( + LocalFilesStorageResourceProvider.FromDirectory(sourcePath), + BlobsStorageResourceProvider.FromClient( container, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = "sample-blob-directory" })); + new BlobStorageResourceContainerOptions() { BlobPrefix = "sample-blob-directory" })); } finally { @@ -572,15 +567,13 @@ public async Task UploadDirectory_EventHandler_SasAsync() }; #endregion TransferManager transferManager = new TransferManager(options); - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); // Create simple transfer directory upload job which uploads the directory and the contents of that directory TransferOperation uploadDirectoryJobId = await transferManager.StartTransferAsync( - files.FromDirectory(sourcePath), - blobs.FromClient( + LocalFilesStorageResourceProvider.FromDirectory(sourcePath), + BlobsStorageResourceProvider.FromClient( container, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = "sample-blob-directory" })); + new BlobStorageResourceContainerOptions() { BlobPrefix = "sample-blob-directory" })); } finally { @@ -611,10 +604,10 @@ public async Task DownloadDirectory_EventHandler_ActiveDirectoryAuthAsync() // Create a token credential that can use our Azure Active // Directory application to authenticate with Azure Storage - TokenCredential credential = new DefaultAzureCredential(); + TokenCredential tokenCredential = new DefaultAzureCredential(); // Create a client that can authenticate using our token credential - BlobServiceClient service = new BlobServiceClient(ActiveDirectoryBlobUri, credential); + BlobServiceClient service = new BlobServiceClient(ActiveDirectoryBlobUri, tokenCredential); string containerName = Randomize("sample-container"); // Create a client that can authenticate with a connection string @@ -627,15 +620,13 @@ public async Task DownloadDirectory_EventHandler_ActiveDirectoryAuthAsync() // Prepare to download try { - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); // Get a reference to a source blobs and upload sample content to download - StorageResource sourceDirectory = blobs.FromClient(blobContainerClient, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = "sample-blob-directory" }); - StorageResource sourceDirectory2 = blobs.FromClient(blobContainerClient, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = "sample-blob-directory2" }); - StorageResource destinationDirectory = files.FromDirectory(downloadPath); - StorageResource destinationDirectory2 = files.FromDirectory(downloadPath2); + StorageResource sourceDirectory = BlobsStorageResourceProvider.FromClient(blobContainerClient, + new BlobStorageResourceContainerOptions() { BlobPrefix = "sample-blob-directory" }); + StorageResource sourceDirectory2 = BlobsStorageResourceProvider.FromClient(blobContainerClient, + new BlobStorageResourceContainerOptions() { BlobPrefix = "sample-blob-directory2" }); + StorageResource destinationDirectory = LocalFilesStorageResourceProvider.FromDirectory(downloadPath); + StorageResource destinationDirectory2 = LocalFilesStorageResourceProvider.FromDirectory(downloadPath2); // Upload a couple of blobs so we have something to list await blobContainerClient.UploadBlobAsync("first", File.OpenRead(CreateTempFile())); @@ -662,15 +653,16 @@ await transferManager.StartTransferAsync( // Create different download transfer string optionalSourcePrefix = "sample-blob-directory2"; + BlobsStorageResourceProvider blobs = new(tokenCredential); #region Snippet:SimpleDirectoryDownload_Blob TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromContainer( + sourceResource: await blobs.FromContainerAsync( blobContainerUri, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = optionalSourcePrefix + BlobPrefix = optionalSourcePrefix }), - destinationResource: files.FromDirectory(downloadPath)); + destinationResource: LocalFilesStorageResourceProvider.FromDirectory(downloadPath)); await transferOperation.WaitForCompletionAsync(); #endregion } @@ -701,6 +693,7 @@ public async Task CopySingle_ConnectionStringAsync() string connectionString = ConnectionString; string containerName = Randomize("sample-container"); + TokenCredential tokenCredential = new DefaultAzureCredential(); // Create a client that can authenticate with a connection string BlobContainerClient container = new BlobContainerClient(connectionString, containerName); @@ -727,14 +720,13 @@ public async Task CopySingle_ConnectionStringAsync() // Upload file data TransferManager transferManager = new TransferManager(default); - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); + BlobsStorageResourceProvider blobs = new(tokenCredential); // Create simple transfer single blob upload job #region Snippet:s2sCopyBlob TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromBlob(sourceBlobUri), - destinationResource: blobs.FromBlob(destinationBlobUri, new AppendBlobStorageResourceOptions())); + sourceResource: await blobs.FromBlobAsync(sourceBlobUri), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri, new AppendBlobStorageResourceOptions())); await transferOperation.WaitForCompletionAsync(); #endregion @@ -776,10 +768,10 @@ public async Task CopyDirectory() string containerName = Randomize("sample-container"); // Create a SharedKeyCredential that we can use to authenticate - StorageSharedKeyCredential credential = new StorageSharedKeyCredential(accountName, accountKey); + TokenCredential tokenCredential = new DefaultAzureCredential(); // Create a client that can authenticate with a connection string - BlobServiceClient service = new BlobServiceClient(serviceUri, credential); + BlobServiceClient service = new BlobServiceClient(serviceUri, tokenCredential); BlobContainerClient container = service.GetBlobContainerClient(containerName); Uri sourceContainerUri = container.Uri; Uri destinationContainerUri = container.Uri; @@ -793,17 +785,15 @@ public async Task CopyDirectory() string sourceDirectoryName = "sample-blob-directory"; string sourceDirectoryName2 = "sample-blob-directory2"; - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); // Get a reference to a source blobs and upload sample content to download - StorageResource sourceDirectory1 = blobs.FromClient(container, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = sourceDirectoryName }); - StorageResource sourceDirectory2 = blobs.FromClient(container, - new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = sourceDirectoryName2 }); + StorageResource sourceDirectory1 = BlobsStorageResourceProvider.FromClient(container, + new BlobStorageResourceContainerOptions() { BlobPrefix = sourceDirectoryName }); + StorageResource sourceDirectory2 = BlobsStorageResourceProvider.FromClient(container, + new BlobStorageResourceContainerOptions() { BlobPrefix = sourceDirectoryName2 }); // Create destination paths - StorageResource destinationDirectory1 = files.FromDirectory(downloadPath); - StorageResource destinationDirectory2 = files.FromDirectory(downloadPath2); + StorageResource destinationDirectory1 = LocalFilesStorageResourceProvider.FromDirectory(downloadPath); + StorageResource destinationDirectory2 = LocalFilesStorageResourceProvider.FromDirectory(downloadPath2); // Upload a couple of blobs so we have something to list await container.UploadBlobAsync($"{sourceDirectoryName}/fourth", File.OpenRead(originalPath)); @@ -822,26 +812,27 @@ public async Task CopyDirectory() //await LogFailedFileAsync(args.SourceFileUri, args.DestinationFileClient.Uri, args.Exception.Message); }; #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + BlobsStorageResourceProvider blobs = new(tokenCredential); // this is just a directory copy within a container, but they can be separate containers as well BlobContainerClient sourceContainer = container; BlobContainerClient destinationContainer = container; #region Snippet:s2sCopyBlobContainer TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: blobs.FromContainer( + sourceResource: await blobs.FromContainerAsync( sourceContainerUri, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = sourceDirectoryName + BlobPrefix = sourceDirectoryName }), - destinationResource: blobs.FromContainer( + destinationResource: await blobs.FromContainerAsync( destinationContainerUri, new BlobStorageResourceContainerOptions() { // all source blobs will be copied as a single type of destination blob // defaults to block blobs if unspecified BlobType = BlobType.Block, - BlobDirectoryPrefix = downloadPath + BlobPrefix = downloadPath })); await transferOperation.WaitForCompletionAsync(); #endregion @@ -876,21 +867,20 @@ public async Task PauseAndResumeAsync_ManagerId() // Create a token credential that can use our Azure Active // Directory application to authenticate with Azure Storage - TokenCredential tokenCredential = new DefaultAzureCredential(); // Create transfer manager #region Snippet:SetupTransferManagerForResume - LocalFilesStorageResourceProvider files = new(); + TokenCredential tokenCredential = new DefaultAzureCredential(); BlobsStorageResourceProvider blobs = new(tokenCredential); TransferManager transferManager = new(new TransferManagerOptions() { - ResumeProviders = new List() { files, blobs }, + ProvidersForResuming = new List() { blobs }, }); #endregion // Create source and destination resource - StorageResource sourceResource = blobs.FromClient(sourceBlob); - StorageResource destinationResource = files.FromFile(downloadPath); + StorageResource sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(downloadPath); // Create simple transfer single blob download job TransferOperation transferOperation = await transferManager.StartTransferAsync( @@ -903,8 +893,10 @@ public async Task PauseAndResumeAsync_ManagerId() await transferManager.PauseTransferAsync(transferId); #endregion + #region Snippet:ResumeAllTransfers // Resume all transfers List transfers = await transferManager.ResumeAllTransfersAsync(); + #endregion // Resume a single transfer #region Snippet:DataMovement_ResumeSingle @@ -927,6 +919,7 @@ public async Task PauseAndResumeAsync_ManagerId() public async Task PauseAndResumeAsync_DataTransferPause() { string connectionString = ConnectionString; + TokenCredential tokenCredential = new DefaultAzureCredential(); string containerName = Randomize("sample-container"); // Create a client that can authenticate with a connection string @@ -943,15 +936,14 @@ public async Task PauseAndResumeAsync_DataTransferPause() await sourceBlob.DownloadToAsync(downloadPath); // Create transfer manager - BlobsStorageResourceProvider blobs = new(); - LocalFilesStorageResourceProvider files = new(); + BlobsStorageResourceProvider blobs = new(tokenCredential); TransferManagerOptions options = new TransferManagerOptions(); - options.ResumeProviders = new List() { files, blobs }; + options.ProvidersForResuming = new List() { blobs }; TransferManager transferManager = new TransferManager(options); // Create source and destination resource - StorageResource sourceResource = blobs.FromClient(sourceBlob); - StorageResource destinationResource = files.FromFile(downloadPath); + StorageResource sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(downloadPath); // Create simple transfer single blob download job TransferOperation transferOperation = await transferManager.StartTransferAsync( @@ -964,7 +956,7 @@ public async Task PauseAndResumeAsync_DataTransferPause() #endregion TransferOperation resumedTransfer = await transferManager.ResumeTransferAsync( - transferId: transferOperation.Id); + transferId: transferOperation.Id); // Wait for download to finish await resumedTransfer.WaitForCompletionAsync(); @@ -1024,11 +1016,11 @@ public async Task UploadDirectory() { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -1094,11 +1086,11 @@ public async Task DownloadDirectory() { BlobContainerOptions = new BlobStorageResourceContainerOptions { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, TransferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, } }; @@ -1124,8 +1116,7 @@ public async Task MonitorUploadAsync() try { // Get a reference to a source local file - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(sourceLocalPath); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(sourceLocalPath); // Get a reference to a destination blob TransferManager transferManager = new TransferManager(); @@ -1181,9 +1172,8 @@ async Task ListenToProgressAsync(TransferManager transferMana } #endregion - BlobsStorageResourceProvider blobs = new(); - StorageResource destinationResource1 = blobs.FromClient(container.GetBlockBlobClient("sample-blob-1")); - StorageResource destinationResource2 = blobs.FromClient(container.GetBlockBlobClient("sample-blob-2")); + StorageResource destinationResource1 = BlobsStorageResourceProvider.FromClient(container.GetBlockBlobClient("sample-blob-1")); + StorageResource destinationResource2 = BlobsStorageResourceProvider.FromClient(container.GetBlockBlobClient("sample-blob-2")); TransferOperation dataTransfer1 = await ListenToTransfersAsync(transferManager, sourceResource, destinationResource1); TransferOperation dataTransfer2 = await ListenToProgressAsync(transferManager, new Progress(p => { }), sourceResource, destinationResource2); await CheckTransfersAsync(transferManager); @@ -1207,6 +1197,55 @@ async Task ListenToProgressAsync(TransferManager transferMana } } + public void CreateTransferOptionCreationMode() + { + #region Snippet:TransferOptionsOverwrite + TransferOptions optionsOverwriteIfExists = new TransferOptions() + { + CreationMode = StorageResourceCreationMode.OverwriteIfExists, + }; + #endregion + #region Snippet:TransferOptionsSkipIfExists + TransferOptions optionsSkipIfExists = new TransferOptions() + { + CreationMode = StorageResourceCreationMode.SkipIfExists, + }; + #endregion + } + + public async Task ResumeTransfersStoredAsync() + { + #region Snippet:TransferManagerResumeTransfers + TokenCredential tokenCredential = new DefaultAzureCredential(); + BlobsStorageResourceProvider blobs = new(tokenCredential); + TransferManager transferManager = new TransferManager(new TransferManagerOptions() + { + ProvidersForResuming = new List() { blobs } + }); + // Get resumable transfers from transfer manager + await foreach (TransferProperties properties in transferManager.GetResumableTransfersAsync()) + { + // Resume the transfer + if (properties.SourceUri.AbsoluteUri == "https://storageaccount.blob.core.windows.net/containername/blobpath") + { + await transferManager.ResumeTransferAsync(properties.TransferId); + } + } + #endregion + } + + #region Snippet:EnumerateTransfersStatus + public async Task CheckTransfersStatusAsync(TransferManager transferManager) + { + string logFile = CreateTempPath(); + await foreach (TransferOperation transfer in transferManager.GetTransfersAsync()) + { + using StreamWriter logStream = File.AppendText(logFile); + logStream.WriteLine(Enum.GetName(typeof(TransferStatus), transfer.Status)); + } + } + #endregion + public async Task CreateBlobContainerTestDirectory(BlobContainerClient client, int depth = 0, string basePath = default) { basePath = basePath ?? Path.GetTempFileName(); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj index bff5641272a8..2e54a3889cdd 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/Azure.Storage.DataMovement.Blobs.csproj @@ -1,10 +1,11 @@ - + $(RequiredTargetFrameworks);net6.0 + true Microsoft Azure.Storage.DataMovement.Blobs client library - 12.0.0-beta.7 + 12.0.0 BlobDataMovementSDK;$(DefineConstants) Microsoft Azure Storage DataMovement Blobs AzureStorage BlobStorage azureofficial diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobContainerClientExtensions.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobContainerClientExtensions.cs index c2c69cea9da1..bcacd2629a37 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobContainerClientExtensions.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobContainerClientExtensions.cs @@ -15,8 +15,6 @@ namespace Azure.Storage.Blobs public static class BlobContainerClientExtensions { private static Lazy s_defaultTransferManager = new Lazy(() => new TransferManager(default)); - private static Lazy s_filesProvider = new(); - private static Lazy s_blobsProvider = new(); /// /// Uploads the entire contents of local directory to the blob container. @@ -54,7 +52,7 @@ public static Task UploadDirectoryAsync( { BlobContainerOptions = new() { - BlobDirectoryPrefix = blobDirectoryPrefix, + BlobPrefix = blobDirectoryPrefix, } }, cancellationToken); @@ -88,8 +86,8 @@ public static async Task UploadDirectoryAsync( BlobContainerClientTransferOptions options, CancellationToken cancellationToken = default) { - StorageResource localDirectory = s_filesProvider.Value.FromDirectory(localDirectoryPath); - StorageResource blobDirectory = s_blobsProvider.Value.FromClient(client, options?.BlobContainerOptions); + StorageResource localDirectory = LocalFilesStorageResourceProvider.FromDirectory(localDirectoryPath); + StorageResource blobDirectory = BlobsStorageResourceProvider.FromClient(client, options?.BlobContainerOptions); TransferOperation transfer = await s_defaultTransferManager.Value.StartTransferAsync( localDirectory, @@ -141,7 +139,7 @@ public static Task DownloadToDirectoryAsync( { BlobContainerOptions = new() { - BlobDirectoryPrefix = blobDirectoryPrefix + BlobPrefix = blobDirectoryPrefix }, }, cancellationToken); @@ -175,8 +173,8 @@ public static async Task DownloadToDirectoryAsync( BlobContainerClientTransferOptions options, CancellationToken cancellationToken = default) { - StorageResource localDirectory = s_filesProvider.Value.FromDirectory(localDirectoryPath); - StorageResource blobDirectory = s_blobsProvider.Value.FromClient(client, options?.BlobContainerOptions); + StorageResource localDirectory = LocalFilesStorageResourceProvider.FromDirectory(localDirectoryPath); + StorageResource blobDirectory = BlobsStorageResourceProvider.FromClient(client, options?.BlobContainerOptions); TransferOperation transfer = await s_defaultTransferManager.Value.StartTransferAsync( blobDirectory, diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobDestinationCheckpointDetails.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobDestinationCheckpointDetails.cs index 28277106bd0d..ebcbb0d05af0 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobDestinationCheckpointDetails.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobDestinationCheckpointDetails.cs @@ -127,7 +127,7 @@ public BlobDestinationCheckpointDetails( ContentEncoding = contentEncoding; IsContentEncodingSet = isContentEncodingSet; - ContentEncodingBytes = contentEncoding!= default ? Encoding.UTF8.GetBytes(contentEncoding) : Array.Empty(); + ContentEncodingBytes = contentEncoding != default ? Encoding.UTF8.GetBytes(contentEncoding) : Array.Empty(); ContentLanguage = contentLanguage; IsContentLanguageSet = isContentLanguageSet; @@ -434,27 +434,27 @@ private int CalculateLength() // Length is calculated based on whether the property is preserved. // If the property is preserved, the property's length is added to the total length. int length = DataMovementBlobConstants.DestinationCheckpointDetails.VariableLengthStartIndex; - if (!IsContentTypeSet) + if (IsContentTypeSet) { length += ContentTypeBytes.Length; } - if (!IsContentEncodingSet) + if (IsContentEncodingSet) { length += ContentEncodingBytes.Length; } - if (!IsContentLanguageSet) + if (IsContentLanguageSet) { length += ContentLanguageBytes.Length; } - if (!IsContentDispositionSet) + if (IsContentDispositionSet) { length += ContentDispositionBytes.Length; } - if (!IsCacheControlSet) + if (IsCacheControlSet) { length += CacheControlBytes.Length; } - if (!IsMetadataSet) + if (IsMetadataSet) { length += MetadataBytes.Length; } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainer.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainer.cs index 2b4c47bb0a2b..b261e045b969 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainer.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainer.cs @@ -50,7 +50,7 @@ public BlobStorageResourceContainer(BlobContainerClient blobContainerClient, Blo { BlobContainerClient = blobContainerClient; _options = options; - DirectoryPrefix = _options?.BlobDirectoryPrefix; + DirectoryPrefix = _options?.BlobPrefix; _uri = DirectoryPrefix != null ? new BlobUriBuilder(BlobContainerClient.Uri) @@ -234,7 +234,7 @@ protected override Task CreateIfNotExistsAsync(CancellationToken cancellationTok protected override StorageResourceContainer GetChildStorageResourceContainer(string path) { BlobStorageResourceContainerOptions options = _options.DeepCopy(); - options.BlobDirectoryPrefix = string.Join("/", DirectoryPrefix, path); + options.BlobPrefix = string.Join("/", DirectoryPrefix, path); return new BlobStorageResourceContainer( BlobContainerClient, options); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainerOptions.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainerOptions.cs index aa98a1f474a7..c94fdd1a2f07 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainerOptions.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobStorageResourceContainerOptions.cs @@ -31,7 +31,7 @@ public BlobType? BlobType /// /// Optional. The directory prefix within the Blob Storage Container to use in the transfer. /// - public string BlobDirectoryPrefix { get; set; } + public string BlobPrefix { get; set; } /// /// Optional. Additional options applied to each resource in the container. diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobsStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobsStorageResourceProvider.cs index 07bd2efdae42..0f69b65675ae 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobsStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/BlobsStorageResourceProvider.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; using System.Threading; using System.Threading.Tasks; using Azure.Core; @@ -17,39 +18,6 @@ namespace Azure.Storage.DataMovement.Blobs /// public class BlobsStorageResourceProvider : StorageResourceProvider { - /// - /// Delegate for fetching a shared key credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential(Uri uri, bool readOnly); - - /// - /// Delegate for fetching a token credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate TokenCredential GetTokenCredential(Uri uri, bool readOnly); - - /// - /// Delegate for fetching a SAS credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate AzureSasCredential GetAzureSasCredential(Uri uri, bool readOnly); - private enum ResourceType { Unknown = 0, @@ -71,17 +39,9 @@ private enum CredentialType protected override string ProviderId => "blob"; private readonly CredentialType _credentialType; - private readonly GetStorageSharedKeyCredential _getStorageSharedKeyCredential; - private readonly GetTokenCredential _getTokenCredential; - private readonly GetAzureSasCredential _getAzureSasCredential; - - /// - /// Default constructor. - /// - public BlobsStorageResourceProvider() - { - _credentialType = CredentialType.None; - } + private readonly TokenCredential _tokenCredential; + private readonly Func> _getStorageSharedKeyCredential; + private readonly Func> _getAzureSasCredential; /// /// @@ -102,7 +62,7 @@ public BlobsStorageResourceProvider() public BlobsStorageResourceProvider(StorageSharedKeyCredential credential) { _credentialType = CredentialType.SharedKey; - _getStorageSharedKeyCredential = (_, _) => credential; + _getStorageSharedKeyCredential = (_, _) => new ValueTask(credential); } /// @@ -124,7 +84,7 @@ public BlobsStorageResourceProvider(StorageSharedKeyCredential credential) public BlobsStorageResourceProvider(TokenCredential credential) { _credentialType = CredentialType.Token; - _getTokenCredential = (_, _) => credential; + _tokenCredential = credential; } /// @@ -148,7 +108,7 @@ public BlobsStorageResourceProvider(TokenCredential credential) public BlobsStorageResourceProvider(AzureSasCredential credential) { _credentialType = CredentialType.Sas; - _getAzureSasCredential = (_, _) => credential; + _getAzureSasCredential = (_, _) => new ValueTask(credential); } /// @@ -157,18 +117,18 @@ public BlobsStorageResourceProvider(AzureSasCredential credential) /// Storage . /// /// - /// This instance will use the given to fetch a credential + /// This instance will use the given callback to fetch a credential /// when constructing the underlying Azure.Storage.Blobs client, e.g. /// . - /// The delegate will only be used when the provider needs to construct a client in the first place. It will + /// The callback will only be used when the provider needs to construct a client in the first place. It will /// not be used when creating a from a pre-existing client, e.g. /// . /// /// /// - /// Delegate for acquiring a credential. + /// Callback for acquiring a credential for the given Uri. /// - public BlobsStorageResourceProvider(GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) + public BlobsStorageResourceProvider(Func> getStorageSharedKeyCredentialAsync) { _credentialType = CredentialType.SharedKey; _getStorageSharedKeyCredential = getStorageSharedKeyCredentialAsync; @@ -176,34 +136,11 @@ public BlobsStorageResourceProvider(GetStorageSharedKeyCredential getStorageShar /// /// - /// Constructs this provider to use the given delegate for acquiring a credential when making a new Blob + /// Constructs this provider to use the given callback for acquiring a credential when making a new Blob /// Storage . /// /// - /// This instance will use the given to fetch a credential - /// when constructing the underlying Azure.Storage.Blobs client, e.g. - /// . - /// The delegate will only be used when the provider needs to construct a client in the first place. It will - /// not be used when creating a from a pre-existing client, e.g. - /// . - /// - /// - /// - /// Delegate for acquiring a credential. - /// - public BlobsStorageResourceProvider(GetTokenCredential getTokenCredentialAsync) - { - _credentialType = CredentialType.SharedKey; - _getTokenCredential = getTokenCredentialAsync; - } - - /// - /// - /// Constructs this provider to use the given delegate for acquiring a credential when making a new Blob - /// Storage . - /// - /// - /// This instance will use the given to fetch a credential + /// This instance will use the given callback to fetch a credential /// when constructing the underlying Azure.Storage.Blobs client, e.g. /// . /// The delegate will only be used when the provider needs to construct a client in the first place. It will @@ -214,28 +151,31 @@ public BlobsStorageResourceProvider(GetTokenCredential getTokenCredentialAsync) /// /// /// - /// Delegate for acquiring a credential. + /// Callback for acquiring a credential for the given Uri and required set of permissions. /// - public BlobsStorageResourceProvider(GetAzureSasCredential getAzureSasCredentialAsync) + public BlobsStorageResourceProvider(Func> getAzureSasCredentialAsync) { - _credentialType = CredentialType.SharedKey; + _credentialType = CredentialType.Sas; _getAzureSasCredential = getAzureSasCredentialAsync; } #region Abstract Class Implementation /// - protected override Task FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: true, cancellationToken)); + [EditorBrowsable(EditorBrowsableState.Never)] + protected override async ValueTask FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) + => await FromTransferPropertiesAsync(properties, getSource: true, cancellationToken).ConfigureAwait(false); /// - protected override Task FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: false, cancellationToken)); + [EditorBrowsable(EditorBrowsableState.Never)] + protected override async ValueTask FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) + => await FromTransferPropertiesAsync(properties, getSource: false, cancellationToken).ConfigureAwait(false); - private StorageResource FromTransferProperties( + private async ValueTask FromTransferPropertiesAsync( TransferProperties properties, bool getSource, CancellationToken cancellationToken) { + CancellationHelper.ThrowIfCancellationRequested(cancellationToken); StorageResourceCheckpointDetails checkpointDetails = properties.GetCheckpointDetails(getSource); ResourceType type = GetType(checkpointDetails, properties.IsContainer); @@ -261,19 +201,19 @@ private StorageResource FromTransferProperties( properties, checkpointDetails as BlobDestinationCheckpointDetails, getSource, - _getStorageSharedKeyCredential(uri, getSource), + await _getStorageSharedKeyCredential(uri, cancellationToken).ConfigureAwait(false), cancellationToken), CredentialType.Token => rehydrator.Rehydrate( properties, checkpointDetails as BlobDestinationCheckpointDetails, getSource, - _getTokenCredential(uri, getSource), + _tokenCredential, cancellationToken), CredentialType.Sas => rehydrator.Rehydrate( properties, checkpointDetails as BlobDestinationCheckpointDetails, getSource, - _getAzureSasCredential(uri, getSource), + await _getAzureSasCredential(uri, cancellationToken).ConfigureAwait(false), cancellationToken), _ => throw BadCredentialTypeException(_credentialType), }; @@ -308,17 +248,25 @@ internal async Task FromDestinationInternalHookAsync( /// /// Options for creating the storage resource. /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// /// /// The configured storage resource. /// - public StorageResource FromContainer(Uri containerUri, BlobStorageResourceContainerOptions options = default) + public async ValueTask FromContainerAsync( + Uri containerUri, + BlobStorageResourceContainerOptions options = default, + CancellationToken cancellationToken = default) { + CancellationHelper.ThrowIfCancellationRequested(cancellationToken); BlobContainerClient client = _credentialType switch { CredentialType.None => new BlobContainerClient(containerUri), - CredentialType.SharedKey => new BlobContainerClient(containerUri, _getStorageSharedKeyCredential(containerUri, false)), - CredentialType.Token => new BlobContainerClient(containerUri, _getTokenCredential(containerUri, false)), - CredentialType.Sas => new BlobContainerClient(containerUri, _getAzureSasCredential(containerUri, false)), + CredentialType.SharedKey => new BlobContainerClient(containerUri, await _getStorageSharedKeyCredential(containerUri, cancellationToken).ConfigureAwait(false)), + CredentialType.Token => new BlobContainerClient(containerUri, _tokenCredential), + CredentialType.Sas => new BlobContainerClient(containerUri, await _getAzureSasCredential(containerUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new BlobStorageResourceContainer(client, options); @@ -344,19 +292,27 @@ public StorageResource FromContainer(Uri containerUri, BlobStorageResourceContai /// blob type of the destination. If only the base options type is /// provided, block blob will be the default used. /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// /// /// The configured storage resource. /// - public StorageResource FromBlob(Uri blobUri, BlobStorageResourceOptions options = default) + public async ValueTask FromBlobAsync( + Uri blobUri, + BlobStorageResourceOptions options = default, + CancellationToken cancellationToken = default) { + CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (options is BlockBlobStorageResourceOptions) { BlockBlobClient blockClient = _credentialType switch { CredentialType.None => new BlockBlobClient(blobUri), - CredentialType.SharedKey => new BlockBlobClient(blobUri, _getStorageSharedKeyCredential(blobUri, false)), - CredentialType.Token => new BlockBlobClient(blobUri, _getTokenCredential(blobUri, false)), - CredentialType.Sas => new BlockBlobClient(blobUri, _getAzureSasCredential(blobUri, false)), + CredentialType.SharedKey => new BlockBlobClient(blobUri, await _getStorageSharedKeyCredential(blobUri, cancellationToken).ConfigureAwait(false)), + CredentialType.Token => new BlockBlobClient(blobUri, _tokenCredential), + CredentialType.Sas => new BlockBlobClient(blobUri, await _getAzureSasCredential(blobUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new BlockBlobStorageResource(blockClient, options as BlockBlobStorageResourceOptions); @@ -366,9 +322,9 @@ public StorageResource FromBlob(Uri blobUri, BlobStorageResourceOptions options PageBlobClient pageClient = _credentialType switch { CredentialType.None => new PageBlobClient(blobUri), - CredentialType.SharedKey => new PageBlobClient(blobUri, _getStorageSharedKeyCredential(blobUri, false)), - CredentialType.Token => new PageBlobClient(blobUri, _getTokenCredential(blobUri, false)), - CredentialType.Sas => new PageBlobClient(blobUri, _getAzureSasCredential(blobUri, false)), + CredentialType.SharedKey => new PageBlobClient(blobUri, await _getStorageSharedKeyCredential(blobUri, cancellationToken).ConfigureAwait(false)), + CredentialType.Token => new PageBlobClient(blobUri, _tokenCredential), + CredentialType.Sas => new PageBlobClient(blobUri, await _getAzureSasCredential(blobUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new PageBlobStorageResource(pageClient, options as PageBlobStorageResourceOptions); @@ -378,9 +334,9 @@ public StorageResource FromBlob(Uri blobUri, BlobStorageResourceOptions options AppendBlobClient appendClient = _credentialType switch { CredentialType.None => new AppendBlobClient(blobUri), - CredentialType.SharedKey => new AppendBlobClient(blobUri, _getStorageSharedKeyCredential(blobUri, false)), - CredentialType.Token => new AppendBlobClient(blobUri, _getTokenCredential(blobUri, false)), - CredentialType.Sas => new AppendBlobClient(blobUri, _getAzureSasCredential(blobUri, false)), + CredentialType.SharedKey => new AppendBlobClient(blobUri, await _getStorageSharedKeyCredential(blobUri, cancellationToken).ConfigureAwait(false)), + CredentialType.Token => new AppendBlobClient(blobUri, _tokenCredential), + CredentialType.Sas => new AppendBlobClient(blobUri, await _getAzureSasCredential(blobUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new AppendBlobStorageResource(appendClient, options as AppendBlobStorageResourceOptions); @@ -388,9 +344,9 @@ public StorageResource FromBlob(Uri blobUri, BlobStorageResourceOptions options BlockBlobClient client = _credentialType switch { CredentialType.None => new BlockBlobClient(blobUri), - CredentialType.SharedKey => new BlockBlobClient(blobUri, _getStorageSharedKeyCredential(blobUri, false)), - CredentialType.Token => new BlockBlobClient(blobUri, _getTokenCredential(blobUri, false)), - CredentialType.Sas => new BlockBlobClient(blobUri, _getAzureSasCredential(blobUri, false)), + CredentialType.SharedKey => new BlockBlobClient(blobUri, await _getStorageSharedKeyCredential(blobUri, cancellationToken).ConfigureAwait(false)), + CredentialType.Token => new BlockBlobClient(blobUri, _tokenCredential), + CredentialType.Sas => new BlockBlobClient(blobUri, await _getAzureSasCredential(blobUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new BlockBlobStorageResource(client, options as BlockBlobStorageResourceOptions); @@ -412,7 +368,7 @@ public StorageResource FromBlob(Uri blobUri, BlobStorageResourceOptions options /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( BlobContainerClient client, BlobStorageResourceContainerOptions options = default) { @@ -433,7 +389,7 @@ public StorageResource FromClient( /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( BlockBlobClient client, BlockBlobStorageResourceOptions options = default) { @@ -454,7 +410,7 @@ public StorageResource FromClient( /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( PageBlobClient client, PageBlobStorageResourceOptions options = default) { @@ -475,7 +431,7 @@ public StorageResource FromClient( /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( AppendBlobClient client, AppendBlobStorageResourceOptions options = default) { @@ -528,7 +484,7 @@ private BlobStorageResourceContainerOptions GetOptions( { return new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = GetPrefix(transferProperties, isSource) + BlobPrefix = GetPrefix(transferProperties, isSource) }; } else diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/DataMovementBlobsExtensions.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/DataMovementBlobsExtensions.cs index e8020f725990..636c45f7d423 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/src/DataMovementBlobsExtensions.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/src/DataMovementBlobsExtensions.cs @@ -552,7 +552,7 @@ internal static BlobStorageResourceContainerOptions GetBlobContainerOptions( { BlobType = default, _isBlobTypeSet = false, - BlobDirectoryPrefix = directoryPrefix, + BlobPrefix = directoryPrefix, BlobOptions = new(checkpointDetails), }; } @@ -562,7 +562,7 @@ internal static BlobStorageResourceContainerOptions DeepCopy(this BlobStorageRes { BlobType = options?.BlobType, _isBlobTypeSet = options?._isBlobTypeSet ?? false, - BlobDirectoryPrefix = options?.BlobDirectoryPrefix, + BlobPrefix = options?.BlobPrefix, BlobOptions = new BlobStorageResourceOptions(options?.BlobOptions) }; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md index ce65832830da..d0d5cc195789 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md @@ -45,7 +45,7 @@ See the `Metrics.cs` file for more information about individual metrics and what ### Deploying a stress test In order to deploy stress tests to be run in kubernetes clusters, run: -```cmd +```cmd (env) /eng/common/scripts/stress-testing/deploy-stress-tests.ps1 ` >> -Login ` >> -PushImages @@ -60,7 +60,7 @@ This command requires Azure login credentials. ### Deploying a stress test In order to deploy stress tests to be run in kubernetes clusters, run: -```cmd +```cmd (env) /eng/common/scripts/stress-testing/deploy-stress-tests.ps1 ` >> -Login ` >> -PushImages @@ -76,5 +76,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FREADME.png) \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs index 971ffe836a80..ccc98685eb1d 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Infrastructure/TestSetupHelper.cs @@ -79,8 +79,7 @@ await originalStream.CopyToAsync( bufferSize, cancellationToken: cancellationToken); } - LocalFilesStorageResourceProvider files = new(); - return files.FromFile(localSourceFile); + return LocalFilesStorageResourceProvider.FromFile(localSourceFile); } public static async Task CreateLocalFilesToUploadAsync( diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs index 11bf495f7095..2204a7bfb42c 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/BlobScenarioBase.cs @@ -16,8 +16,6 @@ public abstract class BlobScenarioBase : DataMovementScenarioBase protected internal readonly Uri _destinationBlobUri; protected internal int _blobSize; protected internal readonly TokenCredential _tokenCredential; - protected internal BlobsStorageResourceProvider _blobsStorageResourceProvider; - protected internal LocalFilesStorageResourceProvider _localFilesStorageResourceProvider; protected internal BlobServiceClient _blobServiceClient; public BlobScenarioBase( @@ -33,8 +31,6 @@ public BlobScenarioBase( _destinationBlobUri = blobUri; _blobSize = blobSize != default ? blobSize.Value : DataMovementBlobStressConstants.DefaultObjectSize; _tokenCredential = tokenCredential; - _blobsStorageResourceProvider = new BlobsStorageResourceProvider(tokenCredential); - _localFilesStorageResourceProvider = new LocalFilesStorageResourceProvider(); _blobServiceClient = new BlobServiceClient(blobUri, tokenCredential); } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs index 0b74dd042953..74a21081d8e3 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobDirectoryScenarioBase.cs @@ -62,14 +62,14 @@ await BlobTestSetupHelper.CreateBlobsInDirectoryAsync( await destinationContainerClient.CreateIfNotExistsAsync(); // Create Source Blob Container Storage Resource - StorageResource sourceResource = _blobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobDirectoryPrefix = pathPrefix }); + StorageResource sourceResource = BlobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobPrefix = pathPrefix }); // Create Destination Blob Container Storage Resource - StorageResource destinationResource = _blobsStorageResourceProvider.FromClient( + StorageResource destinationResource = BlobsStorageResourceProvider.FromClient( destinationContainerClient, new() { - BlobDirectoryPrefix = pathPrefix, + BlobPrefix = pathPrefix, BlobType = blobType }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs index ae4b3690f168..9ed92c08a7f6 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/CopyBlobSingleScenarioBase.cs @@ -63,11 +63,11 @@ await BlobTestSetupHelper.CreateAppendBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); AppendBlobClient destinationBlob = destinationContainerClient.GetAppendBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } else if (blobType == BlobType.Page) { @@ -77,11 +77,11 @@ await BlobTestSetupHelper.CreatePageBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); PageBlobClient destinationBlob = destinationContainerClient.GetPageBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } else { @@ -91,11 +91,11 @@ await BlobTestSetupHelper.CreateBlockBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); BlockBlobClient destinationBlob = destinationContainerClient.GetBlockBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } // Start Transfer diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs index fcdc5918c502..2622a70365fa 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobDirectoryScenarioBase.cs @@ -61,7 +61,7 @@ await BlobTestSetupHelper.CreateBlobsInDirectoryAsync( StorageResource sourceResource = await TestSetupHelper.GetTemporaryFileStorageResourceAsync(disposingLocalDirectory.DirectoryPath); // Create Destination Storage Resource - StorageResource destinationResource = _blobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobDirectoryPrefix = pathPrefix }); + StorageResource destinationResource = BlobsStorageResourceProvider.FromClient(sourceContainerClient, new() { BlobPrefix = pathPrefix }); // Start Transfer await new TransferValidator() diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs index b47a652bc969..1d9013640481 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/DownloadBlobSingleScenarioBase.cs @@ -57,7 +57,7 @@ await BlobTestSetupHelper.CreateAppendBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); } else if (blobType == BlobType.Page) { @@ -67,7 +67,7 @@ await BlobTestSetupHelper.CreatePageBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); } else { @@ -77,11 +77,11 @@ await BlobTestSetupHelper.CreateBlockBlobAsync( _blobSize, cancellationToken); sourceBaseBlob = sourceBlob; - sourceResource = _blobsStorageResourceProvider.FromClient(sourceBlob); + sourceResource = BlobsStorageResourceProvider.FromClient(sourceBlob); } // Create Local Destination Storage Resource - StorageResource destinationResource = _localFilesStorageResourceProvider.FromFile(Path.Combine(disposingLocalDirectory.DirectoryPath, blobName)); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(Path.Combine(disposingLocalDirectory.DirectoryPath, blobName)); // Start Transfer await new TransferValidator() diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs index f1041f664d95..5bd19a49bccb 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobDirectoryScenarioBase.cs @@ -58,11 +58,11 @@ await TestSetupHelper.CreateLocalFilesToUploadAsync( StorageResource sourceResource = await TestSetupHelper.GetTemporaryFileStorageResourceAsync(disposingLocalDirectory.DirectoryPath); // Create Destination Storage Resource - StorageResource destinationResource = _blobsStorageResourceProvider.FromClient( + StorageResource destinationResource = BlobsStorageResourceProvider.FromClient( destinationContainerClient, new() { - BlobDirectoryPrefix = pathPrefix, + BlobPrefix = pathPrefix, BlobType = blobType }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs index 033abfff2d67..778d968d712a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/src/Scenarios/UploadBlobSingleScenarioBase.cs @@ -57,19 +57,19 @@ internal async Task RunTestInternalAsync(BlobType blobType, CancellationToken ca { AppendBlobClient destinationBlob = destinationContainerClient.GetAppendBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } else if (blobType == BlobType.Page) { PageBlobClient destinationBlob = destinationContainerClient.GetPageBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } else { BlockBlobClient destinationBlob = destinationContainerClient.GetBlockBlobClient(blobName); destinationBaseBlob = destinationBlob; - destinationResource = _blobsStorageResourceProvider.FromClient(destinationBlob); + destinationResource = BlobsStorageResourceProvider.FromClient(destinationBlob); } // Start Transfer diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToBlockBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToBlockBlobDirectoryTests.cs index eeba9e765929..1e2c2bd8feb3 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToBlockBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToBlockBlobDirectoryTests.cs @@ -65,14 +65,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Append }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Append }); protected internal override BlockBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetBlockBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToDirectoryTests.cs index 13e30b52fad3..b7a9a352ed51 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToDirectoryTests.cs @@ -65,14 +65,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Append, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Append }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Append }); protected internal override AppendBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetAppendBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToPageBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToPageBlobDirectoryTests.cs index e91dab64cc76..b3bba854521e 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToPageBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobDirectoryToPageBlobDirectoryTests.cs @@ -65,14 +65,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Page, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Append }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Append }); protected internal override PageBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetPageBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobStartTransferCopyTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobStartTransferCopyTests.cs index 409499df10df..7484bf2a282b 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobStartTransferCopyTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobStartTransferCopyTests.cs @@ -36,7 +36,7 @@ public class AppendBlobStartTransferCopyTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "application/octet-stream"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -233,6 +233,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToBlockBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToBlockBlobTests.cs index 4174c2700667..477f94723d38 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToBlockBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToBlockBlobTests.cs @@ -36,7 +36,7 @@ public class AppendBlobToBlockBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -229,6 +229,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToPageBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToPageBlobTests.cs index 7b0b54e6f744..634e59b94c68 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToPageBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/AppendBlobToPageBlobTests.cs @@ -36,7 +36,7 @@ public class AppendBlobToPageBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -248,6 +248,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj index a7362e1a4692..9f8e04ed39ed 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/Azure.Storage.DataMovement.Blobs.Tests.csproj @@ -10,7 +10,7 @@ DMBlobs - + BaseBlobs @@ -55,6 +55,7 @@ + diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs index eac303a466fe..a5001df279b6 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsIntegrationTests.cs @@ -225,7 +225,7 @@ public async Task StartUploadDirectoryAsync_WithOptions_Skipped() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -451,7 +451,7 @@ public async Task StartDownloadToDirectoryAsync_WithOptions_Skipped() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsTests.cs index 3e1e7b303284..f68308b24ed1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobContainerClientExtensionsTests.cs @@ -68,7 +68,7 @@ public async Task VerifyStartUploadDirectoryAsync([Values] bool addBlobDirectory { await client.UploadDirectoryAsync(WaitUntil.Started, directoryPath, new BlobContainerClientTransferOptions { - BlobContainerOptions = new() { BlobDirectoryPrefix = blobDirectoryPrefix }, + BlobContainerOptions = new() { BlobPrefix = blobDirectoryPrefix }, TransferOptions = options }); } @@ -115,7 +115,7 @@ public async Task VerifyStartDownloadToDirectoryAsync([Values] bool addBlobDirec { await client.DownloadToDirectoryAsync(WaitUntil.Started, directoryPath, new BlobContainerClientTransferOptions { - BlobContainerOptions = new() { BlobDirectoryPrefix = blobDirectoryPrefix }, + BlobContainerOptions = new() { BlobPrefix = blobDirectoryPrefix }, TransferOptions = options }); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobDirectoryStartTransferDownloadTestBase.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobDirectoryStartTransferDownloadTestBase.cs index dfa493f75a5b..6976f68741ab 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobDirectoryStartTransferDownloadTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobDirectoryStartTransferDownloadTestBase.cs @@ -44,7 +44,7 @@ protected override async Task> GetDispo => await ClientBuilder.GetTestContainerAsync(service, containerName); protected override StorageResourceContainer GetStorageResourceContainer(BlobContainerClient container, string directoryPath) - => new BlobStorageResourceContainer(container, new() { BlobType = GetBlobType(), BlobDirectoryPrefix = directoryPath }); + => new BlobStorageResourceContainer(container, new() { BlobType = GetBlobType(), BlobPrefix = directoryPath }); protected override TransferValidator.ListFilesAsync GetSourceLister(BlobContainerClient container, string prefix) => TransferValidator.GetBlobLister(container, prefix); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobPauseResumeTransferTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobPauseResumeTransferTests.cs new file mode 100644 index 000000000000..c58e56653c83 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobPauseResumeTransferTests.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +extern alias DMBlobs; +extern alias BaseBlobs; + +using System; +using System.Threading.Tasks; +using Azure.Storage.Test.Shared; +using Azure.Storage.DataMovement.Tests; +using DMBlobs::Azure.Storage.DataMovement.Blobs; +using BaseBlobs::Azure.Storage.Blobs; +using BaseBlobs::Azure.Storage.Blobs.Specialized; +using BaseBlobs::Azure.Storage.Blobs.Models; +using System.IO; +using NUnit.Framework; +using Metadata = System.Collections.Generic.IDictionary; + +namespace Azure.Storage.DataMovement.Blobs.Tests +{ + [DataMovementBlobsClientTestFixture] + public class BlobPauseResumeTransferTests : PauseResumeTransferTestBase + + { + protected readonly BlobClientOptions.ServiceVersion _serviceVersion; + + public BlobPauseResumeTransferTests(bool async, BlobClientOptions.ServiceVersion serviceVersion) + : base(async, null /* RecordedTestMode.Record /* to re-record */) + { + _serviceVersion = serviceVersion; + ClientBuilder = ClientBuilderExtensions.GetNewBlobsClientBuilder(Tenants, serviceVersion); + } + + protected override async Task> GetDisposingContainerAsync( + string containerName = default, + BlobServiceClient service = default) + => await ClientBuilder.GetTestContainerAsync(service, containerName); + + protected override StorageResourceProvider GetStorageResourceProvider() + => new BlobsStorageResourceProvider(TestEnvironment.Credential); + + protected override async Task CreateSourceStorageResourceItemAsync( + long size, + string blobName, + BlobContainerClient container) + { + BlockBlobClient blobClient = container.GetBlockBlobClient(blobName); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + // Upload blob to storage account + originalStream.Position = 0; + await blobClient.UploadAsync(originalStream); + } + return BlobsStorageResourceProvider.FromClient(blobClient); + } + + protected override StorageResource CreateDestinationStorageResourceItem( + string blobName, + BlobContainerClient container, + Metadata metadata = default, + string contentLanguage = default) + { + BlockBlobStorageResourceOptions testOptions = new() + { + Metadata = metadata, + ContentLanguage = contentLanguage, + }; + BlockBlobClient destinationClient = container.GetBlockBlobClient(blobName); + return BlobsStorageResourceProvider.FromClient(destinationClient, testOptions); + } + + protected override async Task AssertDestinationProperties( + string blobName, + Metadata expectedMetadata, + string expectedContentLanguage, + BlobContainerClient container) + { + BlockBlobClient blob = container.GetBlockBlobClient(blobName); + BlobProperties props = (await blob.GetPropertiesAsync()).Value; + Assert.That(props.Metadata, Is.EqualTo(expectedMetadata)); + Assert.That(props.ContentLanguage, Is.EqualTo(expectedContentLanguage)); + } + + protected override async Task GetStreamFromContainerAsync(Uri uri, BlobContainerClient container) + { + BlobUriBuilder builder = new BlobUriBuilder(uri); + BlockBlobClient blobClient = container.GetBlockBlobClient(builder.BlobName); + if (!await blobClient.ExistsAsync()) + { + throw new FileNotFoundException($"Blob not found: {uri}"); + } + + MemoryStream stream = new MemoryStream(); + await blobClient.DownloadToAsync(stream); + stream.Position = 0; + return stream; + } + + protected override async Task CreateSourceStorageResourceContainerAsync( + long size, + int blobCount, + string directoryPath, + BlobContainerClient container) + { + for (int i = 0; i < blobCount; i++) + { + if (i % 3 == 0) + { + BlockBlobClient blobClient = container.GetBlockBlobClient(string.Join("/", directoryPath, GetNewItemName())); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + // Upload blob to storage account + originalStream.Position = 0; + await blobClient.UploadAsync(originalStream); + } + } + else if (i % 3 == 1) + { + AppendBlobClient blobClient = container.GetAppendBlobClient(string.Join("/", directoryPath, GetNewItemName())); + await blobClient.CreateAsync(); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + // Upload blob to storage account + originalStream.Position = 0; + await blobClient.AppendBlockAsync(originalStream); + } + } + else + { + PageBlobClient blobClient = container.GetPageBlobClient(string.Join("/", directoryPath, GetNewItemName())); + await blobClient.CreateAsync(size); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + // Upload blob to storage account + originalStream.Position = 0; + await blobClient.UploadPagesAsync(originalStream, 0); + } + } + } + BlobStorageResourceContainerOptions options = new(); + options.BlobPrefix = directoryPath; + return BlobsStorageResourceProvider.FromClient(container, options); + } + + protected override StorageResource CreateDestinationStorageResourceContainer( + BlobContainerClient container) + { + BlobStorageResourceContainerOptions options = new() + { + BlobPrefix = GetNewContainerName() + }; + return BlobsStorageResourceProvider.FromClient(container, options); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceContainerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceContainerTests.cs index 87cae8349665..6a322ffd4598 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceContainerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceContainerTests.cs @@ -69,7 +69,7 @@ public void Ctor_PublicUri() string directoryName = "directoryName"; BlobContainerClient blobContainerClient = new BlobContainerClient(uri); BlobStorageResourceContainer storageResource = - new BlobStorageResourceContainer(blobContainerClient, new() { BlobDirectoryPrefix = directoryName }); + new BlobStorageResourceContainer(blobContainerClient, new() { BlobPrefix = directoryName }); // Assert Assert.AreEqual(uri, storageResource.Uri); @@ -84,7 +84,7 @@ public async Task GetStorageResourcesAsync() string folderName = "foo"; BlobStorageResourceContainer storageResourceContainer = - new BlobStorageResourceContainer(test.Container, new() { BlobDirectoryPrefix = folderName }); + new BlobStorageResourceContainer(test.Container, new() { BlobPrefix = folderName }); var resources = new List(); @@ -108,7 +108,7 @@ public async Task GetStorageResourcesAsync_Empty() string prefix = "foo"; StorageResourceContainer container = new BlobStorageResourceContainer( - testContainer, new() { BlobDirectoryPrefix = prefix }); + testContainer, new() { BlobPrefix = prefix }); // Act var directories = new List(); @@ -217,7 +217,7 @@ public async Task GetStorageResourcesAsync_SubDirectories() string prefix = "foo"; StorageResourceContainer container = new BlobStorageResourceContainer( - testContainer, new() { BlobDirectoryPrefix = prefix }); + testContainer, new() { BlobPrefix = prefix }); // Act var directories = new List(); @@ -249,7 +249,7 @@ public async Task GetStorageResourceReferenceAsync_Default() string prefix = "foo"; StorageResourceContainer containerResource = - new BlobStorageResourceContainer(test.Container, new() { BlobDirectoryPrefix = prefix }); + new BlobStorageResourceContainer(test.Container, new() { BlobPrefix = prefix }); StorageResourceItem resource = containerResource.GetStorageResourceReference("bar", default); @@ -270,7 +270,7 @@ public async Task GetStorageResourceReferenceAsync_BlobType(string blobResourceI string prefix = "foo"; StorageResourceContainer containerResource = - new BlobStorageResourceContainer(test.Container, new() { BlobDirectoryPrefix = prefix }); + new BlobStorageResourceContainer(test.Container, new() { BlobPrefix = prefix }); StorageResourceItem resource = containerResource.GetStorageResourceReference("bar", blobResourceId); @@ -290,7 +290,7 @@ public void GetChildStorageResourceContainer() string prefix = "foo"; StorageResourceContainer containerResource = - new BlobStorageResourceContainer(mock.Object, new() { BlobDirectoryPrefix = prefix }); + new BlobStorageResourceContainer(mock.Object, new() { BlobPrefix = prefix }); // Act string childPath = "bar"; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceProviderTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobsStorageResourceProviderTests.cs similarity index 71% rename from sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceProviderTests.cs rename to sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobsStorageResourceProviderTests.cs index 63bddd80b1e0..1471a649c716 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobStorageResourceProviderTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlobsStorageResourceProviderTests.cs @@ -12,14 +12,15 @@ using DMBlobs::Azure.Storage.DataMovement.Blobs; using Moq; using NUnit.Framework; +using System.Threading.Tasks; +using System.Threading; namespace Azure.Storage.DataMovement.Blobs.Tests { - public class BlobStorageResourceProviderTests + public class BlobsStorageResourceProviderTests { public enum CredType { - None, SharedKey, Token, Sas @@ -37,11 +38,6 @@ private void AssertCredPresent(BlobClientConfiguration clientConfig, CredType cr Assert.IsNotNull(clientConfig); switch (credType) { - case CredType.None: - Assert.IsNull(clientConfig.SharedKeyCredential); - Assert.IsNull(clientConfig.TokenCredential); - Assert.IsNull(clientConfig.SasCredential); - break; case CredType.SharedKey: Assert.IsNotNull(clientConfig.SharedKeyCredential); Assert.IsNull(clientConfig.TokenCredential); @@ -104,9 +100,9 @@ private void AssertBlobStorageResourceType( [Test] [Combinatorial] - public void FromContainer( + public async Task FromContainer( [Values(true, false)] bool withPrefix, - [Values(CredType.None, CredType.SharedKey, CredType.Token, CredType.Sas)] CredType credType) + [Values(CredType.SharedKey, CredType.Token, CredType.Sas)] CredType credType) { const string containerName = "mycontainer"; const string prefix = "my/prefix"; @@ -115,13 +111,12 @@ public void FromContainer( BlobsStorageResourceProvider provider = credType switch { - CredType.None => new(), CredType.SharedKey => new(mockCreds.SharedKey.Object), CredType.Token => new(mockCreds.Token.Object), CredType.Sas => new(mockCreds.Sas.Object), _ => throw new ArgumentException("Bad cred type"), }; - BlobStorageResourceContainer resource = provider.FromContainer(uri) as BlobStorageResourceContainer; + BlobStorageResourceContainer resource = await provider.FromContainerAsync(uri) as BlobStorageResourceContainer; Assert.IsNotNull(resource); Assert.AreEqual(uri, resource.Uri); @@ -131,9 +126,9 @@ public void FromContainer( [Test] [Combinatorial] - public void FromBlob( + public async Task FromBlob( [Values(BlobType.Unspecified, BlobType.Block, BlobType.Page, BlobType.Append)] BlobType blobType, - [Values(CredType.None, CredType.SharedKey, CredType.Token, CredType.Sas)] CredType credType) + [Values(CredType.SharedKey, CredType.Token, CredType.Sas)] CredType credType) { const string containerName = "mycontainer"; const string blobName = "my/blob.txt"; @@ -142,7 +137,6 @@ public void FromBlob( BlobsStorageResourceProvider provider = credType switch { - CredType.None => new(), CredType.SharedKey => new(mockCreds.SharedKey.Object), CredType.Token => new(mockCreds.Token.Object), CredType.Sas => new(mockCreds.Sas.Object), @@ -151,10 +145,10 @@ public void FromBlob( StorageResource resource = blobType switch { - BlobType.Unspecified => provider.FromBlob(uri), - BlobType.Block => provider.FromBlob(uri, new BlockBlobStorageResourceOptions()), - BlobType.Page => provider.FromBlob(uri, new PageBlobStorageResourceOptions()), - BlobType.Append => provider.FromBlob(uri, new AppendBlobStorageResourceOptions()), + BlobType.Unspecified => await provider.FromBlobAsync(uri), + BlobType.Block => await provider.FromBlobAsync(uri, new BlockBlobStorageResourceOptions()), + BlobType.Page => await provider.FromBlobAsync(uri, new PageBlobStorageResourceOptions()), + BlobType.Append => await provider.FromBlobAsync(uri, new AppendBlobStorageResourceOptions()), _ => throw new ArgumentException("Bad blob type") }; @@ -164,5 +158,38 @@ public void FromBlob( Assert.AreEqual(uri, underlyingClient.Uri); AssertCredPresent(underlyingClient.ClientConfiguration, credType); } + + [Test] + public async Task CredentialCallback( + [Values(CredType.SharedKey, CredType.Sas)] CredType credType) + { + const string containerName = "mycontainer"; + const string blobName = "my/blob.txt"; + Uri uri = new Uri($"https://myaccount.blob.core.windows.net/{containerName}/{blobName}"); + (Mock SharedKey, Mock Token, Mock Sas) mockCreds = GetMockCreds(); + + ValueTask GetSharedKeyCredential(Uri uri, CancellationToken cancellationToken) + { + return new ValueTask(mockCreds.SharedKey.Object); + } + ValueTask GetSasCredential(Uri _, CancellationToken cancellationToken) + { + return new ValueTask(mockCreds.Sas.Object); + } + + BlobsStorageResourceProvider provider = credType switch + { + CredType.SharedKey => new(GetSharedKeyCredential), + CredType.Sas => new(GetSasCredential), + _ => throw new ArgumentException("Bad cred type"), + }; + StorageResource resource = await provider.FromBlobAsync(uri); + + Assert.IsNotNull(resource); + AssertBlobStorageResourceType(resource, BlobType.Block, out BlobBaseClient underlyingClient); + Assert.AreEqual(uri, resource.Uri); + Assert.AreEqual(uri, underlyingClient.Uri); + AssertCredPresent(underlyingClient.ClientConfiguration, credType); + } } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToAppendBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToAppendBlobDirectoryTests.cs index 1978fae1d7dd..93d4cb1350d7 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToAppendBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToAppendBlobDirectoryTests.cs @@ -86,7 +86,7 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Append, BlobOptions = options }); @@ -99,7 +99,7 @@ protected override StorageResourceContainer GetSourceStorageResourceContainer( containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToDirectoryTests.cs index c5fcd523a740..a627296bd7f9 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToDirectoryTests.cs @@ -64,14 +64,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain }; } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Block }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Block }); protected internal override BlockBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetBlockBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToPageBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToPageBlobDirectoryTests.cs index 8820368d1c8e..27d0c1f0851c 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToPageBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobDirectoryToPageBlobDirectoryTests.cs @@ -64,7 +64,7 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Page, BlobOptions = options }); @@ -76,7 +76,7 @@ protected override StorageResourceContainer GetSourceStorageResourceContainer( => new BlobStorageResourceContainer( containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block }); protected internal override PageBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobStartTransferCopyTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobStartTransferCopyTests.cs index db037b732961..f6e48367dd02 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobStartTransferCopyTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobStartTransferCopyTests.cs @@ -35,7 +35,7 @@ public class BlockBlobStartTransferCopyTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -212,6 +212,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); Assert.AreEqual(_defaultAccessTier.ToString(), destinationProperties.AccessTier); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToAppendBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToAppendBlobTests.cs index 465aa0779f23..a61a5bf37faf 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToAppendBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToAppendBlobTests.cs @@ -36,7 +36,7 @@ public class BlockBlobToAppendBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -233,6 +233,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToPageBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToPageBlobTests.cs index 15b60237a22e..99d2f75e275a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToPageBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/BlockBlobToPageBlobTests.cs @@ -36,7 +36,7 @@ public class BlockBlobToPageBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -234,6 +234,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToAppendBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToAppendBlobDirectoryTests.cs index 61dc32555c36..6bea505e81e9 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToAppendBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToAppendBlobDirectoryTests.cs @@ -65,14 +65,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Append, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Page }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Page }); protected internal override PageBlobClient GetSourceBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetPageBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToBlockBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToBlockBlobDirectoryTests.cs index 362fe4ab4d13..6bd93a920dc8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToBlockBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToBlockBlobDirectoryTests.cs @@ -82,14 +82,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Page }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Page }); protected internal override BlockBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetBlockBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToDirectoryTests.cs index 5a92e7114944..42d7321cb483 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobDirectoryToDirectoryTests.cs @@ -65,14 +65,14 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Page, BlobOptions = options }); } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Page }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Page }); protected internal override PageBlobClient GetDestinationBlob(BlobContainerClient containerClient, string blobName) => containerClient.GetPageBlobClient(blobName); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobStartTransferCopyTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobStartTransferCopyTests.cs index 91b64d4b6e8d..c11178334d97 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobStartTransferCopyTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobStartTransferCopyTests.cs @@ -36,7 +36,7 @@ public class PageBlobStartTransferCopyTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cool; - private const string _defaultContentType = "application/octet-stream"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -224,6 +224,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToAppendBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToAppendBlobTests.cs index 37ed0f17981b..1c31a1551a82 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToAppendBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToAppendBlobTests.cs @@ -36,7 +36,7 @@ public class PageBlobToAppendBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -241,6 +241,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(cancellationToken: cancellationToken); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToBlockBlobTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToBlockBlobTests.cs index 46c36378af3d..e5cf63a82fc5 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToBlockBlobTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PageBlobToBlockBlobTests.cs @@ -36,7 +36,7 @@ public class PageBlobToBlockBlobTests : StartTransferCopyTestBase StorageTestEnvironment> { private readonly AccessTier _defaultAccessTier = AccessTier.Cold; - private const string _defaultContentType = "text/plain"; + private const string _defaultContentType = "image/jpeg"; private const string _defaultContentLanguage = "en-US"; private const string _defaultContentDisposition = "inline"; private const string _defaultCacheControl = "no-cache"; @@ -232,6 +232,7 @@ protected override async Task VerifyPropertiesCopyAsync( Assert.IsNull(destinationProperties.ContentDisposition); Assert.IsNull(destinationProperties.ContentLanguage); Assert.IsNull(destinationProperties.CacheControl); + Assert.That(destinationProperties.ContentType, Is.Not.EqualTo(_defaultContentType)); GetBlobTagResult destinationTags = await destinationClient.GetTagsAsync(); Assert.IsEmpty(destinationTags.Tags); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs index c5113fb10f7e..f89dacfb4993 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs @@ -136,7 +136,7 @@ private async Task TransferAndAssertProgress( TrackBytesTransferred = trackBytes } ; - transferOptions.CreationPreference = createMode; + transferOptions.CreationMode = createMode; TransferOperation transfer = await transferManager.StartTransferAsync(source, destination, transferOptions); CancellationTokenSource tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(waitTime)); @@ -317,11 +317,10 @@ public async Task ProgressHandler_PauseResume(int delayInMs) await PopulateTestContainer(source.Container); BlobsStorageResourceProvider blobProvider = new(TestEnvironment.Credential); - LocalFilesStorageResourceProvider localProvider = new(); TransferManagerOptions transferManagerOptions = new() { - ResumeProviders = [blobProvider, localProvider] + ProvidersForResuming = [blobProvider] }; TransferManager transferManager = new(transferManagerOptions); @@ -338,8 +337,8 @@ public async Task ProgressHandler_PauseResume(int delayInMs) // Act - Start transfer TransferOperation transfer = await transferManager.StartTransferAsync( - blobProvider.FromContainer(source.Container.Uri), - localProvider.FromDirectory(destination.DirectoryPath), + await blobProvider.FromContainerAsync(source.Container.Uri), + LocalFilesStorageResourceProvider.FromDirectory(destination.DirectoryPath), transferOptions); // TODO: This can likely be replaced with something better once mocking is in place diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/RehydrateBlobResourceTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/RehydrateBlobResourceTests.cs index a6f6807d2b7f..9ad72f0b2cd1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/RehydrateBlobResourceTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/RehydrateBlobResourceTests.cs @@ -13,6 +13,8 @@ using DMBlobs::Azure.Storage.DataMovement.Blobs; using Moq; using NUnit.Framework; +using Azure.Core; +using Azure.Identity; namespace Azure.Storage.DataMovement.Blobs.Tests { @@ -24,6 +26,8 @@ public class RehydrateBlobResourceTests private const string DefaultContentDisposition = "inline"; private const string DefaultCacheControl = "no-cache"; private static string GetNewTransferId() => Guid.NewGuid().ToString(); + private static TokenCredential _tokenCredential = new DefaultAzureCredential(); + public RehydrateBlobResourceTests() { } @@ -147,8 +151,8 @@ public async Task RehydrateBlockBlob( GetDefaultDestinationCheckpointDetails(BlobType.Block)).Object; StorageResource storageResource = isSource - ? await new BlobsStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new BlobsStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new BlobsStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new BlobsStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(originalPath, storageResource.Uri.AbsoluteUri); Assert.IsInstanceOf(typeof(BlockBlobStorageResource), storageResource); @@ -175,7 +179,7 @@ public async Task RehydrateBlockBlob_Options() GetSourceCheckpointDetails(), checkpointDetails).Object; - BlockBlobStorageResource storageResource = (BlockBlobStorageResource)await new BlobsStorageResourceProvider() + BlockBlobStorageResource storageResource = (BlockBlobStorageResource)await new BlobsStorageResourceProvider(_tokenCredential) .FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(destinationPath, storageResource.Uri.AbsoluteUri); @@ -217,8 +221,8 @@ public async Task RehydratePageBlob( GetDefaultDestinationCheckpointDetails(BlobType.Page)).Object; StorageResource storageResource = isSource - ? await new BlobsStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new BlobsStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new BlobsStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new BlobsStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(originalPath, storageResource.Uri.AbsoluteUri); if (isSource) @@ -252,7 +256,7 @@ public async Task RehydratePageBlob_Options() GetSourceCheckpointDetails(), checkpointDetails).Object; - PageBlobStorageResource storageResource = (PageBlobStorageResource)await new BlobsStorageResourceProvider() + PageBlobStorageResource storageResource = (PageBlobStorageResource)await new BlobsStorageResourceProvider(_tokenCredential) .FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(destinationPath, storageResource.Uri.AbsoluteUri); @@ -293,8 +297,8 @@ public async Task RehydrateAppendBlob( GetDefaultDestinationCheckpointDetails(BlobType.Append)).Object; StorageResource storageResource = isSource - ? await new BlobsStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new BlobsStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new BlobsStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new BlobsStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(originalPath, storageResource.Uri.AbsoluteUri); if (isSource) @@ -328,7 +332,7 @@ public async Task RehydrateAppendBlob_Options() GetSourceCheckpointDetails(), checkpointDetails).Object; - AppendBlobStorageResource storageResource = (AppendBlobStorageResource)await new BlobsStorageResourceProvider() + AppendBlobStorageResource storageResource = (AppendBlobStorageResource)await new BlobsStorageResourceProvider(_tokenCredential) .FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(destinationPath, storageResource.Uri.AbsoluteUri); @@ -379,8 +383,8 @@ public async Task RehydrateBlobContainer( GetDefaultDestinationCheckpointDetails(BlobType.Block)).Object; StorageResource storageResource = isSource - ? await new BlobsStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new BlobsStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new BlobsStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new BlobsStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.AreEqual(originalPath, storageResource.Uri.AbsoluteUri); Assert.IsInstanceOf(typeof(BlobStorageResourceContainer), storageResource); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/StartTransferCheckpointerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/StartTransferCheckpointerTests.cs index 6ac98441d6c3..a0e7afdcde26 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/StartTransferCheckpointerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/StartTransferCheckpointerTests.cs @@ -79,7 +79,7 @@ public async Task CheckpointerWithSasAsync() TransferOptions transferOptions = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; // Start transfer and await for completion. This transfer will fail diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/AppendBlobDirectoryToShareDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/AppendBlobDirectoryToShareDirectoryTests.cs index 8e24232b5dce..d2ce56cc0964 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/AppendBlobDirectoryToShareDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/AppendBlobDirectoryToShareDirectoryTests.cs @@ -86,6 +86,6 @@ await blobClient.CreateIfNotExistsAsync( } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Append }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Append }); } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/BlockBlobDirectoryToShareDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/BlockBlobDirectoryToShareDirectoryTests.cs index 5b551ce31f89..307aef7e1d64 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/BlockBlobDirectoryToShareDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/BlockBlobDirectoryToShareDirectoryTests.cs @@ -81,6 +81,6 @@ await blobClient.UploadAsync( } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Block }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Block }); } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/PageBlobDirectoryToShareDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/PageBlobDirectoryToShareDirectoryTests.cs index 355fc422f882..e062decfe050 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/PageBlobDirectoryToShareDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/PageBlobDirectoryToShareDirectoryTests.cs @@ -87,6 +87,6 @@ private async Task UploadPagesAsync( } protected override StorageResourceContainer GetSourceStorageResourceContainer(BlobContainerClient containerClient, string directoryPath) - => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobDirectoryPrefix = directoryPath, BlobType = BlobType.Page }); + => new BlobStorageResourceContainer(containerClient, new BlobStorageResourceContainerOptions() { BlobPrefix = directoryPath, BlobType = BlobType.Page }); } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToAppendBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToAppendBlobDirectoryTests.cs index 54f91b61fbf2..2140d1583e32 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToAppendBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToAppendBlobDirectoryTests.cs @@ -131,7 +131,7 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(sourceContainerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Append, BlobOptions = options }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToBlockBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToBlockBlobDirectoryTests.cs index 546114912d8a..28cb7cd33b66 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToBlockBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToBlockBlobDirectoryTests.cs @@ -100,7 +100,7 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(sourceContainerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Block, BlobOptions = options }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToPageBlobDirectoryTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToPageBlobDirectoryTests.cs index b77941083a61..1e782720c39c 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToPageBlobDirectoryTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/BlobToFileSharesTests/ShareDirectoryToPageBlobDirectoryTests.cs @@ -97,7 +97,7 @@ protected override StorageResourceContainer GetDestinationStorageResourceContain } return new BlobStorageResourceContainer(sourceContainerClient, new BlobStorageResourceContainerOptions() { - BlobDirectoryPrefix = directoryPath, + BlobPrefix = directoryPath, BlobType = BlobType.Page, BlobOptions = options }); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md index 80d2cb9768c5..7354f5f68789 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md @@ -1,8 +1,6 @@ # Release History -## 12.0.0-beta.4 (Unreleased) - -### Features Added +## 12.0.0 (2025-02-11) ### Breaking Changes - Changed `ShareFileStorangeResourceOptions.FilePermissions` from `DataTransferProperty` to `bool?` @@ -22,10 +20,16 @@ - `ShareFileStorageResourceOptions.FileChangedOn` - Changed `ShareDirectoryClient.StartUploadDirectoryAsync` to `ShareDirectoryClient.UploadDirectoryAsync` and added a required `waitUntil` parameter. - Changed `ShareDirectoryClient.StartDownloadToDirectoryAsync` to `ShareDirectoryClient.DownloadToDirectoryAsync` and added a required `waitUntil` parameter. +- Several refactors to `ShareFilesStorageResourceProvider`: + - Removed nested delegates `GetStorageSharedKeyCredential`, `GetTokenCredential`, and `GetAzureSasCredential`. + - Removed default constructor. + - Removed constructor overload for `GetTokenCredential` entirely. + - Changed constructor overloads for `GetStorageSharedKeyCredential` and `GetAzureSasCredential` to use `Func`. These callbacks are also now async, returning a `ValueTask`, and the `readOnly` parameter was removed. + - Changed `FromFile` and `FromDirectory` to async, returning a `ValueTask`, and renamed to `FromFileAsync` and `FromDirectoryAsync` respectively. + - Changed `FromClient` methods to `static` methods. ### Bugs Fixed - -### Other Changes +- Fixed File Attributes with ReadOnly does not transfer / copy correctly bug #2167 ## 12.0.0-beta.3 (2024-10-14) diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md index 2b2293f753f7..2f65daf4fc67 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -1,11 +1,5 @@ # Azure Storage Data Movement File Shares client library for .NET -## Project Status: Beta - -This product is in beta. Some features will be missing or have significant bugs. Please see [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. - ---- - Azure Storage is a Microsoft-managed service providing cloud storage that is highly available, secure, durable, scalable, and redundant. Azure Storage includes Azure Blobs (objects), Azure Data Lake Storage Gen2, Azure Files, @@ -27,8 +21,8 @@ Install the Azure Storage client library for .NET you'd like to use with [NuGet][nuget] and the `Azure.Storage.DataMovement.Files.Shares` client library will be included: ```dotnetcli -dotnet add package Azure.Storage.DataMovement --prerelease -dotnet add package Azure.Storage.DataMovement.Files.Shares --prerelease +dotnet add package Azure.Storage.DataMovement +dotnet add package Azure.Storage.DataMovement.Files.Shares ``` ### Prerequisites @@ -45,7 +39,7 @@ az storage account create --name MyStorageAccount --resource-group MyResourceGro ``` ### Authenticate the client -The Azure.Storage.DataMovement.Files.Shares library uses clients from the Azure.Storage.Files.Shares package to communicate with the Azure File Storage service. For more information see the Azure.Storage.Files.Shares [authentication documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares#authenticate-the-client). +The Azure.Storage.DataMovement.Files.Shares library uses clients from the Azure.Storage.Files.Shares package to communicate with the Azure File Storage service. For more information see the Azure.Storage.Files.Shares [authentication documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/README.md#authenticate-the-client). ### Permissions @@ -91,20 +85,19 @@ ShareFilesStorageResourceProvider shares = new(tokenCredential); To create a share `StorageResource`, use the methods `FromFile` or `FromDirectory`. ```C# Snippet:ResourceConstruction_Shares -StorageResource directory = shares.FromDirectory( +StorageResource directory = await shares.FromDirectoryAsync( new Uri("http://myaccount.files.core.windows.net/share/path/to/directory")); -StorageResource rootDirectory = shares.FromDirectory( +StorageResource rootDirectory = await shares.FromDirectoryAsync( new Uri("http://myaccount.files.core.windows.net/share")); -StorageResource file = shares.FromFile( +StorageResource file = await shares.FromFileAsync( new Uri("http://myaccount.files.core.windows.net/share/path/to/file.txt")); ``` Storage resources can also be initialized with the appropriate client object from Azure.Storage.Files.Shares. Since these resources will use the credential already present in the client object, no credential is required in the provider when using `FromClient()`. **However**, a `ShareFilesStorageResourceProvider` must still have a credential if it is to be used in `TransferManagerOptions` for resuming a transfer. ```C# Snippet:ResourceConstruction_FromClients_Shares -ShareFilesStorageResourceProvider shares = new(); -StorageResource shareDirectoryResource = shares.FromClient(directoryClient); -StorageResource shareFileResource = shares.FromClient(fileClient); +StorageResource shareDirectoryResource = ShareFilesStorageResourceProvider.FromClient(directoryClient); +StorageResource shareFileResource = ShareFilesStorageResourceProvider.FromClient(fileClient); ``` ### Upload @@ -114,9 +107,12 @@ An upload takes place between a local file `StorageResource` as source and file Upload a file. ```C# Snippet:SimplefileUpload_Shares +TokenCredential tokenCredential = new DefaultAzureCredential(); +ShareFilesStorageResourceProvider shares = new(tokenCredential); +TransferManager transferManager = new TransferManager(new TransferManagerOptions()); TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalFile), - destinationResource: shares.FromFile(destinationFileUri)); + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalFile), + destinationResource: await shares.FromFileAsync(destinationFileUri)); await fileTransfer.WaitForCompletionAsync(); ``` @@ -124,8 +120,8 @@ Upload a directory. ```C# Snippet:SimpleDirectoryUpload_Shares TransferOperation folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromDirectory(sourceLocalDirectory), - destinationResource: shares.FromDirectory(destinationFolderUri)); + sourceResource: LocalFilesStorageResourceProvider.FromDirectory(sourceLocalDirectory), + destinationResource: await shares.FromDirectoryAsync(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); ``` @@ -137,8 +133,8 @@ Download a file. ```C# Snippet:SimpleFileDownload_Shares TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromFile(sourceFileUri), - destinationResource: files.FromFile(destinationLocalFile)); + sourceResource: await shares.FromFileAsync(sourceFileUri), + destinationResource: LocalFilesStorageResourceProvider.FromFile(destinationLocalFile)); await fileTransfer.WaitForCompletionAsync(); ``` @@ -146,8 +142,8 @@ Download a Directory. ```C# Snippet:SimpleDirectoryDownload_Shares TransferOperation directoryTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromDirectory(sourceDirectoryUri), - destinationResource: files.FromDirectory(destinationLocalDirectory)); + sourceResource: await shares.FromDirectoryAsync(sourceDirectoryUri), + destinationResource: LocalFilesStorageResourceProvider.FromDirectory(destinationLocalDirectory)); await directoryTransfer.WaitForCompletionAsync(); ``` @@ -159,8 +155,8 @@ Copy a single file. ```C# Snippet:s2sCopyFile_Shares TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromFile(sourceFileUri), - destinationResource: shares.FromFile(destinationFileUri)); + sourceResource: await shares.FromFileAsync(sourceFileUri), + destinationResource: await shares.FromFileAsync(destinationFileUri)); await fileTransfer.WaitForCompletionAsync(); ``` @@ -168,15 +164,41 @@ Copy a directory. ```C# Snippet:s2sCopyDirectory_Shares TransferOperation directoryTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromDirectory(sourceDirectoryUri), - destinationResource: shares.FromDirectory(destinationDirectoryUri)); + sourceResource: await shares.FromDirectoryAsync(sourceDirectoryUri), + destinationResource: await shares.FromDirectoryAsync(destinationDirectoryUri)); await directoryTransfer.WaitForCompletionAsync(); ``` +### Resume using ShareFilesStorageResourceProvider + +To resume a transfer with Share File(s), valid credentials must be provided. See the sample below. + +```C# Snippet:TransferManagerResumeTransfers_Shares +TokenCredential tokenCredential = new DefaultAzureCredential(); +ShareFilesStorageResourceProvider shares = new(tokenCredential); +TransferManager transferManager = new TransferManager(new TransferManagerOptions() +{ + ProvidersForResuming = new List() { shares } +}); +// Get resumable transfers from transfer manager +await foreach (TransferProperties properties in transferManager.GetResumableTransfersAsync()) +{ + // Resume the transfer + if (properties.SourceUri.AbsoluteUri == "https://storageaccount.blob.core.windows.net/containername/blobpath") + { + await transferManager.ResumeTransferAsync(properties.TransferId); + } +} +``` + +For more information regarding pause, resume, and/or checkpointing, see [Pause and Resume Checkpointing](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md). + ## Troubleshooting See [Handling Failed Transfers](#handling-failed-transfers) and [Enabling Logging](https://learn.microsoft.com/dotnet/azure/sdk/logging) to assist with any troubleshooting. +See [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. + ## Next steps Get started with our [Blob DataMovement samples][blob_samples]. @@ -198,8 +220,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Common%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs index 2e53b233f70d..bc3864e92c26 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net6.0.cs @@ -8,23 +8,20 @@ public ShareDirectoryClientTransferOptions() { } } public partial class ShareFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public ShareFilesStorageResourceProvider() { } public ShareFilesStorageResourceProvider(Azure.AzureSasCredential credential) { } public ShareFilesStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public ShareFilesStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public ShareFilesStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public ShareFilesStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromDirectory(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromFile(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.ValueTask FromDirectoryAsync(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask FromFileAsync(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class ShareFileStorageResourceOptions { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net8.0.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net8.0.cs index 2e53b233f70d..bc3864e92c26 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net8.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.net8.0.cs @@ -8,23 +8,20 @@ public ShareDirectoryClientTransferOptions() { } } public partial class ShareFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public ShareFilesStorageResourceProvider() { } public ShareFilesStorageResourceProvider(Azure.AzureSasCredential credential) { } public ShareFilesStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public ShareFilesStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public ShareFilesStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public ShareFilesStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromDirectory(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromFile(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.ValueTask FromDirectoryAsync(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask FromFileAsync(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class ShareFileStorageResourceOptions { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs index 2e53b233f70d..bc3864e92c26 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/api/Azure.Storage.DataMovement.Files.Shares.netstandard2.0.cs @@ -8,23 +8,20 @@ public ShareDirectoryClientTransferOptions() { } } public partial class ShareFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public ShareFilesStorageResourceProvider() { } public ShareFilesStorageResourceProvider(Azure.AzureSasCredential credential) { } public ShareFilesStorageResourceProvider(Azure.Core.TokenCredential credential) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetAzureSasCredential getAzureSasCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) { } - public ShareFilesStorageResourceProvider(Azure.Storage.DataMovement.Files.Shares.ShareFilesStorageResourceProvider.GetTokenCredential getTokenCredentialAsync) { } public ShareFilesStorageResourceProvider(Azure.Storage.StorageSharedKeyCredential credential) { } + public ShareFilesStorageResourceProvider(System.Func> getAzureSasCredentialAsync) { } + public ShareFilesStorageResourceProvider(System.Func> getStorageSharedKeyCredentialAsync) { } protected override string ProviderId { get { throw null; } } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromDirectory(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - public Azure.Storage.DataMovement.StorageResource FromFile(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } - protected override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public delegate Azure.AzureSasCredential GetAzureSasCredential(System.Uri uri, bool readOnly); - public delegate Azure.Storage.StorageSharedKeyCredential GetStorageSharedKeyCredential(System.Uri uri, bool readOnly); - public delegate Azure.Core.TokenCredential GetTokenCredential(System.Uri uri, bool readOnly); + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareDirectoryClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + public static Azure.Storage.DataMovement.StorageResource FromClient(Azure.Storage.Files.Shares.ShareFileClient client, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public System.Threading.Tasks.ValueTask FromDirectoryAsync(System.Uri directoryUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.ValueTask FromFileAsync(System.Uri fileUri, Azure.Storage.DataMovement.Files.Shares.ShareFileStorageResourceOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public partial class ShareFileStorageResourceOptions { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json index 778a432c6aad..a584cf9a52f4 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.DataMovement.Files.Shares", - "Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_91bd99f1ca" + "Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_f8e20fac90" } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs index 0a52516dc0e3..323bfae88b09 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs @@ -9,6 +9,8 @@ using Azure.Identity; using Azure.Storage.Files.Shares; using Azure.Storage.Sas; +using System.Threading; +using System.Collections.Generic; namespace Azure.Storage.DataMovement.Files.Shares.Samples { @@ -37,9 +39,6 @@ public async Task ResourceConstructionDemonstration() TransferManager transferManager = new TransferManager(); - // Get local filesystem provider - LocalFilesStorageResourceProvider files = new(); - // Get shares provider with credential #region Snippet:MakeProvider_TokenCredential_Shares ShareFilesStorageResourceProvider shares = new(tokenCredential); @@ -47,11 +46,11 @@ public async Task ResourceConstructionDemonstration() // Construct simple share file resources for data movement #region Snippet:ResourceConstruction_Shares - StorageResource directory = shares.FromDirectory( + StorageResource directory = await shares.FromDirectoryAsync( new Uri("http://myaccount.files.core.windows.net/share/path/to/directory")); - StorageResource rootDirectory = shares.FromDirectory( + StorageResource rootDirectory = await shares.FromDirectoryAsync( new Uri("http://myaccount.files.core.windows.net/share")); - StorageResource file = shares.FromFile( + StorageResource file = await shares.FromFileAsync( new Uri("http://myaccount.files.core.windows.net/share/path/to/file.txt")); #endregion } @@ -59,15 +58,14 @@ public async Task ResourceConstructionDemonstration() ShareDirectoryClient directoryClient = shareClient.GetRootDirectoryClient(); ShareFileClient fileClient = directoryClient.GetFileClient("example.txt"); #region Snippet:ResourceConstruction_FromClients_Shares - ShareFilesStorageResourceProvider shares = new(); - StorageResource shareDirectoryResource = shares.FromClient(directoryClient); - StorageResource shareFileResource = shares.FromClient(fileClient); + StorageResource shareDirectoryResource = ShareFilesStorageResourceProvider.FromClient(directoryClient); + StorageResource shareFileResource = ShareFilesStorageResourceProvider.FromClient(fileClient); #endregion } { StorageSharedKeyCredential sharedKeyCredential = new(StorageAccountName, StorageAccountKey); // Get shares provider with credential - AzureSasCredential GenerateSas(Uri uri, bool readOnly) + ValueTask GenerateSas(Uri uri, CancellationToken cancellationToken) { // Quick sample demonstrating minimal steps // Construct your SAS according to your needs @@ -77,7 +75,7 @@ AzureSasCredential GenerateSas(Uri uri, bool readOnly) ShareName = pathUri.ShareName, FilePath = pathUri.DirectoryOrFilePath, }; - return new AzureSasCredential(sas.ToSasQueryParameters(sharedKeyCredential).ToString()); + return new ValueTask(new AzureSasCredential(sas.ToSasQueryParameters(sharedKeyCredential).ToString())); } ShareFilesStorageResourceProvider shares = new(GenerateSas); } @@ -102,27 +100,26 @@ public async Task Upload() await share.CreateIfNotExistsAsync(); try { - ShareFilesStorageResourceProvider shares = new(new StorageSharedKeyCredential(StorageAccountName, StorageAccountKey)); - LocalFilesStorageResourceProvider files = new(); - // Get a reference to a destination share file/directory Uri destinationFolderUri = share.GetDirectoryClient("sample-directory").Uri; Uri destinationFileUri = share.GetRootDirectoryClient().GetFileClient("sample-file").Uri; - TransferManager transferManager = new TransferManager(new TransferManagerOptions()); // Create simple transfer single share file upload job #region Snippet:SimplefileUpload_Shares + TokenCredential tokenCredential = new DefaultAzureCredential(); + ShareFilesStorageResourceProvider shares = new(tokenCredential); + TransferManager transferManager = new TransferManager(new TransferManagerOptions()); TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalFile), - destinationResource: shares.FromFile(destinationFileUri)); + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalFile), + destinationResource: await shares.FromFileAsync(destinationFileUri)); await fileTransfer.WaitForCompletionAsync(); #endregion // Create simple transfer single share directory upload job #region Snippet:SimpleDirectoryUpload_Shares TransferOperation folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromDirectory(sourceLocalDirectory), - destinationResource: shares.FromDirectory(destinationFolderUri)); + sourceResource: LocalFilesStorageResourceProvider.FromDirectory(sourceLocalDirectory), + destinationResource: await shares.FromDirectoryAsync(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); #endregion } @@ -147,7 +144,6 @@ public async Task Download() try { ShareFilesStorageResourceProvider shares = new(new StorageSharedKeyCredential(StorageAccountName, StorageAccountKey)); - LocalFilesStorageResourceProvider files = new(); // Get a reference to a destination share file/directory Uri sourceDirectoryUri = share.GetDirectoryClient("sample-directory").Uri; @@ -157,16 +153,16 @@ public async Task Download() // Create simple transfer single share file upload job #region Snippet:SimpleFileDownload_Shares TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromFile(sourceFileUri), - destinationResource: files.FromFile(destinationLocalFile)); + sourceResource: await shares.FromFileAsync(sourceFileUri), + destinationResource: LocalFilesStorageResourceProvider.FromFile(destinationLocalFile)); await fileTransfer.WaitForCompletionAsync(); #endregion // Create simple transfer single share directory upload job #region Snippet:SimpleDirectoryDownload_Shares TransferOperation directoryTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromDirectory(sourceDirectoryUri), - destinationResource: files.FromDirectory(destinationLocalDirectory)); + sourceResource: await shares.FromDirectoryAsync(sourceDirectoryUri), + destinationResource: LocalFilesStorageResourceProvider.FromDirectory(destinationLocalDirectory)); await directoryTransfer.WaitForCompletionAsync(); #endregion } @@ -199,16 +195,16 @@ public async Task Copy() // Create simple transfer single share file upload job #region Snippet:s2sCopyFile_Shares TransferOperation fileTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromFile(sourceFileUri), - destinationResource: shares.FromFile(destinationFileUri)); + sourceResource: await shares.FromFileAsync(sourceFileUri), + destinationResource: await shares.FromFileAsync(destinationFileUri)); await fileTransfer.WaitForCompletionAsync(); #endregion // Create simple transfer single share directory upload job #region Snippet:s2sCopyDirectory_Shares TransferOperation directoryTransfer = await transferManager.StartTransferAsync( - sourceResource: shares.FromDirectory(sourceDirectoryUri), - destinationResource: shares.FromDirectory(destinationDirectoryUri)); + sourceResource: await shares.FromDirectoryAsync(sourceDirectoryUri), + destinationResource: await shares.FromDirectoryAsync(destinationDirectoryUri)); await directoryTransfer.WaitForCompletionAsync(); #endregion } @@ -218,6 +214,27 @@ public async Task Copy() } } + public async Task ResumeTransfersStoredAsync() + { + #region Snippet:TransferManagerResumeTransfers_Shares + TokenCredential tokenCredential = new DefaultAzureCredential(); + ShareFilesStorageResourceProvider shares = new(tokenCredential); + TransferManager transferManager = new TransferManager(new TransferManagerOptions() + { + ProvidersForResuming = new List() { shares } + }); + // Get resumable transfers from transfer manager + await foreach (TransferProperties properties in transferManager.GetResumableTransfersAsync()) + { + // Resume the transfer + if (properties.SourceUri.AbsoluteUri == "https://storageaccount.blob.core.windows.net/containername/blobpath") + { + await transferManager.ResumeTransferAsync(properties.TransferId); + } + } + #endregion + } + public async Task CreateFileShareTestDirectory(ShareClient client, int depth = 0, string basePath = default) { basePath = basePath ?? Path.GetTempFileName(); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj index 2c7815d0ca81..f8f0c2c75bca 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/Azure.Storage.DataMovement.Files.Shares.csproj @@ -1,11 +1,12 @@ - + $(RequiredTargetFrameworks);net6.0 + true true Microsoft Azure.Storage.DataMovement.Files.Shares client library - 12.0.0-beta.4 + 12.0.0 ShareDataMovementSDK;$(DefineConstants) Microsoft Azure Storage DataMovement Files AzureStorage AzureFiles azureofficial diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/DataMovementSharesExtensions.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/DataMovementSharesExtensions.cs index 93c1f19286c9..d2fe66309a32 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/DataMovementSharesExtensions.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/DataMovementSharesExtensions.cs @@ -118,6 +118,35 @@ public static FileSmbProperties GetFileSmbProperties( }; } + public static FileSmbProperties GetFileSmbProperties( + this ShareFileStorageResourceOptions options, + StorageResourceItemProperties properties) + { + return new() + { + FileAttributes = (options?._isFileAttributesSet ?? false) + ? options?.FileAttributes + : properties?.RawProperties?.TryGetValue(DataMovementConstants.ResourceProperties.FileAttributes, out object fileAttributes) == true + ? (NtfsFileAttributes?)fileAttributes + : default, + FileCreatedOn = (options?._isFileCreatedOnSet ?? false) + ? options?.FileCreatedOn + : properties?.RawProperties?.TryGetValue(DataMovementConstants.ResourceProperties.CreationTime, out object fileCreatedOn) == true + ? (DateTimeOffset?)fileCreatedOn + : default, + FileLastWrittenOn = (options?._isFileLastWrittenOnSet ?? false) + ? options?.FileLastWrittenOn + : properties?.RawProperties?.TryGetValue(DataMovementConstants.ResourceProperties.LastWrittenOn, out object fileLastWrittenOn) == true + ? (DateTimeOffset?)fileLastWrittenOn + : default, + FileChangedOn = (options?._isFileChangedOnSet ?? false) + ? options?.FileChangedOn + : properties?.RawProperties?.TryGetValue(DataMovementConstants.ResourceProperties.ChangedOnTime, out object fileChangedOn) == true + ? (DateTimeOffset?)fileChangedOn + : default, + }; + } + internal static ShareFileUploadRangeOptions ToShareFileUploadRangeOptions( this ShareFileStorageResourceOptions options) => new() diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryClientExtensions.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryClientExtensions.cs index 1e662b3ea9d2..7c80d5b0245c 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryClientExtensions.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryClientExtensions.cs @@ -15,8 +15,6 @@ namespace Azure.Storage.Files.Shares public static class ShareDirectoryClientExtensions { private static Lazy s_defaultTransferManager = new(() => new TransferManager(default)); - private static Lazy s_localFilesProvider = new(); - private static Lazy s_shareFilesProvider = new(); /// /// Uploads the entire contents of local directory to the share directory. @@ -47,8 +45,8 @@ public static async Task UploadDirectoryAsync( ShareDirectoryClientTransferOptions options = default, CancellationToken cancellationToken = default) { - StorageResource localDirectory = s_localFilesProvider.Value.FromDirectory(localDirectoryPath); - StorageResource shareDirectory = s_shareFilesProvider.Value.FromClient(client, options?.ShareDirectoryOptions); + StorageResource localDirectory = LocalFilesStorageResourceProvider.FromDirectory(localDirectoryPath); + StorageResource shareDirectory = ShareFilesStorageResourceProvider.FromClient(client, options?.ShareDirectoryOptions); TransferOperation trasnfer = await s_defaultTransferManager.Value.StartTransferAsync( localDirectory, @@ -92,8 +90,8 @@ public static async Task DownloadToDirectoryAsync( ShareDirectoryClientTransferOptions options = default, CancellationToken cancellationToken = default) { - StorageResource localDirectory = s_localFilesProvider.Value.FromDirectory(localDirectoryPath); - StorageResource shareDirectory = s_shareFilesProvider.Value.FromClient(client, options?.ShareDirectoryOptions); + StorageResource localDirectory = LocalFilesStorageResourceProvider.FromDirectory(localDirectoryPath); + StorageResource shareDirectory = ShareFilesStorageResourceProvider.FromClient(client, options?.ShareDirectoryOptions); TransferOperation trasnfer = await s_defaultTransferManager.Value.StartTransferAsync( shareDirectory, diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryStorageResourceContainer.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryStorageResourceContainer.cs index afbf94d1481d..210c88983c69 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryStorageResourceContainer.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareDirectoryStorageResourceContainer.cs @@ -16,7 +16,7 @@ namespace Azure.Storage.DataMovement.Files.Shares internal class ShareDirectoryStorageResourceContainer : StorageResourceContainerInternal { internal ShareFileStorageResourceOptions ResourceOptions { get; set; } - internal PathScanner PathScanner { get; set; } = PathScanner.Singleton.Value; + internal SharesPathScanner PathScanner { get; set; } = SharesPathScanner.Singleton.Value; internal ShareDirectoryClient ShareDirectoryClient { get; } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFileStorageResource.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFileStorageResource.cs index d24d9e6c3729..d09d06a40fb7 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFileStorageResource.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFileStorageResource.cs @@ -30,8 +30,6 @@ internal class ShareFileStorageResource : StorageResourceItemInternal protected override long MaxSupportedSingleTransferSize => DataMovementShareConstants.MaxRange; - protected override long MaxSupportedSingleTransferSize => DataMovementShareConstants.MaxRange; - protected override long MaxSupportedChunkSize => DataMovementShareConstants.MaxRange; protected override long? Length => ResourceProperties?.ResourceLength; @@ -82,6 +80,12 @@ internal async Task CreateAsync( IDictionary metadata = _options?.GetFileMetadata(properties?.RawProperties); string filePermission = _options?.GetFilePermission(properties?.RawProperties); FileSmbProperties smbProperties = _options?.GetFileSmbProperties(properties, _destinationPermissionKey); + // if transfer is not empty and File Attribute contains ReadOnly, we should not set it before creating the file. + if ((properties == null || properties.ResourceLength > 0) && IsReadOnlySet(smbProperties.FileAttributes)) + { + smbProperties.FileAttributes = default; + } + await ShareFileClient.CreateAsync( maxSize: maxSize, httpHeaders: httpHeaders, @@ -92,13 +96,34 @@ await ShareFileClient.CreateAsync( cancellationToken: cancellationToken).ConfigureAwait(false); } - protected override Task CompleteTransferAsync( + private bool IsReadOnlySet(NtfsFileAttributes? fileAttributes) + { + return fileAttributes?.HasFlag(NtfsFileAttributes.ReadOnly) ?? false; + } + + protected override async Task CompleteTransferAsync( bool overwrite, StorageResourceCompleteTransferOptions completeTransferOptions, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); - return Task.CompletedTask; + + StorageResourceItemProperties sourceProperties = completeTransferOptions?.SourceProperties; + FileSmbProperties smbProperties = _options?.GetFileSmbProperties(sourceProperties); + // Call Set Properties + // if transfer is not empty and original File Attribute contains ReadOnly + // or if FileChangedOn is to be preserved or manually set + if (((sourceProperties == null || sourceProperties.ResourceLength > 0) && IsReadOnlySet(smbProperties.FileAttributes)) + || (_options?._isFileChangedOnSet == false || _options?.FileChangedOn != null)) + { + ShareFileHttpHeaders httpHeaders = _options?.GetShareFileHttpHeaders(sourceProperties?.RawProperties); + await ShareFileClient.SetHttpHeadersAsync(new() + { + HttpHeaders = httpHeaders, + SmbProperties = smbProperties, + }, + cancellationToken: cancellationToken).ConfigureAwait(false); + } } protected override async Task CopyBlockFromUriAsync( diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs index 1227464a7edb..ab1dbf9455d6 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; +using System.ComponentModel; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -17,39 +17,6 @@ namespace Azure.Storage.DataMovement.Files.Shares /// public class ShareFilesStorageResourceProvider : StorageResourceProvider { - /// - /// Delegate for fetching a shared key credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate StorageSharedKeyCredential GetStorageSharedKeyCredential(Uri uri, bool readOnly); - - /// - /// Delegate for fetching a token credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate TokenCredential GetTokenCredential(Uri uri, bool readOnly); - - /// - /// Delegate for fetching a SAS credential for a given URI. - /// - /// - /// URI of resource to fetch credential for. - /// - /// - /// Whether the permission can be read-only. - /// - public delegate AzureSasCredential GetAzureSasCredential(Uri uri, bool readOnly); - private enum ResourceType { Unknown = 0, @@ -70,19 +37,11 @@ private enum CredentialType protected override string ProviderId => "share"; private readonly CredentialType _credentialType; - private readonly GetStorageSharedKeyCredential _getStorageSharedKeyCredential; - private readonly GetTokenCredential _getTokenCredential; - private readonly GetAzureSasCredential _getAzureSasCredential; + private readonly TokenCredential _tokenCredential; + private readonly Func> _getStorageSharedKeyCredential; + private readonly Func> _getAzureSasCredential; #region ctors - /// - /// Default constrctor. - /// - public ShareFilesStorageResourceProvider() - { - _credentialType = CredentialType.None; - } - /// /// /// Constructs this provider to use the given credential when making a new File Share @@ -102,7 +61,7 @@ public ShareFilesStorageResourceProvider() public ShareFilesStorageResourceProvider(StorageSharedKeyCredential credential) { _credentialType = CredentialType.SharedKey; - _getStorageSharedKeyCredential = (_, _) => credential; + _getStorageSharedKeyCredential = (_, _) => new ValueTask(credential); } /// @@ -124,7 +83,7 @@ public ShareFilesStorageResourceProvider(StorageSharedKeyCredential credential) public ShareFilesStorageResourceProvider(TokenCredential credential) { _credentialType = CredentialType.Token; - _getTokenCredential = (_, _) => credential; + _tokenCredential = credential; } /// @@ -148,7 +107,7 @@ public ShareFilesStorageResourceProvider(TokenCredential credential) public ShareFilesStorageResourceProvider(AzureSasCredential credential) { _credentialType = CredentialType.Sas; - _getAzureSasCredential = (_, _) => credential; + _getAzureSasCredential = (_, _) => new ValueTask(credential); } /// @@ -157,7 +116,7 @@ public ShareFilesStorageResourceProvider(AzureSasCredential credential) /// see cref="StorageResource"/>. /// /// - /// This instance will use the given to fetch a credential + /// This instance will use the given callback to fetch a credential /// when constructing the underlying Azure.Storage.Files.Shares client, e.g. /// . /// The delegate will only be used when the provider needs to construct a client in the first place. It will @@ -166,9 +125,9 @@ public ShareFilesStorageResourceProvider(AzureSasCredential credential) /// /// /// - /// Delegate for acquiring a credential. + /// Callback for acquiring a credential for the given Uri. /// - public ShareFilesStorageResourceProvider(GetStorageSharedKeyCredential getStorageSharedKeyCredentialAsync) + public ShareFilesStorageResourceProvider(Func> getStorageSharedKeyCredentialAsync) { _credentialType = CredentialType.SharedKey; _getStorageSharedKeyCredential = getStorageSharedKeyCredentialAsync; @@ -180,30 +139,7 @@ public ShareFilesStorageResourceProvider(GetStorageSharedKeyCredential getStorag /// . /// /// - /// This instance will use the given to fetch a credential - /// when constructing the underlying Azure.Storage.Files.Shares client, e.g. - /// . - /// The delegate will only be used when the provider needs to construct a client in the first place. It will - /// not be used when creating a from a pre-existing client, e.g. - /// . - /// - /// - /// - /// Delegate for acquiring a credential. - /// - public ShareFilesStorageResourceProvider(GetTokenCredential getTokenCredentialAsync) - { - _credentialType = CredentialType.SharedKey; - _getTokenCredential = getTokenCredentialAsync; - } - - /// - /// - /// Constructs this provider to use the given delegate for acquiring a credential when making a new File Share - /// . - /// - /// - /// This instance will use the given to fetch a credential + /// This instance will use the given callback to fetch a credential /// when constructing the underlying Azure.Storage.Files.Shares client, e.g. /// . /// The delegate will only be used when the provider needs to construct a client in the first place. It will @@ -214,28 +150,29 @@ public ShareFilesStorageResourceProvider(GetTokenCredential getTokenCredentialAs /// /// /// - /// Delegate for acquiring a credential. + /// Callback for acquiring a credential for the given Uri. /// - public ShareFilesStorageResourceProvider(GetAzureSasCredential getAzureSasCredentialAsync) + public ShareFilesStorageResourceProvider(Func> getAzureSasCredentialAsync) { - _credentialType = CredentialType.SharedKey; + _credentialType = CredentialType.Sas; _getAzureSasCredential = getAzureSasCredentialAsync; } #endregion #region Abstract Class Implementation /// - protected override Task FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) + [EditorBrowsable(EditorBrowsableState.Never)] + protected override async ValueTask FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) { // Source share file data currently empty, so no specific properties to grab - - return Task.FromResult(properties.IsContainer - ? FromDirectory(properties.SourceUri) - : FromFile(properties.SourceUri)); + return properties.IsContainer + ? await FromDirectoryAsync(properties.SourceUri).ConfigureAwait(false) + : await FromFileAsync(properties.SourceUri).ConfigureAwait(false); } /// - protected override Task FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) + [EditorBrowsable(EditorBrowsableState.Never)] + protected override async ValueTask FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) { ShareFileDestinationCheckpointDetails checkpointDetails; using (MemoryStream stream = new(properties.DestinationCheckpointDetails)) @@ -269,9 +206,9 @@ protected override Task FromDestinationAsync(TransferProperties FileMetadata = checkpointDetails.FileMetadata, _isFileMetadataSet = checkpointDetails.IsFileMetadataSet, }; - return Task.FromResult(properties.IsContainer - ? FromDirectory(properties.DestinationUri, options) - : FromFile(properties.DestinationUri, options)); + return properties.IsContainer + ? await FromDirectoryAsync(properties.DestinationUri, options).ConfigureAwait(false) + : await FromFileAsync(properties.DestinationUri, options).ConfigureAwait(false); } /// @@ -303,20 +240,28 @@ internal async Task FromDestinationInternalHookAsync( /// /// Options for creating the storage resource. /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// /// /// The configured storage resource. /// - public StorageResource FromDirectory(Uri directoryUri, ShareFileStorageResourceOptions options = default) + public async ValueTask FromDirectoryAsync( + Uri directoryUri, + ShareFileStorageResourceOptions options = default, + CancellationToken cancellationToken = default) { + CancellationHelper.ThrowIfCancellationRequested(cancellationToken); ShareDirectoryClient client = _credentialType switch { CredentialType.None => new ShareDirectoryClient(directoryUri), - CredentialType.SharedKey => new ShareDirectoryClient(directoryUri, _getStorageSharedKeyCredential(directoryUri, false)), + CredentialType.SharedKey => new ShareDirectoryClient(directoryUri, await _getStorageSharedKeyCredential(directoryUri, cancellationToken).ConfigureAwait(false)), CredentialType.Token => new ShareDirectoryClient( directoryUri, - _getTokenCredential(directoryUri, false), + _tokenCredential, new ShareClientOptions { ShareTokenIntent = ShareTokenIntent.Backup }), - CredentialType.Sas => new ShareDirectoryClient(directoryUri, _getAzureSasCredential(directoryUri, false)), + CredentialType.Sas => new ShareDirectoryClient(directoryUri, await _getAzureSasCredential(directoryUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new ShareDirectoryStorageResourceContainer(client, options); @@ -331,22 +276,28 @@ public StorageResource FromDirectory(Uri directoryUri, ShareFileStorageResourceO /// /// Options for creating the storage resource. /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// /// /// The configured storage resource. /// - public StorageResource FromFile( + public async ValueTask FromFileAsync( Uri fileUri, - ShareFileStorageResourceOptions options = default) + ShareFileStorageResourceOptions options = default, + CancellationToken cancellationToken = default) { + CancellationHelper.ThrowIfCancellationRequested(cancellationToken); ShareFileClient client = _credentialType switch { CredentialType.None => new ShareFileClient(fileUri), - CredentialType.SharedKey => new ShareFileClient(fileUri, _getStorageSharedKeyCredential(fileUri, false)), + CredentialType.SharedKey => new ShareFileClient(fileUri, await _getStorageSharedKeyCredential(fileUri, cancellationToken).ConfigureAwait(false)), CredentialType.Token => new ShareFileClient( fileUri, - _getTokenCredential(fileUri, false), + _tokenCredential, new ShareClientOptions { ShareTokenIntent = ShareTokenIntent.Backup }), - CredentialType.Sas => new ShareFileClient(fileUri, _getAzureSasCredential(fileUri, false)), + CredentialType.Sas => new ShareFileClient(fileUri, await _getAzureSasCredential(fileUri, cancellationToken).ConfigureAwait(false)), _ => throw BadCredentialTypeException(_credentialType), }; return new ShareFileStorageResource(client, options); @@ -368,7 +319,7 @@ public StorageResource FromFile( /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( ShareDirectoryClient client, ShareFileStorageResourceOptions options = default) { @@ -389,7 +340,7 @@ public StorageResource FromClient( /// /// The configured storage resource. /// - public StorageResource FromClient( + public static StorageResource FromClient( ShareFileClient client, ShareFileStorageResourceOptions options = default) { @@ -397,10 +348,6 @@ public StorageResource FromClient( } #endregion - private static ArgumentException BadResourceTypeException(ResourceType resourceType) - => new ArgumentException( - $"No support for resource type {Enum.GetName(typeof(ResourceType), resourceType)}."); - private static ArgumentException BadCredentialTypeException(CredentialType credentialType) => new ArgumentException( $"No support for credential type {Enum.GetName(typeof(CredentialType), credentialType)}."); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/PathScanner.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/SharesPathScanner.cs similarity index 95% rename from sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/PathScanner.cs rename to sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/SharesPathScanner.cs index f874b488e2ac..aa3791693210 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/PathScanner.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/SharesPathScanner.cs @@ -13,9 +13,9 @@ namespace Azure.Storage.DataMovement.Files.Shares { - internal class PathScanner + internal class SharesPathScanner { - public static Lazy Singleton { get; } = new Lazy(() => new PathScanner()); + public static Lazy Singleton { get; } = new Lazy(() => new SharesPathScanner()); public virtual async IAsyncEnumerable ScanAsync( ShareDirectoryClient sourceDirectory, diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj index 1e90788ea584..517ed4bdce44 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/Azure.Storage.DataMovement.Files.Shares.Tests.csproj @@ -10,7 +10,6 @@ DMShare - BaseShares @@ -35,9 +34,6 @@ - - - @@ -51,6 +47,8 @@ + + diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/PathScannerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/PathScannerTests.cs index 4e01b92219ee..ab127b1c39b1 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/PathScannerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/PathScannerTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -13,6 +14,7 @@ using Moq; using Moq.Protected; using NUnit.Framework; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { @@ -59,7 +61,7 @@ public async Task PathScannerFindsAllRecursive(string baseDirName) List files = new(); List directories = new(); await foreach (StorageResource storageResource - in new PathScanner().ScanAsync( + in new SharesPathScanner().ScanAsync( sourceDirectory: sourceDirectory.Object, destinationShare: destinationShare.Object, sourceOptions: default, @@ -132,7 +134,7 @@ public async Task PathScannerFindsAllRecursive_Traits() List directories = new(); ShareFileTraits traits = ShareFileTraits.Attributes | ShareFileTraits.PermissionKey; await foreach (StorageResource storageResource - in new PathScanner().ScanAsync( + in new SharesPathScanner().ScanAsync( sourceDirectory: mockDirectory.Object, destinationShare: mockDestinationShare.Object, sourceOptions: default, diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/RehydrateShareResourceTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/RehydrateShareResourceTests.cs index 6f7fa1b5405a..a2e5afba27c8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/RehydrateShareResourceTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/RehydrateShareResourceTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -11,11 +12,15 @@ using Azure.Storage.Tests; using Moq; using NUnit.Framework; +using Azure.Core; +using Azure.Identity; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { public class RehydrateShareResourceTests { + private TokenCredential _tokenCredential = new DefaultAzureCredential(); public const string ShareProviderId = "share"; private static byte[] GetBytes(StorageResourceCheckpointDetailsInternal checkpointDetails) @@ -25,6 +30,20 @@ private static byte[] GetBytes(StorageResourceCheckpointDetailsInternal checkpoi return stream.ToArray(); } + private static byte[] GetBytesSource(ShareFileSourceCheckpointDetails checkpointDetails) + { + using MemoryStream stream = new(); + checkpointDetails.SerializeInternal(stream); + return stream.ToArray(); + } + + private static byte[] GetBytesDestination(ShareFileDestinationCheckpointDetails checkpointDetails) + { + using MemoryStream stream = new(); + checkpointDetails.SerializeInternal(stream); + return stream.ToArray(); + } + private static Mock GetProperties( string transferId, string sourcePath, @@ -41,8 +60,8 @@ private static Mock GetProperties( mock.Setup(p => p.DestinationUri).Returns(new Uri(destinationPath)); mock.Setup(p => p.SourceProviderId).Returns(sourceProviderId); mock.Setup(p => p.DestinationProviderId).Returns(destinationProviderId); - mock.Setup(p => p.SourceCheckpointDetails).Returns(GetBytes(sourceCheckpointDetails)); - mock.Setup(p => p.DestinationCheckpointDetails).Returns(GetBytes(destinationCheckpointDetails)); + mock.Setup(p => p.SourceCheckpointDetails).Returns(GetBytesSource(sourceCheckpointDetails)); + mock.Setup(p => p.DestinationCheckpointDetails).Returns(GetBytesDestination(destinationCheckpointDetails)); mock.Setup(p => p.IsContainer).Returns(isContainer); return mock; } @@ -67,8 +86,8 @@ public async Task RehydrateFile( new ShareFileDestinationCheckpointDetails(false, null, false, null, false, null, false, null, false, null, false, null, false, false, null, false, null, false, null, false, null, false, null)).Object; StorageResource storageResource = isSource - ? await new ShareFilesStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new ShareFilesStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new ShareFilesStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new ShareFilesStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.That(originalPath, Is.EqualTo(storageResource.Uri.AbsoluteUri)); Assert.That(storageResource, Is.TypeOf()); @@ -123,7 +142,7 @@ public async Task RehydrateFile_DestinationOptions() originalDestinationData).Object; ShareFileStorageResource storageResource = (ShareFileStorageResource) - await new ShareFilesStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + await new ShareFilesStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.That(destinationPath, Is.EqualTo(storageResource.Uri.AbsoluteUri)); Assert.That(storageResource, Is.TypeOf()); @@ -181,8 +200,8 @@ public async Task RehydrateDirectory( new ShareFileDestinationCheckpointDetails(false, null, false, null, false, null, false, null, false, null, false, null, false, false, null, false, null, false, null, false, null, false, null)).Object; StorageResource storageResource = isSource - ? await new ShareFilesStorageResourceProvider().FromSourceInternalHookAsync(transferProperties) - : await new ShareFilesStorageResourceProvider().FromDestinationInternalHookAsync(transferProperties); + ? await new ShareFilesStorageResourceProvider(_tokenCredential).FromSourceInternalHookAsync(transferProperties) + : await new ShareFilesStorageResourceProvider(_tokenCredential).FromDestinationInternalHookAsync(transferProperties); Assert.That(originalPath, Is.EqualTo(storageResource.Uri.AbsoluteUri)); Assert.That(storageResource, Is.TypeOf()); diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDestinationCheckpointDetailsTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDestinationCheckpointDetailsTests.cs index fe4274a45f49..e458cd51dbe7 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDestinationCheckpointDetailsTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDestinationCheckpointDetailsTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -10,6 +11,7 @@ using Azure.Storage.Test; using NUnit.Framework; using Metadata = System.Collections.Generic.IDictionary; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryClientExtensionsTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryClientExtensionsTests.cs index 718ae8f40558..1eac747deaf2 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryClientExtensionsTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryClientExtensionsTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.IO; @@ -8,8 +9,10 @@ using System.Threading; using System.Threading.Tasks; using BaseShares::Azure.Storage.Files.Shares; +using DMShare::Azure.Storage.Files.Shares; using Moq; using NUnit.Framework; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { @@ -31,9 +34,9 @@ public void Setup() It.IsAny(), It.IsAny())); - _backupTransferManagerValue = (Lazy)typeof(Storage.Files.Shares.ShareDirectoryClientExtensions) + _backupTransferManagerValue = (Lazy)typeof(ShareDirectoryClientExtensions) .GetField("s_defaultTransferManager", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null); - typeof(Storage.Files.Shares.ShareDirectoryClientExtensions) + typeof(ShareDirectoryClientExtensions) .GetField("s_defaultTransferManager", BindingFlags.NonPublic | BindingFlags.Static) .SetValue(null, new Lazy(() => ExtensionMockTransferManager.Object)); } @@ -41,7 +44,7 @@ public void Setup() [TearDown] public void Teardown() { - typeof(Storage.Files.Shares.ShareDirectoryClientExtensions) + typeof(ShareDirectoryClientExtensions) .GetField("s_defaultTransferManager", BindingFlags.NonPublic | BindingFlags.Static) .SetValue(null, _backupTransferManagerValue); } @@ -59,7 +62,7 @@ public async Task StartUploadDirectory([Values(true, false)] bool useOptions) string localPath = Path.GetTempPath(); Mock clientMock = new(); - await Storage.Files.Shares.ShareDirectoryClientExtensions.UploadDirectoryAsync( + await ShareDirectoryClientExtensions.UploadDirectoryAsync( clientMock.Object, WaitUntil.Started, localPath, @@ -88,7 +91,7 @@ public async Task StartDownloadDirectory([Values(true, false)] bool useOptions) string localPath = Path.GetTempPath(); Mock clientMock = new(); - await Storage.Files.Shares.ShareDirectoryClientExtensions.DownloadToDirectoryAsync( + await ShareDirectoryClientExtensions.DownloadToDirectoryAsync( clientMock.Object, WaitUntil.Started, localPath, diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferCopyTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferCopyTests.cs index d96a77f3617b..64d471f5432a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferCopyTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferCopyTests.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; -using Azure.Core.TestFramework; using Azure.Storage.DataMovement.Tests; using BaseShares::Azure.Storage.Files.Shares; using BaseShares::Azure.Storage.Files.Shares.Models; @@ -18,6 +18,7 @@ using System.Threading; using Azure.Core; using Metadata = System.Collections.Generic.IDictionary; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { @@ -285,6 +286,7 @@ protected async Task VerifyPropertiesCopyAsync( Assert.AreEqual(_defaultContentType, destinationProperties.ContentType); Assert.AreEqual(_defaultFileCreatedOn, destinationProperties.SmbProperties.FileCreatedOn); Assert.AreEqual(_defaultFileLastWrittenOn, destinationProperties.SmbProperties.FileLastWrittenOn); + Assert.AreEqual(_defaultFileChangedOn, destinationProperties.SmbProperties.FileChangedOn); } else if (transferPropertiesTestType == TransferPropertiesTestType.Preserve) { @@ -298,6 +300,7 @@ protected async Task VerifyPropertiesCopyAsync( Assert.AreEqual(sourceProperties.ContentType, destinationProperties.ContentType); Assert.AreEqual(sourceProperties.SmbProperties.FileCreatedOn, destinationProperties.SmbProperties.FileCreatedOn); Assert.AreEqual(sourceProperties.SmbProperties.FileLastWrittenOn, destinationProperties.SmbProperties.FileLastWrittenOn); + Assert.AreEqual(sourceProperties.SmbProperties.FileChangedOn, destinationProperties.SmbProperties.FileChangedOn); // Check if the permissions are the same. Permission Keys will be different as they are defined by the share service. ShareClient sourceShareClient = sourceClient.GetParentShareClient(); @@ -319,6 +322,7 @@ protected async Task VerifyPropertiesCopyAsync( Assert.AreEqual(sourceProperties.ContentType, destinationProperties.ContentType); Assert.AreEqual(sourceProperties.SmbProperties.FileCreatedOn, destinationProperties.SmbProperties.FileCreatedOn); Assert.AreEqual(sourceProperties.SmbProperties.FileLastWrittenOn, destinationProperties.SmbProperties.FileLastWrittenOn); + Assert.AreEqual(sourceProperties.SmbProperties.FileChangedOn, destinationProperties.SmbProperties.FileChangedOn); } } @@ -364,70 +368,5 @@ private ShareFileStorageResourceOptions GetShareFileStorageResourceOptions(Trans } return options; } - - private async Task CopyRemoteObjects_VerifyProperties( - ShareClient sourceContainer, - ShareClient destinationContainer, - TransferPropertiesTestType propertiesType) - { - // Arrange - int size = Constants.KB; - string sourcePrefix = "sourceFolder"; - string destPrefix = "destFolder"; - await CreateDirectoryInSourceAsync(sourceContainer, sourcePrefix); - string itemName1 = string.Join("/", sourcePrefix, GetNewObjectName()); - string itemName2 = string.Join("/", sourcePrefix, GetNewObjectName()); - await CreateShareFileAsync(sourceContainer, size, itemName1, propertiesType: propertiesType); - await CreateShareFileAsync(sourceContainer, size, itemName2, propertiesType: propertiesType); - - string subDirName = string.Join("/", sourcePrefix, "bar"); - await CreateDirectoryInSourceAsync(sourceContainer, subDirName); - string itemName3 = string.Join("/", subDirName, GetNewObjectName()); - await CreateShareFileAsync(sourceContainer, size, itemName3, propertiesType: propertiesType); - - string subDirName2 = string.Join("/", sourcePrefix, "pik"); - await CreateDirectoryInSourceAsync(sourceContainer, subDirName2); - string itemName4 = string.Join("/", subDirName2, GetNewObjectName()); - await CreateShareFileAsync(sourceContainer, size, itemName4, propertiesType: propertiesType); - - await CreateDirectoryInDestinationAsync(destinationContainer, destPrefix); - - // Create storage resource containers - StorageResourceContainer sourceResource = - GetSourceStorageResourceContainer(sourceContainer, sourcePrefix); - StorageResourceContainer destinationResource = - GetDestinationStorageResourceContainer(destinationContainer, destPrefix, propertiesType); - - // Create Transfer Manager - TransferOptions options = new TransferOptions(); - TestEventsRaised testEventsRaised = new TestEventsRaised(options); - TransferManager transferManager = new TransferManager(); - - // Start transfer and await for completion. - TransferOperation transfer = await transferManager.StartTransferAsync( - sourceResource, - destinationResource, - options).ConfigureAwait(false); - - CancellationTokenSource tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); - await TestTransferWithTimeout.WaitForCompletionAsync( - transfer, - testEventsRaised, - tokenSource.Token); - - // Verify completion - Assert.NotNull(transfer); - Assert.IsTrue(transfer.HasCompleted); - Assert.AreEqual(TransferState.Completed, transfer.Status.State); - await testEventsRaised.AssertContainerCompletedCheck(4); - - // Assert - await VerifyResultsAsync( - sourceContainer, - sourcePrefix, - destinationContainer, - destPrefix, - propertiesType); - } } } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferDownloadTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferDownloadTests.cs index fe23b32bfb73..25d7845ab639 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferDownloadTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferDownloadTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -11,6 +12,7 @@ using Azure.Storage.DataMovement.Tests; using BaseShares::Azure.Storage.Files.Shares; using Azure.Storage.Test.Shared; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferUploadTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferUploadTests.cs index 17b957ec7127..d0a7f9c48229 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferUploadTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStartTransferUploadTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -10,6 +11,7 @@ using Azure.Storage.DataMovement.Tests; using BaseShares::Azure.Storage.Files.Shares; using Azure.Storage.Test.Shared; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStorageResourceContainerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStorageResourceContainerTests.cs index 3381c96c4266..6d58acb840d9 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStorageResourceContainerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareDirectoryStorageResourceContainerTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -14,6 +15,7 @@ using Azure.Storage.Tests; using Moq; using NUnit.Framework; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { @@ -45,7 +47,7 @@ public async Task GetStorageResourcesCallsPathScannerCorrectly() List expectedResources = expectedFiles.Select(m => (StorageResource) new ShareFileStorageResource(m.Object)).ToList(); expectedResources.Concat(expectedDirectories.Select(m => (StorageResource) new ShareDirectoryStorageResourceContainer(m.Object, default))); // And a mock path scanner - Mock pathScanner = new(); + Mock pathScanner = new(); pathScanner.Setup(p => p.ScanAsync( mainClient.Object, default, diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFilePauseResumeTransferTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFilePauseResumeTransferTests.cs new file mode 100644 index 000000000000..d76d2d5f8f17 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFilePauseResumeTransferTests.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +extern alias BaseShares; +extern alias DMShare; + +using System; +using System.Threading.Tasks; +using Azure.Storage.Test.Shared; +using Azure.Storage.DataMovement.Tests; +using BaseShares::Azure.Storage.Files.Shares; +using System.IO; +using NUnit.Framework; +using BaseShares::Azure.Storage.Files.Shares.Models; +using Metadata = System.Collections.Generic.IDictionary; +using DMShare::Azure.Storage.DataMovement.Files.Shares; +using System.Linq; + +namespace Azure.Storage.DataMovement.Files.Shares.Tests +{ + [DataMovementShareClientTestFixture] + public class ShareFilePauseResumeTransferTests : PauseResumeTransferTestBase + + { + protected readonly ShareClientOptions.ServiceVersion _serviceVersion; + + public ShareFilePauseResumeTransferTests(bool async, ShareClientOptions.ServiceVersion serviceVersion) + : base(async, null /* RecordedTestMode.Record /* to re-record */) + { + _serviceVersion = serviceVersion; + ClientBuilder = ClientBuilderExtensions.GetNewShareClientBuilder(Tenants, serviceVersion); + } + + protected override async Task> GetDisposingContainerAsync( + string containerName = default, + ShareServiceClient service = default) + => await ClientBuilder.GetTestShareAsync(service, containerName); + + protected override StorageResourceProvider GetStorageResourceProvider() + => new ShareFilesStorageResourceProvider(TestEnvironment.Credential); + + protected override async Task CreateSourceStorageResourceItemAsync( + long size, + string fileName, + ShareClient container) + { + ShareFileClient fileClient = container.GetRootDirectoryClient().GetFileClient(fileName); + await fileClient.CreateAsync(size); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + originalStream.Position = 0; + await fileClient.UploadAsync(originalStream); + } + return ShareFilesStorageResourceProvider.FromClient(fileClient); + } + + protected override StorageResource CreateDestinationStorageResourceItem( + string fileName, + ShareClient container, + Metadata metadata = default, + string contentLanguage = default) + { + ShareFileStorageResourceOptions testOptions = new() + { + FileMetadata = metadata, + ContentLanguage = contentLanguage is null ? null : new[] { contentLanguage } + }; + ShareFileClient fileClient = container.GetRootDirectoryClient().GetFileClient(fileName); + return ShareFilesStorageResourceProvider.FromClient(fileClient, testOptions); + } + + protected override async Task AssertDestinationProperties( + string fileName, + Metadata expectedMetadata, + string expectedContentLanguage, + ShareClient container) + { + ShareFileClient fileClient = container.GetRootDirectoryClient().GetFileClient(fileName); + ShareFileProperties props = (await fileClient.GetPropertiesAsync()).Value; + Assert.That(props.Metadata, Is.EqualTo(expectedMetadata)); + Assert.That(props.ContentLanguage.First, Is.EqualTo(expectedContentLanguage)); + } + + protected override async Task GetStreamFromContainerAsync(Uri uri, ShareClient container) + { + var uriBuilder = new ShareUriBuilder(uri); + string fileName = uriBuilder.DirectoryOrFilePath; + ShareFileClient fileClient = container.GetRootDirectoryClient().GetFileClient(fileName); + if (!await fileClient.ExistsAsync()) + { + throw new FileNotFoundException($"File not found: {uri}"); + } + + // Download the file to a MemoryStream + ShareFileDownloadInfo downloadInfo = await fileClient.DownloadAsync(); + MemoryStream memoryStream = new MemoryStream(); + await downloadInfo.Content.CopyToAsync(memoryStream); + memoryStream.Position = 0; + return memoryStream; + } + + protected override async Task CreateSourceStorageResourceContainerAsync( + long size, + int count, + string directoryPath, + ShareClient container) + { + for (int i = 0; i < count; i++) + { + ShareFileClient fileClient = container.GetRootDirectoryClient().GetFileClient(GetNewItemName()); + await fileClient.CreateAsync(size); + // create a new file and copy contents of stream into it, and then close the FileStream + using (Stream originalStream = await CreateLimitedMemoryStream(size)) + { + originalStream.Position = 0; + await fileClient.UploadAsync(originalStream); + } + } + return ShareFilesStorageResourceProvider.FromClient(container.GetRootDirectoryClient()); + } + + protected override StorageResource CreateDestinationStorageResourceContainer( + ShareClient container) + { + return ShareFilesStorageResourceProvider.FromClient(container.GetRootDirectoryClient()); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileResourceTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileResourceTests.cs index a60737029dc4..0c51852baea3 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileResourceTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileResourceTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Collections.Generic; @@ -19,6 +20,7 @@ using Moq.Protected; using NUnit.Framework; using Metadata = System.Collections.Generic.IDictionary; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferCopyTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferCopyTests.cs index dab95c9776c5..e4c56a128c05 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferCopyTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferCopyTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Threading.Tasks; @@ -17,6 +18,7 @@ using BaseShares::Azure.Storage.Files.Shares.Specialized; using BaseShares::Azure.Storage.Sas; using Metadata = System.Collections.Generic.IDictionary; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { @@ -132,6 +134,7 @@ private async Task CreateFileClientWithPermissionKeyAsync( ShareClientOptions options = null, Stream contents = null, TransferPropertiesTestType propertiesType = TransferPropertiesTestType.Default, + NtfsFileAttributes fileAttribute = _defaultFileAttributes, CancellationToken cancellationToken = default) { objectName ??= GetNewObjectName(); @@ -145,14 +148,14 @@ private async Task CreateFileClientWithPermissionKeyAsync( string permissionKey = default; if (propertiesType == TransferPropertiesTestType.Preserve) { - PermissionInfo permissionInfo = await container.CreatePermissionAsync(new ShareFilePermission() { Permission = _defaultPermissions } ); + PermissionInfo permissionInfo = await container.CreatePermissionAsync(new ShareFilePermission() { Permission = _defaultPermissions }); permissionKey = permissionInfo.FilePermissionKey; } await fileClient.CreateAsync( maxSize: objectLength.Value, new ShareFileCreateOptions() { - HttpHeaders = new ShareFileHttpHeaders() + HttpHeaders = new ShareFileHttpHeaders() { ContentLanguage = _defaultContentLanguage, ContentDisposition = _defaultContentDisposition, @@ -161,7 +164,7 @@ await fileClient.CreateAsync( Metadata = _defaultMetadata, SmbProperties = new FileSmbProperties() { - FileAttributes = _defaultFileAttributes, + FileAttributes = fileAttribute, FilePermissionKey = permissionKey, FileCreatedOn = _defaultFileCreatedOn, FileChangedOn = _defaultFileChangedOn, @@ -236,7 +239,7 @@ protected override StorageResourceItem GetDestinationStorageResourceItem( ContentLanguage = _defaultContentLanguage, CacheControl = _defaultCacheControl, ContentType = _defaultContentType, - FileMetadata = _defaultMetadata, + FileMetadata = _defaultMetadata, FileAttributes = _defaultFileAttributes, FileCreatedOn = _defaultFileCreatedOn, FileChangedOn = _defaultFileChangedOn, @@ -416,6 +419,111 @@ await VerifyPropertiesCopyAsync( cancellationToken: cancellationTokenSource.Token); } + [RecordedTest] + [Combinatorial] + public async Task ShareFileToShareFile_ManuallySetFileAttributes( + [Values(NtfsFileAttributes.ReadOnly, NtfsFileAttributes.Hidden, NtfsFileAttributes.Archive, (NtfsFileAttributes.ReadOnly | NtfsFileAttributes.Archive), (NtfsFileAttributes.ReadOnly | NtfsFileAttributes.Hidden))] NtfsFileAttributes fileAttribute, + [Values(0, 1024)] long fileLength) + { + // Arrange + await using IDisposingContainer source = await GetSourceDisposingContainerAsync(); + await using IDisposingContainer destination = await GetDestinationDisposingContainerAsync(); + + // Create source + ShareFileClient sourceClient = await CreateFileClientWithPermissionKeyAsync( + container: source.Container, + objectLength: fileLength, + createResource: true); + StorageResourceItem sourceResource = GetSourceStorageResourceItem(sourceClient); + + // Create destination + ShareFileClient destinationClient = await GetDestinationObjectClientAsync( + container: destination.Container, + createResource: false); + // Manually setting destination File Attributes + ShareFileStorageResourceOptions destFileAttributeOptions = new(); + destFileAttributeOptions.FileAttributes = fileAttribute; + StorageResourceItem destinationResource = new ShareFileStorageResource(destinationClient, destFileAttributeOptions); + + TransferOptions options = new TransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + TransferManager transferManager = new TransferManager(); + + // Act - Start transfer and await for completion. + TransferOperation transfer = await transferManager.StartTransferAsync( + sourceResource, + destinationResource, + options); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + transfer, + testEventsRaised, + cancellationTokenSource.Token); + + // Assert + Assert.IsTrue(transfer.HasCompleted); + Assert.AreEqual(TransferState.Completed, transfer.Status.State); + await testEventsRaised.AssertSingleCompletedCheck(); + using Stream sourceStream = await sourceClient.OpenReadAsync(cancellationToken: cancellationTokenSource.Token); + using Stream destinationStream = await destinationClient.OpenReadAsync(cancellationToken: cancellationTokenSource.Token); + Assert.AreEqual(sourceStream, destinationStream); + // Verify destination File Attributes + ShareFileProperties destinationProperties = await destinationClient.GetPropertiesAsync(cancellationToken: cancellationTokenSource.Token); + Assert.AreEqual(fileAttribute, destinationProperties.SmbProperties.FileAttributes); + } + + [RecordedTest] + [Combinatorial] + public async Task ShareFileToShareFile_PreserveFromSourceFileAttributes( + [Values(NtfsFileAttributes.ReadOnly, NtfsFileAttributes.Hidden, NtfsFileAttributes.Archive, (NtfsFileAttributes.ReadOnly | NtfsFileAttributes.Archive), (NtfsFileAttributes.ReadOnly | NtfsFileAttributes.Hidden))] NtfsFileAttributes fileAttribute, + [Values(0, 1024)] long fileLength) + { + // Arrange + await using IDisposingContainer source = await GetSourceDisposingContainerAsync(); + await using IDisposingContainer destination = await GetDestinationDisposingContainerAsync(); + + // Create source + ShareFileClient sourceClient = await CreateFileClientWithPermissionKeyAsync( + container: source.Container, + objectLength: fileLength, + createResource: true, + fileAttribute: fileAttribute); + // Manually setting source File Attributes + ShareFileStorageResourceOptions sourceFileAttributeOptions = new(); + sourceFileAttributeOptions.FileAttributes = fileAttribute; + StorageResourceItem sourceResource = new ShareFileStorageResource(sourceClient, sourceFileAttributeOptions); + + // Create destination + ShareFileClient destinationClient = await GetDestinationObjectClientAsync( + container: destination.Container, + createResource: false); + // No options set, so preserve from source + StorageResourceItem destinationResource = new ShareFileStorageResource(destinationClient); + + TransferOptions options = new TransferOptions(); + TestEventsRaised testEventsRaised = new TestEventsRaised(options); + TransferManager transferManager = new TransferManager(); + + // Act - Start transfer and await for completion. + TransferOperation transfer = await transferManager.StartTransferAsync( + sourceResource, + destinationResource, + options); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + await TestTransferWithTimeout.WaitForCompletionAsync( + transfer, + testEventsRaised, + cancellationTokenSource.Token); + + // Assert + Assert.IsTrue(transfer.HasCompleted); + Assert.AreEqual(TransferState.Completed, transfer.Status.State); + await testEventsRaised.AssertSingleCompletedCheck(); + using Stream sourceStream = await sourceClient.OpenReadAsync(cancellationToken: cancellationTokenSource.Token); + using Stream destinationStream = await destinationClient.OpenReadAsync(cancellationToken: cancellationTokenSource.Token); + Assert.AreEqual(sourceStream, destinationStream); + } + [RecordedTest] public async Task ShareFileToShareFile_PermissionKeyDefault() { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferDownloadTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferDownloadTests.cs index cccb03db5987..7bbda3e3efe8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferDownloadTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferDownloadTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.IO; @@ -8,6 +9,7 @@ using Azure.Storage.DataMovement.Tests; using BaseShares::Azure.Storage.Files.Shares; using Azure.Storage.Test.Shared; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferUploadTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferUploadTests.cs index cb529c44b3ff..6a5bba7b012f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferUploadTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareFileStartTransferUploadTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. extern alias BaseShares; +extern alias DMShare; using System; using System.Threading.Tasks; @@ -9,6 +10,7 @@ using BaseShares::Azure.Storage.Files.Shares; using System.IO; using Azure.Core.TestFramework; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareSourceCheckpointDetailsTests.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareSourceCheckpointDetailsTests.cs index 5db4b1077f85..404bcc1b70bd 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareSourceCheckpointDetailsTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/tests/ShareSourceCheckpointDetailsTests.cs @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +extern alias DMShare; using System; using System.IO; using NUnit.Framework; +using DMShare::Azure.Storage.DataMovement.Files.Shares; namespace Azure.Storage.DataMovement.Files.Shares.Tests { diff --git a/sdk/storage/Azure.Storage.DataMovement.sln b/sdk/storage/Azure.Storage.DataMovement.sln index fcc85276888d..867a47bf87eb 100644 --- a/sdk/storage/Azure.Storage.DataMovement.sln +++ b/sdk/storage/Azure.Storage.DataMovement.sln @@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Storage.DataMovement. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Storage.DataMovement.Files.Shares.Samples.Tests", "Azure.Storage.DataMovement.Files.Shares\samples\Azure.Storage.DataMovement.Files.Shares.Samples.Tests.csproj", "{76FB3889-81CD-4AD2-8372-13E2CA98B226}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Storage.DataMovement.Samples.Tests", "Azure.Storage.DataMovement\samples\Azure.Storage.DataMovement.Samples.Tests.csproj", "{180F8DFB-74DA-4753-8674-A35252688732}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -117,6 +119,10 @@ Global {76FB3889-81CD-4AD2-8372-13E2CA98B226}.Debug|Any CPU.Build.0 = Debug|Any CPU {76FB3889-81CD-4AD2-8372-13E2CA98B226}.Release|Any CPU.ActiveCfg = Release|Any CPU {76FB3889-81CD-4AD2-8372-13E2CA98B226}.Release|Any CPU.Build.0 = Release|Any CPU + {180F8DFB-74DA-4753-8674-A35252688732}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {180F8DFB-74DA-4753-8674-A35252688732}.Debug|Any CPU.Build.0 = Debug|Any CPU + {180F8DFB-74DA-4753-8674-A35252688732}.Release|Any CPU.ActiveCfg = Release|Any CPU + {180F8DFB-74DA-4753-8674-A35252688732}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/storage/Azure.Storage.DataMovement/CHANGELOG.md b/sdk/storage/Azure.Storage.DataMovement/CHANGELOG.md index 3f275232db19..c668d890a0ec 100644 --- a/sdk/storage/Azure.Storage.DataMovement/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.DataMovement/CHANGELOG.md @@ -1,8 +1,6 @@ # Release History -## 12.0.0-beta.7 (Unreleased) - -### Features Added +## 12.0.0 (2025-02-11) ### Breaking Changes - Removed `DataTransferProperty` and `DataTransferProperty` @@ -33,14 +31,17 @@ - `TransferItemSkippedEventArgs.SourceResource` -> `TransferItemSkippedEventArgs.Source` and `TransferItemSkippedEventArgs.DestinationResource` -> `TransferItemSkippedEventArgs.Destination` - `TransferCheckpointStoreOptions.Local` -> `TransferCheckpointStoreOptions.CreateLocalStore` - `TransferCheckpointStoreOptions.Disabled` -> `TransferCheckpointStoreOptions.DisableCheckpoint` +- Renamed `TransferOptions.CreationPreference` to `TransferOptions.CreateMode` - Removed properties from `StorageResourceItemProperties` constructor since properties are settable. - Changed type of `StorageResourceItemProperties.RawProperties` to `IDictionary`. +- Changed `List TransferManagerOptions.ResumeProviders` to `IList TransferManagerOptions.ProvidersForResuming` +- Changed the following `LocalFilesStorageResourceProvider` methods to `static` methods: + - `FromFile(string)` + - `FromDirectory(string)` ### Bugs Fixed - Fixed bug where adding multiple transfers in parallel could cause a collision (`InvalidOperationException`) in the data transfers stored within the `TransferManager`. -### Other Changes - ## 12.0.0-beta.6 (2024-10-14) ### Features Added diff --git a/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md b/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md index eb98a6f215db..433f96b9e284 100644 --- a/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md +++ b/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md @@ -26,4 +26,39 @@ The Azure Storage REST service has various limitations as to the size of request ### Resume Behavior when Client Options are set -When calling `*StorageResourceProvider.FromClient` with a Storage Client (e.g. `BlobBaseClient`, `ShareFileClient`) initialized with `*ClientOptions` (e.g `BlobClientOptions`, `ShareClientOptions`). It is NOT guaranteed that properties set within the `*ClientOptions` will be respected when resuming a transfer. \ No newline at end of file +When calling `*StorageResourceProvider.FromClient` with a Storage Client (e.g. `BlobBaseClient`, `ShareFileClient`) initialized with `*ClientOptions` (e.g `BlobClientOptions`, `ShareClientOptions`). It is NOT guaranteed that properties set within the `*ClientOptions` will be respected when resuming a transfer. + +### Encryption Scope Support + +There is currently no support to specify an encryption scope for operations such as uploads, downloads, or copies. + +### Recursive Directory Disable Support + +Currently there is support for transferring entire directories, including all subdirectories and files within them. However, we do not offer an option to disable directory recursion. This means that users cannot copy only the files in a folder without also copying its subdirectories. + +### Blob to Share File with OAuth/Entra ID + +There is currently no support for transferring data from an Azure Storage Blob to Azure Storage Shares using authentication based on Microsoft Entra ID. + +### Resume Transfers started from any Beta version/Deprecated package + +Transfers initiated with any beta version of the DataMovement library cannot be resumed due to a schema version change from string to int, which may lead to unexpected errors. Additionally, transfers from the deprecated Microsoft.Azure.Storage.DataMovement package also cannot be resumed. + +### Blob Tag Support + +There is currently no support for managing or utilizing blob tags. This means users cannot add, retrieve, or manage blob tags during a transfer. + +### Public URL Copying + +There is currently no support for copying blobs via Public URLs. However, the library does support copying Azure Storage URLs, which can be used for moving data within the Azure Storage ecosystem. + +### Copy with a AzureSasCredential + +There is currently no support for service-to-service copy given a client that was initialized with a AzureSasCredential from `BlobStorageResourceProvider.FromClient` and/or `ShareStorageResourceProvider.FromClient`. +Here are two alternatives: +1. Use `BlobsStorageResourceProvider(AzureSasCredential)` / `ShareFilesStorageResourceProvider(AzureSasCredential)` to authenticate and then create StorageResource. +2. Initialize a client with a Uri that has a SAS included in the Uri if you still want to use `BlobStorageResourceProvider.FromClient` and/or `ShareStorageResourceProvider.FromClient`. + +### Fresh transfer vs Resumed transfer Performance + +The performance of resumed transfers is currently lower than that of fresh transfers. This is due to fetching source properties on Resume. diff --git a/sdk/storage/Azure.Storage.DataMovement/MigrationGuide.md b/sdk/storage/Azure.Storage.DataMovement/MigrationGuide.md index 07d259c9408b..6d0b45c10ad4 100644 --- a/sdk/storage/Azure.Storage.DataMovement/MigrationGuide.md +++ b/sdk/storage/Azure.Storage.DataMovement/MigrationGuide.md @@ -12,6 +12,9 @@ Familiarity with the legacy data movement client library is assumed. For those n - [Package and namespaces](#package-and-namespaces) - [Authentication](#authentication) - [Type structure](#type-structure) + - [TransferManager](#transfermanager) + - [Storage resources and providers](#storage-resources-and-providers) + - [TransferContext → TransferOptions](#transfercontext--transferoptions) - [Migration samples](#migration-samples) - [Additional information](#additional-information) @@ -21,7 +24,7 @@ Version 12 of the Data Movemenet library inherits all the benefits of the versio TODO -### Core client libraries +### Core client library migration benefits To understand why we created our version 12 client libraries, you may refer to the Tech Community blog post, [Announcing the Azure Storage v12 Client Libraries](https://techcommunity.microsoft.com/t5/azure-storage/announcing-the-azure-storage-v12-client-libraries/ba-p/1482394) or refer to our video [Introducing the New Azure SDKs](https://aka.ms/azsdk/intro). @@ -52,6 +55,82 @@ dotnet add package Azure.Storage.DataMovement.Blobs Note the separation of the Data Movement package from the Blob Storage Data Movement package. Packages to other storage services can be added or removed from your installation. +### Type Structure + +This section to discuss the following as important structural API changes: + +- Changes to the `TransferManager` +- New `StorageResource` type and storage resource providers +- Replacing `TransferContext` with `TransferOptions` + +#### TransferManager + +The `TransferManager` is still the core type that handles transfers in Data Movement, though its API has been completely rewritten. +It is no longer a static type, though **we recommend maintaining a singleton instance** for optimal usage. + +All transfer methods for upload, download, and copy, for both files and directories, have been replaced with a single instance method: +```C# +Task StartTransferAsync( + StorageResource sourceResource, + StorageResource destinationResource, + TransferOptions transferOptions = default, + CancellationToken cancellationToken = default) +``` +The appropriate upload, download, or copy operation will be performed based on the `StorageResource` instances passed. E.g., a `sourceResource` pointing to a local file and a `destinationResource` pointing to an Azure blob will perform an upload. More information on `StorageResource` can be found in the following section on [storage resources and providers](#storage-resources-and-providers). + +The following table is a quick reference of where to find functionality from legacy `TransferManager` APIs. This **does not** imply fully identical behavior between libraries. + +| Operation | Legacy `TransferManager` API | Modern API +| --------- | ---------- | ---------- | +| Upload, Download, Copy | `UploadAsync`, `UploadDirectoryAsync`, `DownloadAsync`, `DownloadDirectoryAsync`, `CopyAsync`, `CopyDirectoryAsync` | `TransferManager.StartTransferAsync` +| Limit concurrent transfers | `Configurations.ParallelOperations` | `TransferManagerOptions.MaximumConcurrency` (applied at TransferManager construction) +| Limit concurrent listings | `Configurations.MaxListingConcurrency` | Not implemented +| Limit memory usage | `Configurations.MaximumCacheSize` | Not implemented +| Set chunking size | `Configurations.BlockSize` | `TransferOptions.MaximumTransferChunkSize` (applied at TransferManager construction) +| Alter user agent string | `Configurations.UserAgentPrefix` | Not implemented + +#### Storage Resources and Providers + +The modern library introduces a new and unified `StorageResource` type. While the legacy library directly used types like `CloudBlob` and `CloudFile` in its API, the modern library uses `StorageResource` to define transfer source and destination. Storage resources can be further divided into two subtypes: **items** and **containers**. Examples of items are block blobs and local files. Examples of containers are blob containers and local folders. + +**Important:** a transfer **must** be between two items or two containers. An exception will be thrown when attempting to transfer an item to a container and vice versa. + +`StorageResource` instances are obtained through providers. +Providers are often scoped to a single storage service and will have unique APIs to acquire `StorageResource` instances as well as properly authenticate them. +Here is an example using providers to create an upload to an Azure blob. +Note that local files use a static provider, while blobs (and every other provider in our packages) must be instantiated. +Further examples can be found in our [migration samples](#migration-samples). + +```C# +BlobsStorageResourceProvider blobs = new(myTokenCredential); +TransferManager transferManager = new TransferManager(); + +TransferOperation transferOperation = await transferManager.StartTransferAsync( + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalPath), + destinationResource: blobs.FromBlob(destinationBlobUri)); +``` + +Providers can also be registered with the `TransferManager` at construction as a mechanism to resume in case of a failure. (TODO link to resume sample). + +#### TransferContext → TransferOptions + +In the legacy library, `TransferContext` was an object with per-transfer specifications. In the modern library, `TransferOptions` is its replacement. + +Not all functionality exposed by `TransferContext` is currently supported in the modern Data Movement library. + +The following table is a quick reference of where to find functionality from legacy `TransferContext` APIs. This **does not** imply fully identical behavior between libraries. + +| Configuration | Legacy `TransferContext` API | Modern API +| ------------- | ---------------------------- | ---------- +| Checkpointing | `TransferCheckpoint` provided at `TransferContext` construction | `TransferCheckpointStoreOptions` provided at `TransferManagerOptions` construction. +| Observe checkpointing | `LastCheckpoint` | Not implemented +| Client request ID | `ClientRequestId` | Not implemented +| Logging | `LogLevel` | **No longer per-transfer**. `TransferManagerOptions.Diagnostics`. +| Overwrite | `ShouldOverwriteCallbackAsync` | `TransferOptions.CreationPreference` +| Progress Handling | `ProgressHandler` | `TransferOptions.ProgressHandlerOptions` +| Transfer Updates | `FileTransferred`, `FileSkipped`, `FileFailed` | `TransferOptions.ItemTransferCompleted`, `TransferOptions.ItemTransferFailed`, `TransferOptions.ItemTransferSkipped`, `TransferOptions.TransferStatusChanged` +| Attributes | `SetAttributesContextAsync` | TODO + ### Authentication #### Azure Active Directory @@ -68,23 +147,375 @@ TODO TODO -### Type Structure +## Migration Samples + +This section contains side-by-side samples of legacy vs modern library usage of various features. +These samples are not meant to be exhaustive, but demonstrate a wide variety of uses that may need migration. + +- [Upload](#upload) + - [Upload single file to blob storage](#upload-single-file-to-blob-storage) + - [Upload directory to blob storage](#upload-directory-to-blob-storage) +- [Download](#download) + - [Download single blob](#download-single-blob) + - [Download blob directory](#download-blob-directory) +- [Service to service copy](#copy) + - [Copy blob to blob](#copy-blob-to-blob) + - [Copy blob to file share](#copy-blob-to-share-file) +- [Progress reporting](#progress-reporting) +- [Pause and resume](#pause-and-resume) + +### Upload + +#### Upload single file to blob storage + +**Legacy:** +```C# +// these values provided by your code +string filePath, containerName, blobName; +CloudBlobClient client; +``` +```C# +// upload blob +await TransferManager.UploadAsync( + filePath, + client.GetContainerReference(containerName).GetBlockBlobReference(blobName)); +``` +**Modern:** +```C# Snippet:DataMovementMigration_UploadSingleFile_VarDeclaration +// these values provided by your code +string filePath; +Uri blobUri; +BlobsStorageResourceProvider blobs; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_UploadSingleFile +// upload blob +TransferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromFile(filePath), + await blobs.FromBlobAsync(blobUri)); +await operation.WaitForCompletionAsync(); +``` -TODO TransferManager changes +#### Upload directory to blob storage -TODO StorageResource, Container and Item +**Legacy:** +```C# +// these values provided by your code +string directoryPath, containerName, blobDirectoryPath; +CloudBlobClient client; +``` +```C# +// upload blob +await TransferManager.UploadDirectoryAsync( + directoryPath, + client.GetContainerReference(containerName).GetDirectoryReference(blobDirectoryPath)); +``` +**Modern:** +```C# Snippet:DataMovementMigration_UploadBlobDirectory_VarDeclaration +// these values provided by your code +string directoryPath, blobDirectoryPath; +Uri containerUri; +BlobsStorageResourceProvider blobs; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_UploadBlobDirectory +// upload blobs +TransferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromDirectory(directoryPath), + await blobs.FromContainerAsync(containerUri, new BlobStorageResourceContainerOptions() + { + BlobPrefix = blobDirectoryPath, + })); +await operation.WaitForCompletionAsync(); +``` -TODO Providers +### Download -## Migration Samples +#### Download single blob -TODO -- Upload -- Download -- S2S -- Progress reporting -- Error reporting -- Pause/Resume +**Legacy:** +```C# +// these values provided by your code +string filePath, containerName, blobName; +CloudBlobClient client; +``` +```C# +// download blob +await TransferManager.DownloadAsync( + client.GetContainerReference(containerName).GetBlockBlobReference(blobName), + filePath); +``` +**Modern:** +```C# Snippet:DataMovementMigration_DownloadBlob_VarDeclaration +// these values provided by your code +string filePath; +Uri blobUri; +BlobsStorageResourceProvider blobs; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_DownloadBlob +// download blob +TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(blobUri), + LocalFilesStorageResourceProvider.FromFile(filePath)); +await operation.WaitForCompletionAsync(); +``` + +#### Download blob directory + +**Legacy:** +```C# +// these values provided by your code +string directoryPath, containerName, blobDirectoryPath; +CloudBlobClient client; +``` +```C# +// download blob directory +await TransferManager.DownloadDirectoryAsync( + client.GetContainerReference(containerName).GetDirectoryReference(blobDirectoryPath), + filePath, + options: null, + context: null); +``` +**Modern:** +```C# Snippet:DataMovementMigration_DownloadBlobDirectory_VarDeclaration +// these values provided by your code +string directoryPath, blobDirectoryPath; +Uri containerUri; +BlobsStorageResourceProvider blobs; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_DownloadBlobDirectory +// download blob directory +TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromContainerAsync(containerUri, new BlobStorageResourceContainerOptions() + { + BlobPrefix = blobDirectoryPath, + }), + LocalFilesStorageResourceProvider.FromDirectory(directoryPath)); +await operation.WaitForCompletionAsync(); +``` + +### Copy + +#### Copy blob to blob + +Note: The modern data movement library only supports service side sync copy. + +**Legacy:** +```C# +// these values provided by your code +string srcContainerName, srcBlobName, dstContainerName, dstBlobName; +CloudBlobClient client; +``` +```C# +// copy blob +await TransferManager.DownloadAsync( + client.GetContainerReference(srcContainerName).GetBlockBlobReference(srcBlobName), + client.GetContainerReference(dstContainerName).GetBlockBlobReference(dstBlobName), + CopyMethod.ServiceSideSyncCopy); +``` +**Modern:** +```C# Snippet:DataMovementMigration_CopyBlobToBlob_VarDeclaration +// these values provided by your code +Uri srcBlobUri, dstBlobUri; +BlobsStorageResourceProvider blobs; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_CopyBlobToBlob +// upload blob +TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(srcBlobUri), + await blobs.FromBlobAsync(dstBlobUri)); +await operation.WaitForCompletionAsync(); +``` + +#### Copy blob to share file + +Note: File shares requires the Azure.Storage.DataMovement.Files.Shares package. + +**Legacy:** +```C# +// these values provided by your code +string containerName, blobName, shareName, filePath; +CloudBlobClient blobClient; +CloudFileClient fileClient; +``` +```C# +// copy file +await TransferManager.DownloadAsync( + blobClient.GetContainerReference(srcContainerName).GetBlockBlobReference(srcBlobName), + fileClient.GetShareReference(dstContainerName).GetRootDirectoryReference().GetBlockBlobReference(dstBlobName), + CopyMethod.ServiceSideSyncCopy); +``` +**Modern:** +```C# Snippet:DataMovementMigration_CopyBlobToShareFile_VarDeclaration +// these values provided by your code +Uri blobUri, fileUri; +BlobsStorageResourceProvider blobs; +ShareFilesStorageResourceProvider files; +TransferManager transferManager; +``` +```C# Snippet:DataMovementMigration_CopyBlobToShareFile +// upload blob +TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(blobUri), + await files.FromFileAsync(fileUri)); +await operation.WaitForCompletionAsync(); +``` + +### Progress Reporting + +#### Post-transfer report + +In the legacy data movement library, it was possible to check a report of how many files were or were not transferred in a directory transfer, as shown below. +With the modern library, applications must instead enable progress reporting or listen to transfer events, as detailed in the following sections. + +```C# +TransferStatus status = await TransferManager.UploadDirectoryAsync( + directoryPath, + client.GetContainerReference(containerName).GetDirectoryReference(blobDirectoryPath)); +// observe status +// status.NumberOfFilesTransferred +// status.NumberOfFilesSkipped +// status.NumberOfFilesFailed +// status.BytesTransferred +``` + +#### IProgress + +**Legacy:** +```C# +// progress handler provided by your code +IProgress progress; +``` +```C# +await TransferManager.UploadDirectoryAsync( + directoryPath, + client.GetContainerReference(containerName).GetDirectoryReference(blobDirectoryPath), + options: default, + new DirectoryTransferContext() + { + ProgressHandler = progress, + }); +``` +**Modern:** +```C# +// progress handler provided by your code +IProgress progress; +// if TransferProgress report is desired for +// each transfer of bytes, set to true. +bool reportBytes; +``` +```C# +// upload blobs +TranferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromDirectory(directoryPath), + blobs.FromContainer(containerUri, new BlobStorageResourceContainerOptions() + { + BlobDirectoryPrefix = blobDirectoryPath, + }), + new TransferOptions() + { + new ProgressHandlerOptions() + { + ProgressHandler = progress, + TrackBytesTransferred = reportBytes; + } + }); +await operation.WaitForCompletionAsync(); +``` + +#### Eventing (new to modern library) + +**Modern:** +```C# +// callback provided by your code +Func onItemCompleted; +Func onItemSkipped; +Func onItemFailed; +``` +```C# +TransferOptions options = new TransferOptions(); +options.ItemTransferCompleted += onItemCompleted; +options.ItemTransferSkipped += onItemSkipped; +options.ItemTransferFailed += onItemFailed; +TranferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromDirectory(directoryPath), + blobs.FromContainer(containerUri, new BlobStorageResourceContainerOptions() + { + BlobDirectoryPrefix = blobDirectoryPath, + }), + options); +await operation.WaitForCompletionAsync(); +``` + +### Pause and resume + +#### Pause + +In the legacy library, transfers were paused by invoking a cancellation token. +In the modern library, transfers are paused by calling the pause method on a given `TransferOperation`. + +**Legacy:** +```C# +CancellationTokenSource cts = new(); +Task uploadTask = TransferManager.UploadAsync(source, destination, cts.Token); +cts.Cancel(); +``` +**Modern:** +```C# +TransferOperation transfer = await transferManager.StartTransferAsync(source, destination); +await transfer.PauseAsync(); +``` + +#### Resume + +In the legacy library, transfers were resumed by starting a transfer that matched an existing transfer in the context's journal. +In the modern library, a separate resume API exists to resume a transfer by ID. + +For resume, the transfer manager must be configured with a provider for each service involved in a transfer to be resumed. +This allows for the appropriate credential to be supplied, as credentials are not stored in the checkpointer. + +No provider is needed for local files. + +No checkpointer is needed to be supplied; it is enabled by default to write to a temporary directory on the local machine. +Checkpointer options may be supplied to the transfer manager to configure the directory or to disable checkpointing entirely. + +**Legacy:** +```C# +SingleTransferContext context = new(journalStream); +Task uploadTask = TransferManager.UploadAsync( + source, + destination, + options: default, + context); +``` +**Modern:** +```C# +TransferManager transferManager = new(new TransferManagerOptions() +{ + // enable to resume transfers involving blob storage + ResumeProviders = new() { new BlobsStorageResourceProvider(myCredential) }, +}); +TransferOperation transfer = await transferManager.ResumeTransferAsync(transferId); +``` + +The modern `TransferManager` also has methods to enumerate resumable transfers. + +```C# +List operations = new(); +await foreach (TransferProperties transferProperties in transferManager.GetResumableTransfersAsync()) +{ + operations.Add(await transferManager.ResumeTransferAsync()); +} +``` + +The above sample is a simplified version of `TransferManager.ResumeAllTransfersAsync()` and can be simplified to the following. + +```C# +List operations = await transferManager.ResumeAllTransfersAsync(); +``` ## Additional information diff --git a/sdk/storage/Azure.Storage.DataMovement/README.md b/sdk/storage/Azure.Storage.DataMovement/README.md index 4f4f97c1f435..76de40c5feb7 100644 --- a/sdk/storage/Azure.Storage.DataMovement/README.md +++ b/sdk/storage/Azure.Storage.DataMovement/README.md @@ -1,11 +1,5 @@ # Azure Storage Data Movement Common client library for .NET -## Project Status: Beta - -This product is in beta. Some features will be missing or have significant bugs. Please see [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. - ---- - Azure Storage is a Microsoft-managed service providing cloud storage that is highly available, secure, durable, scalable, and redundant. @@ -24,7 +18,7 @@ Install the Azure Storage client library for .NET you'd like to use with [NuGet][nuget] and the `Azure.Storage.DataMovement` client library will be included: ```dotnetcli -dotnet add package Azure.Storage.DataMovement --prerelease +dotnet add package Azure.Storage.DataMovement ``` ### Prerequisites @@ -42,7 +36,9 @@ az storage account create --name MyStorageAccount --resource-group MyResourceGro ### Authenticate the client -Authentication is specific to the targeted storage service. Please see documentation for the individual services +Authentication is specific to the targeted storage service. Please see documentation for the individual services: +- [Blob](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs/README.md#authenticate-the-client) +- [File Share](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/README.md#authenticate-the-client) ### Permissions @@ -50,7 +46,7 @@ Data Movement must have appropriate permissions to the storage resources. Permissions are specific to the type of storage Data Movement is connected to. - [Blob storage permissions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md#permissions) -- [File share permissions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement.Files.Shares//README.md#permissions) +- [File share permissions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md#permissions) ## Key concepts @@ -87,188 +83,36 @@ TransferManager transferManager = new TransferManager(new TransferManagerOptions Transfers are defined by a source and destination `StorageResource`. There are two kinds of `StorageResource`: `StorageResourceSingle` and `StorageResourceContainer`. Source and destination of a given transfer must be of the same kind. -`StorageResource` instances are obtained from `StorageResourceProvider` instances. See [Initializing Local File `StorageResource`](#initializing-local-file-storageresource) for more information on the resource provider for local files and directories. See the documentation for other DataMovement extension packages for more info on their `StorageResourceProvider` types. +`StorageResource` instances are obtained from `StorageResourceProvider` instances. See [Initializing Local File StorageResource(s)](#initializing-local-file-storageresource) for more information on the resource provider for local files and directories. See the [Next Steps](#next-steps) for our DataMovement extension packages for more info on their respective `StorageResourceProvider` types. -The below sample demonstrates `StorageResourceProvider` use to start transfers by uploading a file to Azure Blob Storage, using the Azure.Storage.DataMovement.Blobs package. It uses an Azure.Core token credential with permission to write to the blob. +The sample below demonstrates `StorageResourceProvider` use to start transfers by uploading a file to Azure Blob Storage, using the Azure.Storage.DataMovement.Blobs package. It uses an Azure.Core `TokenCredential` generated from Azure.Identity `DefaultAzureCredential()` with permission to write to the blob. ```C# Snippet:SimpleBlobUpload_BasePackage -LocalFilesStorageResourceProvider files = new(); -BlobsStorageResourceProvider blobs = new(tokenCredential); +TokenCredential defaultTokenCredential = new DefaultAzureCredential(); +BlobsStorageResourceProvider blobs = new BlobsStorageResourceProvider(defaultTokenCredential); // Create simple transfer single blob upload job TransferOperation transferOperation = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalPath), - destinationResource: blobs.FromBlob(destinationBlobUri)); + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalPath), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri)); await transferOperation.WaitForCompletionAsync(); ``` -### Resuming Existing Transfers - -By persisting transfer progress to disk, DataMovement allows resuming of transfers that failed partway through, or were otherwise paused. To resume a transfer, the transfer manager needs to be setup in the first place with `StorageResourceProvider` instances (the same ones used above in [Starting New Transfers](#starting-new-transfers)) which are capable of reassembling the transfer components from persisted data. - -To pause see [Pausing Transfers](#pausing-transfers). - -The below sample initializes the `TransferManager` such that it's capable of resuming transfers between the local filesystem and Azure Blob Storage, using the Azure.Storage.DataMovement.Blobs package. - -**Important:** Credentials to storage providers are not persisted. Storage access which requires credentials will need its appropriate `StorageResourceProvider` to be configured with those credentials. Below uses an `Azure.Core` token credential with permission to the appropriate resources. - -```C# Snippet:SetupTransferManagerForResume -LocalFilesStorageResourceProvider files = new(); -BlobsStorageResourceProvider blobs = new(tokenCredential); -TransferManager transferManager = new(new TransferManagerOptions() -{ - ResumeProviders = new List() { files, blobs }, -}); -``` - -To resume a transfer, provide the transfer's ID, as shown below. In the case where your application does not have the desired transfer ID available, use `TransferManager.GetTransfersAsync()` to find that transfer and it's ID. - -```C# Snippet:DataMovement_ResumeSingle -TransferOperation resumedTransfer = await transferManager.ResumeTransferAsync(transferId); -``` - -#### Pause and Resume Checkpointing - -The location of persisted transfer data will be different than the default location if `TransferCheckpointStoreOptions` were set in `TransferManagerOptions`. To resume transfers recorded in a non-default location, the transfer manager resuming the transfer will also need the appropriate checkpoint store options. - -To specify the checkpoint folder directory: -```csharp -TransferManagerOptions options = new TransferManagerOptions() -{ - CheckpointerOptions = TransferCheckpointStoreOptions.Local() -}; -``` - -To disable checkpointing: -```csharp -TransferManagerOptions options = new TransferManagerOptions() -{ - CheckpointerOptions = TransferCheckpointStoreOptions.Disabled() -}; -``` - -### Monitoring Transfers - -Transfers can be observed through several mechanisms, depending on your needs. - -#### With `DataTransfer` - -Simple observation can be done through a `DataTransfer` instance representing an individual transfer. This is obtained on transfer start. You can also enumerate through all transfers on a `TransferManager`. - -A function that writes the status of each transfer to console: - -```C# Snippet:EnumerateTransfers -async Task CheckTransfersAsync(TransferManager transferManager) -{ - await foreach (TransferOperation transfer in transferManager.GetTransfersAsync()) - { - using StreamWriter logStream = File.AppendText(logFile); - logStream.WriteLine(Enum.GetName(typeof(TransferStatus), transfer.Status)); - } -} -``` - -`DataTransfer` contains property `TransferStatus`. You can read this to determine the state of the transfer. States include queued for transfer, in progress, paused, completed, and more. - -`DataTransfer` also exposes a task for transfer completion, shown in [Starting New Transfers](#starting-new-transfers). - -#### With Events via `TransferOptions` - -When starting a transfer, `TransferOptions` contains multiple events that can be listened to for observation. Below demonstrates listening to the event for individual file completion and logging the result. - -A function that listens to status events for a given transfer: - -```C# Snippet:ListenToTransferEvents -async Task ListenToTransfersAsync(TransferManager transferManager, - StorageResource source, StorageResource destination) -{ - TransferOptions transferOptions = new(); - transferOptions.ItemTransferCompleted += (TransferItemCompletedEventArgs args) => - { - using StreamWriter logStream = File.AppendText(logFile); - logStream.WriteLine($"File Completed Transfer: {args.Source.Uri.LocalPath}"); - return Task.CompletedTask; - }; - return await transferManager.StartTransferAsync( - source, - destination, - transferOptions); -} -``` - -#### With IProgress via `TransferOptions` - -When starting a transfer, `TransferOptions` allows setting a progress handler that contains the progress information for the overall transfer. Granular progress updates will be communicated to the provided `IProgress` instance. - -A function that listens to progress updates for a given transfer with a supplied `IProgress`: - -```C# Snippet:ListenToProgress -async Task ListenToProgressAsync(TransferManager transferManager, IProgress progress, - StorageResource source, StorageResource destination) -{ - TransferOptions transferOptions = new() - { - ProgressHandlerOptions = new() - { - ProgressHandler = progress, - // optionally include the below if progress updates on bytes transferred are desired - TrackBytesTransferred = true, - } - }; - return await transferManager.StartTransferAsync( - source, - destination, - transferOptions); -} -``` +The sample below demonstrates `StorageResourceProvider` use to start transfers by uploading a file to Azure Share File Storage, using the Azure.Storage.DataMovement.Files.Shares package. It uses an Azure.Core `TokenCredential` generated from Azure.Identity `DefaultAzureCredential()` with permission to write to the blob. -### Pausing transfers - -Transfers can be paused either by a given `DataTransfer` or through the `TransferManager` handling the transfer by referencing the transfer ID. The ID can be found on the `DataTransfer` object you received upon transfer start. - -```C# Snippet:PauseFromTransfer -await transferOperation.PauseAsync(); -``` - -```C# Snippet:PauseFromManager -await transferManager.PauseTransferAsync(transferId); +```C# Snippet:SimplefileUpload_Shares +TokenCredential tokenCredential = new DefaultAzureCredential(); +ShareFilesStorageResourceProvider shares = new(tokenCredential); +TransferManager transferManager = new TransferManager(new TransferManagerOptions()); +TransferOperation fileTransfer = await transferManager.StartTransferAsync( + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalFile), + destinationResource: await shares.FromFileAsync(destinationFileUri)); +await fileTransfer.WaitForCompletionAsync(); ``` -### Handling Failed Transfers - -Transfer failure can be observed by checking the `DataTransfer` status upon completion, or by listening to failure events on the transfer. While checking the `DataTransfer` may be sufficient for handling single-file transfer failures, event listening is recommended for container transfers. - -Below logs failure for a single transfer by checking its status after completion. - -```C# Snippet:LogTotalTransferFailure -await dataTransfer2.WaitForCompletionAsync(); -if (dataTransfer2.Status.State == TransferState.Completed - && dataTransfer2.Status.HasFailedItems) -{ - using (StreamWriter logStream = File.AppendText(logFile)) - { - logStream.WriteLine($"Failure for TransferId: {dataTransfer2.Id}"); - } -} -``` - -Below logs individual failures in a container transfer via `TransferOptions` events. - -```C# Snippet:LogIndividualTransferFailures -transferOptions.ItemTransferFailed += (TransferItemFailedEventArgs args) => -{ - using (StreamWriter logStream = File.AppendText(logFile)) - { - // Specifying specific resources that failed, since its a directory transfer - // maybe only one file failed out of many - logStream.WriteLine($"Exception occurred with TransferId: {args.TransferId}," + - $"Source Resource: {args.Source.Uri.AbsoluteUri}, +" + - $"Destination Resource: {args.Destination.Uri.AbsoluteUri}," + - $"Exception Message: {args.Exception.Message}"); - } - return Task.CompletedTask; -}; -``` +See more examples of starting a transfer respective to each storage service: +- [Blob](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs#upload) +- [Share Files](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Files.Shares#upload) ### Initializing Local File or Directory `StorageResource` @@ -284,12 +128,20 @@ StorageResource directoryResource = files.FromDirectory("C:/path/to/dir"); See [Handling Failed Transfers](#handling-failed-transfers) and [Enabling Logging](https://learn.microsoft.com/dotnet/azure/sdk/logging) to assist with any troubleshooting. +See [Known Issues](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/KnownIssues.md) for detailed information. + ## Next steps Get started with our [Blob DataMovement samples][blob_samples]. Get started with our [Share File DataMovement samples][share_samples]. +For advanced scenarios regarding the `TransferManager` see [TransferManager Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md). + +For advanced scenarios regarding the `TransferManager.StartTransfer()` operation, see [Start Transfer Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/samples/StartTransfer.md). + +For advanced scenarios and information regarding Resume, Pause and/or checkpointing see [Pause and Resume, Checkpointing Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md). + ## Contributing See the [Storage CONTRIBUTING.md][storage_contrib] for details on building, @@ -305,8 +157,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Common%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/src [docs]: https://learn.microsoft.com/dotnet/api/azure.storage diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs index 291b9aa443ad..dc03f5ffcd4f 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs @@ -2,47 +2,68 @@ namespace Azure.Storage.DataMovement { public partial class LocalFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public LocalFilesStorageResourceProvider() { } + internal LocalFilesStorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override string ProviderId { get { throw null; } } - protected internal override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } - public Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } - protected internal override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public abstract partial class StorageResource { protected StorageResource() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract bool IsContainer { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract string ProviderId { get; } public abstract System.Uri Uri { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetDestinationCheckpointDetails(); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetSourceCheckpointDetails(); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract partial class StorageResourceCheckpointDetails { protected StorageResourceCheckpointDetails() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract int Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract void Serialize(System.IO.Stream stream); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCompleteTransferOptions { public StorageResourceCompleteTransferOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public abstract partial class StorageResourceContainer : Azure.Storage.DataMovement.StorageResource { protected StorageResourceContainer() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CreateIfNotExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceContainer GetChildStorageResourceContainer(string path); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceItem GetStorageResourceReference(string path, string resourceId); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Collections.Generic.IAsyncEnumerable GetStorageResourcesAsync(Azure.Storage.DataMovement.StorageResourceContainer destinationContainer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCopyFromUriOptions { public StorageResourceCopyFromUriOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string BlockId { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.HttpAuthorization SourceAuthentication { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public enum StorageResourceCreationMode @@ -55,45 +76,77 @@ public enum StorageResourceCreationMode public abstract partial class StorageResourceItem : Azure.Storage.DataMovement.StorageResource { protected StorageResourceItem() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long? Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedChunkSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedSingleTransferSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ResourceId { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal Azure.Storage.DataMovement.StorageResourceItemProperties ResourceProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.TransferOrder TransferType { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CompleteTransferAsync(bool overwrite, Azure.Storage.DataMovement.StorageResourceCompleteTransferOptions completeTransferOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyBlockFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.HttpRange range, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromStreamAsync(System.IO.Stream stream, long streamLength, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceWriteToOffsetOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task DeleteIfExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetCopyAuthorizationHeaderAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItemProperties properties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPropertiesAsync(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task ReadStreamAsync(long position = (long)0, long? length = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task SetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.Storage.DataMovement.StorageResourceItemProperties sourceProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceItemProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceItemProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ETag? ETag { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.DateTimeOffset? LastModifiedTime { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IDictionary RawProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public long? ResourceLength { get { throw null; } set { } } } public abstract partial class StorageResourceProvider { protected StorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ProviderId { get; } - protected internal abstract System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); - protected internal abstract System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceReadStreamResult { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly System.IO.Stream Content; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ContentLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly Azure.ETag? ETag; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ResourceLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceReadStreamResult(System.IO.Stream content, Azure.HttpRange range, Azure.Storage.DataMovement.StorageResourceItemProperties properties) { } } public partial class StorageResourceWriteToOffsetOptions @@ -159,7 +212,7 @@ public TransferManagerOptions() { } public Azure.Core.DiagnosticsOptions Diagnostics { get { throw null; } } public Azure.Storage.DataMovement.TransferErrorMode ErrorMode { get { throw null; } set { } } public int? MaximumConcurrency { get { throw null; } set { } } - public System.Collections.Generic.List ResumeProviders { get { throw null; } set { } } + public System.Collections.Generic.IList ProvidersForResuming { get { throw null; } set { } } } public partial class TransferOperation { @@ -174,7 +227,7 @@ internal TransferOperation() { } public partial class TransferOptions : System.IEquatable { public TransferOptions() { } - public Azure.Storage.DataMovement.StorageResourceCreationMode CreationPreference { get { throw null; } set { } } + public Azure.Storage.DataMovement.StorageResourceCreationMode CreationMode { get { throw null; } set { } } public long? InitialTransferSize { get { throw null; } set { } } public long? MaximumTransferChunkSize { get { throw null; } set { } } public Azure.Storage.DataMovement.TransferProgressHandlerOptions ProgressHandlerOptions { get { throw null; } set { } } @@ -216,12 +269,17 @@ public TransferProgressHandlerOptions() { } } public partial class TransferProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal TransferProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] DestinationCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string DestinationProviderId { get { throw null; } } public virtual System.Uri DestinationUri { get { throw null; } } public virtual bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] SourceCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string SourceProviderId { get { throw null; } } public virtual System.Uri SourceUri { get { throw null; } } public virtual string TransferId { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs index 291b9aa443ad..dc03f5ffcd4f 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs @@ -2,47 +2,68 @@ namespace Azure.Storage.DataMovement { public partial class LocalFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public LocalFilesStorageResourceProvider() { } + internal LocalFilesStorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override string ProviderId { get { throw null; } } - protected internal override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } - public Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } - protected internal override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public abstract partial class StorageResource { protected StorageResource() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract bool IsContainer { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract string ProviderId { get; } public abstract System.Uri Uri { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetDestinationCheckpointDetails(); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetSourceCheckpointDetails(); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract partial class StorageResourceCheckpointDetails { protected StorageResourceCheckpointDetails() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract int Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract void Serialize(System.IO.Stream stream); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCompleteTransferOptions { public StorageResourceCompleteTransferOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public abstract partial class StorageResourceContainer : Azure.Storage.DataMovement.StorageResource { protected StorageResourceContainer() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CreateIfNotExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceContainer GetChildStorageResourceContainer(string path); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceItem GetStorageResourceReference(string path, string resourceId); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Collections.Generic.IAsyncEnumerable GetStorageResourcesAsync(Azure.Storage.DataMovement.StorageResourceContainer destinationContainer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCopyFromUriOptions { public StorageResourceCopyFromUriOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string BlockId { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.HttpAuthorization SourceAuthentication { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public enum StorageResourceCreationMode @@ -55,45 +76,77 @@ public enum StorageResourceCreationMode public abstract partial class StorageResourceItem : Azure.Storage.DataMovement.StorageResource { protected StorageResourceItem() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long? Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedChunkSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedSingleTransferSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ResourceId { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal Azure.Storage.DataMovement.StorageResourceItemProperties ResourceProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.TransferOrder TransferType { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CompleteTransferAsync(bool overwrite, Azure.Storage.DataMovement.StorageResourceCompleteTransferOptions completeTransferOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyBlockFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.HttpRange range, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromStreamAsync(System.IO.Stream stream, long streamLength, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceWriteToOffsetOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task DeleteIfExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetCopyAuthorizationHeaderAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItemProperties properties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPropertiesAsync(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task ReadStreamAsync(long position = (long)0, long? length = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task SetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.Storage.DataMovement.StorageResourceItemProperties sourceProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceItemProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceItemProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ETag? ETag { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.DateTimeOffset? LastModifiedTime { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IDictionary RawProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public long? ResourceLength { get { throw null; } set { } } } public abstract partial class StorageResourceProvider { protected StorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ProviderId { get; } - protected internal abstract System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); - protected internal abstract System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceReadStreamResult { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly System.IO.Stream Content; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ContentLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly Azure.ETag? ETag; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ResourceLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceReadStreamResult(System.IO.Stream content, Azure.HttpRange range, Azure.Storage.DataMovement.StorageResourceItemProperties properties) { } } public partial class StorageResourceWriteToOffsetOptions @@ -159,7 +212,7 @@ public TransferManagerOptions() { } public Azure.Core.DiagnosticsOptions Diagnostics { get { throw null; } } public Azure.Storage.DataMovement.TransferErrorMode ErrorMode { get { throw null; } set { } } public int? MaximumConcurrency { get { throw null; } set { } } - public System.Collections.Generic.List ResumeProviders { get { throw null; } set { } } + public System.Collections.Generic.IList ProvidersForResuming { get { throw null; } set { } } } public partial class TransferOperation { @@ -174,7 +227,7 @@ internal TransferOperation() { } public partial class TransferOptions : System.IEquatable { public TransferOptions() { } - public Azure.Storage.DataMovement.StorageResourceCreationMode CreationPreference { get { throw null; } set { } } + public Azure.Storage.DataMovement.StorageResourceCreationMode CreationMode { get { throw null; } set { } } public long? InitialTransferSize { get { throw null; } set { } } public long? MaximumTransferChunkSize { get { throw null; } set { } } public Azure.Storage.DataMovement.TransferProgressHandlerOptions ProgressHandlerOptions { get { throw null; } set { } } @@ -216,12 +269,17 @@ public TransferProgressHandlerOptions() { } } public partial class TransferProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal TransferProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] DestinationCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string DestinationProviderId { get { throw null; } } public virtual System.Uri DestinationUri { get { throw null; } } public virtual bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] SourceCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string SourceProviderId { get { throw null; } } public virtual System.Uri SourceUri { get { throw null; } } public virtual string TransferId { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs index 291b9aa443ad..dc03f5ffcd4f 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs @@ -2,47 +2,68 @@ namespace Azure.Storage.DataMovement { public partial class LocalFilesStorageResourceProvider : Azure.Storage.DataMovement.StorageResourceProvider { - public LocalFilesStorageResourceProvider() { } + internal LocalFilesStorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override string ProviderId { get { throw null; } } - protected internal override System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } - public Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } - public Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } - protected internal override System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceContainer FromDirectory(string directoryPath) { throw null; } + public static Azure.Storage.DataMovement.StorageResourceItem FromFile(string filePath) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal override System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken) { throw null; } } public abstract partial class StorageResource { protected StorageResource() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract bool IsContainer { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract string ProviderId { get; } public abstract System.Uri Uri { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetDestinationCheckpointDetails(); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceCheckpointDetails GetSourceCheckpointDetails(); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract partial class StorageResourceCheckpointDetails { protected StorageResourceCheckpointDetails() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract int Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract void Serialize(System.IO.Stream stream); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCompleteTransferOptions { public StorageResourceCompleteTransferOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public abstract partial class StorageResourceContainer : Azure.Storage.DataMovement.StorageResource { protected StorageResourceContainer() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CreateIfNotExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceContainer GetChildStorageResourceContainer(string path); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.StorageResourceItem GetStorageResourceReference(string path, string resourceId); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Collections.Generic.IAsyncEnumerable GetStorageResourcesAsync(Azure.Storage.DataMovement.StorageResourceContainer destinationContainer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceCopyFromUriOptions { public StorageResourceCopyFromUriOptions() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string BlockId { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.HttpAuthorization SourceAuthentication { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Storage.DataMovement.StorageResourceItemProperties SourceProperties { get { throw null; } set { } } } public enum StorageResourceCreationMode @@ -55,45 +76,77 @@ public enum StorageResourceCreationMode public abstract partial class StorageResourceItem : Azure.Storage.DataMovement.StorageResource { protected StorageResourceItem() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal override bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long? Length { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedChunkSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract long MaxSupportedSingleTransferSize { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ResourceId { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal Azure.Storage.DataMovement.StorageResourceItemProperties ResourceProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract Azure.Storage.DataMovement.TransferOrder TransferType { get; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CompleteTransferAsync(bool overwrite, Azure.Storage.DataMovement.StorageResourceCompleteTransferOptions completeTransferOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyBlockFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.HttpRange range, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromStreamAsync(System.IO.Stream stream, long streamLength, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceWriteToOffsetOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task CopyFromUriAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, bool overwrite, long completeLength, Azure.Storage.DataMovement.StorageResourceCopyFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task DeleteIfExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetCopyAuthorizationHeaderAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItemProperties properties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task GetPropertiesAsync(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task ReadStreamAsync(long position = (long)0, long? length = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract System.Threading.Tasks.Task SetPermissionsAsync(Azure.Storage.DataMovement.StorageResourceItem sourceResource, Azure.Storage.DataMovement.StorageResourceItemProperties sourceProperties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceItemProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceItemProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ETag? ETag { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.DateTimeOffset? LastModifiedTime { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IDictionary RawProperties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public long? ResourceLength { get { throw null; } set { } } } public abstract partial class StorageResourceProvider { protected StorageResourceProvider() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal abstract string ProviderId { get; } - protected internal abstract System.Threading.Tasks.Task FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); - protected internal abstract System.Threading.Tasks.Task FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromDestinationAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected internal abstract System.Threading.Tasks.ValueTask FromSourceAsync(Azure.Storage.DataMovement.TransferProperties properties, System.Threading.CancellationToken cancellationToken); } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class StorageResourceReadStreamResult { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly System.IO.Stream Content; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ContentLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly Azure.ETag? ETag; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public readonly long? ResourceLength; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public StorageResourceReadStreamResult(System.IO.Stream content, Azure.HttpRange range, Azure.Storage.DataMovement.StorageResourceItemProperties properties) { } } public partial class StorageResourceWriteToOffsetOptions @@ -159,7 +212,7 @@ public TransferManagerOptions() { } public Azure.Core.DiagnosticsOptions Diagnostics { get { throw null; } } public Azure.Storage.DataMovement.TransferErrorMode ErrorMode { get { throw null; } set { } } public int? MaximumConcurrency { get { throw null; } set { } } - public System.Collections.Generic.List ResumeProviders { get { throw null; } set { } } + public System.Collections.Generic.IList ProvidersForResuming { get { throw null; } set { } } } public partial class TransferOperation { @@ -174,7 +227,7 @@ internal TransferOperation() { } public partial class TransferOptions : System.IEquatable { public TransferOptions() { } - public Azure.Storage.DataMovement.StorageResourceCreationMode CreationPreference { get { throw null; } set { } } + public Azure.Storage.DataMovement.StorageResourceCreationMode CreationMode { get { throw null; } set { } } public long? InitialTransferSize { get { throw null; } set { } } public long? MaximumTransferChunkSize { get { throw null; } set { } } public Azure.Storage.DataMovement.TransferProgressHandlerOptions ProgressHandlerOptions { get { throw null; } set { } } @@ -216,12 +269,17 @@ public TransferProgressHandlerOptions() { } } public partial class TransferProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal TransferProperties() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] DestinationCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string DestinationProviderId { get { throw null; } } public virtual System.Uri DestinationUri { get { throw null; } } public virtual bool IsContainer { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual byte[] SourceCheckpointDetails { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual string SourceProviderId { get { throw null; } } public virtual System.Uri SourceUri { get { throw null; } } public virtual string TransferId { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/samples/Azure.Storage.DataMovement.Samples.Tests.csproj b/sdk/storage/Azure.Storage.DataMovement/samples/Azure.Storage.DataMovement.Samples.Tests.csproj new file mode 100644 index 000000000000..2d61661069c1 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/samples/Azure.Storage.DataMovement.Samples.Tests.csproj @@ -0,0 +1,42 @@ + + + $(RequiredTargetFrameworks) + Microsoft Azure.Storage.DataMovement client library samples + false + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md b/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md new file mode 100644 index 000000000000..0af4e7e3f6b2 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md @@ -0,0 +1,104 @@ +# Resuming through Checkpointing + +By persisting transfer progress to disk, DataMovement allows resuming of transfers that failed partway through, or were otherwise paused. To resume a transfer, the transfer manager needs to be setup in the first place with `StorageResourceProvider` instances (the same ones used above in [Starting New Transfers](#starting-new-transfers)) which are capable of reassembling the transfer components from persisted data. + +When resuming a transfer, any individual transfer item (e.g. blob, file) in which, +the transfer did not successfully transfer or transfer that was interrupted partway, will be resumed from the beginning. This means that no transfer will resume from the middle of a transfer item. + +By default Data Movement SDK will create a folder called `.azstoragedml` at the path where the SDK is being run. + +## Setting Checkpointer Folder Local Location + +The location of persisted transfer data will be different than the default location if `TransferCheckpointStoreOptions` were set in `TransferManagerOptions`. To resume transfers recorded in a non-default location, the transfer manager resuming the transfer will also need the appropriate checkpoint store options. + +To specify the checkpoint folder directory: +```csharp +string localCheckpointerPath = "C://user//checkpointer-folder" +TransferManagerOptions options = new TransferManagerOptions() +{ + CheckpointerOptions = TransferCheckpointStoreOptions.Local(localCheckpointerPath) +}; +``` + +## Disable checkpointing + +> **WARNING:** If checkpointer is disabled, you will not be able to pause and/or resume any transfer. + +To disable checkpointing see the code snippet below. This will disable the checkpointer from writing to disk on default to store the checkpointer information. + +```csharp +TransferManagerOptions options = new TransferManagerOptions() +{ + CheckpointerOptions = TransferCheckpointStoreOptions.Disabled() +}; +``` + +## Resuming Existing Transfers + +By persisting transfer progress to disk, DataMovement allows resuming of transfers that failed partway through, or were otherwise paused. To resume a transfer, the transfer manager needs to be setup in the first place with `StorageResourceProvider` instances (the same ones used above in [Starting New Transfers](#starting-new-transfers)) which are capable of reassembling the transfer components from persisted data. + +The below sample initializes the `TransferManager` such that it's capable of resuming transfers between the local filesystem and Azure Blob Storage, using the Azure.Storage.DataMovement.Blobs package. The `BlobsStorageResourceProvider` uses an `Azure.Core` token credential with permission to the appropriate resources. + +> **Important:** Credentials to storage providers are not persisted. Storage access which requires credentials will need its appropriate `StorageResourceProvider` to be configured with those credentials. + +```C# Snippet:SetupTransferManagerForResume +TokenCredential tokenCredential = new DefaultAzureCredential(); +BlobsStorageResourceProvider blobs = new(tokenCredential); +TransferManager transferManager = new(new TransferManagerOptions() +{ + ProvidersForResuming = new List() { blobs }, +}); +``` + +To resume a transfer, provide the transfer's ID, as shown below. In the case where your application does not have the desired transfer ID available, use `TransferManager.GetTransfersAsync()` to find that transfer and it's ID. + +> **WARNING:** If your storage resource requires credentials, and the `TransferManagerOptions.ProvidersForResuming` was not configured correctly (e.g. providing correct credentials to the `StorageResourceProvider`, or failing to set `ProvidersForResuming`), and you attempt to resume, the transfer will most likely fail. + +```C# Snippet:DataMovement_ResumeSingle +TransferOperation resumedTransfer = await transferManager.ResumeTransferAsync(transferId); +``` + +### Retrieve Resumable transfers stored in the Checkpointer + +To retrieve and resume specific transfers stored within the checkpointer, see the sample below. + +```C# Snippet:TransferManagerResumeTransfers +TokenCredential tokenCredential = new DefaultAzureCredential(); +BlobsStorageResourceProvider blobs = new(tokenCredential); +TransferManager transferManager = new TransferManager(new TransferManagerOptions() +{ + ProvidersForResuming = new List() { blobs } +}); +// Get resumable transfers from transfer manager +await foreach (TransferProperties properties in transferManager.GetResumableTransfersAsync()) +{ + // Resume the transfer + if (properties.SourceUri.AbsoluteUri == "https://storageaccount.blob.core.windows.net/containername/blobpath") + { + await transferManager.ResumeTransferAsync(properties.TransferId); + } +} +``` + +To resume **all** transfers stored in the checkpointer, see the sample below. + +```C# Snippet:ResumeAllTransfers +// Resume all transfers +List transfers = await transferManager.ResumeAllTransfersAsync(); +``` + +Each storage service has their respective `StorageResourceProvider`: +- [Blob](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md#) +- [Share File](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md#resume-using-sharefilesstorageresourceprovider) + +## Pausing transfers + +Transfers can be paused either by a given `DataTransfer` or through the `TransferManager` handling the transfer by referencing the transfer ID. The ID can be found on the `DataTransfer` object you received upon transfer start. + +```C# Snippet:PauseFromTransfer +await transferOperation.PauseAsync(); +``` + +```C# Snippet:PauseFromManager +await transferManager.PauseTransferAsync(transferId); +``` \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.DataMovement/samples/Sample01b_Migration.cs b/sdk/storage/Azure.Storage.DataMovement/samples/Sample01b_Migration.cs new file mode 100644 index 000000000000..3b11393a2b33 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/samples/Sample01b_Migration.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Threading.Tasks; +using Azure.Storage.Blobs.Specialized; +using Azure.Storage.Sas; +using NUnit.Framework; +using Azure.Core; +using Azure.Identity; +using Azure.Storage.Blobs.Models; +using Azure.Storage.Blobs; +using System.Collections.Generic; +using Azure.Storage.DataMovement.Blobs; +using Azure.Storage.DataMovement.Files.Shares; +using Azure.Storage.Files.Shares; + +namespace Azure.Storage.DataMovement.Samples +{ + /// + /// Samples for migrating from Microsoft.Azure.Storage.DataMovement + /// to Azure.Storage.DataMovement. + /// + public class Sample01b_Migration : SampleTest + { + public Random _rand = new Random(); + + public (Uri AccountUri, StorageSharedKeyCredential AccountCredential) GetSharedKeyAccessAccount() + { + // Get a Storage account name and shared key + // + // You can obtain both from the Azure Portal by clicking Access + // Keys under Settings in the Portal Storage account blade. + // + // You can also get access to your account keys from the Azure CLI + // with: + // + // az storage account keys list --account-name --resource-group + // + string accountName = StorageAccountName; + string accountKey = StorageAccountKey; + + // Create a SharedKeyCredential that we can use to authenticate + return (StorageAccountBlobUri, new StorageSharedKeyCredential(accountName, accountKey)); + } + + [Test] + public async Task UploadBlob() + { + #region Snippet:DataMovementMigration_UploadSingleFile_VarDeclaration + // these values provided by your code + string filePath; + Uri blobUri; + BlobsStorageResourceProvider blobs; + TransferManager transferManager; + #endregion + + // Create a temporary Lorem Ipsum file on disk to upload + filePath = CreateTempFile(); + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + blobUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }.ToUri(); + + // Create the container for this sample to upload a file to + BlobContainerClient container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + + try + { + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_UploadSingleFile + // upload blob + TransferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromFile(filePath), + await blobs.FromBlobAsync(blobUri)); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task UploadBlobDirectory() + { + #region Snippet:DataMovementMigration_UploadBlobDirectory_VarDeclaration + // these values provided by your code + string directoryPath, blobDirectoryPath; + Uri containerUri; + BlobsStorageResourceProvider blobs; + TransferManager transferManager; + #endregion + + // Create a temporary populated directory on disk to upload + directoryPath = CreateLocalTestDirectory(3); + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + blobDirectoryPath = Randomize("sample-blob-dir"); + containerUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + }.ToUri(); + + // Create the container for this sample to upload a file to + BlobContainerClient container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + + try + { + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_UploadBlobDirectory + // upload blobs + TransferOperation operation = await transferManager.StartTransferAsync( + LocalFilesStorageResourceProvider.FromDirectory(directoryPath), + await blobs.FromContainerAsync(containerUri, new BlobStorageResourceContainerOptions() + { + BlobPrefix = blobDirectoryPath, + })); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task DownloadBlob() + { + #region Snippet:DataMovementMigration_DownloadBlob_VarDeclaration + // these values provided by your code + string filePath; + Uri blobUri; + BlobsStorageResourceProvider blobs; + TransferManager transferManager; + #endregion + + // Create a temporary populated directory on disk to upload + filePath = CreateTempPath(); + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + blobUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }.ToUri(); + + BlobContainerClient container = null; + try + { + // Create the container & blob for this sample download + container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + await container.GetBlobClient(blobName) + .UploadAsync(BinaryData.FromString(SampleFileContent)); + + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_DownloadBlob + // download blob + TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(blobUri), + LocalFilesStorageResourceProvider.FromFile(filePath)); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container?.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task DownloadBlobDirectory() + { + #region Snippet:DataMovementMigration_DownloadBlobDirectory_VarDeclaration + // these values provided by your code + string directoryPath, blobDirectoryPath; + Uri containerUri; + BlobsStorageResourceProvider blobs; + TransferManager transferManager; + #endregion + + // Create a temporary populated directory on disk to upload + directoryPath = CreateLocalTestDirectory(3); + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + blobDirectoryPath = Randomize("sample-blob-dir"); + containerUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + }.ToUri(); + + // Create the container for this sample to upload a file to + BlobContainerClient container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + + try + { + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_DownloadBlobDirectory + // download blob directory + TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromContainerAsync(containerUri, new BlobStorageResourceContainerOptions() + { + BlobPrefix = blobDirectoryPath, + }), + LocalFilesStorageResourceProvider.FromDirectory(directoryPath)); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task CopyBlob() + { + #region Snippet:DataMovementMigration_CopyBlobToBlob_VarDeclaration + // these values provided by your code + Uri srcBlobUri, dstBlobUri; + BlobsStorageResourceProvider blobs; + TransferManager transferManager; + #endregion + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + string srcBlobName = Randomize("sample-blob"); + string dstBlobName = Randomize("sample-blob"); + srcBlobUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + BlobName = srcBlobName, + }.ToUri(); + dstBlobUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + BlobName = dstBlobName, + }.ToUri(); + + BlobContainerClient container = null; + try + { + // Create the container & blob for this sample download + container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + await container.GetBlobClient(srcBlobName) + .UploadAsync(BinaryData.FromString(SampleFileContent)); + + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_CopyBlobToBlob + // upload blob + TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(srcBlobUri), + await blobs.FromBlobAsync(dstBlobUri)); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container.DeleteIfExistsAsync(); + } + } + + [Test] + public async Task CopyBlobToShare() + { + #region Snippet:DataMovementMigration_CopyBlobToShareFile_VarDeclaration + // these values provided by your code + Uri blobUri, fileUri; + BlobsStorageResourceProvider blobs; + ShareFilesStorageResourceProvider files; + TransferManager transferManager; + #endregion + + // Get account and shared key access + // (see implementation for details) + (Uri accountUri, StorageSharedKeyCredential credential) = GetSharedKeyAccessAccount(); + + // generate a container and blob name for purposes of sample + string containerName = Randomize("sample-container"); + string blobName = Randomize("sample-blob"); + string filePath = $"{Randomize("sample-folder")}/{Randomize("sample-file")}"; + blobUri = new BlobUriBuilder(accountUri) + { + BlobContainerName = containerName, + BlobName = blobName, + }.ToUri(); + fileUri = new ShareUriBuilder(accountUri) + { + ShareName = containerName, + DirectoryOrFilePath = filePath, + }.ToUri(); + + BlobContainerClient container = null; + ShareClient share = null; + try + { + // Create the container & blob for this sample download + container = new BlobServiceClient(accountUri, credential) + .GetBlobContainerClient(containerName); + await container.CreateIfNotExistsAsync(); + await container.GetBlobClient(blobName) + .UploadAsync(BinaryData.FromString(SampleFileContent)); + + // create the share to copy to + share = new ShareClient(accountUri, credential); + await share.CreateIfNotExistsAsync(); + + transferManager = new TransferManager(); + blobs = new BlobsStorageResourceProvider(credential); + files = new ShareFilesStorageResourceProvider(credential); + + #region Snippet:DataMovementMigration_CopyBlobToShareFile + // upload blob + TransferOperation operation = await transferManager.StartTransferAsync( + await blobs.FromBlobAsync(blobUri), + await files.FromFileAsync(fileUri)); + await operation.WaitForCompletionAsync(); + #endregion + } + finally + { + await container?.DeleteIfExistsAsync(); + await share?.DeleteIfExistsAsync(); + } + } + + public async Task CreateBlobContainerTestDirectory(BlobContainerClient client, int depth = 0, string basePath = default) + { + basePath = basePath ?? Path.GetTempFileName(); + + var dirPath = string.IsNullOrEmpty(basePath) ? Path.GetTempFileName() : $"{basePath}/{Path.GetTempFileName()}"; + + await CreateBlobTestFiles(client, dirPath, 5); + + if (depth > 0) + { + await CreateBlobContainerTestDirectory(client, --depth, dirPath); + } + + return dirPath; + } + + public async Task CreateBlobTestFiles(BlobContainerClient client, string dirPath = default, int count = 1) + { + var buff = new byte[1000]; + + for (int i = 0; i < count; i++) + { + var blobPath = string.IsNullOrEmpty(dirPath) ? $"{Path.GetTempFileName()}.txt" : $"{dirPath}/{Path.GetTempFileName()}.txt"; + + _rand.NextBytes(buff); + + await client.UploadBlobAsync(blobPath, new MemoryStream(buff)); + } + } + + public string CreateLocalTestDirectory(int depth = 0, string basePath = default) + { + basePath = basePath ?? Path.GetTempPath(); + + var dirPath = Path.Combine(basePath, Randomize("sample-dir")); + + Directory.CreateDirectory(dirPath); + + CreateLocalTestFiles(dirPath, 5); + + if (depth > 0) + { + CreateLocalTestDirectory(--depth, dirPath); + } + + return dirPath; + } + + public void CreateLocalTestFiles(string dirPath, int count = 1) + { + var buff = new byte[1000]; + + for (int i = 0; i < count; i++) + { + var filePath = Path.Combine(dirPath, Path.GetTempFileName() + ".txt"); + + _rand.NextBytes(buff); + + File.WriteAllText(filePath, Convert.ToBase64String(buff)); + } + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement/samples/StartTransfer.md b/sdk/storage/Azure.Storage.DataMovement/samples/StartTransfer.md new file mode 100644 index 000000000000..83d9f0b9b3c2 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/samples/StartTransfer.md @@ -0,0 +1,141 @@ +# Utilizing `TransferManager.StartTransfer` + +Most of the following examples reuse the same `TransferManager` instance, and therefore only need to be configured once. We recommend this singleton approach, as each instance uses its own concurrency pool, checkpointer path and other resources. + +For other advanced `TransferManager` samples see [TransferManager Advanced Examples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md). + +## Monitoring Transfers + +Transfers can be observed through several mechanisms, depending on your needs. + +### With `TransferOperation` + +Simple observation can be done through a `TransferOperation` instance representing an individual transfer. This is obtained on transfer start. You can also enumerate through all transfers on a `TransferManager.GetTransfersAsync()`. See [Enumerate Through Transfers](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md#Enumerating through Transfers). + +`TransferOperation` contains property `TransferStatus`. You can read this to determine the state of the transfer. States include queued for transfer, in progress, paused, completed, and more. It also contains whether or not the transfer has failed, skipped or has successfully completed. + +`TransferOperation` also exposes a task for transfer completion, `TransferOperation.WaitForCompletionAsync()`. See the last line of the code snippet below. + +```C# Snippet:SimpleBlobUpload_BasePackage +TokenCredential defaultTokenCredential = new DefaultAzureCredential(); +BlobsStorageResourceProvider blobs = new BlobsStorageResourceProvider(defaultTokenCredential); + +// Create simple transfer single blob upload job +TransferOperation transferOperation = await transferManager.StartTransferAsync( + sourceResource: LocalFilesStorageResourceProvider.FromFile(sourceLocalPath), + destinationResource: await blobs.FromBlobAsync(destinationBlobUri)); +await transferOperation.WaitForCompletionAsync(); +``` + +### With Events via `TransferOptions` + +When starting a transfer, `TransferOptions` contains multiple events that can be subscribed to for observation. Below demonstrates listening to the event for individual file completion and logging the result. + +A function that listens to status events for a given transfer: + +```C# Snippet:ListenToTransferEvents +async Task ListenToTransfersAsync(TransferManager transferManager, + StorageResource source, StorageResource destination) +{ + TransferOptions transferOptions = new(); + transferOptions.ItemTransferCompleted += (TransferItemCompletedEventArgs args) => + { + using StreamWriter logStream = File.AppendText(logFile); + logStream.WriteLine($"File Completed Transfer: {args.Source.Uri.LocalPath}"); + return Task.CompletedTask; + }; + return await transferManager.StartTransferAsync( + source, + destination, + transferOptions); +} +``` + +The same can be done when a transfer has completed, failed or has been skipped. + +## With IProgress via `TransferOptions` + +When starting a transfer, `TransferOptions` allows setting a progress handler that contains the progress information for the overall transfer. Granular progress updates will be communicated to the provided `IProgress` instance. + +A function that listens to progress updates for a given transfer with a supplied `IProgress`: + +```C# Snippet:ListenToProgress +async Task ListenToProgressAsync(TransferManager transferManager, IProgress progress, + StorageResource source, StorageResource destination) +{ + TransferOptions transferOptions = new() + { + ProgressHandlerOptions = new() + { + ProgressHandler = progress, + // optionally include the below if progress updates on bytes transferred are desired + TrackBytesTransferred = true, + } + }; + return await transferManager.StartTransferAsync( + source, + destination, + transferOptions); +} +``` + +## Handling/Monitoring Failed Transfers + +Transfer failure can be observed by checking the `TransferOperation` status upon completion, or by listening to failure events on the transfer. While checking the `TransferOperation` may be sufficient for handling single-file transfer failures, event listening is recommended for container transfers. + +Below logs failure for a single transfer by checking its status after completion. + +```C# Snippet:LogTotalTransferFailure +await dataTransfer2.WaitForCompletionAsync(); +if (dataTransfer2.Status.State == TransferState.Completed + && dataTransfer2.Status.HasFailedItems) +{ + using (StreamWriter logStream = File.AppendText(logFile)) + { + logStream.WriteLine($"Failure for TransferId: {dataTransfer2.Id}"); + } +} +``` + +Below logs individual failures in a container transfer via `TransferOptions` events. + +```C# Snippet:LogIndividualTransferFailures +transferOptions.ItemTransferFailed += (TransferItemFailedEventArgs args) => +{ + using (StreamWriter logStream = File.AppendText(logFile)) + { + // Specifying specific resources that failed, since its a directory transfer + // maybe only one file failed out of many + logStream.WriteLine($"Exception occurred with TransferId: {args.TransferId}," + + $"Source Resource: {args.Source.Uri.AbsoluteUri}, +" + + $"Destination Resource: {args.Destination.Uri.AbsoluteUri}," + + $"Exception Message: {args.Exception.Message}"); + } + return Task.CompletedTask; +}; +``` + +## Transfer Creation Mode + +By default, if a transfer that fails to transfer an individual transfer item, it will bring the entire transfer to a stopped completion state that contains failures. + +To overwrite if a transfer item already exists set the `TransferOptions.CreationMode` to `StorageResourceCreationMode.OverwriteIfExists`. + +```C# Snippet:TransferOptionsOverwrite +TransferOptions optionsOverwriteIfExists = new TransferOptions() +{ + CreationMode = StorageResourceCreationMode.OverwriteIfExists, +}; +``` + +To skip when a failure is seen during a transfer of an item set the `TransferOptions.CreationMode` to `StorageResourceCreationMode.Skip`. + +```C# Snippet:TransferOptionsSkipIfExists +TransferOptions optionsSkipIfExists = new TransferOptions() +{ + CreationMode = StorageResourceCreationMode.SkipIfExists, +}; +``` + + + diff --git a/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md b/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md new file mode 100644 index 000000000000..369a76a639c1 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/samples/TransferManager.md @@ -0,0 +1,55 @@ +# Utilizing the `TransferManager` + +Most of the following examples reuse the same `TransferManager` instance, and therefore only need to be configured once. We recommend this singleton approach, as each instance uses its own concurrency pool, checkpointer path and other resources. + +## Configuring `TransferManager` with `TransferManagerOptions` + +To configuration the `TransferManager` for specific needs, this can be set through `TransferManagerOptions` at initialization of the `TransferManager`. + +```C# Snippet:CreateTransferManagerSimple_BasePackage +TransferManager transferManager = new TransferManager(new TransferManagerOptions()); +``` + +## Setting Checkpointer + +The checkpointer options (`TransferCheckpointStoreOptions`) is set through the `TransferManagerOptions`. For more information about checkpointing see [Resume through Checkpointing](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.DataMovement/samples/PauseResumeCheckpointing.md). + +The example below shows how to set the checkpointer to a specific local path. +```csharp +string localCheckpointerPath = "C://user//checkpointer-folder" +TransferManagerOptions options = new TransferManagerOptions() +{ + CheckpointerOptions = TransferCheckpointStoreOptions.Local(localCheckpointerPath) +}; +``` + +## Enumerating through Transfers + +To enumerate through all transfers on a `TransferManager`. + +A function that writes the status of each transfer to console: + +```C# Snippet:EnumerateTransfers +async Task CheckTransfersAsync(TransferManager transferManager) +{ + await foreach (TransferOperation transfer in transferManager.GetTransfersAsync()) + { + using StreamWriter logStream = File.AppendText(logFile); + logStream.WriteLine(Enum.GetName(typeof(TransferStatus), transfer.Status)); + } +} +``` + +To list transfers based on `TransferStatus` value: + +```C# Snippet:EnumerateTransfersStatus +public async Task CheckTransfersStatusAsync(TransferManager transferManager) +{ + string logFile = CreateTempPath(); + await foreach (TransferOperation transfer in transferManager.GetTransfersAsync()) + { + using StreamWriter logStream = File.AppendText(logFile); + logStream.WriteLine(Enum.GetName(typeof(TransferStatus), transfer.Status)); + } +} +``` \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.DataMovement/src/AssemblyInfo.cs b/sdk/storage/Azure.Storage.DataMovement/src/AssemblyInfo.cs index 5382a3cfe054..51b106647cd3 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/AssemblyInfo.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/AssemblyInfo.cs @@ -14,4 +14,10 @@ "012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" + "e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" + "aa7b11b4")] +[assembly: InternalsVisibleTo("Azure.Storage.DataMovement.Files.Shares.Tests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100d15ddcb2968829" + + "5338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc" + + "012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" + + "e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" + + "aa7b11b4")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj b/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj index c987d0213cf4..1407f0d91d4b 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj +++ b/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj @@ -1,10 +1,11 @@ $(RequiredTargetFrameworks);net6.0 + true Microsoft Azure.Storage.DataMovement client library - 12.0.0-beta.7 + 12.0.0 DataMovementSDK;$(DefineConstants) Microsoft Azure Storage DataMovement AzureStorage azureofficial diff --git a/sdk/storage/Azure.Storage.DataMovement/src/LocalFilesStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement/src/LocalFilesStorageResourceProvider.cs index d9125edb2401..7c2f4b776472 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/LocalFilesStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/LocalFilesStorageResourceProvider.cs @@ -2,9 +2,9 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; using System.Threading; using System.Threading.Tasks; -using Azure.Core; using Azure.Storage.Common; namespace Azure.Storage.DataMovement @@ -15,22 +15,25 @@ namespace Azure.Storage.DataMovement public class LocalFilesStorageResourceProvider : StorageResourceProvider { /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal override string ProviderId => "local"; /// /// Default constructor. /// - public LocalFilesStorageResourceProvider() + internal LocalFilesStorageResourceProvider() { } /// - protected internal override Task FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: true)); + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal override ValueTask FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) + => new(FromTransferProperties(properties, getSource: true)); /// - protected internal override Task FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: false)); + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal override ValueTask FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) + => new(FromTransferProperties(properties, getSource: false)); private StorageResource FromTransferProperties(TransferProperties properties, bool getSource) { @@ -50,7 +53,7 @@ private StorageResource FromTransferProperties(TransferProperties properties, bo /// /// Storage resource to this file. /// - public StorageResourceItem FromFile(string filePath) + public static StorageResourceItem FromFile(string filePath) { return new LocalFileStorageResource(filePath); } @@ -64,7 +67,7 @@ public StorageResourceItem FromFile(string filePath) /// /// Storage resource to this directory. /// - public StorageResourceContainer FromDirectory(string directoryPath) + public static StorageResourceContainer FromDirectory(string directoryPath) { return new LocalDirectoryStorageResourceContainer(directoryPath); } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs b/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs index 9aed96530aab..73045e45e4c9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -194,29 +193,26 @@ public override async Task ProcessPartToChunkAsync() } await OnTransferStateChangedAsync(TransferState.InProgress).ConfigureAwait(false); - long? fileLength = default; - StorageResourceItemProperties sourceProperties = default; - fileLength = _sourceResource.Length; - sourceProperties = await _sourceResource.GetPropertiesAsync(_cancellationToken).ConfigureAwait(false); - await _destinationResource.SetPermissionsAsync( - _sourceResource, - sourceProperties, - _cancellationToken).ConfigureAwait(false); - - fileLength = sourceProperties.ResourceLength; - if (!fileLength.HasValue) + StorageResourceItemProperties sourceProperties = + await _sourceResource.GetPropertiesAsync(_cancellationToken).ConfigureAwait(false); + if (!sourceProperties.ResourceLength.HasValue) { await InvokeFailedArgAsync(Errors.UnableToGetLength()).ConfigureAwait(false); return; } - long length = fileLength.Value; + long length = sourceProperties.ResourceLength.Value; + + await _destinationResource.SetPermissionsAsync( + _sourceResource, + sourceProperties, + _cancellationToken).ConfigureAwait(false); // Perform a single copy operation if (_initialTransferSize >= length) { await QueueChunkToChannelAsync( async () => - await StartSingleCallCopy(length).ConfigureAwait(false)) + await StartSingleCallCopy(length, sourceProperties: sourceProperties).ConfigureAwait(false)) .ConfigureAwait(false); return; } @@ -231,7 +227,7 @@ await StartSingleCallCopy(length).ConfigureAwait(false)) sourceProperties, _cancellationToken); - // If we cannot upload in one shot, initiate the parallel block uploader + // If we cannot copy in one shot, queue the rest of the chunks if (await CreateDestinationResource(length, blockSize).ConfigureAwait(false)) { IEnumerable<(long Offset, long Length)> ranges = GetRanges(length, blockSize); @@ -261,7 +257,7 @@ await QueueStageBlockRequest( } } - internal async Task StartSingleCallCopy(long completeLength) + private async Task StartSingleCallCopy(long completeLength, StorageResourceItemProperties sourceProperties) { try { @@ -276,6 +272,7 @@ await _destinationResource.CopyFromUriAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); await ReportBytesWrittenAsync(completeLength).ConfigureAwait(false); + await CompleteTransferAsync(sourceProperties).ConfigureAwait(false); await OnTransferStateChangedAsync(TransferState.Completed).ConfigureAwait(false); } catch (RequestFailedException exception) @@ -297,11 +294,10 @@ await _destinationResource.CopyFromUriAsync( } /// - /// Creates the destination if necessary, and overwrites if necessary. - /// Will return false if no further upload of the blob is necessary + /// Creates the destination resource and performs the first copy call. + /// Returns false if the copy is complete or this operation failed/skipped. /// - /// - internal async Task CreateDestinationResource(long length, long blockSize) + private async Task CreateDestinationResource(long totalLength, long blockSize) { try { @@ -311,18 +307,12 @@ await _destinationResource.CopyBlockFromUriAsync( sourceResource: _sourceResource, overwrite: _createMode == StorageResourceCreationMode.OverwriteIfExists, range: new HttpRange(0, blockSize), - completeLength: length, + completeLength: totalLength, options: options, cancellationToken: _cancellationToken).ConfigureAwait(false); // Report first chunk written to progress tracker await ReportBytesWrittenAsync(blockSize).ConfigureAwait(false); - - if (blockSize == length) - { - await CompleteTransferAsync(options.SourceProperties).ConfigureAwait(false); - return false; - } return true; } catch (RequestFailedException exception) @@ -335,6 +325,8 @@ await _destinationResource.CopyBlockFromUriAsync( { await InvokeFailedArgAsync(ex).ConfigureAwait(false); } + + // Do not continue if we need to skip or there was an error. return false; } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResource.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResource.cs index 64fe41b844f0..c12eea9c511c 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResource.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResource.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; namespace Azure.Storage.DataMovement { @@ -20,6 +21,7 @@ protected StorageResource() /// /// Defines whether the storage resource is a container. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract bool IsContainer { get; } /// @@ -31,18 +33,21 @@ protected StorageResource() /// A string ID for the resource provider that should be used for rehydration. /// NOTE: Must be no more than 5 characters long. /// + [EditorBrowsable(EditorBrowsableState.Never)] public abstract string ProviderId { get; } /// /// Gets the source checkpoint data for this resource that will be written to the checkpointer. /// /// A containing the checkpoint information for this resource. + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract StorageResourceCheckpointDetails GetSourceCheckpointDetails(); /// /// Gets the destination checkpoint data for this resource that will be written to the checkpointer. /// /// A containing the checkpoint information for this resource. + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract StorageResourceCheckpointDetails GetDestinationCheckpointDetails(); } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCheckpointDetails.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCheckpointDetails.cs index d6bbb0d87671..9e7ed57a86db 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCheckpointDetails.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCheckpointDetails.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ComponentModel; using System.IO; namespace Azure.Storage.DataMovement @@ -8,17 +9,20 @@ namespace Azure.Storage.DataMovement /// /// Abstract class for checkpoint data related to a specific resource type. /// + [EditorBrowsable(EditorBrowsableState.Never)] public abstract class StorageResourceCheckpointDetails { /// /// The length of the checkpoint data in bytes. /// + [EditorBrowsable(EditorBrowsableState.Never)] public abstract int Length { get; } /// /// Serializes the checkpoint data into the given stream. /// /// The stream to serialize the data into. + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract void Serialize(Stream stream); } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCompleteTransferOptions.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCompleteTransferOptions.cs index 15e2cf8b0c98..b2a14356eb2d 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCompleteTransferOptions.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCompleteTransferOptions.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.Collections.Generic; -using System.Text; +using System.ComponentModel; namespace Azure.Storage.DataMovement { /// /// Options for . /// + [EditorBrowsable(EditorBrowsableState.Never)] public class StorageResourceCompleteTransferOptions { /// /// Optional. Specifies the source properties to set in the destination. /// + [EditorBrowsable(EditorBrowsableState.Never)] public StorageResourceItemProperties SourceProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceContainer.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceContainer.cs index 7ad733f237b4..52f5aaff05b0 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceContainer.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceContainer.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using System.ComponentModel; using System.Threading; using System.Threading.Tasks; @@ -20,6 +21,7 @@ protected StorageResourceContainer() { } /// /// Lists all the child storage resources in the path. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract IAsyncEnumerable GetStorageResourcesAsync( StorageResourceContainer destinationContainer = default, CancellationToken cancellationToken = default); @@ -29,12 +31,14 @@ protected internal abstract IAsyncEnumerable GetStorageResource /// /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract StorageResourceItem GetStorageResourceReference(string path, string resourceId); /// /// Creates storage resource container if it does not already exists. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task CreateIfNotExistsAsync(CancellationToken cancellationToken = default); /// @@ -44,11 +48,13 @@ protected internal abstract IAsyncEnumerable GetStorageResource /// The path of the child container. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract StorageResourceContainer GetChildStorageResourceContainer(string path); /// /// Storage Resource is a container. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal override bool IsContainer => true; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCopyFromUriOptions.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCopyFromUriOptions.cs index 4b50e4c718e4..38ca7675181e 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCopyFromUriOptions.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceCopyFromUriOptions.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ComponentModel; using System.IO; using System.Threading; @@ -9,6 +10,7 @@ namespace Azure.Storage.DataMovement /// /// Options for /// + [EditorBrowsable(EditorBrowsableState.Never)] public class StorageResourceCopyFromUriOptions { /// @@ -17,6 +19,7 @@ public class StorageResourceCopyFromUriOptions /// /// Applies only to block blobs. /// + [EditorBrowsable(EditorBrowsableState.Never)] public string BlockId { get; internal set; } /// @@ -24,11 +27,13 @@ public class StorageResourceCopyFromUriOptions /// /// Only applies to copy operations, not local operations. /// + [EditorBrowsable(EditorBrowsableState.Never)] public HttpAuthorization SourceAuthentication { get; set; } /// /// Optional. Specifies the source properties to set in the destination. /// + [EditorBrowsable(EditorBrowsableState.Never)] public StorageResourceItemProperties SourceProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItem.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItem.cs index c97a86c9526c..f4cf9d98d5f6 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItem.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItem.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ComponentModel; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -20,33 +21,32 @@ protected StorageResourceItem() { } /// /// The identifier for the type of storage resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract string ResourceId { get; } /// /// Defines the transfer type of the storage resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract TransferOrder TransferType { get; } /// /// Defines the maximum supported size for the storage resource to be created /// in a single API call. /// - protected internal abstract long MaxSupportedSingleTransferSize { get; } - - /// - /// Defines the maximum supported size for the storage resource to be created - /// in a single API call. - /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract long MaxSupportedSingleTransferSize { get; } /// /// Defines the maximum supported chunk size for the storage resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract long MaxSupportedChunkSize { get; } /// /// Storage Resource is a container. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal override bool IsContainer => false; /// @@ -54,11 +54,13 @@ protected StorageResourceItem() { } /// /// Will return default if the length was not set by a GetStorageResources API call. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract long? Length { get; } /// /// Properties of the Storage Resource Item. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal StorageResourceItemProperties ResourceProperties { get; set; } /// @@ -75,6 +77,7 @@ protected StorageResourceItem() { } /// notifications that the operation should be cancelled. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task ReadStreamAsync( long position = 0, long? length = default, @@ -99,6 +102,7 @@ protected internal abstract Task ReadStreamAsyn /// notifications that the operation should be cancelled. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task CopyFromStreamAsync( Stream stream, long streamLength, @@ -123,6 +127,7 @@ protected internal abstract Task CopyFromStreamAsync( /// notifications that the operation should be cancelled. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task CopyFromUriAsync( StorageResourceItem sourceResource, bool overwrite, @@ -147,6 +152,7 @@ protected internal abstract Task CopyFromUriAsync( /// notifications that the operation should be cancelled. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task CopyBlockFromUriAsync( StorageResourceItem sourceResource, HttpRange range, @@ -161,12 +167,14 @@ protected internal abstract Task CopyBlockFromUriAsync( /// See . /// /// Returns the properties of the Storage Resource. See + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task GetPropertiesAsync(CancellationToken token = default); /// /// Gets the Permissions of a storage resource. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task GetPermissionsAsync( StorageResourceItemProperties properties = default, CancellationToken cancellationToken = default); @@ -174,6 +182,7 @@ protected internal abstract Task GetPermissionsAsync( /// Sets the permissions of the storage resource. /// /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task SetPermissionsAsync( StorageResourceItem sourceResource, StorageResourceItemProperties sourceProperties, @@ -190,6 +199,7 @@ protected internal abstract Task SetPermissionsAsync( /// Gets the HTTP Authorization header for the storage resource if available. If not available /// will return default. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task GetCopyAuthorizationHeaderAsync(CancellationToken cancellationToken = default); /// @@ -206,6 +216,7 @@ protected internal abstract Task SetPermissionsAsync( /// notifications that the operation should be cancelled. /// /// The Task which Commits the list of ids + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task CompleteTransferAsync( bool overwrite, StorageResourceCompleteTransferOptions completeTransferOptions = default, @@ -222,6 +233,7 @@ protected internal abstract Task CompleteTransferAsync( /// If the storage resource exists and is deleted, true will be returned. /// Otherwise if the storage resource does not exist, false will be returned. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract Task DeleteIfExistsAsync(CancellationToken cancellationToken = default); } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItemProperties.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItemProperties.cs index b43add646520..98894fdee8e7 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItemProperties.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceItemProperties.cs @@ -3,37 +3,44 @@ using System; using System.Collections.Generic; +using System.ComponentModel; namespace Azure.Storage.DataMovement { /// /// Properties of a Storage Resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public class StorageResourceItemProperties { /// /// The length of the resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public long? ResourceLength { get; set; } /// /// The HTTP ETag of the Storage Resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public ETag? ETag { get; set; } /// /// The Last Modified Time of the Storage Resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public DateTimeOffset? LastModifiedTime { get; set; } /// /// Dictionary of the properties associated with this resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public IDictionary RawProperties { get; set; } /// /// Base constructor for mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] public StorageResourceItemProperties() { RawProperties = new Dictionary(); diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceProvider.cs index 247232620e1b..a1c753b95bf1 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceProvider.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ComponentModel; using System.Threading; using System.Threading.Tasks; @@ -14,16 +15,19 @@ public abstract class StorageResourceProvider /// /// Provider ID. For DataMovement to query in selecting appropriate provider on resume. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal abstract string ProviderId { get; } /// /// Gets a source resource from the given transfer properties. /// - protected internal abstract Task FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken); + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal abstract ValueTask FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken); /// /// Gets a source resource from the given transfer properties. /// - protected internal abstract Task FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken); + [EditorBrowsable(EditorBrowsableState.Never)] + protected internal abstract ValueTask FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken); } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceReadStreamResult.cs b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceReadStreamResult.cs index 8965fa760ded..3a2d13a1950a 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceReadStreamResult.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StorageResourceReadStreamResult.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.ComponentModel; using System.IO; namespace Azure.Storage.DataMovement @@ -8,26 +9,31 @@ namespace Azure.Storage.DataMovement /// /// The properties and content returned from downloading a storage resource /// + [EditorBrowsable(EditorBrowsableState.Never)] public class StorageResourceReadStreamResult { /// /// Content. /// + [EditorBrowsable(EditorBrowsableState.Never)] public readonly Stream Content; /// /// Length of the content. /// + [EditorBrowsable(EditorBrowsableState.Never)] public readonly long? ContentLength; /// /// Length of the resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public readonly long? ResourceLength; /// /// The ETag of the result. /// + [EditorBrowsable(EditorBrowsableState.Never)] public readonly ETag? ETag; internal StorageResourceReadStreamResult() { } @@ -38,6 +44,7 @@ internal StorageResourceReadStreamResult() { } /// /// /// + [EditorBrowsable(EditorBrowsableState.Never)] public StorageResourceReadStreamResult( Stream content, HttpRange range, @@ -53,6 +60,7 @@ public StorageResourceReadStreamResult( /// Constructor for ReadStreamStorageResourceInfo /// /// + [EditorBrowsable(EditorBrowsableState.Never)] internal StorageResourceReadStreamResult( Stream content) { diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs b/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs index 79715b83e071..d6056bc2e24a 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs @@ -195,64 +195,61 @@ public override async Task ProcessPartToChunkAsync() return; } await OnTransferStateChangedAsync(TransferState.InProgress).ConfigureAwait(false); - long? fileLength = default; - StorageResourceItemProperties properties = await _sourceResource.GetPropertiesAsync(_cancellationToken).ConfigureAwait(false); - fileLength = properties.ResourceLength; - if (fileLength.HasValue) + StorageResourceItemProperties sourceProperties = + await _sourceResource.GetPropertiesAsync(_cancellationToken).ConfigureAwait(false); + if (!sourceProperties.ResourceLength.HasValue) { - long length = fileLength.Value; - if (_initialTransferSize >= length) + await InvokeFailedArgAsync(Errors.UnableToGetLength()).ConfigureAwait(false); + return; + } + long length = sourceProperties.ResourceLength.Value; + + if (_initialTransferSize >= length) + { + // If we can create the destination in one call + await QueueChunkToChannelAsync( + async () => + await CreateDestinationResource( + blockSize: length, + length: length, + singleCall: true, + sourceProperties: sourceProperties).ConfigureAwait(false)).ConfigureAwait(false); + return; + } + long blockSize = _transferChunkSize; + _commitBlockHandler = new CommitChunkHandler( + expectedLength: length, + blockSize: blockSize, + GetBlockListCommitHandlerBehaviors(this), + _destinationResource.TransferType, + sourceProperties, + _cancellationToken); + + bool destinationCreated = await CreateDestinationResource( + blockSize, + length, + false, + sourceProperties).ConfigureAwait(false); + if (destinationCreated) + { + // If we cannot upload in one shot, initiate the parallel block uploader + IEnumerable<(long Offset, long Length)> ranges = GetRanges(length, blockSize); + if (_destinationResource.TransferType == TransferOrder.Unordered) { - // If we can create the destination in one call - await QueueChunkToChannelAsync( - async () => - await CreateDestinationResource( - blockSize: length, - length: length, - singleCall: true, - sourceProperties: properties).ConfigureAwait(false)).ConfigureAwait(false); - return; + await QueueStageBlockRequests(ranges, length, sourceProperties).ConfigureAwait(false); } - long blockSize = _transferChunkSize; - _commitBlockHandler = new CommitChunkHandler( - expectedLength: length, - blockSize: blockSize, - GetBlockListCommitHandlerBehaviors(this), - _destinationResource.TransferType, - properties, - _cancellationToken); - - bool destinationCreated = await CreateDestinationResource( - blockSize, - length, - false, - properties).ConfigureAwait(false); - if (destinationCreated) + else // Sequential { - // If we cannot upload in one shot, initiate the parallel block uploader - IEnumerable<(long Offset, long Length)> ranges = GetRanges(length, blockSize); - if (_destinationResource.TransferType == TransferOrder.Unordered) - { - await QueueStageBlockRequests(ranges, length, properties).ConfigureAwait(false); - } - else // Sequential - { - // Queue the first partitioned block task - (long Offset, long Length) first = ranges.First(); - await QueueStageBlockRequest( - first.Offset, - first.Length, - length, - properties).ConfigureAwait(false); - } + // Queue the first partitioned block task + (long Offset, long Length) first = ranges.First(); + await QueueStageBlockRequest( + first.Offset, + first.Length, + length, + sourceProperties).ConfigureAwait(false); } } - else - { - // TODO: logging when given the event handler - await InvokeFailedArgAsync(Errors.UnableToGetLength()).ConfigureAwait(false); - } } catch (Exception ex) { @@ -261,7 +258,8 @@ await QueueStageBlockRequest( } /// - /// Return whether we need to do more after creating the destination resource + /// Creates the destination resource and performs the first copy call. + /// Returns false if the copy is complete or this operation failed. /// private async Task CreateDestinationResource( long blockSize, @@ -329,8 +327,7 @@ await _destinationResource.CopyFromStreamAsync( // Report bytes written before completion await ReportBytesWrittenAsync(blockSize).ConfigureAwait(false); - - // Set completion status to completed + await CompleteTransferAsync(sourceProperties).ConfigureAwait(false); await OnTransferStateChangedAsync(TransferState.Completed).ConfigureAwait(false); } else diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferItemFailedEventArgs.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferItemFailedEventArgs.cs index f1a4bd5a5c0c..48929a73238e 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferItemFailedEventArgs.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferItemFailedEventArgs.cs @@ -47,7 +47,7 @@ public class TransferItemFailedEventArgs : TransferEventArgs /// default value is . /// /// - /// Trhown if is empty or null. + /// Thrown if is empty or null. /// Thrown if is empty or null. /// Thrown if is empty or null. /// diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs index 152ebf4b79c0..cee8540163c7 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs @@ -209,7 +209,7 @@ internal TransferJobInternal( errorHandling, transferOptions.InitialTransferSize, transferOptions.MaximumTransferChunkSize, - transferOptions.CreationPreference, + transferOptions.CreationMode, arrayPool, transferOptions.GetTransferStatus(), transferOptions.GetFailed(), @@ -244,7 +244,7 @@ internal TransferJobInternal( errorHandling, transferOptions.InitialTransferSize, transferOptions.MaximumTransferChunkSize, - transferOptions.CreationPreference, + transferOptions.CreationMode, arrayPool, transferOptions.GetTransferStatus(), transferOptions.GetFailed(), @@ -300,7 +300,6 @@ public virtual async IAsyncEnumerable ProcessJobToJobPartAsync( { // Single resource transfer, we can skip to chunking the job. part = await _createJobPartSingleAsync(this, partNumber).ConfigureAwait(false); - AppendJobPart(part); await OnAllResourcesEnumeratedAsync().ConfigureAwait(false); } catch (Exception ex) @@ -308,6 +307,7 @@ public virtual async IAsyncEnumerable ProcessJobToJobPartAsync( await InvokeFailedArgAsync(ex).ConfigureAwait(false); yield break; } + AppendJobPart(part); yield return part; } else @@ -342,7 +342,7 @@ public virtual async IAsyncEnumerable ProcessJobToJobPartAsync( yield break; } - if (!isEnumerationComplete) + if (!isEnumerationComplete && !_isSingleResource) { await foreach (JobPartInternal jobPartInternal in EnumerateAndCreateJobPartsAsync().ConfigureAwait(false)) { diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs index 9c682b28201b..95cdebb5ac2a 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs @@ -71,7 +71,7 @@ public TransferManager(TransferManagerOptions options = default) options?.ErrorMode ?? TransferErrorMode.StopOnAnyFailure, new ClientDiagnostics(options?.ClientOptions ?? ClientOptions.Default)), CheckpointerExtensions.BuildCheckpointer(options?.CheckpointStoreOptions), - options?.ResumeProviders != null ? new List(options.ResumeProviders) : new(), + options?.ProvidersForResuming != null ? new List(options.ProvidersForResuming) : new(), default) {} @@ -92,6 +92,7 @@ internal TransferManager( _chunksProcessor = chunksProcessor; _jobBuilder = jobBuilder; _resumeProviders = new(resumeProviders ?? new List()); + _resumeProviders.Add(new LocalFilesStorageResourceProvider()); _checkpointer = checkpointer; _generateTransferId = generateTransferId ?? (() => Guid.NewGuid().ToString()); diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferManagerOptions.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferManagerOptions.cs index e393c71812a9..e962504bcd7f 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferManagerOptions.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferManagerOptions.cs @@ -34,7 +34,7 @@ internal class TransferManagerClientOptions : ClientOptions /// More information is available about instantiating these and other /// implementations. /// - public List ResumeProviders { get; set; } + public IList ProvidersForResuming { get; set; } /// /// Optional. Sets the way errors during a transfer will be handled. diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferOptions.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferOptions.cs index 986f59070d9c..9ea6409790ec 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferOptions.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferOptions.cs @@ -100,7 +100,7 @@ public bool Equals(TransferOptions obj) /// the transfer for all resources that were successfully enumerated and the regular default /// for any remaining resources. /// - public StorageResourceCreationMode CreationPreference { get; set; } + public StorageResourceCreationMode CreationMode { get; set; } /// /// If the transfer status of the job changes then the event will get added to this handler. @@ -127,7 +127,7 @@ public bool Equals(TransferOptions obj) /// /// If the transfer has any skipped events that occur the event will get added to this handler. /// Skipped transfer occur during Transfer due to no overwrite allowed as specified in - /// + /// /// public event SyncAsyncEventHandler ItemTransferSkipped; diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferProperties.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferProperties.cs index d3a967137846..eeb40f9eb7bc 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferProperties.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferProperties.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; namespace Azure.Storage.DataMovement { @@ -23,11 +24,13 @@ public class TransferProperties /// /// A string ID for the source resource provider that should be used for rehydration. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual string SourceProviderId { get; internal set; } /// /// The additional checkpoint data specific to the source resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual byte[] SourceCheckpointDetails { get; internal set; } /// @@ -38,11 +41,13 @@ public class TransferProperties /// /// A string ID for the destination resource provider that should be used for rehydration. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual string DestinationProviderId { get; internal set; } /// /// The additional checkpoint data specific to the destination resource. /// + [EditorBrowsable(EditorBrowsableState.Never)] public virtual byte[] DestinationCheckpointDetails { get; internal set; } /// @@ -53,6 +58,7 @@ public class TransferProperties /// /// For mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] protected internal TransferProperties() { } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferStatus.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferStatus.cs index 6ade57dc43c6..f4de3fe3e179 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferStatus.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferStatus.cs @@ -43,7 +43,7 @@ public class TransferStatus : IEquatable /// If set to `false`, the transfer currently has no items that has been skipped. /// /// It's possible to never have any items skipped if - /// is not enabled in the . + /// is not enabled in the . /// public bool HasSkippedItems => _hasSkippedItemValue != 0; diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/CleanUpTransferTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/CleanUpTransferTests.cs index b38b23432c77..354473f53864 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/CleanUpTransferTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/CleanUpTransferTests.cs @@ -87,7 +87,6 @@ private void AssertBaseSource(Mock source) source.Verify(b => b.Uri, Times.Exactly(8)); source.Verify(b => b.ProviderId, Times.Once()); source.Verify(b => b.ResourceId, Times.Once()); - source.Verify(b => b.Length, Times.Once()); source.Verify(b => b.GetSourceCheckpointDetails(), Times.Once()); source.Verify(b => b.GetPropertiesAsync(It.IsAny())); source.Verify(b => b.GetCopyAuthorizationHeaderAsync(It.IsAny())); diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceItem.cs b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceItem.cs index a66b80f32ac4..7e9e1197bdc7 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceItem.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceItem.cs @@ -24,8 +24,6 @@ internal class MockStorageResourceItem : StorageResourceItem protected internal override long MaxSupportedSingleTransferSize => Constants.GB; - protected internal override long MaxSupportedSingleTransferSize => Constants.GB; - protected internal override long MaxSupportedChunkSize => Constants.GB; protected internal override long? Length { get; } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs index bc7de36d35a7..6098939a5f53 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs @@ -28,12 +28,12 @@ internal MockStorageResourceProvider( } /// - protected internal override Task FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: true)); + protected internal override ValueTask FromSourceAsync(TransferProperties properties, CancellationToken cancellationToken) + => new(FromTransferProperties(properties, getSource: true)); /// - protected internal override Task FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) - => Task.FromResult(FromTransferProperties(properties, getSource: false)); + protected internal override ValueTask FromDestinationAsync(TransferProperties properties, CancellationToken cancellationToken) + => new(FromTransferProperties(properties, getSource: false)); private StorageResource FromTransferProperties(TransferProperties properties, bool getSource) { diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryStorageResourceItem.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryStorageResourceItem.cs index d8306b0752da..a8b3502e0629 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryStorageResourceItem.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryStorageResourceItem.cs @@ -23,8 +23,6 @@ internal class MemoryStorageResourceItem : StorageResourceItem protected internal override long MaxSupportedSingleTransferSize => long.MaxValue; - protected internal override long MaxSupportedSingleTransferSize => long.MaxValue; - protected internal override long MaxSupportedChunkSize => long.MaxValue; protected internal override long? Length => Buffer.Length; diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PauseResumeTransferTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/PauseResumeTransferTestBase.cs similarity index 66% rename from sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PauseResumeTransferTests.cs rename to sdk/storage/Azure.Storage.DataMovement/tests/Shared/PauseResumeTransferTestBase.cs index a8e33b66cfc9..3957b5afde85 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/PauseResumeTransferTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/PauseResumeTransferTestBase.cs @@ -1,188 +1,300 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -extern alias BaseBlobs; -extern alias DMBlobs; using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Azure.Core.TestFramework; -using BaseBlobs::Azure.Storage.Blobs; -using BaseBlobs::Azure.Storage.Blobs.Models; -using BaseBlobs::Azure.Storage.Blobs.Specialized; -using Azure.Storage.Blobs.Tests; -using Azure.Storage.Common; -using Azure.Storage.DataMovement.Blobs.Tests; +using Azure.Core; +using Azure.Storage.Test.Shared; +using System.Threading.Tasks; +using System.IO; +using NUnit.Framework; +using System.Threading; using Azure.Storage.DataMovement.JobPlan; using Azure.Storage.Test; -using DMBlobs::Azure.Storage.DataMovement.Blobs; using Moq; -using NUnit.Framework; using Metadata = System.Collections.Generic.IDictionary; +using Azure.Storage.Common; namespace Azure.Storage.DataMovement.Tests { - public class PauseResumeTransferTests : DataMovementBlobTestBase + public abstract class PauseResumeTransferTestBase + : StorageTestBase + where TServiceClient : class + where TContainerClient : class + where TObjectClient : class + where TClientOptions : ClientOptions + where TEnvironment : StorageTestEnvironment, new() { - private readonly CancellationToken _mockingToken = new(); + public ClientBuilder ClientBuilder { get; protected set; } - public PauseResumeTransferTests( + public PauseResumeTransferTestBase( bool async, - BlobClientOptions.ServiceVersion serviceVersion) - : base(async, serviceVersion, default) + RecordedTestMode? mode = null) : base(async, mode) { } - private async Task AssertDirectorySourceAndDestinationAsync( - TransferDirection transferType, - StorageResourceContainer sourceResource, - StorageResourceContainer destinationResource, - BlobContainerClient sourceContainer, - BlobContainerClient destinationContainer) + protected string GetNewContainerName() + => $"test-container-{ClientBuilder.Recording.Random.NewGuid()}"; + protected string GetNewItemName() + => $"test-item-{ClientBuilder.Recording.Random.NewGuid()}"; + + #region Abstract Methods + protected abstract Task> GetDisposingContainerAsync( + string containerName = default, + TServiceClient service = default); + + protected abstract StorageResourceProvider GetStorageResourceProvider(); + + protected abstract Task CreateSourceStorageResourceItemAsync( + long size, + string name, + TContainerClient container); + + protected abstract StorageResource CreateDestinationStorageResourceItem( + string name, + TContainerClient container, + Metadata metadata = default, + string contentLanguage = default); + + protected abstract Task AssertDestinationProperties( + string name, + Metadata metadata, + string contentLanguage, + TContainerClient container); + + protected abstract Task GetStreamFromContainerAsync( + Uri uri, + TContainerClient container); + + protected abstract Task CreateSourceStorageResourceContainerAsync( + long size, + int count, + string directoryPath, + TContainerClient container); + + protected abstract StorageResource CreateDestinationStorageResourceContainer( + TContainerClient container); + #endregion + + #region Helper Methods + private async Task CreateLocalFileSourceResourceAsync( + long size, + string directory) { - await foreach (StorageResourceItem childSourceResource in sourceResource.GetStorageResourcesAsync()) + string localSourceFile = await CreateRandomFileAsync(directory); + // create a new file and copy contents of stream into it, and then close the FileStream + using Stream originalStream = await CreateLimitedMemoryStream(size); + using (FileStream fileStream = File.Create(localSourceFile)) { - StorageResourceItem childDestinationResource; - if (transferType == TransferDirection.Upload) - { - string destinationChildName = childSourceResource.Uri.LocalPath.Substring(sourceResource.Uri.LocalPath.Length + 1); - childDestinationResource = destinationResource.GetStorageResourceReference(destinationChildName, default); - } - else - { - string destinationChildName = childSourceResource.Uri.AbsoluteUri.Substring(sourceResource.Uri.AbsoluteUri.Length + 1); - childDestinationResource = destinationResource.GetStorageResourceReference(destinationChildName, default); - } - await AssertSourceAndDestinationAsync( - transferType: transferType, - sourceResource: childSourceResource, - destinationResource: childDestinationResource, - sourceContainer: sourceContainer, - destinationContainer: destinationContainer); + await originalStream.CopyToAsync(fileStream); } + return LocalFilesStorageResourceProvider.FromFile(localSourceFile); } - private async Task AssertSourceAndDestinationAsync( + private async Task<(StorageResource SourceResource, StorageResource DestinationResource)> CreateStorageResourcesAsync( TransferDirection transferType, - StorageResource sourceResource, - StorageResource destinationResource, - BlobContainerClient sourceContainer, - BlobContainerClient destinationContainer) + long size, + string localDirectory, + TContainerClient sourceContainer, + TContainerClient destinationContainer, + string storagePath = default) { - if (transferType == TransferDirection.Upload) + storagePath ??= GetNewItemName(); + + StorageResource SourceResource = default; + StorageResource DestinationResource = default; + if (transferType == TransferDirection.Download) { - // Verify Upload by downloading the blob and comparing the values - BlobUriBuilder destinationBuilder = new BlobUriBuilder(destinationResource.Uri); - using (FileStream fileStream = File.OpenRead(sourceResource.Uri.LocalPath)) - { - await DownloadAndAssertAsync(fileStream, destinationContainer.GetBlockBlobClient(destinationBuilder.BlobName)); - } + Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); + Argument.AssertNotNullOrEmpty(localDirectory, nameof(localDirectory)); + SourceResource ??= await CreateSourceStorageResourceItemAsync(size, storagePath, sourceContainer); + DestinationResource ??= LocalFilesStorageResourceProvider.FromFile(Path.Combine(localDirectory, storagePath)); } - else if (transferType == TransferDirection.Download) + else if (transferType == TransferDirection.Copy) { - // Verify Download - BlobUriBuilder sourceBuilder = new BlobUriBuilder(sourceResource.Uri); - using (FileStream fileStream = File.OpenRead(destinationResource.Uri.LocalPath)) - { - await DownloadAndAssertAsync(fileStream, sourceContainer.GetBlockBlobClient(sourceBuilder.BlobName)); - } + Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); + Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); + SourceResource ??= await CreateSourceStorageResourceItemAsync(size, storagePath, sourceContainer); + DestinationResource ??= CreateDestinationStorageResourceItem(storagePath, destinationContainer); } else { - BlobUriBuilder sourceBuilder = new BlobUriBuilder(sourceResource.Uri); - BlobUriBuilder destinationBuilder = new BlobUriBuilder(destinationResource.Uri); - - await DownloadCopyBlobAndAssert( - sourceContainer.GetBlobBaseClient(sourceBuilder.BlobName), - destinationContainer.GetBlobBaseClient(destinationBuilder.BlobName)); + // Default to Upload + Argument.AssertNotNullOrEmpty(localDirectory, nameof(localDirectory)); + Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); + SourceResource ??= await CreateLocalFileSourceResourceAsync(size, localDirectory); + DestinationResource ??= CreateDestinationStorageResourceItem(storagePath, destinationContainer); } + return (SourceResource, DestinationResource); } - private async Task CreateLocalFileSourceResourceAsync( - long size, - string directory, - LocalFilesStorageResourceProvider provider) + /// + /// Upload and verify the contents of the blob + /// + /// By default in this function an event argument will be added to the options event handler + /// to detect when the upload has finished. + /// + private async Task CreateSingleLongTransferAsync( + TransferManager manager, + TransferDirection transferType = TransferDirection.Upload, + string localDirectory = default, + TContainerClient sourceContainer = default, + TContainerClient destinationContainer = default, + StorageResource sourceResource = default, + StorageResource destinationResource = default, + TransferOptions transferOptions = default, + long size = DataMovementTestConstants.KB * 100) { - string localSourceFile = await CreateRandomFileAsync(directory); - // create a new file and copy contents of stream into it, and then close the FileStream - // so the StagedUploadAsync call is not prevented from reading using its FileStream. - using Stream originalStream = await CreateLimitedMemoryStream(size); - using (FileStream fileStream = File.Create(localSourceFile)) + Argument.AssertNotNull(manager, nameof(manager)); + if (sourceResource == default && destinationResource == default) { - await originalStream.CopyToAsync(fileStream); + (StorageResource source, StorageResource dest) = await CreateStorageResourcesAsync( + transferType: transferType, + size: size, + localDirectory: localDirectory, + sourceContainer: sourceContainer, + destinationContainer: destinationContainer); + sourceResource = source; + destinationResource = dest; } - return provider.FromFile(localSourceFile); + else if ((sourceResource == default && destinationResource != default) || + (sourceResource != default && destinationResource == default)) + { + throw new ArgumentException($"Both {nameof(sourceResource)} or {nameof(destinationResource)} must be specified, " + + $"if only one is specified."); + } + + // Act + return await manager.StartTransferAsync(sourceResource, destinationResource, transferOptions); } - private async Task CreateBlobSourceResourceAsync( - long size, - string blobName, - BlobContainerClient container, - BlobsStorageResourceProvider provider, - BlockBlobStorageResourceOptions options = default) + private bool StreamsAreEqual(Stream stream1, Stream stream2) { - BlockBlobClient blobClient = container.GetBlockBlobClient(blobName); + if (stream1 == stream2) + { + return true; + } + if (stream1 == null || stream2 == null) + { + return false; + } + if (!stream1.CanRead || !stream2.CanRead) + { + return false; + } + if (stream1.Length != stream2.Length) + { + return false; + } - // create a new file and copy contents of stream into it, and then close the FileStream - // so the StagedUploadAsync call is not prevented from reading using its FileStream. - using (Stream originalStream = await CreateLimitedMemoryStream(size)) + const int bufferSize = 8192; // Read in chunks + byte[] buffer1 = new byte[bufferSize]; + byte[] buffer2 = new byte[bufferSize]; + + stream1.Position = 0; + stream2.Position = 0; + + using (BufferedStream bs1 = new BufferedStream(stream1, bufferSize)) + using (BufferedStream bs2 = new BufferedStream(stream2, bufferSize)) { - // Upload blob to storage account - originalStream.Position = 0; - await blobClient.UploadAsync(originalStream); + int bytesRead1, bytesRead2; + while ((bytesRead1 = bs1.Read(buffer1, 0, buffer1.Length)) > 0) + { + bytesRead2 = bs2.Read(buffer2, 0, buffer2.Length); + if (bytesRead1 != bytesRead2 || !buffer1.Take(bytesRead1).SequenceEqual(buffer2.Take(bytesRead2))) + { + return false; + } + } } - return provider.FromClient(blobClient, options); + return true; } - private StorageResource CreateBlobDestinationResource( - BlobContainerClient container, - BlobsStorageResourceProvider provider, - string blobName = default, - BlockBlobStorageResourceOptions options = default) + private async Task VerifyTransferContent(StorageResource sResource, StorageResource dResource, + TContainerClient sourceContainer, TContainerClient destinationContainer, TransferDirection transferType) { - blobName ??= GetNewBlobName(); - BlockBlobClient destinationClient = container.GetBlockBlobClient(blobName); - return provider.FromClient(destinationClient, options); + // Verify transfer + Stream sourceStream = default; + Stream destinationStream = default; + if (transferType == TransferDirection.Upload) + { + sourceStream = File.OpenRead(sResource.Uri.LocalPath); + destinationStream = await GetStreamFromContainerAsync(dResource.Uri, destinationContainer); + } + else if (transferType == TransferDirection.Download) + { + sourceStream = await GetStreamFromContainerAsync(sResource.Uri, sourceContainer); + destinationStream = File.OpenRead(dResource.Uri.LocalPath); + } + else // Copy + { + sourceStream = await GetStreamFromContainerAsync(sResource.Uri, sourceContainer); + destinationStream = await GetStreamFromContainerAsync(dResource.Uri, destinationContainer); + } + Assert.IsTrue(StreamsAreEqual(sourceStream, destinationStream)); } - private async Task<(StorageResource SourceResource, StorageResource DestinationResource)> CreateStorageResourcesAsync( - TransferDirection transferType, + private async Task CreateLocalDirectorySourceResourceAsync( long size, - string localDirectory, - BlobContainerClient sourceContainer, - BlobContainerClient destinationContainer, - BlobsStorageResourceProvider blobProvider, - LocalFilesStorageResourceProvider localProvider, - string storagePath = default) + int fileCount, + string directoryPath) { - storagePath ??= GetNewBlobName(); + for (int i = 0; i < fileCount; i++) + { + await CreateRandomFileAsync(directoryPath, size: size); + } + return LocalFilesStorageResourceProvider.FromDirectory(directoryPath); + } + private async Task<(StorageResource SourceResource, StorageResource DestinationResource)> CreateStorageResourceContainersAsync( + TransferDirection transferType, + long size, + int transferCount, + string sourceDirectoryPath, + string destinationDirectoryPath, + TContainerClient sourceContainer, + TContainerClient destinationContainer) + { StorageResource SourceResource = default; StorageResource DestinationResource = default; if (transferType == TransferDirection.Download) { Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); - Argument.AssertNotNullOrEmpty(localDirectory, nameof(localDirectory)); - SourceResource ??= await CreateBlobSourceResourceAsync(size, storagePath, sourceContainer, blobProvider); - DestinationResource ??= localProvider.FromFile(Path.Combine(localDirectory, storagePath)); + Argument.AssertNotNullOrEmpty(destinationDirectoryPath, nameof(destinationDirectoryPath)); + SourceResource ??= await CreateSourceStorageResourceContainerAsync( + size: size, + count: transferCount, + directoryPath: GetNewContainerName(), + container: sourceContainer); + DestinationResource ??= LocalFilesStorageResourceProvider.FromDirectory(destinationDirectoryPath); } else if (transferType == TransferDirection.Copy) { Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); - SourceResource ??= await CreateBlobSourceResourceAsync(size, storagePath, sourceContainer, blobProvider); - DestinationResource ??= CreateBlobDestinationResource(destinationContainer, blobProvider, storagePath); + SourceResource ??= await CreateSourceStorageResourceContainerAsync( + size: size, + count: transferCount, + directoryPath: GetNewContainerName(), + container: sourceContainer); + DestinationResource ??= CreateDestinationStorageResourceContainer(destinationContainer); } else { // Default to Upload - Argument.AssertNotNullOrEmpty(localDirectory, nameof(localDirectory)); + Argument.AssertNotNullOrEmpty(sourceDirectoryPath, nameof(sourceDirectoryPath)); Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); - SourceResource ??= await CreateLocalFileSourceResourceAsync(size, localDirectory, localProvider); - DestinationResource ??= CreateBlobDestinationResource(destinationContainer, blobProvider, storagePath); + SourceResource ??= await CreateLocalDirectorySourceResourceAsync( + size: size, + fileCount: transferCount, + directoryPath: sourceDirectoryPath); + DestinationResource ??= CreateDestinationStorageResourceContainer(destinationContainer); } return (SourceResource, DestinationResource); } @@ -193,30 +305,30 @@ private StorageResource CreateBlobDestinationResource( /// By default in this function an event argument will be added to the options event handler /// to detect when the upload has finished. /// - private async Task CreateSingleLongTransferAsync( + private async Task CreateDirectoryLongTransferAsync( TransferManager manager, TransferDirection transferType = TransferDirection.Upload, - string localDirectory = default, - BlobContainerClient sourceContainer = default, - BlobContainerClient destinationContainer = default, + string sourceDirectory = default, + string destinationDirectory = default, + TContainerClient sourceContainer = default, + TContainerClient destinationContainer = default, StorageResource sourceResource = default, StorageResource destinationResource = default, TransferOptions transferOptions = default, - long size = Constants.KB * 100, - BlobsStorageResourceProvider blobProvider = default, - LocalFilesStorageResourceProvider localProvider = default) + int transferCount = 100, + long size = DataMovementTestConstants.MB) { Argument.AssertNotNull(manager, nameof(manager)); if (sourceResource == default && destinationResource == default) { - (StorageResource source, StorageResource dest) = await CreateStorageResourcesAsync( + (StorageResource source, StorageResource dest) = await CreateStorageResourceContainersAsync( transferType: transferType, size: size, - localDirectory: localDirectory, + transferCount: transferCount, + sourceDirectoryPath: sourceDirectory, + destinationDirectoryPath: destinationDirectory, sourceContainer: sourceContainer, - destinationContainer: destinationContainer, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer); sourceResource = source; destinationResource = dest; } @@ -231,8 +343,36 @@ private async Task CreateSingleLongTransferAsync( return await manager.StartTransferAsync(sourceResource, destinationResource, transferOptions); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + private async Task AssertDirectorySourceAndDestinationAsync( + TransferDirection transferType, + StorageResourceContainer sourceResource, + StorageResourceContainer destinationResource, + TContainerClient sourceContainer, + TContainerClient destinationContainer) + { + await foreach (StorageResourceItem childSourceResource in sourceResource.GetStorageResourcesAsync()) + { + StorageResourceItem childDestinationResource; + if (transferType == TransferDirection.Upload) + { + string destinationChildName = childSourceResource.Uri.LocalPath.Substring(sourceResource.Uri.LocalPath.Length + 1); + childDestinationResource = destinationResource.GetStorageResourceReference(destinationChildName, default); + } + else + { + string destinationChildName = childSourceResource.Uri.AbsoluteUri.Substring(sourceResource.Uri.AbsoluteUri.Length + 1); + childDestinationResource = destinationResource.GetStorageResourceReference(destinationChildName, default); + } + + // Verify transfer + await VerifyTransferContent(childSourceResource, childDestinationResource, sourceContainer, destinationContainer, transferType); + } + } + #endregion + + #region Tests + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -241,16 +381,15 @@ public async Task TryPauseTransferAsync_Id(TransferDirection transferType) // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions(); @@ -264,13 +403,11 @@ public async Task TryPauseTransferAsync_Id(TransferDirection transferType) localDirectory: localDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 100, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + size: DataMovementTestConstants.KB * 100, + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -285,8 +422,8 @@ public async Task TryPauseTransferAsync_Id(TransferDirection transferType) Assert.IsTrue(File.Exists(fileName.FullPath)); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -295,16 +432,15 @@ public async Task TryPauseTransferAsync_TransferOperation(TransferDirection tran // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferOptions transferOptions = new TransferOptions(); TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); @@ -318,13 +454,11 @@ public async Task TryPauseTransferAsync_TransferOperation(TransferDirection tran localDirectory: localDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 100, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + size: DataMovementTestConstants.KB * 100, + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -355,8 +489,8 @@ public void TryPauseTransferAsync_Error() Assert.CatchAsync(async () => await transferManager.PauseTransferAsync("bad transfer Id")); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -365,16 +499,15 @@ public async Task TryPauseTransferAsync_AlreadyPaused(TransferDirection transfer // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferOptions transferOptions = new TransferOptions(); TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); @@ -388,13 +521,11 @@ public async Task TryPauseTransferAsync_AlreadyPaused(TransferDirection transfer localDirectory: localDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 100, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + size: DataMovementTestConstants.KB * 100, + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -414,8 +545,8 @@ public async Task TryPauseTransferAsync_AlreadyPaused(TransferDirection transfer Assert.IsTrue(File.Exists(fileName.FullPath)); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -424,31 +555,27 @@ public async Task PauseThenResumeTransferAsync(TransferDirection transferType) // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferOptions transferOptions = new TransferOptions(); TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); TransferManager transferManager = new TransferManager(options); - long size = Constants.KB * 100; + long size = DataMovementTestConstants.KB * 100; (StorageResource sResource, StorageResource dResource) = await CreateStorageResourcesAsync( transferType: transferType, size: size, localDirectory: localDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer.Container); // Add long-running job to pause, if the job is not big enough // then the job might finish before we can pause it. @@ -458,26 +585,26 @@ public async Task PauseThenResumeTransferAsync(TransferDirection transferType) destinationResource: dResource, transferOptions: transferOptions); - // Act - Pause Job - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + // Act + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); - // Assert - Confirm we've paused - Assert.AreEqual(TransferState.Paused, transfer.Status.State); + // Assert await testEventsRaised.AssertPausedCheck(); + Assert.AreEqual(TransferState.Paused, transfer.Status.State); // Act - Resume Job TransferOptions resumeOptions = new TransferOptions() { // Enable overwrite on resume, to overwrite destination. - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; TestEventsRaised testEventRaised2 = new TestEventsRaised(resumeOptions); TransferOperation resumeTransfer = await transferManager.ResumeTransferAsync( transferId: transfer.Id, transferOptions: resumeOptions); - CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await resumeTransfer.WaitForCompletionAsync(waitTransferCompletion.Token); // Assert @@ -486,16 +613,28 @@ public async Task PauseThenResumeTransferAsync(TransferDirection transferType) Assert.IsTrue(resumeTransfer.HasCompleted); // Verify transfer - await AssertSourceAndDestinationAsync( - transferType: transferType, - sourceResource: sResource, - destinationResource: dResource, - sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container); + Stream sourceStream = default; + Stream destinationStream = default; + if (transferType == TransferDirection.Upload) + { + sourceStream = File.OpenRead(sResource.Uri.LocalPath); + destinationStream = await GetStreamFromContainerAsync(dResource.Uri, destinationContainer.Container); + } + else if (transferType == TransferDirection.Download) + { + sourceStream = await GetStreamFromContainerAsync(sResource.Uri, sourceContainer.Container); + destinationStream = File.OpenRead(dResource.Uri.LocalPath); + } + else // Copy + { + sourceStream = await GetStreamFromContainerAsync(sResource.Uri, sourceContainer.Container); + destinationStream = await GetStreamFromContainerAsync(dResource.Uri, destinationContainer.Container); + } + Assert.IsTrue(StreamsAreEqual(sourceStream, destinationStream)); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -504,31 +643,27 @@ public async Task ResumeTransferAsync(TransferDirection transferType) // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferOptions transferOptions = new TransferOptions(); TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); TransferManager transferManager = new TransferManager(options); - long size = Constants.KB * 100; + long size = DataMovementTestConstants.KB * 100; (StorageResource sResource, StorageResource dResource) = await CreateStorageResourcesAsync( transferType: transferType, size: size, localDirectory: localDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer.Container); // Add long-running job to pause, if the job is not big enough // then the job might finish before we can pause it. @@ -538,13 +673,13 @@ public async Task ResumeTransferAsync(TransferDirection transferType) destinationResource: dResource, transferOptions: transferOptions); - // Act - Pause Job - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + // Act + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); - // Assert - Confirm we've paused - Assert.AreEqual(TransferState.Paused, transfer.Status.State); + // Assert await testEventsRaised.AssertPausedCheck(); + Assert.AreEqual(TransferState.Paused, transfer.Status.State); // Act - Resume Job TransferOptions resumeOptions = new(); @@ -553,7 +688,7 @@ public async Task ResumeTransferAsync(TransferDirection transferType) transfer.Id, resumeOptions); - CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await resumeTransfer.WaitForCompletionAsync(waitTransferCompletion.Token); // Assert @@ -561,16 +696,10 @@ public async Task ResumeTransferAsync(TransferDirection transferType) Assert.AreEqual(TransferState.Completed, resumeTransfer.Status.State); Assert.IsTrue(resumeTransfer.HasCompleted); - // Verify transfer - await AssertSourceAndDestinationAsync( - transferType: transferType, - sourceResource: sResource, - destinationResource: dResource, - sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container); + //Verify transfer + await VerifyTransferContent(sResource, dResource, sourceContainer.Container, destinationContainer.Container, transferType); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] [Test] [LiveOnly] [TestCase(TransferDirection.Upload)] @@ -580,243 +709,59 @@ public async Task ResumeTransferAsync_Options(TransferDirection transferType) // Arrange using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory localDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer blobContainer = await GetTestContainerAsync(service); + await using IDisposingContainer container = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); Metadata metadata = DataProvider.BuildMetadata(); - BlockBlobStorageResourceOptions testOptions = new() - { - Metadata = DataProvider.BuildMetadata(), - AccessTier = AccessTier.Cool, - ContentLanguage = "en-US", - }; + string contentLanguage = "en-US"; - long size = Constants.KB; + string destName = GetNewItemName(); + long size = DataMovementTestConstants.KB; StorageResource source; StorageResource destination; if (transferType == TransferDirection.Upload) { - source = await CreateLocalFileSourceResourceAsync(size, localDirectory.DirectoryPath, localProvider); - destination = CreateBlobDestinationResource(blobContainer.Container, blobProvider, options: testOptions); + source = await CreateLocalFileSourceResourceAsync(size, localDirectory.DirectoryPath); + destination = CreateDestinationStorageResourceItem(destName, container.Container, metadata, contentLanguage); } else // Copy { - source = await CreateBlobSourceResourceAsync(size, GetNewBlobName(), blobContainer.Container, blobProvider); - destination = CreateBlobDestinationResource(blobContainer.Container, blobProvider, options: testOptions); + source = await CreateSourceStorageResourceItemAsync(size, GetNewItemName(), container.Container); + destination = CreateDestinationStorageResourceItem(destName, container.Container, metadata, contentLanguage); } TransferOperation transfer = await transferManager.StartTransferAsync(source, destination); - // Act - Pause Job - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + // Act + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); + + // Assert Assert.AreEqual(TransferState.Paused, transfer.Status.State); + await Task.Delay(150); // Act - Resume Job TransferOperation resumeTransfer = await transferManager.ResumeTransferAsync(transfer.Id); - CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource waitTransferCompletion = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await resumeTransfer.WaitForCompletionAsync(waitTransferCompletion.Token); // Assert Assert.AreEqual(TransferState.Completed, resumeTransfer.Status.State); Assert.IsTrue(resumeTransfer.HasCompleted); - BlobUriBuilder builder = new BlobUriBuilder(destination.Uri); - BlockBlobClient blob = blobContainer.Container.GetBlockBlobClient(builder.BlobName); - BlobProperties props = (await blob.GetPropertiesAsync()).Value; - Assert.That(props.Metadata, Is.EqualTo(metadata)); - Assert.AreEqual(testOptions.AccessTier, new AccessTier(props.AccessTier)); - Assert.AreEqual(testOptions.ContentLanguage, props.ContentLanguage); - } - - private async Task CreateBlobDirectorySourceResourceAsync( - long size, - int blobCount, - string directoryPath, - BlobContainerClient container, - BlobsStorageResourceProvider provider, - BlobStorageResourceContainerOptions options = default) - { - for (int i = 0; i < blobCount; i++) - { - if (i % 3 == 0) - { - BlockBlobClient blobClient = container.GetBlockBlobClient(string.Join("/", directoryPath, GetNewBlobName())); - // create a new file and copy contents of stream into it, and then close the FileStream - // so the StagedUploadAsync call is not prevented from reading using its FileStream. - using (Stream originalStream = await CreateLimitedMemoryStream(size)) - { - // Upload blob to storage account - originalStream.Position = 0; - await blobClient.UploadAsync(originalStream); - } - } - else if (i % 3 == 1) - { - AppendBlobClient blobClient = container.GetAppendBlobClient(string.Join("/", directoryPath, GetNewBlobName())); - await blobClient.CreateAsync(); - // create a new file and copy contents of stream into it, and then close the FileStream - // so the StagedUploadAsync call is not prevented from reading using its FileStream. - using (Stream originalStream = await CreateLimitedMemoryStream(size)) - { - // Upload blob to storage account - originalStream.Position = 0; - await blobClient.AppendBlockAsync(originalStream); - } - } - else - { - PageBlobClient blobClient = container.GetPageBlobClient(string.Join("/", directoryPath, GetNewBlobName())); - await blobClient.CreateAsync(size); - // create a new file and copy contents of stream into it, and then close the FileStream - // so the StagedUploadAsync call is not prevented from reading using its FileStream. - using (Stream originalStream = await CreateLimitedMemoryStream(size)) - { - // Upload blob to storage account - originalStream.Position = 0; - await blobClient.UploadPagesAsync(originalStream, 0); - } - } - } - options ??= new(); - options.BlobDirectoryPrefix = directoryPath; - return provider.FromClient(container, options); + await AssertDestinationProperties(destName, metadata, contentLanguage, container.Container); } - private async Task CreateLocalDirectorySourceResourceAsync( - long size, - int fileCount, - string directoryPath, - LocalFilesStorageResourceProvider provider) - { - for (int i = 0; i < fileCount; i++) - { - await CreateRandomFileAsync(directoryPath, size: size); - } - return provider.FromDirectory(directoryPath); - } - - private async Task<(StorageResource SourceResource, StorageResource DestinationResource)> CreateStorageResourceContainersAsync( - TransferDirection transferType, - long size, - int transferCount, - string sourceDirectoryPath, - string destinationDirectoryPath, - BlobContainerClient sourceContainer, - BlobContainerClient destinationContainer, - BlobsStorageResourceProvider blobProvider, - LocalFilesStorageResourceProvider localProvider) - { - StorageResource SourceResource = default; - StorageResource DestinationResource = default; - if (transferType == TransferDirection.Download) - { - Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); - Argument.AssertNotNullOrEmpty(destinationDirectoryPath, nameof(destinationDirectoryPath)); - SourceResource ??= await CreateBlobDirectorySourceResourceAsync( - size: size, - blobCount: transferCount, - directoryPath: GetNewBlobDirectoryName(), - container: sourceContainer, - provider: blobProvider); - DestinationResource ??= localProvider.FromDirectory(destinationDirectoryPath); - } - else if (transferType == TransferDirection.Copy) - { - Argument.AssertNotNull(sourceContainer, nameof(sourceContainer)); - Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); - BlobStorageResourceContainerOptions options = new BlobStorageResourceContainerOptions() - { - BlobDirectoryPrefix = GetNewBlobDirectoryName(), - }; - SourceResource ??= await CreateBlobDirectorySourceResourceAsync( - size: size, - blobCount: transferCount, - directoryPath: GetNewBlobDirectoryName(), - container: sourceContainer, - provider: blobProvider); - DestinationResource ??= blobProvider.FromClient(destinationContainer, options); - } - else - { - // Default to Upload - Argument.AssertNotNullOrEmpty(sourceDirectoryPath, nameof(sourceDirectoryPath)); - Argument.AssertNotNull(destinationContainer, nameof(destinationContainer)); - SourceResource ??= await CreateLocalDirectorySourceResourceAsync( - size: size, - fileCount: transferCount, - directoryPath: sourceDirectoryPath, - provider: localProvider); - - BlobStorageResourceContainerOptions options = new() - { - BlobDirectoryPrefix = GetNewBlobDirectoryName() - }; - DestinationResource ??= blobProvider.FromClient(destinationContainer, options); - } - return (SourceResource, DestinationResource); - } - - /// - /// Upload and verify the contents of the blob - /// - /// By default in this function an event argument will be added to the options event handler - /// to detect when the upload has finished. - /// - private async Task CreateDirectoryLongTransferAsync( - TransferManager manager, - TransferDirection transferType = TransferDirection.Upload, - string sourceDirectory = default, - string destinationDirectory = default, - BlobContainerClient sourceContainer = default, - BlobContainerClient destinationContainer = default, - StorageResource sourceResource = default, - StorageResource destinationResource = default, - TransferOptions transferOptions = default, - int transferCount = 100, - long size = Constants.MB, - BlobsStorageResourceProvider blobProvider = default, - LocalFilesStorageResourceProvider localProvider = default) - { - Argument.AssertNotNull(manager, nameof(manager)); - if (sourceResource == default && destinationResource == default) - { - (StorageResource source, StorageResource dest) = await CreateStorageResourceContainersAsync( - transferType: transferType, - size: size, - transferCount: transferCount, - sourceDirectoryPath: sourceDirectory, - destinationDirectoryPath: destinationDirectory, - sourceContainer: sourceContainer, - destinationContainer: destinationContainer, - blobProvider: blobProvider, - localProvider: localProvider); - sourceResource = source; - destinationResource = dest; - } - else if ((sourceResource == default && destinationResource != default) || - (sourceResource != default && destinationResource == default)) - { - throw new ArgumentException($"Both {nameof(sourceResource)} or {nameof(destinationResource)} must be specified, " + - $"if only one is specified."); - } - - // Act - return await manager.StartTransferAsync(sourceResource, destinationResource, transferOptions); - } - - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -826,16 +771,15 @@ public async Task TryPauseTransferAsync_Id_Directory(TransferDirection transferT using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions(); @@ -851,14 +795,12 @@ public async Task TryPauseTransferAsync_Id_Directory(TransferDirection transferT destinationDirectory: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 4, + size: DataMovementTestConstants.KB * 4, transferCount: partCount, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -866,8 +808,8 @@ public async Task TryPauseTransferAsync_Id_Directory(TransferDirection transferT Assert.AreEqual(TransferState.Paused, transfer.Status.State); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -877,17 +819,15 @@ public async Task TryPauseTransferAsync_TransferOperation_Directory(TransferDire using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions(); @@ -903,14 +843,12 @@ public async Task TryPauseTransferAsync_TransferOperation_Directory(TransferDire destinationDirectory: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 4, + size: DataMovementTestConstants.KB * 4, transferCount: partCount, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -918,8 +856,8 @@ public async Task TryPauseTransferAsync_TransferOperation_Directory(TransferDire Assert.AreEqual(TransferState.Paused, transfer.Status.State); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -929,17 +867,15 @@ public async Task TryPauseTransferAsync_AlreadyPaused_Directory(TransferDirectio using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions(); @@ -955,14 +891,12 @@ public async Task TryPauseTransferAsync_AlreadyPaused_Directory(TransferDirectio destinationDirectory: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, destinationContainer: destinationContainer.Container, - size: Constants.KB * 4, + size: DataMovementTestConstants.KB * 4, transferCount: partCount, - transferOptions: transferOptions, - blobProvider: blobProvider, - localProvider: localProvider); + transferOptions: transferOptions); // Act - CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(20)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); // Assert @@ -976,8 +910,8 @@ public async Task TryPauseTransferAsync_AlreadyPaused_Directory(TransferDirectio Assert.AreEqual(TransferState.Paused, transfer.Status.State); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -987,26 +921,24 @@ public async Task PauseThenResumeTransferAsync_Directory(TransferDirection trans using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions() { - InitialTransferSize = Constants.KB, - MaximumTransferChunkSize = Constants.KB + InitialTransferSize = DataMovementTestConstants.KB, + MaximumTransferChunkSize = DataMovementTestConstants.KB }; TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); - long size = Constants.KB * 4; + long size = DataMovementTestConstants.KB * 4; int partCount = 4; (StorageResource sResource, StorageResource dResource) = await CreateStorageResourceContainersAsync( @@ -1016,9 +948,7 @@ public async Task PauseThenResumeTransferAsync_Directory(TransferDirection trans sourceDirectoryPath: sourceDirectory.DirectoryPath, destinationDirectoryPath: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer.Container); // Add long-running job to pause, if the job is not big enough // then the job might finish before we can pause it. @@ -1028,19 +958,19 @@ public async Task PauseThenResumeTransferAsync_Directory(TransferDirection trans destinationResource: dResource, transferOptions: transferOptions); - // Act - Pause Job + // Act CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(100)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); - // Assert - Confirm we've paused - Assert.AreEqual(TransferState.Paused, transfer.Status.State); + // Assert await testEventsRaised.AssertPausedCheck(); + Assert.AreEqual(TransferState.Paused, transfer.Status.State); int completedBeforePause = testEventsRaised.SingleCompletedEvents.Count; // Act - Resume Job TransferOptions resumeOptions = new() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; TestEventsRaised testEventRaised2 = new TestEventsRaised(resumeOptions); TransferOperation resumeTransfer = await transferManager.ResumeTransferAsync( @@ -1064,8 +994,8 @@ await AssertDirectorySourceAndDestinationAsync( destinationContainer: destinationContainer.Container); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35439")] - [RecordedTest] + [Test] + [LiveOnly] [TestCase(TransferDirection.Upload)] [TestCase(TransferDirection.Download)] [TestCase(TransferDirection.Copy)] @@ -1075,26 +1005,24 @@ public async Task ResumeTransferAsync_Directory(TransferDirection transferType) using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); TransferOptions transferOptions = new TransferOptions() { - InitialTransferSize = Constants.KB, - MaximumTransferChunkSize = Constants.KB + InitialTransferSize = DataMovementTestConstants.KB, + MaximumTransferChunkSize = DataMovementTestConstants.KB }; TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); - long size = Constants.KB * 4; + long size = DataMovementTestConstants.KB * 4; int partCount = 4; (StorageResource sResource, StorageResource dResource) = await CreateStorageResourceContainersAsync( @@ -1104,9 +1032,7 @@ public async Task ResumeTransferAsync_Directory(TransferDirection transferType) sourceDirectoryPath: sourceDirectory.DirectoryPath, destinationDirectoryPath: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer.Container); // Add long-running job to pause, if the job is not big enough // then the job might finish before we can pause it. @@ -1116,19 +1042,19 @@ public async Task ResumeTransferAsync_Directory(TransferDirection transferType) destinationResource: dResource, transferOptions: transferOptions); - // Act - Pause Job + // Act CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(100)); await transferManager.PauseTransferAsync(transfer.Id, cancellationTokenSource.Token); - // Assert - Confirm we've paused - Assert.AreEqual(TransferState.Paused, transfer.Status.State); + // Assert await testEventsRaised.AssertPausedCheck(); + Assert.AreEqual(TransferState.Paused, transfer.Status.State); int completedBeforePause = testEventsRaised.SingleCompletedEvents.Count; // Act - Resume Job TransferOptions resumeOptions = new() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; TestEventsRaised testEventsRaised2 = new TestEventsRaised(resumeOptions); TransferOperation resumeTransfer = await transferManager.ResumeTransferAsync( @@ -1170,20 +1096,18 @@ public async Task ResumeTransferAsync_Directory_Large( using DisposingLocalDirectory checkpointerDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory sourceDirectory = DisposingLocalDirectory.GetTestDirectory(); using DisposingLocalDirectory destinationDirectory = DisposingLocalDirectory.GetTestDirectory(); - BlobServiceClient service = GetServiceClient_OAuth(); - await using DisposingBlobContainer sourceContainer = await GetTestContainerAsync(service); - await using DisposingBlobContainer destinationContainer = await GetTestContainerAsync(service); + await using IDisposingContainer sourceContainer = await GetDisposingContainerAsync(); + await using IDisposingContainer destinationContainer = await GetDisposingContainerAsync(); - BlobsStorageResourceProvider blobProvider = new(GetSharedKeyCredential()); - LocalFilesStorageResourceProvider localProvider = new(); + StorageResourceProvider provider = GetStorageResourceProvider(); TransferManagerOptions options = new TransferManagerOptions() { CheckpointStoreOptions = TransferCheckpointStoreOptions.CreateLocalStore(checkpointerDirectory.DirectoryPath), ErrorMode = TransferErrorMode.ContinueOnFailure, - ResumeProviders = new() { blobProvider, localProvider }, + ProvidersForResuming = new List() { provider }, }; TransferManager transferManager = new TransferManager(options); - long size = Constants.MB; + long size = DataMovementTestConstants.MB; (StorageResource sResource, StorageResource dResource) = await CreateStorageResourceContainersAsync( transferType: transferType, @@ -1192,9 +1116,7 @@ public async Task ResumeTransferAsync_Directory_Large( sourceDirectoryPath: sourceDirectory.DirectoryPath, destinationDirectoryPath: destinationDirectory.DirectoryPath, sourceContainer: sourceContainer.Container, - destinationContainer: destinationContainer.Container, - blobProvider: blobProvider, - localProvider: localProvider); + destinationContainer: destinationContainer.Container); TransferOptions transferOptions = new() { @@ -1258,7 +1180,8 @@ public async Task PauseAllTriggersCorrectPauses() manager._transfers.TryAdd(Guid.NewGuid().ToString(), transfer.Object); } - await manager.PauseAllRunningTransfersAsync(_mockingToken); + CancellationTokenSource token = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + await manager.PauseAllRunningTransfersAsync(token.Token); foreach (Mock transfer in pausable) { @@ -1270,5 +1193,6 @@ public async Task PauseAllTriggersCorrectPauses() transfer.VerifyNoOtherCalls(); } } + #endregion } } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferCopyTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferCopyTestBase.cs index 061b7d8280b0..1fe2957458cf 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferCopyTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferCopyTestBase.cs @@ -502,7 +502,7 @@ public async Task SourceObjectToDestinationObject_Overwrite_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List() { options }; List objectNames = new List() { name }; @@ -530,7 +530,7 @@ public async Task SourceObjectToDestinationObject_Overwrite_NotExists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List() { options }; @@ -568,7 +568,7 @@ public async Task SourceObjectToDestinationObject_Skip_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists, + CreationMode = StorageResourceCreationMode.SkipIfExists, }; // Create new source block object. @@ -630,7 +630,7 @@ public async Task SourceObjectToDestinationObject_Failure_Exists() // Create options bag to fail and keep track of the failure. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists, + CreationMode = StorageResourceCreationMode.FailIfExists, }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); // Create new source object. @@ -759,7 +759,7 @@ public async Task StartTransfer_AwaitCompletion_Failed() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -805,7 +805,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped() // Create transfer options with Skipping available TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -835,12 +835,14 @@ await TestTransferWithTimeout.WaitForCompletionAsync( private async Task CopyRemoteObjects_VerifyProperties( TSourceContainerClient sourceContainer, TDestinationContainerClient destinationContainer, - TransferPropertiesTestType propertiesType) + TransferPropertiesTestType propertiesType, + long size = Constants.KB, + long? chunkSize = default) { // Create blob with properties TSourceObjectClient sourceClient = await GetSourceObjectClientAsync( container: sourceContainer, - objectLength: 0, + objectLength: size, createResource: true); // Set preserve properties StorageResourceItem sourceResource = GetSourceStorageResourceItem(sourceClient); @@ -853,7 +855,10 @@ private async Task CopyRemoteObjects_VerifyProperties( destinationClient, propertiesTestType: propertiesType); - TransferOptions options = new TransferOptions(); + TransferOptions options = new() + { + MaximumTransferChunkSize = chunkSize, + }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); TransferManager transferManager = new TransferManager(); @@ -928,5 +933,24 @@ await CopyRemoteObjects_VerifyProperties( destination.Container, TransferPropertiesTestType.NewProperties); } + + [RecordedTest] + [TestCase((int) TransferPropertiesTestType.Default)] + [TestCase((int) TransferPropertiesTestType.Preserve)] + [TestCase((int) TransferPropertiesTestType.NoPreserve)] + [TestCase((int) TransferPropertiesTestType.NewProperties)] + public virtual async Task SourceObjectToDestinationObject_VerifyProperties_Chunks(int propertiesType) + { + // Arrange + await using IDisposingContainer source = await GetSourceDisposingContainerAsync(); + await using IDisposingContainer destination = await GetDestinationDisposingContainerAsync(); + + await CopyRemoteObjects_VerifyProperties( + source.Container, + destination.Container, + (TransferPropertiesTestType) propertiesType, + size: Constants.KB, + chunkSize: Constants.KB / 2); + } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryCopyTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryCopyTestBase.cs index 6d911f370d3a..669e254f6466 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryCopyTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryCopyTestBase.cs @@ -522,7 +522,7 @@ public async Task DirectoryToDirectory_OverwriteExists() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; // Act @@ -567,7 +567,7 @@ public async Task DirectoryToDirectory_OverwriteNotExists() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; // Act @@ -728,7 +728,7 @@ public async Task StartTransfer_AwaitCompletion_Failed() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -766,7 +766,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped() // Create transfer options with Skipping available TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -803,7 +803,7 @@ public async Task StartTransfer_AwaitCompletion_Failed_SmallChunks() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists, + CreationMode = StorageResourceCreationMode.FailIfExists, InitialTransferSize = 512, MaximumTransferChunkSize = 512 }; diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryDownloadTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryDownloadTestBase.cs index f2ab84b9ff50..9e77c8e11f43 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryDownloadTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDirectoryDownloadTestBase.cs @@ -156,8 +156,7 @@ private async Task DownloadDirectoryAndVerifyAsync( }; StorageResourceContainer sourceResource = GetStorageResourceContainer(sourceContainer, sourcePrefix); - LocalFilesStorageResourceProvider localProvider = new(); - StorageResourceContainer destinationResource = localProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); + StorageResourceContainer destinationResource = LocalFilesStorageResourceProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); await new TransferValidator().TransferAndVerifyAsync( sourceResource, @@ -244,8 +243,7 @@ public async Task DownloadDirectoryAsync_Empty() TestEventsRaised testEventRaised = new TestEventsRaised(options); StorageResourceContainer sourceResource = GetStorageResourceContainer(test.Container, sourceDirectoryName); - LocalFilesStorageResourceProvider localProvider = new(); - StorageResourceContainer destinationResource = localProvider.FromDirectory(destinationFolder); + StorageResourceContainer destinationResource = LocalFilesStorageResourceProvider.FromDirectory(destinationFolder); TransferOperation transfer = await transferManager.StartTransferAsync(sourceResource, destinationResource, options); await TestTransferWithTimeout.WaitForCompletionAsync( @@ -425,8 +423,7 @@ private async Task CreateStartTransfer( // Create storage resources StorageResourceContainer sourceResource = GetStorageResourceContainer(containerClient, sourcePrefix); - LocalFilesStorageResourceProvider files = new(); - StorageResource destinationResource = files.FromDirectory(destinationFolder); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromDirectory(destinationFolder); // Create Transfer Manager with single threaded operation TransferManagerOptions managerOptions = new TransferManagerOptions() @@ -486,7 +483,7 @@ public async Task StartTransfer_AwaitCompletion_Failed() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -528,7 +525,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped() // Create transfer options with Skipping available TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -569,7 +566,7 @@ public async Task StartTransfer_AwaitCompletion_Failed_SmallChunks() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists, + CreationMode = StorageResourceCreationMode.FailIfExists, InitialTransferSize = 512, MaximumTransferChunkSize = 512 }; diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDownloadTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDownloadTestBase.cs index 8683c88be0f5..492d3f8880d2 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDownloadTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferDownloadTestBase.cs @@ -139,8 +139,7 @@ private async Task CreateStartTransfer( objectLength: size, createResource: true); StorageResourceItem sourceResource = GetStorageResourceItem(TObjectClient); - LocalFilesStorageResourceProvider files = new(); - StorageResource destinationResource = files.FromFile(destFile); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(destFile); // Create Transfer Manager with single threaded operation TransferManagerOptions managerOptions = new TransferManagerOptions() @@ -195,7 +194,7 @@ public async Task StartTransfer_AwaitCompletion_Failed() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventRaised = new TestEventsRaised(options); @@ -234,7 +233,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped() // Create transfer options with Skipping available TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventRaised = new TestEventsRaised(options); @@ -361,8 +360,7 @@ private async Task DownloadObjectsAndVerify( // of order operations still get predictable IDs and the // recordings work correctly StorageResourceItem sourceResource = GetStorageResourceItem(downloadedObjectInfo[i].SourceObjectClient); - LocalFilesStorageResourceProvider files = new(); - StorageResource destinationResource = files.FromFile(downloadedObjectInfo[i].DestinationLocalPath); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(downloadedObjectInfo[i].DestinationLocalPath); // Act TransferOperation transfer = await transferManager.StartTransferAsync( @@ -429,7 +427,7 @@ public async Task RemoteObjectToLocal_Overwrite_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List { options }; await DownloadObjectsAndVerify( @@ -451,7 +449,7 @@ public async Task RemoteObjectToLocal_Overwrite_NotExists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List { options }; await DownloadObjectsAndVerify( @@ -487,7 +485,7 @@ public async Task RemoteObjectToLocal_Skip_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists, + CreationMode = StorageResourceCreationMode.SkipIfExists, }; options.ItemTransferSkipped += (TransferItemSkippedEventArgs args) => { @@ -502,8 +500,7 @@ public async Task RemoteObjectToLocal_Skip_Exists() TestEventsRaised testEventsRaised = new(options); TransferManager transferManager = new TransferManager(); - LocalFilesStorageResourceProvider files = new(); - StorageResource destinationResource = files.FromFile(destFile); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(destFile); // Start transfer and await for completion. TransferOperation transfer = await transferManager.StartTransferAsync( @@ -548,12 +545,11 @@ public async Task RemoteObjectToLocal_Failure_Exists() // Create options bag to fail and keep track of the failure. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists, + CreationMode = StorageResourceCreationMode.FailIfExists, }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); StorageResourceItem sourceResource = GetStorageResourceItem(sourceClient); - LocalFilesStorageResourceProvider files = new(); - StorageResource destinationResource = files.FromFile(destFile); + StorageResource destinationResource = LocalFilesStorageResourceProvider.FromFile(destFile); TransferManager transferManager = new TransferManager(); diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadDirectoryTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadDirectoryTestBase.cs index da1c3f3882a3..3edae2737ae9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadDirectoryTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadDirectoryTestBase.cs @@ -36,8 +36,6 @@ public abstract class StartTransferUploadDirectoryTestBase< public ClientBuilder ClientBuilder { get; protected set; } - public LocalFilesStorageResourceProvider LocalResourceProvider { get; } = new(); - public StartTransferUploadDirectoryTestBase(bool async, RecordedTestMode? mode = null, bool isPageBlob = false) : base(async, mode) { @@ -147,7 +145,7 @@ private async Task UploadDirectoryAndVerifyAsync( ErrorMode = TransferErrorMode.ContinueOnFailure }; - StorageResourceContainer sourceResource = LocalResourceProvider.FromDirectory(sourceLocalDirectoryPath); + StorageResourceContainer sourceResource = LocalFilesStorageResourceProvider.FromDirectory(sourceLocalDirectoryPath); StorageResourceContainer destinationResource = GetStorageResourceContainer(destinationContainer); await new TransferValidator() @@ -227,7 +225,7 @@ await SetupDirectoryAsync( TransferOptions options = new() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); TransferManagerOptions transferManagerOptions = new() @@ -235,7 +233,7 @@ await SetupDirectoryAsync( ErrorMode = TransferErrorMode.ContinueOnFailure }; - StorageResourceContainer sourceResource = LocalResourceProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); + StorageResourceContainer sourceResource = LocalFilesStorageResourceProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); StorageResourceContainer destinationResource = GetStorageResourceContainer(test.Container); TransferOperation transfer = await new TransferManager(transferManagerOptions) .StartTransferAsync(sourceResource, destinationResource, options, cancellationToken); @@ -296,7 +294,7 @@ await SetupDirectoryAsync( TransferOptions options = new() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); TransferManagerOptions transferManagerOptions = new() @@ -304,7 +302,7 @@ await SetupDirectoryAsync( ErrorMode = TransferErrorMode.ContinueOnFailure }; - StorageResourceContainer sourceResource = LocalResourceProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); + StorageResourceContainer sourceResource = LocalFilesStorageResourceProvider.FromDirectory(disposingLocalDirectory.DirectoryPath); StorageResourceContainer destinationResource = GetStorageResourceContainer(test.Container); TransferOperation transfer = await new TransferManager(transferManagerOptions) .StartTransferAsync(sourceResource, destinationResource, options, cancellationToken); @@ -345,7 +343,7 @@ public async Task UploadOverwriteIfExists() TransferOptions options = new() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists + CreationMode = StorageResourceCreationMode.OverwriteIfExists }; CancellationToken cancellationToken = TestHelper.GetTimeoutToken(waitTimeInSec); await InitializeDestinationDataAsync( diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadTestBase.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadTestBase.cs index 12474ab91267..31d56d41cd98 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadTestBase.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StartTransferUploadTestBase.cs @@ -145,8 +145,7 @@ private async Task CreateStartTransfer( { await originalStream.CopyToAsync(fileStream); } - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(localSourceFile); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(localSourceFile); // Create Transfer Manager with single threaded operation TransferManagerOptions managerOptions = new TransferManagerOptions() @@ -202,7 +201,7 @@ public async Task StartTransfer_AwaitCompletion_Failed() TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists + CreationMode = StorageResourceCreationMode.FailIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -249,7 +248,7 @@ public async Task StartTransfer_AwaitCompletion_Skipped() // Create transfer options with Skipping available TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists + CreationMode = StorageResourceCreationMode.SkipIfExists }; TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -366,8 +365,7 @@ private async Task UploadResourceAndVerify( StorageResourceItem destinationResource = GetStorageResourceItem(destClient); // Act - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(localSourceFile); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(localSourceFile); TransferOperation transfer = await transferManager.StartTransferAsync(sourceResource, destinationResource, options[i]); uploadedObjectInfo.Add(new VerifyUploadObjectContentInfo( @@ -484,7 +482,7 @@ public async Task LocalToRemoteObject_Overwrite_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List() { options }; List objectNames = new List() { objectName }; @@ -510,7 +508,7 @@ public async Task LocalToRemoteObject_Overwrite_NotExists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.OverwriteIfExists, + CreationMode = StorageResourceCreationMode.OverwriteIfExists, }; List optionsList = new List() { options }; @@ -548,10 +546,9 @@ public async Task LocalToRemoteObject_Skip_Exists() // Create options bag to overwrite any existing destination. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.SkipIfExists, + CreationMode = StorageResourceCreationMode.SkipIfExists, }; - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(newSourceFile); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(newSourceFile); StorageResourceItem destinationResource = GetStorageResourceItem(objectClient); TestEventsRaised testEventsRaised = new TestEventsRaised(options); @@ -607,11 +604,10 @@ public async Task LocalToRemoteObject_Failure_Exists() // Create options bag to fail and keep track of the failure. TransferOptions options = new TransferOptions() { - CreationPreference = StorageResourceCreationMode.FailIfExists, + CreationMode = StorageResourceCreationMode.FailIfExists, }; TestEventsRaised testEventRaised = new TestEventsRaised(options); - LocalFilesStorageResourceProvider files = new(); - StorageResource sourceResource = files.FromFile(newSourceFile); + StorageResource sourceResource = LocalFilesStorageResourceProvider.FromFile(newSourceFile); StorageResourceItem destinationResource = GetStorageResourceItem(objectClient); TransferManager transferManager = new TransferManager(); diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StorageResourceTestWrappers.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StorageResourceTestWrappers.cs index 8601500064f8..6b6be7c5ef53 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StorageResourceTestWrappers.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/StorageResourceTestWrappers.cs @@ -47,8 +47,6 @@ private T ThrowOrDo(Func func) => _throwScopeManager.InScope protected internal override long MaxSupportedSingleTransferSize => ThrowOr(_inner.MaxSupportedSingleTransferSize); - protected internal override long MaxSupportedSingleTransferSize => ThrowOr(_inner.MaxSupportedSingleTransferSize); - protected internal override long MaxSupportedChunkSize => ThrowOr(_inner.MaxSupportedChunkSize); protected internal override long? Length => ThrowOr(_inner.Length); diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs index d75e054a5c6d..f00c3cc8e9ce 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs @@ -324,15 +324,8 @@ public async Task AssertContainerCompletedWithSkippedCheck(int expectedSkipCount public async Task AssertPausedCheck() { await WaitForStatusEventsAsync().ConfigureAwait(false); - - AssertUnexpectedFailureCheck(); Assert.IsEmpty(SkippedEvents); - - AssertTransferStatusCollection( - new TransferStatus[] { - InProgressStatus, - new TransferStatusInternal(TransferState.Paused, false, false) }, - StatusEvents.Select(e => e.TransferStatus).ToArray()); + Assert.AreEqual(TransferState.Paused, StatusEvents.Last().TransferStatus.State); } /// @@ -377,7 +370,7 @@ internal static List PopulateTestOptions(int transferCount, re /// private Task WaitForStatusEventsAsync() { - return Task.Delay(100); + return Task.Delay(150); } } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index a5d4e5644226..43182b1f696d 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 12.22.0-beta.1 (Unreleased) +## 12.22.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 12.22.0-beta.1 (2025-02-11) ### Features Added - Added support for service version 2025-05-05. diff --git a/sdk/storage/Azure.Storage.Files.DataLake/README.md b/sdk/storage/Azure.Storage.Files.DataLake/README.md index 5a228acaaf33..087831b5c384 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/README.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/README.md @@ -254,8 +254,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Files.DataLake%2FREADME.png) - [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Files.DataLake/samples [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.DataLake/src diff --git a/sdk/storage/Azure.Storage.Files.DataLake/assets.json b/sdk/storage/Azure.Storage.Files.DataLake/assets.json index 4a64b8398f65..91eef4279b06 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/assets.json +++ b/sdk/storage/Azure.Storage.Files.DataLake/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.DataLake", - "Tag": "net/storage/Azure.Storage.Files.DataLake_d74597f1e3" + "Tag": "net/storage/Azure.Storage.Files.DataLake_8242aa1fad" } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/perf/README.md b/sdk/storage/Azure.Storage.Files.DataLake/perf/README.md index 16d52281ab3f..8a4bbc64e72b 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/perf/README.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/perf/README.md @@ -1,8 +1,8 @@ # Azure Storage Files Data Lake performance tests The assets in this area comprise a set of performance tests for the [Azure Storage Files Data Lake client library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.DataLake) and its associated ecosystem. The artifacts in this library are intended to be used primarily with the Azure SDK engineering system's testing infrastructure, by may also be run as stand-alone applications from the command line. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Files.DataLake.Perf%2FREADME.png) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj index 89a7d0d73779..3e560b2e0150 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/Azure.Storage.Files.DataLake.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.DataLake client library - 12.22.0-beta.1 + 12.22.0-beta.2 12.21.0 DataLakeSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 420d6cc0e768..e5ed93421c9b 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 12.22.0-beta.1 (Unreleased) +## 12.22.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 12.22.0-beta.1 (2025-02-11) ### Features Added - Added support for service version 2025-05-05. diff --git a/sdk/storage/Azure.Storage.Files.Shares/README.md b/sdk/storage/Azure.Storage.Files.Shares/README.md index 312f9cb83bac..69ca07c80aaa 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.Files.Shares/README.md @@ -34,6 +34,20 @@ Here's an example using the Azure CLI: az storage account create --name MyStorageAccount --resource-group MyResourceGroup --location westus --sku Standard_LRS ``` +### Authenticate the client + +In order to interact with the Azure Blobs Storage service, you'll need to create an instance of the ShareServiceClient class. The [Azure Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md) library makes it easy to add Azure Active Directory support for authenticating Azure SDK clients with their corresponding Azure services. + +```C# Snippet:ShareFile_TokenCredential +// Create a TokenCredential that we can use to authenticate +TokenCredential credential = new DefaultAzureCredential(); + +// Create a client that can authenticate with a TokenCredential +ShareServiceClient shareServiceClient = new ShareServiceClient( + StorageAccountFileUri, + credential); +``` + ## Key concepts Azure file shares can be used to: @@ -228,8 +242,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Files.Shares%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/src [package]: https://www.nuget.org/packages/Azure.Storage.Files.Shares/ diff --git a/sdk/storage/Azure.Storage.Files.Shares/perf/README.md b/sdk/storage/Azure.Storage.Files.Shares/perf/README.md index b9ec362fb83c..6f0a9fcf03a9 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/perf/README.md +++ b/sdk/storage/Azure.Storage.Files.Shares/perf/README.md @@ -1,8 +1,8 @@ # Azure Storage Files Shares performance tests The assets in this area comprise a set of performance tests for the [Azure Storage Files Shares client library for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares) and its associated ecosystem. The artifacts in this library are intended to be used primarily with the Azure SDK engineering system's testing infrastructure, but may also be run as stand-alone applications from the command line. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Storage.Files.DataLake.Perf%2FREADME.png) diff --git a/sdk/storage/Azure.Storage.Files.Shares/samples/Sample02_Auth.cs b/sdk/storage/Azure.Storage.Files.Shares/samples/Sample02_Auth.cs index d8e8ad769463..d867ba7c7a99 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/samples/Sample02_Auth.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/samples/Sample02_Auth.cs @@ -143,6 +143,7 @@ public async Task SharedAccessSignatureAuthAsync() [Test] public async Task TokenCredentialAuthAsync() { + #region Snippet:ShareFile_TokenCredential // Create a TokenCredential that we can use to authenticate TokenCredential credential = new DefaultAzureCredential(); @@ -150,6 +151,7 @@ public async Task TokenCredentialAuthAsync() ShareServiceClient shareServiceClient = new ShareServiceClient( StorageAccountFileUri, credential); + #endregion // Make a service request to verify we've successfully authenticated await shareServiceClient.GetPropertiesAsync(); diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj index 740f463a07c5..1e0b4892b8f5 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Azure.Storage.Files.Shares.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Files.Shares client library - 12.22.0-beta.1 + 12.22.0-beta.2 12.21.0 FileSDK;$(DefineConstants) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs index 4b1d45d8a65d..b25234f5f826 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs @@ -778,7 +778,7 @@ internal async Task> CreateInternal( fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -795,7 +795,7 @@ internal async Task> CreateInternal( fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), cancellationToken: cancellationToken); } @@ -1778,7 +1778,7 @@ private async Task> SetHttpHeadersInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1794,7 +1794,7 @@ private async Task> SetHttpHeadersInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), cancellationToken: cancellationToken); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs index 3b204c64c3b5..04f497c29c38 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs @@ -988,7 +988,7 @@ private async Task> CreateInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), nfsFileType: posixProperties?.FileType, metadata: metadata, filePermission: filePermission, @@ -1009,7 +1009,7 @@ private async Task> CreateInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), nfsFileType: posixProperties?.FileType, metadata: metadata, filePermission: filePermission, @@ -3827,7 +3827,7 @@ private async Task> SetHttpHeadersInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), fileHttpHeaders: httpHeaders.ToFileHttpHeaders(), shareFileRequestConditions: conditions, cancellationToken: cancellationToken) @@ -3846,7 +3846,7 @@ private async Task> SetHttpHeadersInternal( fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), owner: posixProperties?.Owner, group: posixProperties?.Group, - fileMode: posixProperties?.FileMode.ToOctalFileMode(), + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), fileHttpHeaders: httpHeaders.ToFileHttpHeaders(), shareFileRequestConditions: conditions, cancellationToken: cancellationToken); diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index 38d8078961ca..07e167582087 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -1,12 +1,20 @@ # Release History -## 12.22.0-beta.1 (Unreleased) +## 12.22.0-beta.2 (Unreleased) ### Features Added -- Added support for service version 2025-05-05. + +### Breaking Changes + +### Bugs Fixed ### Other Changes +## 12.22.0-beta.1 (2025-02-11) + +### Features Added +- Added support for service version 2025-05-05. + ## 12.21.0 (2024-11-12) ### Features Added diff --git a/sdk/storage/Azure.Storage.Queues/README.md b/sdk/storage/Azure.Storage.Queues/README.md index 6727a035c82a..59eae22409ed 100644 --- a/sdk/storage/Azure.Storage.Queues/README.md +++ b/sdk/storage/Azure.Storage.Queues/README.md @@ -201,8 +201,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Queues%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Queues/src [package]: https://www.nuget.org/packages/Azure.Storage.Queues/ diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index afb080aee3ce..131b3cd8676e 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -4,7 +4,7 @@ Microsoft Azure.Storage.Queues client library - 12.22.0-beta.1 + 12.22.0-beta.2 12.21.0 QueueSDK;$(DefineConstants) diff --git a/sdk/storage/CONTRIBUTING.md b/sdk/storage/CONTRIBUTING.md index 268cc661723d..eff20f246eb1 100644 --- a/sdk/storage/CONTRIBUTING.md +++ b/sdk/storage/CONTRIBUTING.md @@ -124,8 +124,6 @@ Our samples are structured as unit tests so we can easily verify they're up to date and working correctly. These tests aren't recorded and make minimal use of test infrastructure to keep them easy to read. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FCONTRIBUTING.png) - [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md index 8ee9c7c12a16..c7c025355d7a 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md @@ -10,6 +10,11 @@ ### Other Changes +## 5.3.4 (2025-02-11) + +### Other Changes +- This release contains bug fixes to improve quality. + ## 5.3.3 (2024-10-10) ### Other Changes @@ -19,7 +24,7 @@ ### Other Changes - This release contains bug fixes to improve quality. -- + ## 5.3.1 (2024-07-17) ### Bugs Fixed diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md index c28482f4ed7e..ad81ebf0141b 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md @@ -335,8 +335,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Webjobs.Extensions.Blobs%2FREADME.png) - [nuget]: https://www.nuget.org/ [storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/api/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.net8.0.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/api/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.net8.0.cs new file mode 100644 index 000000000000..181645968ac9 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/api/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.net8.0.cs @@ -0,0 +1,60 @@ +namespace Microsoft.Azure.WebJobs +{ + [Microsoft.Azure.WebJobs.ConnectionProviderAttribute(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))] + [Microsoft.Azure.WebJobs.Description.BindingAttribute] + [System.AttributeUsageAttribute(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue)] + [System.Diagnostics.DebuggerDisplayAttribute("{BlobPath,nq}")] + public sealed partial class BlobAttribute : System.Attribute, Microsoft.Azure.WebJobs.IConnectionProvider + { + public BlobAttribute(string blobPath) { } + public BlobAttribute(string blobPath, System.IO.FileAccess access) { } + public System.IO.FileAccess? Access { get { throw null; } set { } } + [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] + public string BlobPath { get { throw null; } } + public string Connection { get { throw null; } set { } } + } + [Microsoft.Azure.WebJobs.ConnectionProviderAttribute(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))] + [Microsoft.Azure.WebJobs.Description.BindingAttribute] + [System.AttributeUsageAttribute(System.AttributeTargets.Parameter)] + [System.Diagnostics.DebuggerDisplayAttribute("{BlobPath,nq}")] + public sealed partial class BlobTriggerAttribute : System.Attribute, Microsoft.Azure.WebJobs.IConnectionProvider + { + public BlobTriggerAttribute(string blobPath) { } + public string BlobPath { get { throw null; } } + public string Connection { get { throw null; } set { } } + public Microsoft.Azure.WebJobs.BlobTriggerSource Source { get { throw null; } set { } } + } + public enum BlobTriggerSource + { + LogsAndContainerScan = 0, + EventGrid = 1, + } +} +namespace Microsoft.Azure.WebJobs.Extensions.Storage +{ + public partial class AzureStorageBlobsWebJobsStartup : Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup + { + public AzureStorageBlobsWebJobsStartup() { } + public void Configure(Microsoft.Azure.WebJobs.IWebJobsBuilder builder) { } + } +} +namespace Microsoft.Azure.WebJobs.Host +{ + public partial class BlobsOptions : Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter + { + public BlobsOptions() { } + public int MaxDegreeOfParallelism { get { throw null; } set { } } + public int PoisonBlobThreshold { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + string Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter.Format() { throw null; } + } +} +namespace Microsoft.Extensions.Hosting +{ + public static partial class StorageBlobsWebJobsBuilderExtensions + { + public static Microsoft.Azure.WebJobs.IWebJobsBuilder AddAzureStorageBlobs(this Microsoft.Azure.WebJobs.IWebJobsBuilder builder, System.Action configureBlobs = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Microsoft.Azure.WebJobs.IWebJobsBuilder AddAzureStorageBlobsScaleForTrigger(this Microsoft.Azure.WebJobs.IWebJobsBuilder builder, Microsoft.Azure.WebJobs.Host.Scale.TriggerMetadata triggerMetadata) { throw null; } + } +} diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj index 06239ed3fa1f..bbc153e97793 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj @@ -5,7 +5,7 @@ 5.4.0-beta.1 - 5.3.3 + 5.3.4 This extension adds bindings for Storage $(NoWarn);IDT002;IDT003 diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md index f692008f3a2a..8fcf94d753a7 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md @@ -62,8 +62,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Webjobs.Extensions.Blobs%2FREADME.png) - [nuget]: https://www.nuget.org/ [storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md index 9f2747c57941..b781739e9efc 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md @@ -12,6 +12,13 @@ ### Other Changes +## 5.3.4 (2025-02-11) + +### Bugs Fixed +- Fixed bug where calling StopAsync in QueueListener while drain mode was enabled would cancel the execution cancellation token. +- Fixed bug where the cancellation token passed to QueueListener.ProcessMessageAsync was being propagated to the QueueProcessor.CompleteProcessingMessageAsync call. Since this token is always canceled when QueueListener.StopAsync is invoked, it caused messages to be processed but not deleted. + + ## 5.3.3 (2024-10-10) ### Other Changes diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md index a8b40f6391c3..920f5f851ed9 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md @@ -286,8 +286,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Webjobs.Extensions.Blobs%2FREADME.png) - [nuget]: https://www.nuget.org/ [storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj index bb2d28d0ee6c..c8a4be0c8fcb 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj @@ -5,7 +5,7 @@ 5.4.0-beta.1 - 5.3.3 + 5.3.4 This extension adds bindings for Storage $(NoWarn);IDT002 diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md index 8f9e3da2beff..94c4aa9b6d20 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md @@ -10,6 +10,11 @@ ### Other Changes +## 5.3.4 (2025-02-11) + +### Other Changes +Please refer to [`Microsoft.Azure.WebJobs.Extension.Storage.Blobs`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md) and [`Microsoft.Azure.WebJobs.Extension.Storage.Queues`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md) for detailed list of changes. + ## 5.3.3 (2024-10-10) ### Other Changes diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md index 0b081aff0b36..663cd7bcf8f9 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md @@ -72,8 +72,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Webjobs.Extensions.Blobs%2FREADME.png) - [nuget]: https://www.nuget.org/ [storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/api/Microsoft.Azure.WebJobs.Extensions.Storage.net8.0.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/api/Microsoft.Azure.WebJobs.Extensions.Storage.net8.0.cs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/src/Microsoft.Azure.WebJobs.Extensions.Storage.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/src/Microsoft.Azure.WebJobs.Extensions.Storage.csproj index 85bd5e32daa7..77b457940309 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/src/Microsoft.Azure.WebJobs.Extensions.Storage.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/src/Microsoft.Azure.WebJobs.Extensions.Storage.csproj @@ -5,7 +5,7 @@ 5.4.0-beta.1 - 5.3.3 + 5.3.4 false This extension adds bindings for Storage diff --git a/sdk/storage/README.md b/sdk/storage/README.md index 8f2ce204454c..42ac812301d9 100644 --- a/sdk/storage/README.md +++ b/sdk/storage/README.md @@ -31,8 +31,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FREADME.png) - [blobs]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs/README.md [blobs_batch]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs.Batch/README.md diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.net8.0.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.net8.0.cs index aa97c62a8f09..63ba583f0b9d 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.net8.0.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.net8.0.cs @@ -636,7 +636,8 @@ public static partial class ArmStorageCacheModelFactory public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemArchiveStatus AmlFileSystemArchiveStatus(Azure.ResourceManager.StorageCache.Models.ArchiveStatusType? state = default(Azure.ResourceManager.StorageCache.Models.ArchiveStatusType?), System.DateTimeOffset? lastCompletionOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastStartedOn = default(System.DateTimeOffset?), int? percentComplete = default(int?), string errorCode = null, string errorMessage = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo AmlFileSystemClientInfo(string mgsAddress = null, string mountCommand = null, string lustreVersion = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemContainerStorageInterface containerStorageInterface = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemContainerStorageInterface AmlFileSystemContainerStorageInterface(string persistentVolumeClaim = null, string persistentVolume = null, string storageClass = null) { throw null; } - public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, System.Collections.Generic.IEnumerable zones = null, float? storageCapacityTiB = default(float?), Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType?), string filesystemSubnet = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo = null, int? throughputProvisionedMBps = default(int?), Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string skuName, System.Collections.Generic.IEnumerable zones, float? storageCapacityTiB, Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState, string filesystemSubnet, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo, int? throughputProvisionedMBps, Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm) { throw null; } public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, System.Collections.Generic.IEnumerable zones = null, float? storageCapacityTiB = default(float?), Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType?), string filesystemSubnet = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo = null, int? throughputProvisionedMBps = default(int?), Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemRootSquashSettings rootSquashSettings = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth AmlFileSystemHealth(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealthStateType? state = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealthStateType?), string statusCode = null, string statusDescription = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm AmlFileSystemPropertiesHsm(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHsmSettings settings = null, System.Collections.Generic.IEnumerable archiveStatus = null) { throw null; } diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.netstandard2.0.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.netstandard2.0.cs index aa97c62a8f09..63ba583f0b9d 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.netstandard2.0.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/api/Azure.ResourceManager.StorageCache.netstandard2.0.cs @@ -636,7 +636,8 @@ public static partial class ArmStorageCacheModelFactory public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemArchiveStatus AmlFileSystemArchiveStatus(Azure.ResourceManager.StorageCache.Models.ArchiveStatusType? state = default(Azure.ResourceManager.StorageCache.Models.ArchiveStatusType?), System.DateTimeOffset? lastCompletionOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastStartedOn = default(System.DateTimeOffset?), int? percentComplete = default(int?), string errorCode = null, string errorMessage = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo AmlFileSystemClientInfo(string mgsAddress = null, string mountCommand = null, string lustreVersion = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemContainerStorageInterface containerStorageInterface = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemContainerStorageInterface AmlFileSystemContainerStorageInterface(string persistentVolumeClaim = null, string persistentVolume = null, string storageClass = null) { throw null; } - public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, System.Collections.Generic.IEnumerable zones = null, float? storageCapacityTiB = default(float?), Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType?), string filesystemSubnet = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo = null, int? throughputProvisionedMBps = default(int?), Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string skuName, System.Collections.Generic.IEnumerable zones, float? storageCapacityTiB, Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState, string filesystemSubnet, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo, int? throughputProvisionedMBps, Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm) { throw null; } public static Azure.ResourceManager.StorageCache.AmlFileSystemData AmlFileSystemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null, System.Collections.Generic.IEnumerable zones = null, float? storageCapacityTiB = default(float?), Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth health = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType? provisioningState = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemProvisioningStateType?), string filesystemSubnet = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemClientInfo clientInfo = null, int? throughputProvisionedMBps = default(int?), Azure.ResourceManager.StorageCache.Models.StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm hsm = null, Azure.ResourceManager.StorageCache.Models.AmlFileSystemRootSquashSettings rootSquashSettings = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealth AmlFileSystemHealth(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealthStateType? state = default(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHealthStateType?), string statusCode = null, string statusDescription = null) { throw null; } public static Azure.ResourceManager.StorageCache.Models.AmlFileSystemPropertiesHsm AmlFileSystemPropertiesHsm(Azure.ResourceManager.StorageCache.Models.AmlFileSystemHsmSettings settings = null, System.Collections.Generic.IEnumerable archiveStatus = null) { throw null; } diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Customized/ArmStorageCacheModelFactory.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Customized/ArmStorageCacheModelFactory.cs deleted file mode 100644 index 4bc895ef6f60..000000000000 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Customized/ArmStorageCacheModelFactory.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using System; -using System.Reflection; -using System.ComponentModel; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.StorageCache; - -namespace Azure.ResourceManager.StorageCache.Models -{ - /// Model factory for models. - public static partial class ArmStorageCacheModelFactory - { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The managed identity used by the AML file system, if configured. Current supported identity types: None, UserAssigned. - /// SKU for the resource. - /// Availability zones for resources. This field should only contain a single element in the array. - /// The size of the AML file system, in TiB. This might be rounded up. - /// Health of the AML file system. - /// ARM provisioning state. - /// Subnet used for managing the AML file system and for client-facing operations. This subnet should have at least a /24 subnet mask within the VNET's address space. - /// Client information for the AML file system. - /// Throughput provisioned in MB per sec, calculated as storageCapacityTiB * per-unit storage throughput. - /// Specifies encryption settings of the AML file system. - /// Start time of a 30-minute weekly maintenance window. - /// Hydration and archive settings and status. - /// A new instance for mocking. - public static AmlFileSystemData AmlFileSystemData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, ResourceManager.Models.SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string skuName = null, IEnumerable zones = null, float? storageCapacityTiB = null, AmlFileSystemHealth health = null, AmlFileSystemProvisioningStateType? provisioningState = null, string filesystemSubnet = null, AmlFileSystemClientInfo clientInfo = null, int? throughputProvisionedMBps = null, StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey = null, AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow = null, AmlFileSystemPropertiesHsm hsm = null) - { - tags ??= new Dictionary(); - zones ??= new List(); - - return new AmlFileSystemData(id, name, resourceType, systemData, tags, location, identity, skuName != null ? new StorageCacheSkuName(skuName, null) : null, zones?.ToList(), storageCapacityTiB, health, provisioningState, filesystemSubnet, clientInfo, throughputProvisionedMBps, keyEncryptionKey != null ? new AmlFileSystemEncryptionSettings(keyEncryptionKey, null) : null, maintenanceWindow, hsm, null, null); - } - } -} diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/ArmStorageCacheModelFactory.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/ArmStorageCacheModelFactory.cs index 4af945c0a539..c99dc29f12c3 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/ArmStorageCacheModelFactory.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/ArmStorageCacheModelFactory.cs @@ -535,5 +535,31 @@ public static StorageTargetData StorageTargetData(ResourceIdentifier id = null, location, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed identity used by the AML file system, if configured. Current supported identity types: None, UserAssigned. + /// SKU for the resource. + /// Availability zones for resources. This field should only contain a single element in the array. + /// The size of the AML file system, in TiB. This might be rounded up. + /// Health of the AML file system. + /// ARM provisioning state. + /// Subnet used for managing the AML file system and for client-facing operations. This subnet should have at least a /24 subnet mask within the VNET's address space. + /// Client information for the AML file system. + /// Throughput provisioned in MB per sec, calculated as storageCapacityTiB * per-unit storage throughput. + /// Specifies encryption settings of the AML file system. + /// Start time of a 30-minute weekly maintenance window. + /// Hydration and archive settings and status. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AmlFileSystemData AmlFileSystemData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string skuName, IEnumerable zones, float? storageCapacityTiB, AmlFileSystemHealth health, AmlFileSystemProvisioningStateType? provisioningState, string filesystemSubnet, AmlFileSystemClientInfo clientInfo, int? throughputProvisionedMBps, StorageCacheEncryptionKeyVaultKeyReference keyEncryptionKey, AmlFileSystemPropertiesMaintenanceWindow maintenanceWindow, AmlFileSystemPropertiesHsm hsm) + { + return AmlFileSystemData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, identity: identity, skuName: skuName, zones: zones, storageCapacityTiB: storageCapacityTiB, health: health, provisioningState: provisioningState, filesystemSubnet: filesystemSubnet, clientInfo: clientInfo, throughputProvisionedMBps: throughputProvisionedMBps, keyEncryptionKey: keyEncryptionKey, maintenanceWindow: maintenanceWindow, hsm: hsm, rootSquashSettings: default); + } } } diff --git a/sdk/tables/Azure.Data.Tables/CHANGELOG.md b/sdk/tables/Azure.Data.Tables/CHANGELOG.md index 286938b43103..ae5f51fa9001 100644 --- a/sdk/tables/Azure.Data.Tables/CHANGELOG.md +++ b/sdk/tables/Azure.Data.Tables/CHANGELOG.md @@ -26,6 +26,22 @@ ``` +### Other Changes +- Improved the performance of `TableServiceClient.GetTableClient()` + +## 12.10.0 (2025-01-14) + +### Breaking Changes + +- Calling `TableClient.Query`, `TableClient.QueryAsync`, or `TableClient.CreateQueryFilter` with a filter expression that uses `string.Equals` or `string.Compare` with a `StringComparison` parameter will now throw an exception. This is because the Azure Table service does not support these methods in query filters. Previously the `StringComparison` argument was silently ignored, which can lead to subtle bugs in client code. The new behavior can be overridden by either setting an AppContext switch named "Azure.Data.Tables.DisableThrowOnStringComparisonFilter" to `true` or by setting the environment variable "AZURE_DATA_TABLES_DISABLE_THROWONSTRINGCOMPARISONFILTER" to "true". Note: AppContext switches can also be configured via configuration like below: + +```xml + + + + ``` + + ### Other Changes - Improved the performance of `TableServiceClient.GetTableClient()` diff --git a/sdk/tables/Azure.Data.Tables/README.md b/sdk/tables/Azure.Data.Tables/README.md index ae1e1c18bc13..1c42293f3330 100644 --- a/sdk/tables/Azure.Data.Tables/README.md +++ b/sdk/tables/Azure.Data.Tables/README.md @@ -301,5 +301,3 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftables%2FAzure.Data.Tables%2FREADME.png) diff --git a/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md b/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md index f4c9425f72a9..a50bd396fc0a 100644 --- a/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md +++ b/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md @@ -296,8 +296,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fstorage%2FAzure.Storage.Webjobs.Tables%2FREADME.png) - [nuget]: https://www.nuget.org/ [storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview diff --git a/sdk/template/.content/packageResource/README.md b/sdk/template/.content/packageResource/README.md index 098ecd77cb54..ee54b516f6d7 100644 --- a/sdk/template/.content/packageResource/README.md +++ b/sdk/template/.content/packageResource/README.md @@ -87,5 +87,3 @@ This is a template, but your SDK readme should include details on how to contrib [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/template/Azure.Template/README.png) \ No newline at end of file diff --git a/sdk/template/Azure.Template/README.md b/sdk/template/Azure.Template/README.md index 784c8bfe3d9a..bab1c67a5e86 100644 --- a/sdk/template/Azure.Template/README.md +++ b/sdk/template/Azure.Template/README.md @@ -98,5 +98,3 @@ This is a template, but your SDK readme should include details on how to contrib [style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/template/Azure.Template/README.png) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md index 472b24a8eb0f..918a0ee3ed0e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md @@ -1,8 +1,8 @@ # Azure Cognitive Services Text Analytics code sharing library This library is intended to serve as a common location for non-public code for the legacy REST API that is used by the [Azure Cognitive Services Text Analytics client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/textanalytics/Azure.AI.TextAnalytics). The Text Analytics library includes these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference. - -## Contributing + +## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. @@ -11,5 +11,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%textanalytics%2FAzure.AI.TextAnalytics.Legacy.Shared%2FREADME.png) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md index 564f677cae3f..df188932613a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md @@ -787,8 +787,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftextanalytics%2FAzure.AI.TextAnalytics%2FREADME.png) - [textanalytics_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/src [language_service_docs]: https://learn.microsoft.com/azure/cognitive-services/language-service/ diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/perf/Azure.AI.TextAnalytics.Perf/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/perf/Azure.AI.TextAnalytics.Perf/README.md index 440495f02a7b..71672021e95f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/perf/Azure.AI.TextAnalytics.Perf/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/perf/Azure.AI.TextAnalytics.Perf/README.md @@ -19,5 +19,3 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftextanalytics%2FAzure.AI.TextAnalytics%2Fperf%2FAzure.AI.TextAnalytics.Perf%2FREADME.png) diff --git a/sdk/translation/Azure.AI.Translation.Document/README.md b/sdk/translation/Azure.AI.Translation.Document/README.md index 4d99499fbb68..30db551898fa 100644 --- a/sdk/translation/Azure.AI.Translation.Document/README.md +++ b/sdk/translation/Azure.AI.Translation.Document/README.md @@ -55,7 +55,7 @@ az cognitiveservices account create \ For more information about creating the resource or how to get the location information see [here][cognitive_resource_cli]. #### Setup Azure Blob Storage Account -For more information about creating an Azure Blob Storage account see [here][azure_blob_storage_account]. For creating containers for your source and target files see [here][container]. Make sure to authorize your Translation resource storage access, more info [here][storage_container_authorization]. +For more information about creating an Azure Blob Storage account see [here][azure_blob_storage_account]. For creating containers for your source and target files see [here][container]. Make sure to authorize your Translation resource storage access, more info [here][storage_container_authorization]. ### Authenticate the client In order to interact with the Document Translation service, you'll need to create an instance of the [DocumentTranslationClient][documenttranslation_client_class] class. You will need an **endpoint**, and either an **API key** or `TokenCredential` to instantiate a client object. For more information regarding authenticating with cognitive services, see [Authenticate requests to Azure Cognitive Services][cognitive_auth]. @@ -487,9 +487,6 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fdocumenttranslation%2FAzure.AI.Translation.Document%2FREADME.png) - - [documenttranslation_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/src [documenttranslation_docs]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview diff --git a/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md b/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md index 5b460179ce2a..da7c49e8e342 100644 --- a/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md +++ b/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md @@ -228,5 +228,3 @@ additional questions or comments. [github-page-issues]: https://github.com/Azure/azure-sdk-for-net/issues [applied-ai-service]: https://azure.microsoft.com/product-categories/applied-ai-services/#services [machine-learning]: https://azure.microsoft.com/services/machine-learning - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fvideoanalyzer%2Fazure-media-videoanalyzer-edge%2FREADME.png) diff --git a/sdk/vision/Azure.AI.Vision.ImageAnalysis/README.md b/sdk/vision/Azure.AI.Vision.ImageAnalysis/README.md index dbb09c066b97..774beadb660f 100644 --- a/sdk/vision/Azure.AI.Vision.ImageAnalysis/README.md +++ b/sdk/vision/Azure.AI.Vision.ImageAnalysis/README.md @@ -8,7 +8,7 @@ Use the Image Analysis client library to: * Upload an image for analysis, or provide an image URL * Get the analysis result -[Product documentation][image_analysis_overview] +[Product documentation][image_analysis_overview] | [Samples](https://aka.ms/azsdk/image-analysis/samples/csharp) | [Vision Studio][vision_studio] | [API reference documentation](https://aka.ms/azsdk/image-analysis/ref-docs/csharp) @@ -80,7 +80,7 @@ Once you've initialized an `ImageAnalysisClient`, you need to select one or more 1. `VisualFeatures.Caption` ([Examples](#generate-an-image-caption-for-an-image-file) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample01_HellowWorld.md)): Generate a human-readable sentence that describes the content of an image. 1. `VisualFeatures.Read` ([Examples](#extract-text-from-the-image-file) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/README.md)): Also known as Optical Character Recognition (OCR). Extract printed or handwritten text from images. -1. `VisualFeatures.DenseCaptions` ([Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample02_DenseCaptions.md)): Dense Captions provides more details by generating one-sentence captions for up to 10 different regions in the image, including one for the whole image. +1. `VisualFeatures.DenseCaptions` ([Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample02_DenseCaptions.md)): Dense Captions provides more details by generating one-sentence captions for up to 10 different regions in the image, including one for the whole image. 1. `VisualFeatures.Tags` ([Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample03_Tags.md)): Extract content tags for thousands of recognizable objects, living beings, scenery, and actions that appear in images. 1. `VisualFeatures.Objects` ([Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample04_Objects.md)): Object detection. This is similar to tagging, but focused on detecting physical objects in the image and returning their location. 1. `VisualFeatures.SmartCrops` ([Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/samples/Sample05_SmartCrops.md)): Used to find a representative sub-region of the image for thumbnail generation, with priority given to include faces. @@ -91,7 +91,7 @@ For more information about these features, see [Image Analysis overview][image_a ### Analyze from image buffer or URL The `ImageAnalysisClient` contains an `Analyze` method that has two overloads: -* `Analyze (BinaryData ...`: Analyze an image from an input [BinaryData](https://learn.microsoft.com/dotnet/api/system.binarydata) object. The client will upload the image to the service as part of the REST request. +* `Analyze (BinaryData ...`: Analyze an image from an input [BinaryData](https://learn.microsoft.com/dotnet/api/system.binarydata) object. The client will upload the image to the service as part of the REST request. * `Analyze (Uri ...)`: Analyze an image from a publicly-accessible URL, via the `Uri` object. The client will send the image URL to the service. The service will download the image. The examples below demonstrate both. The `Analyze` examples populate the input [BinaryData](https://learn.microsoft.com/dotnet/api/system.binarydata) object by loading an image from a file from disk. @@ -253,12 +253,10 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/vision/Azure.AI.Vision.ImageAnalysis/README.png) - [image_analysis_overview]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-image-analysis?tabs=4-0 [image_analysis_concepts]: https://learn.microsoft.com/azure/ai-services/computer-vision/concept-tag-images-40 [vision_studio]: https://aka.ms/vision-studio/image-analysis [imageanalysis_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/vision/Azure.AI.Vision.ImageAnalysis/src/Generated/ImageAnalysisClient.cs [azure_identity]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet -[azure_identity_dac]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet \ No newline at end of file +[azure_identity_dac]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/README.md b/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/README.md index 25f20a75cd89..8d5a7065e129 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/README.md +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub.Client/README.md @@ -235,7 +235,5 @@ You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) - [azure_sub]: https://azure.microsoft.com/free/dotnet/ [awps_sample]: https://github.com/Azure/azure-webpubsub/tree/main/samples/csharp diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/README.md b/sdk/webpubsub/Azure.Messaging.WebPubSub/README.md index 23db9ef38f60..55a16c3741b4 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/README.md +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/README.md @@ -188,8 +188,6 @@ You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) - [azure_sub]: https://azure.microsoft.com/free/dotnet/ [samples_ref]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Azure.Messaging.WebPubSub/tests/Samples/ [awps_sample]: https://github.com/Azure/azure-webpubsub/tree/main/samples/csharp diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/README.md b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/README.md index 878a02f70a76..044829903b25 100644 --- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/README.md +++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/README.md @@ -24,7 +24,7 @@ You must have an [Azure subscription][free_subs] and an Azure resource group wit ### Authenticate the client -In order to let the extension work with Azure Web PubSub service, you will need to provide a valid `ConnectionString`. +In order to let the extension work with Azure Web PubSub service, you will need to provide a valid `ConnectionString`. You can find the **Keys** for you Azure Web PubSub service in the [Azure Portal][portal]. @@ -152,8 +152,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.Functions.Worker.Extensions.WebPubSub%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md index 197a81370b55..87aa43111e6b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md @@ -24,7 +24,7 @@ You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) ### Authenticate the client -In order to let the extension work with Azure Web PubSub service, you will need to provide a valid `ConnectionString`. +In order to let the extension work with Azure Web PubSub service, you will need to provide a valid `ConnectionString`. You can find the **Keys** for you Azure Web PubSub service in the [Azure Portal](https://portal.azure.com/). @@ -168,8 +168,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.WebPubSub%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/ diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md index 60d9150213eb..57823e6d4f73 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md @@ -24,7 +24,7 @@ You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) ### Authenticate the client -In order to let the extension work with Web PubSub for Socket.IO, you will need to provide either access keys or identity based configuration to authenticate with the service. +In order to let the extension work with Web PubSub for Socket.IO, you will need to provide either access keys or identity based configuration to authenticate with the service. #### Access key based configuration @@ -198,8 +198,6 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.WebPubSub%2FREADME.png) - [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/ diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md index eee20f7df22a..4ef1751933fa 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md @@ -246,8 +246,6 @@ You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png) - [azure_sub]: https://azure.microsoft.com/free/dotnet/ [sample_ref]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/tests/Samples/ [package_ref]: https://www.nuget.org/packages/Microsoft.Azure.WebPubSub.AspNetCore/ \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/README.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/README.md index 0c28610cbc1d..dc0f403a33d0 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/README.md @@ -59,7 +59,5 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or contact opencode@microsoft.com with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventgrid%2FMicrosoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents%2FREADME.png) - [azure_sub]: https://azure.microsoft.com/free/dotnet/ [samples_ref]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Azure.Messaging.WebPubSub/tests/Samples/ \ No newline at end of file